IMediaEncoder.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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.Dto;
  9. using MediaBrowser.Model.Entities;
  10. using MediaBrowser.Model.MediaInfo;
  11. namespace MediaBrowser.Controller.MediaEncoding
  12. {
  13. /// <summary>
  14. /// Interface IMediaEncoder.
  15. /// </summary>
  16. public interface IMediaEncoder : ITranscoderSupport
  17. {
  18. /// <summary>
  19. /// Gets the encoder path.
  20. /// </summary>
  21. /// <value>The encoder path.</value>
  22. string EncoderPath { get; }
  23. /// <summary>
  24. /// Whether given encoder codec is supported.
  25. /// </summary>
  26. /// <param name="encoder">The encoder.</param>
  27. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  28. bool SupportsEncoder(string encoder);
  29. /// <summary>
  30. /// Whether given decoder codec is supported.
  31. /// </summary>
  32. /// <param name="decoder">The decoder.</param>
  33. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  34. bool SupportsDecoder(string decoder);
  35. /// <summary>
  36. /// Whether given hardware acceleration type is supported.
  37. /// </summary>
  38. /// <param name="hwaccel">The hwaccel.</param>
  39. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  40. bool SupportsHwaccel(string hwaccel);
  41. /// <summary>
  42. /// Whether given filter is supported.
  43. /// </summary>
  44. /// <param name="filter">The filter.</param>
  45. /// <returns><c>true</c> if the filter is supported, <c>false</c> otherwise.</returns>
  46. bool SupportsFilter(string filter);
  47. /// <summary>
  48. /// Whether filter is supported with the given option.
  49. /// </summary>
  50. /// <param name="option">The option.</param>
  51. /// <returns><c>true</c> if the filter is supported, <c>false</c> otherwise.</returns>
  52. bool SupportsFilterWithOption(FilterOptionType option);
  53. /// <summary>
  54. /// Get the version of media encoder.
  55. /// </summary>
  56. /// <returns>The version of media encoder.</returns>
  57. Version GetMediaEncoderVersion();
  58. /// <summary>
  59. /// Extracts the audio image.
  60. /// </summary>
  61. /// <param name="path">The path.</param>
  62. /// <param name="imageStreamIndex">Index of the image stream.</param>
  63. /// <param name="cancellationToken">The cancellation token.</param>
  64. /// <returns>Task{Stream}.</returns>
  65. Task<string> ExtractAudioImage(string path, int? imageStreamIndex, CancellationToken cancellationToken);
  66. /// <summary>
  67. /// Extracts the video image.
  68. /// </summary>
  69. /// <param name="inputFile">Input file.</param>
  70. /// <param name="container">Video container type.</param>
  71. /// <param name="mediaSource">Media source information.</param>
  72. /// <param name="videoStream">Media stream information.</param>
  73. /// <param name="threedFormat">Video 3D format.</param>
  74. /// <param name="offset">Time offset.</param>
  75. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  76. /// <returns>Location of video image.</returns>
  77. Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream videoStream, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
  78. /// <summary>
  79. /// Extracts the video image.
  80. /// </summary>
  81. /// <param name="inputFile">Input file.</param>
  82. /// <param name="container">Video container type.</param>
  83. /// <param name="mediaSource">Media source information.</param>
  84. /// <param name="imageStream">Media stream information.</param>
  85. /// <param name="imageStreamIndex">Index of the stream to extract from.</param>
  86. /// <param name="outputExtension">The extension of the file to write, including the '.'.</param>
  87. /// <param name="cancellationToken">CancellationToken to use for operation.</param>
  88. /// <returns>Location of video image.</returns>
  89. Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream imageStream, int? imageStreamIndex, string outputExtension, CancellationToken cancellationToken);
  90. /// <summary>
  91. /// Gets the media info.
  92. /// </summary>
  93. /// <param name="request">The request.</param>
  94. /// <param name="cancellationToken">The cancellation token.</param>
  95. /// <returns>Task.</returns>
  96. Task<MediaInfo> GetMediaInfo(MediaInfoRequest request, CancellationToken cancellationToken);
  97. /// <summary>
  98. /// Gets the input argument.
  99. /// </summary>
  100. /// <param name="inputFile">The input file.</param>
  101. /// <param name="mediaSource">The mediaSource.</param>
  102. /// <returns>System.String.</returns>
  103. string GetInputArgument(string inputFile, MediaSourceInfo mediaSource);
  104. /// <summary>
  105. /// Gets the time parameter.
  106. /// </summary>
  107. /// <param name="ticks">The ticks.</param>
  108. /// <returns>System.String.</returns>
  109. string GetTimeParameter(long ticks);
  110. Task ConvertImage(string inputPath, string outputPath);
  111. /// <summary>
  112. /// Escapes the subtitle filter path.
  113. /// </summary>
  114. /// <param name="path">The path.</param>
  115. /// <returns>System.String.</returns>
  116. string EscapeSubtitleFilterPath(string path);
  117. /// <summary>
  118. /// Sets the path to find FFmpeg.
  119. /// </summary>
  120. void SetFFmpegPath();
  121. /// <summary>
  122. /// Updates the encoder path.
  123. /// </summary>
  124. /// <param name="path">The path.</param>
  125. /// <param name="pathType">The type of path.</param>
  126. void UpdateEncoderPath(string path, string pathType);
  127. /// <summary>
  128. /// Gets the primary playlist of .vob files.
  129. /// </summary>
  130. /// <param name="path">The to the .vob files.</param>
  131. /// <param name="titleNumber">The title number to start with.</param>
  132. /// <returns>A playlist.</returns>
  133. IEnumerable<string> GetPrimaryPlaylistVobFiles(string path, uint? titleNumber);
  134. }
  135. }