2
0

IMediaEncoder.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. /// Gets a value indicating whether the configured Vaapi device is from AMD(radeonsi/r600 Mesa driver).
  36. /// </summary>
  37. /// <value><c>true</c> if the Vaapi device is an AMD(radeonsi/r600 Mesa driver) GPU, <c>false</c> otherwise.</value>
  38. bool IsVaapiDeviceAmd { get; }
  39. /// <summary>
  40. /// Gets a value indicating whether the configured Vaapi device is from Intel(iHD driver).
  41. /// </summary>
  42. /// <value><c>true</c> if the Vaapi device is an Intel(iHD driver) GPU, <c>false</c> otherwise.</value>
  43. bool IsVaapiDeviceInteliHD { get; }
  44. /// <summary>
  45. /// Gets a value indicating whether the configured Vaapi device is from Intel(legacy i965 driver).
  46. /// </summary>
  47. /// <value><c>true</c> if the Vaapi device is an Intel(legacy i965 driver) GPU, <c>false</c> otherwise.</value>
  48. bool IsVaapiDeviceInteli965 { get; }
  49. /// <summary>
  50. /// Whether given encoder codec is supported.
  51. /// </summary>
  52. /// <param name="encoder">The encoder.</param>
  53. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  54. bool SupportsEncoder(string encoder);
  55. /// <summary>
  56. /// Whether given decoder codec is supported.
  57. /// </summary>
  58. /// <param name="decoder">The decoder.</param>
  59. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  60. bool SupportsDecoder(string decoder);
  61. /// <summary>
  62. /// Whether given hardware acceleration type is supported.
  63. /// </summary>
  64. /// <param name="hwaccel">The hwaccel.</param>
  65. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  66. bool SupportsHwaccel(string hwaccel);
  67. /// <summary>
  68. /// Whether given filter is supported.
  69. /// </summary>
  70. /// <param name="filter">The filter.</param>
  71. /// <returns><c>true</c> if the filter is supported, <c>false</c> otherwise.</returns>
  72. bool SupportsFilter(string filter);
  73. /// <summary>
  74. /// Whether filter is supported with the given option.
  75. /// </summary>
  76. /// <param name="option">The option.</param>
  77. /// <returns><c>true</c> if the filter is supported, <c>false</c> otherwise.</returns>
  78. bool SupportsFilterWithOption(FilterOptionType option);
  79. /// <summary>
  80. /// Extracts the audio image.
  81. /// </summary>
  82. /// <param name="path">The path.</param>
  83. /// <param name="imageStreamIndex">Index of the image stream.</param>
  84. /// <param name="cancellationToken">The cancellation token.</param>
  85. /// <returns>Task{Stream}.</returns>
  86. Task<string> ExtractAudioImage(string path, int? imageStreamIndex, CancellationToken cancellationToken);
  87. /// <summary>
  88. /// Extracts the video image.
  89. /// </summary>
  90. /// <param name="inputFile">Input file.</param>
  91. /// <param name="container">Video container type.</param>
  92. /// <param name="mediaSource">Media source information.</param>
  93. /// <param name="videoStream">Media stream information.</param>
  94. /// <param name="threedFormat">Video 3D format.</param>
  95. /// <param name="offset">Time offset.</param>
  96. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  97. /// <returns>Location of video image.</returns>
  98. Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream videoStream, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
  99. /// <summary>
  100. /// Extracts the video image.
  101. /// </summary>
  102. /// <param name="inputFile">Input file.</param>
  103. /// <param name="container">Video container type.</param>
  104. /// <param name="mediaSource">Media source information.</param>
  105. /// <param name="imageStream">Media stream information.</param>
  106. /// <param name="imageStreamIndex">Index of the stream to extract from.</param>
  107. /// <param name="targetFormat">The format of the file to write.</param>
  108. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  109. /// <returns>Location of video image.</returns>
  110. Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream imageStream, int? imageStreamIndex, ImageFormat? targetFormat, CancellationToken cancellationToken);
  111. /// <summary>
  112. /// Gets the media info.
  113. /// </summary>
  114. /// <param name="request">The request.</param>
  115. /// <param name="cancellationToken">The cancellation token.</param>
  116. /// <returns>Task.</returns>
  117. Task<MediaInfo> GetMediaInfo(MediaInfoRequest request, CancellationToken cancellationToken);
  118. /// <summary>
  119. /// Gets the input argument.
  120. /// </summary>
  121. /// <param name="inputFile">The input file.</param>
  122. /// <param name="mediaSource">The mediaSource.</param>
  123. /// <returns>System.String.</returns>
  124. string GetInputArgument(string inputFile, MediaSourceInfo mediaSource);
  125. /// <summary>
  126. /// Gets the input argument for an external subtitle file.
  127. /// </summary>
  128. /// <param name="inputFile">The input file.</param>
  129. /// <returns>System.String.</returns>
  130. string GetExternalSubtitleInputArgument(string inputFile);
  131. /// <summary>
  132. /// Gets the time parameter.
  133. /// </summary>
  134. /// <param name="ticks">The ticks.</param>
  135. /// <returns>System.String.</returns>
  136. string GetTimeParameter(long ticks);
  137. Task ConvertImage(string inputPath, string outputPath);
  138. /// <summary>
  139. /// Escapes the subtitle filter path.
  140. /// </summary>
  141. /// <param name="path">The path.</param>
  142. /// <returns>System.String.</returns>
  143. string EscapeSubtitleFilterPath(string path);
  144. /// <summary>
  145. /// Sets the path to find FFmpeg.
  146. /// </summary>
  147. void SetFFmpegPath();
  148. /// <summary>
  149. /// Updates the encoder path.
  150. /// </summary>
  151. /// <param name="path">The path.</param>
  152. /// <param name="pathType">The type of path.</param>
  153. void UpdateEncoderPath(string path, string pathType);
  154. /// <summary>
  155. /// Gets the primary playlist of .vob files.
  156. /// </summary>
  157. /// <param name="path">The to the .vob files.</param>
  158. /// <param name="titleNumber">The title number to start with.</param>
  159. /// <returns>A playlist.</returns>
  160. IEnumerable<string> GetPrimaryPlaylistVobFiles(string path, uint? titleNumber);
  161. }
  162. }