IMediaEncoder.cs 4.3 KB

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