IMediaEncoder.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. using MediaBrowser.Model.Dlna;
  7. using MediaBrowser.Model.Dto;
  8. using MediaBrowser.Model.Entities;
  9. using MediaBrowser.Model.IO;
  10. using MediaBrowser.Model.MediaInfo;
  11. using MediaBrowser.Model.System;
  12. namespace MediaBrowser.Controller.MediaEncoding
  13. {
  14. /// <summary>
  15. /// Interface IMediaEncoder.
  16. /// </summary>
  17. public interface IMediaEncoder : ITranscoderSupport
  18. {
  19. /// <summary>
  20. /// The location of the discovered FFmpeg tool.
  21. /// </summary>
  22. FFmpegLocation EncoderLocation { get; }
  23. /// <summary>
  24. /// Gets the encoder path.
  25. /// </summary>
  26. /// <value>The encoder path.</value>
  27. string EncoderPath { get; }
  28. /// <summary>
  29. /// Whether given encoder codec is supported.
  30. /// </summary>
  31. /// <param name="encoder">The encoder.</param>
  32. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  33. bool SupportsEncoder(string encoder);
  34. /// <summary>
  35. /// Whether given decoder codec is supported.
  36. /// </summary>
  37. /// <param name="decoder">The decoder.</param>
  38. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  39. bool SupportsDecoder(string decoder);
  40. /// <summary>
  41. /// Whether given hardware acceleration type is supported.
  42. /// </summary>
  43. /// <param name="hwaccel">The hwaccel.</param>
  44. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  45. bool SupportsHwaccel(string hwaccel);
  46. /// <summary>
  47. /// Whether given filter is supported.
  48. /// </summary>
  49. /// <param name="filter">The filter.</param>
  50. /// <param name="option">The option.</param>
  51. /// <returns><c>true</c> if the filter is supported, <c>false</c> otherwise.</returns>
  52. bool SupportsFilter(string filter, string option);
  53. /// <summary>
  54. /// Extracts the audio image.
  55. /// </summary>
  56. /// <param name="path">The path.</param>
  57. /// <param name="imageStreamIndex">Index of the image stream.</param>
  58. /// <param name="cancellationToken">The cancellation token.</param>
  59. /// <returns>Task{Stream}.</returns>
  60. Task<string> ExtractAudioImage(string path, int? imageStreamIndex, CancellationToken cancellationToken);
  61. /// <summary>
  62. /// Extracts the video image.
  63. /// </summary>
  64. Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream videoStream, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
  65. Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream imageStream, int? imageStreamIndex, CancellationToken cancellationToken);
  66. /// <summary>
  67. /// Extracts the video images on interval.
  68. /// </summary>
  69. Task ExtractVideoImagesOnInterval(
  70. string inputFile,
  71. string container,
  72. MediaStream videoStream,
  73. MediaSourceInfo mediaSource,
  74. Video3DFormat? threedFormat,
  75. TimeSpan interval,
  76. string targetDirectory,
  77. string filenamePrefix,
  78. int? maxWidth,
  79. CancellationToken cancellationToken);
  80. /// <summary>
  81. /// Gets the media info.
  82. /// </summary>
  83. /// <param name="request">The request.</param>
  84. /// <param name="cancellationToken">The cancellation token.</param>
  85. /// <returns>Task.</returns>
  86. Task<MediaInfo> GetMediaInfo(MediaInfoRequest request, CancellationToken cancellationToken);
  87. /// <summary>
  88. /// Gets the input argument.
  89. /// </summary>
  90. /// <param name="inputFile">The input file.</param>
  91. /// <param name="mediaSource">The mediaSource.</param>
  92. /// <returns>System.String.</returns>
  93. string GetInputArgument(string inputFile, MediaSourceInfo mediaSource);
  94. /// <summary>
  95. /// Gets the time parameter.
  96. /// </summary>
  97. /// <param name="ticks">The ticks.</param>
  98. /// <returns>System.String.</returns>
  99. string GetTimeParameter(long ticks);
  100. Task ConvertImage(string inputPath, string outputPath);
  101. /// <summary>
  102. /// Escapes the subtitle filter path.
  103. /// </summary>
  104. /// <param name="path">The path.</param>
  105. /// <returns>System.String.</returns>
  106. string EscapeSubtitleFilterPath(string path);
  107. void SetFFmpegPath();
  108. void UpdateEncoderPath(string path, string pathType);
  109. IEnumerable<string> GetPrimaryPlaylistVobFiles(string path, uint? titleNumber);
  110. }
  111. }