2
0

IMediaEncoder.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. using MediaBrowser.Model.Dlna;
  7. using MediaBrowser.Model.Entities;
  8. using MediaBrowser.Model.IO;
  9. using MediaBrowser.Model.MediaInfo;
  10. using MediaBrowser.Model.System;
  11. namespace MediaBrowser.Controller.MediaEncoding
  12. {
  13. /// <summary>
  14. /// Interface IMediaEncoder.
  15. /// </summary>
  16. public interface IMediaEncoder : ITranscoderSupport
  17. {
  18. /// <summary>
  19. /// The location of the discovered FFmpeg tool.
  20. /// </summary>
  21. FFmpegLocation EncoderLocation { get; }
  22. /// <summary>
  23. /// Gets the encoder path.
  24. /// </summary>
  25. /// <value>The encoder path.</value>
  26. string EncoderPath { get; }
  27. /// <summary>
  28. /// Whether given encoder codec is supported.
  29. /// </summary>
  30. /// <param name="encoder">The encoder.</param>
  31. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  32. bool SupportsEncoder(string encoder);
  33. /// <summary>
  34. /// Whether given decoder codec is supported.
  35. /// </summary>
  36. /// <param name="decoder">The decoder.</param>
  37. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  38. bool SupportsDecoder(string decoder);
  39. /// <summary>
  40. /// Whether given hardware acceleration type is supported.
  41. /// </summary>
  42. /// <param name="hwaccel">The hwaccel.</param>
  43. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  44. bool SupportsHwaccel(string hwaccel);
  45. /// <summary>
  46. /// Extracts the audio image.
  47. /// </summary>
  48. /// <param name="path">The path.</param>
  49. /// <param name="imageStreamIndex">Index of the image stream.</param>
  50. /// <param name="cancellationToken">The cancellation token.</param>
  51. /// <returns>Task{Stream}.</returns>
  52. Task<string> ExtractAudioImage(string path, int? imageStreamIndex, CancellationToken cancellationToken);
  53. /// <summary>
  54. /// Extracts the video image.
  55. /// </summary>
  56. Task<string> ExtractVideoImage(string[] inputFiles, string container, MediaProtocol protocol, MediaStream videoStream, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
  57. Task<string> ExtractVideoImage(string[] inputFiles, string container, MediaProtocol protocol, MediaStream imageStream, int? imageStreamIndex, CancellationToken cancellationToken);
  58. /// <summary>
  59. /// Extracts the video images on interval.
  60. /// </summary>
  61. Task ExtractVideoImagesOnInterval(
  62. string[] inputFiles,
  63. string container,
  64. MediaStream videoStream,
  65. MediaProtocol protocol,
  66. Video3DFormat? threedFormat,
  67. TimeSpan interval,
  68. string targetDirectory,
  69. string filenamePrefix,
  70. int? maxWidth,
  71. CancellationToken cancellationToken);
  72. /// <summary>
  73. /// Gets the media info.
  74. /// </summary>
  75. /// <param name="request">The request.</param>
  76. /// <param name="cancellationToken">The cancellation token.</param>
  77. /// <returns>Task.</returns>
  78. Task<MediaInfo> GetMediaInfo(MediaInfoRequest request, CancellationToken cancellationToken);
  79. /// <summary>
  80. /// Gets the input argument.
  81. /// </summary>
  82. /// <param name="inputFiles">The input files.</param>
  83. /// <param name="protocol">The protocol.</param>
  84. /// <returns>System.String.</returns>
  85. string GetInputArgument(IReadOnlyList<string> inputFiles, MediaProtocol protocol);
  86. /// <summary>
  87. /// Gets the time parameter.
  88. /// </summary>
  89. /// <param name="ticks">The ticks.</param>
  90. /// <returns>System.String.</returns>
  91. string GetTimeParameter(long ticks);
  92. Task ConvertImage(string inputPath, string outputPath);
  93. /// <summary>
  94. /// Escapes the subtitle filter path.
  95. /// </summary>
  96. /// <param name="path">The path.</param>
  97. /// <returns>System.String.</returns>
  98. string EscapeSubtitleFilterPath(string path);
  99. void SetFFmpegPath();
  100. void UpdateEncoderPath(string path, string pathType);
  101. IEnumerable<string> GetPrimaryPlaylistVobFiles(string path, IIsoMount isoMount, uint? titleNumber);
  102. }
  103. }