2021-05-06 22:39:20 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2020-08-22 19:56:24 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 20:01:16 +00:00
|
|
|
using System;
|
2018-12-27 23:27:57 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using MediaBrowser.Model.Dlna;
|
2021-11-12 15:11:15 +00:00
|
|
|
using MediaBrowser.Model.Drawing;
|
2020-09-24 06:41:42 +00:00
|
|
|
using MediaBrowser.Model.Dto;
|
2019-01-13 19:25:32 +00:00
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
using MediaBrowser.Model.MediaInfo;
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.MediaEncoding
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-06-15 22:37:52 +00:00
|
|
|
/// Interface IMediaEncoder.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
public interface IMediaEncoder : ITranscoderSupport
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the encoder path.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The encoder path.</value>
|
|
|
|
string EncoderPath { get; }
|
|
|
|
|
2021-09-23 13:29:12 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the probe path.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The probe path.</value>
|
|
|
|
string ProbePath { get; }
|
|
|
|
|
2021-12-24 08:50:40 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the version of encoder.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The version of encoder.</returns>
|
|
|
|
Version EncoderVersion { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
2021-12-24 21:18:24 +00:00
|
|
|
/// Gets a value indicating whether the configured Vaapi device is from AMD(radeonsi/r600 Mesa driver).
|
2021-12-24 08:50:40 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value><c>true</c> if the Vaapi device is an AMD(radeonsi/r600 Mesa driver) GPU, <c>false</c> otherwise.</value>
|
|
|
|
bool IsVaapiDeviceAmd { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
2021-12-24 21:18:24 +00:00
|
|
|
/// Gets a value indicating whether the configured Vaapi device is from Intel(iHD driver).
|
2021-12-24 08:50:40 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value><c>true</c> if the Vaapi device is an Intel(iHD driver) GPU, <c>false</c> otherwise.</value>
|
|
|
|
bool IsVaapiDeviceInteliHD { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
2021-12-24 21:18:24 +00:00
|
|
|
/// Gets a value indicating whether the configured Vaapi device is from Intel(legacy i965 driver).
|
2021-12-24 08:50:40 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value><c>true</c> if the Vaapi device is an Intel(legacy i965 driver) GPU, <c>false</c> otherwise.</value>
|
|
|
|
bool IsVaapiDeviceInteli965 { get; }
|
|
|
|
|
2020-04-08 16:15:01 +00:00
|
|
|
/// <summary>
|
2020-05-25 21:43:26 +00:00
|
|
|
/// Whether given encoder codec is supported.
|
2020-04-08 16:15:01 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="encoder">The encoder.</param>
|
|
|
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
|
|
|
bool SupportsEncoder(string encoder);
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
2020-05-25 21:43:26 +00:00
|
|
|
/// Whether given decoder codec is supported.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="decoder">The decoder.</param>
|
|
|
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
|
|
|
bool SupportsDecoder(string decoder);
|
|
|
|
|
2020-04-08 16:15:01 +00:00
|
|
|
/// <summary>
|
2020-05-25 21:43:26 +00:00
|
|
|
/// Whether given hardware acceleration type is supported.
|
2020-04-08 16:15:01 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="hwaccel">The hwaccel.</param>
|
|
|
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
|
|
|
bool SupportsHwaccel(string hwaccel);
|
|
|
|
|
2021-01-26 19:20:53 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Whether given filter is supported.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="filter">The filter.</param>
|
2021-07-24 16:52:16 +00:00
|
|
|
/// <returns><c>true</c> if the filter is supported, <c>false</c> otherwise.</returns>
|
|
|
|
bool SupportsFilter(string filter);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Whether filter is supported with the given option.
|
|
|
|
/// </summary>
|
2021-01-26 19:20:53 +00:00
|
|
|
/// <param name="option">The option.</param>
|
2021-01-29 09:53:42 +00:00
|
|
|
/// <returns><c>true</c> if the filter is supported, <c>false</c> otherwise.</returns>
|
2021-07-24 16:52:16 +00:00
|
|
|
bool SupportsFilterWithOption(FilterOptionType option);
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Extracts the audio image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">The path.</param>
|
|
|
|
/// <param name="imageStreamIndex">Index of the image stream.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
|
|
|
Task<string> ExtractAudioImage(string path, int? imageStreamIndex, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Extracts the video image.
|
|
|
|
/// </summary>
|
2021-08-10 21:29:48 +00:00
|
|
|
/// <param name="inputFile">Input file.</param>
|
|
|
|
/// <param name="container">Video container type.</param>
|
|
|
|
/// <param name="mediaSource">Media source information.</param>
|
|
|
|
/// <param name="videoStream">Media stream information.</param>
|
|
|
|
/// <param name="threedFormat">Video 3D format.</param>
|
|
|
|
/// <param name="offset">Time offset.</param>
|
|
|
|
/// <param name="cancellationToken">CancellationToken to use for operation.</param>
|
|
|
|
/// <returns>Location of video image.</returns>
|
2020-10-01 20:20:28 +00:00
|
|
|
Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream videoStream, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
2021-08-10 21:29:48 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Extracts the video image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="inputFile">Input file.</param>
|
|
|
|
/// <param name="container">Video container type.</param>
|
|
|
|
/// <param name="mediaSource">Media source information.</param>
|
|
|
|
/// <param name="imageStream">Media stream information.</param>
|
2021-08-11 20:37:46 +00:00
|
|
|
/// <param name="imageStreamIndex">Index of the stream to extract from.</param>
|
2021-11-12 15:11:15 +00:00
|
|
|
/// <param name="targetFormat">The format of the file to write.</param>
|
2021-08-10 21:29:48 +00:00
|
|
|
/// <param name="cancellationToken">CancellationToken to use for operation.</param>
|
|
|
|
/// <returns>Location of video image.</returns>
|
2021-11-12 15:11:15 +00:00
|
|
|
Task<string> ExtractVideoImage(string inputFile, string container, MediaSourceInfo mediaSource, MediaStream imageStream, int? imageStreamIndex, ImageFormat? targetFormat, CancellationToken cancellationToken);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the media info.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="request">The request.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
Task<MediaInfo> GetMediaInfo(MediaInfoRequest request, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the input argument.
|
|
|
|
/// </summary>
|
2020-10-01 20:20:28 +00:00
|
|
|
/// <param name="inputFile">The input file.</param>
|
2020-09-24 06:41:42 +00:00
|
|
|
/// <param name="mediaSource">The mediaSource.</param>
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <returns>System.String.</returns>
|
2020-10-01 20:20:28 +00:00
|
|
|
string GetInputArgument(string inputFile, MediaSourceInfo mediaSource);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
2022-05-04 14:20:48 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the input argument for an external subtitle file.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="inputFile">The input file.</param>
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
string GetExternalSubtitleInputArgument(string inputFile);
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the time parameter.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="ticks">The ticks.</param>
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
string GetTimeParameter(long ticks);
|
|
|
|
|
|
|
|
Task ConvertImage(string inputPath, string outputPath);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Escapes the subtitle filter path.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">The path.</param>
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
string EscapeSubtitleFilterPath(string path);
|
|
|
|
|
2021-08-10 21:29:48 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the path to find FFmpeg.
|
|
|
|
/// </summary>
|
2019-02-28 22:47:56 +00:00
|
|
|
void SetFFmpegPath();
|
2018-12-27 23:27:57 +00:00
|
|
|
|
2021-08-10 21:29:48 +00:00
|
|
|
/// <summary>
|
2021-08-11 20:37:46 +00:00
|
|
|
/// Updates the encoder path.
|
2021-08-10 21:29:48 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">The path.</param>
|
|
|
|
/// <param name="pathType">The type of path.</param>
|
2018-12-27 23:27:57 +00:00
|
|
|
void UpdateEncoderPath(string path, string pathType);
|
|
|
|
|
2021-08-10 21:29:48 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the primary playlist of .vob files.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">The to the .vob files.</param>
|
|
|
|
/// <param name="titleNumber">The title number to start with.</param>
|
|
|
|
/// <returns>A playlist.</returns>
|
2020-12-03 14:34:15 +00:00
|
|
|
IEnumerable<string> GetPrimaryPlaylistVobFiles(string path, uint? titleNumber);
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|