IMediaEncoder.cs 7.2 KB

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