2
0

IMediaEncoder.cs 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. #nullable disable
  2. #pragma warning disable CS1591
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using MediaBrowser.Model.Dlna;
  8. using MediaBrowser.Model.Drawing;
  9. using MediaBrowser.Model.Dto;
  10. using MediaBrowser.Model.Entities;
  11. using MediaBrowser.Model.MediaInfo;
  12. namespace MediaBrowser.Controller.MediaEncoding
  13. {
  14. /// <summary>
  15. /// Interface IMediaEncoder.
  16. /// </summary>
  17. public interface IMediaEncoder : ITranscoderSupport
  18. {
  19. /// <summary>
  20. /// Gets the encoder path.
  21. /// </summary>
  22. /// <value>The encoder path.</value>
  23. string EncoderPath { get; }
  24. /// <summary>
  25. /// Gets the probe path.
  26. /// </summary>
  27. /// <value>The probe path.</value>
  28. string ProbePath { get; }
  29. /// <summary>
  30. /// Gets the version of encoder.
  31. /// </summary>
  32. /// <returns>The version of encoder.</returns>
  33. Version EncoderVersion { get; }
  34. /// <summary>
  35. /// Whether p key pausing is supported.
  36. /// </summary>
  37. /// <value><c>true</c> if p key pausing is supported, <c>false</c> otherwise.</value>
  38. bool IsPkeyPauseSupported { get; }
  39. /// <summary>
  40. /// Gets a value indicating whether the configured Vaapi device is from AMD(radeonsi/r600 Mesa driver).
  41. /// </summary>
  42. /// <value><c>true</c> if the Vaapi device is an AMD(radeonsi/r600 Mesa driver) GPU, <c>false</c> otherwise.</value>
  43. bool IsVaapiDeviceAmd { get; }
  44. /// <summary>
  45. /// Gets a value indicating whether the configured Vaapi device is from Intel(iHD driver).
  46. /// </summary>
  47. /// <value><c>true</c> if the Vaapi device is an Intel(iHD driver) GPU, <c>false</c> otherwise.</value>
  48. bool IsVaapiDeviceInteliHD { get; }
  49. /// <summary>
  50. /// Gets a value indicating whether the configured Vaapi device is from Intel(legacy i965 driver).
  51. /// </summary>
  52. /// <value><c>true</c> if the Vaapi device is an Intel(legacy i965 driver) GPU, <c>false</c> otherwise.</value>
  53. bool IsVaapiDeviceInteli965 { get; }
  54. /// <summary>
  55. /// Gets a value indicating whether the configured Vaapi device supports vulkan drm format modifier.
  56. /// </summary>
  57. /// <value><c>true</c> if the Vaapi device supports vulkan drm format modifier, <c>false</c> otherwise.</value>
  58. bool IsVaapiDeviceSupportVulkanFmtModifier { get; }
  59. /// <summary>
  60. /// Whether given encoder codec is supported.
  61. /// </summary>
  62. /// <param name="encoder">The encoder.</param>
  63. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  64. bool SupportsEncoder(string encoder);
  65. /// <summary>
  66. /// Whether given decoder codec is supported.
  67. /// </summary>
  68. /// <param name="decoder">The decoder.</param>
  69. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  70. bool SupportsDecoder(string decoder);
  71. /// <summary>
  72. /// Whether given hardware acceleration type is supported.
  73. /// </summary>
  74. /// <param name="hwaccel">The hwaccel.</param>
  75. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  76. bool SupportsHwaccel(string hwaccel);
  77. /// <summary>
  78. /// Whether given filter is supported.
  79. /// </summary>
  80. /// <param name="filter">The filter.</param>
  81. /// <returns><c>true</c> if the filter is supported, <c>false</c> otherwise.</returns>
  82. bool SupportsFilter(string filter);
  83. /// <summary>
  84. /// Whether filter is supported with the given option.
  85. /// </summary>
  86. /// <param name="option">The option.</param>
  87. /// <returns><c>true</c> if the filter is supported, <c>false</c> otherwise.</returns>
  88. bool SupportsFilterWithOption(FilterOptionType option);
  89. /// <summary>
  90. /// Extracts the audio image.
  91. /// </summary>
  92. /// <param name="path">The path.</param>
  93. /// <param name="imageStreamIndex">Index of the image stream.</param>
  94. /// <param name="cancellationToken">The cancellation token.</param>
  95. /// <returns>Task{Stream}.</returns>
  96. Task<string> ExtractAudioImage(string path, int? imageStreamIndex, CancellationToken cancellationToken);
  97. /// <summary>
  98. /// Extracts the video image.
  99. /// </summary>
  100. /// <param name="inputFile">Input file.</param>
  101. /// <param name="container">Video container type.</param>
  102. /// <param name="mediaSource">Media source information.</param>
  103. /// <param name="videoStream">Media stream information.</param>
  104. /// <param name="threedFormat">Video 3D format.</param>
  105. /// <param name="offset">Time offset.</param>
  106. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  107. /// <returns>Location of video image.</returns>
  108. Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream videoStream, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
  109. /// <summary>
  110. /// Extracts the video image.
  111. /// </summary>
  112. /// <param name="inputFile">Input file.</param>
  113. /// <param name="container">Video container type.</param>
  114. /// <param name="mediaSource">Media source information.</param>
  115. /// <param name="imageStream">Media stream information.</param>
  116. /// <param name="imageStreamIndex">Index of the stream to extract from.</param>
  117. /// <param name="targetFormat">The format of the file to write.</param>
  118. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  119. /// <returns>Location of video image.</returns>
  120. Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream imageStream, int? imageStreamIndex, ImageFormat? targetFormat, CancellationToken cancellationToken);
  121. /// <summary>
  122. /// Gets the media info.
  123. /// </summary>
  124. /// <param name="request">The request.</param>
  125. /// <param name="cancellationToken">The cancellation token.</param>
  126. /// <returns>Task.</returns>
  127. Task<MediaInfo> GetMediaInfo(MediaInfoRequest request, CancellationToken cancellationToken);
  128. /// <summary>
  129. /// Gets the input argument.
  130. /// </summary>
  131. /// <param name="inputFile">The input file.</param>
  132. /// <param name="mediaSource">The mediaSource.</param>
  133. /// <returns>System.String.</returns>
  134. string GetInputArgument(string inputFile, MediaSourceInfo mediaSource);
  135. /// <summary>
  136. /// Gets the input argument for an external subtitle file.
  137. /// </summary>
  138. /// <param name="inputFile">The input file.</param>
  139. /// <returns>System.String.</returns>
  140. string GetExternalSubtitleInputArgument(string inputFile);
  141. /// <summary>
  142. /// Gets the time parameter.
  143. /// </summary>
  144. /// <param name="ticks">The ticks.</param>
  145. /// <returns>System.String.</returns>
  146. string GetTimeParameter(long ticks);
  147. Task ConvertImage(string inputPath, string outputPath);
  148. /// <summary>
  149. /// Escapes the subtitle filter path.
  150. /// </summary>
  151. /// <param name="path">The path.</param>
  152. /// <returns>System.String.</returns>
  153. string EscapeSubtitleFilterPath(string path);
  154. /// <summary>
  155. /// Sets the path to find FFmpeg.
  156. /// </summary>
  157. void SetFFmpegPath();
  158. /// <summary>
  159. /// Updates the encoder path.
  160. /// </summary>
  161. /// <param name="path">The path.</param>
  162. /// <param name="pathType">The type of path.</param>
  163. void UpdateEncoderPath(string path, string pathType);
  164. /// <summary>
  165. /// Gets the primary playlist of .vob files.
  166. /// </summary>
  167. /// <param name="path">The to the .vob files.</param>
  168. /// <param name="titleNumber">The title number to start with.</param>
  169. /// <returns>A playlist.</returns>
  170. IEnumerable<string> GetPrimaryPlaylistVobFiles(string path, uint? titleNumber);
  171. }
  172. }