IMediaEncoder.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. using MediaBrowser.Model.Entities;
  2. using MediaBrowser.Model.MediaInfo;
  3. using System;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. using MediaBrowser.Model.Dlna;
  7. namespace MediaBrowser.Controller.MediaEncoding
  8. {
  9. /// <summary>
  10. /// Interface IMediaEncoder
  11. /// </summary>
  12. public interface IMediaEncoder : ITranscoderSupport
  13. {
  14. string EncoderLocationType { get; }
  15. /// <summary>
  16. /// Gets the encoder path.
  17. /// </summary>
  18. /// <value>The encoder path.</value>
  19. string EncoderPath { get; }
  20. /// <summary>
  21. /// Supportses the decoder.
  22. /// </summary>
  23. /// <param name="decoder">The decoder.</param>
  24. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  25. bool SupportsDecoder(string decoder);
  26. /// <summary>
  27. /// Extracts the audio image.
  28. /// </summary>
  29. /// <param name="path">The path.</param>
  30. /// <param name="imageStreamIndex">Index of the image stream.</param>
  31. /// <param name="cancellationToken">The cancellation token.</param>
  32. /// <returns>Task{Stream}.</returns>
  33. Task<string> ExtractAudioImage(string path, int? imageStreamIndex, CancellationToken cancellationToken);
  34. /// <summary>
  35. /// Extracts the video image.
  36. /// </summary>
  37. /// <param name="inputFiles">The input files.</param>
  38. /// <param name="protocol">The protocol.</param>
  39. /// <param name="threedFormat">The threed format.</param>
  40. /// <param name="offset">The offset.</param>
  41. /// <param name="cancellationToken">The cancellation token.</param>
  42. /// <returns>Task{Stream}.</returns>
  43. Task<string> ExtractVideoImage(string[] inputFiles, string container, MediaProtocol protocol, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
  44. Task<string> ExtractVideoImage(string[] inputFiles, string container, MediaProtocol protocol, int? imageStreamIndex, CancellationToken cancellationToken);
  45. /// <summary>
  46. /// Extracts the video images on interval.
  47. /// </summary>
  48. /// <param name="inputFiles">The input files.</param>
  49. /// <param name="protocol">The protocol.</param>
  50. /// <param name="threedFormat">The threed format.</param>
  51. /// <param name="interval">The interval.</param>
  52. /// <param name="targetDirectory">The target directory.</param>
  53. /// <param name="filenamePrefix">The filename prefix.</param>
  54. /// <param name="maxWidth">The maximum width.</param>
  55. /// <param name="cancellationToken">The cancellation token.</param>
  56. /// <returns>Task.</returns>
  57. Task ExtractVideoImagesOnInterval(string[] inputFiles,
  58. MediaProtocol protocol,
  59. Video3DFormat? threedFormat,
  60. TimeSpan interval,
  61. string targetDirectory,
  62. string filenamePrefix,
  63. int? maxWidth,
  64. CancellationToken cancellationToken);
  65. /// <summary>
  66. /// Gets the media info.
  67. /// </summary>
  68. /// <param name="request">The request.</param>
  69. /// <param name="cancellationToken">The cancellation token.</param>
  70. /// <returns>Task.</returns>
  71. Task<MediaInfo> GetMediaInfo(MediaInfoRequest request, CancellationToken cancellationToken);
  72. /// <summary>
  73. /// Gets the input argument.
  74. /// </summary>
  75. /// <param name="inputFiles">The input files.</param>
  76. /// <param name="protocol">The protocol.</param>
  77. /// <returns>System.String.</returns>
  78. string GetInputArgument(string[] inputFiles, MediaProtocol protocol);
  79. /// <summary>
  80. /// Gets the time parameter.
  81. /// </summary>
  82. /// <param name="ticks">The ticks.</param>
  83. /// <returns>System.String.</returns>
  84. string GetTimeParameter(long ticks);
  85. /// <summary>
  86. /// Encodes the audio.
  87. /// </summary>
  88. /// <param name="options">The options.</param>
  89. /// <param name="progress">The progress.</param>
  90. /// <param name="cancellationToken">The cancellation token.</param>
  91. /// <returns>Task.</returns>
  92. Task<string> EncodeAudio(EncodingJobOptions options,
  93. IProgress<double> progress,
  94. CancellationToken cancellationToken);
  95. /// <summary>
  96. /// Encodes the video.
  97. /// </summary>
  98. /// <param name="options">The options.</param>
  99. /// <param name="progress">The progress.</param>
  100. /// <param name="cancellationToken">The cancellation token.</param>
  101. /// <returns>Task&lt;System.String&gt;.</returns>
  102. Task<string> EncodeVideo(EncodingJobOptions options,
  103. IProgress<double> progress,
  104. CancellationToken cancellationToken);
  105. /// <summary>
  106. /// Escapes the subtitle filter path.
  107. /// </summary>
  108. /// <param name="path">The path.</param>
  109. /// <returns>System.String.</returns>
  110. string EscapeSubtitleFilterPath(string path);
  111. Task Init();
  112. void UpdateEncoderPath(string path, string pathType);
  113. bool SupportsEncoder(string encoder);
  114. void SetLogFilename(string name);
  115. void ClearLogFilename();
  116. }
  117. }