mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Add OutputStreamArgument
(cherry picked from commit 0c64c4d81d7055a582d8377123dbc3b7ba86e444)
Former-commit-id: 157a53690f
This commit is contained in:
parent
cbb6c5a055
commit
93e56e523c
2 changed files with 28 additions and 0 deletions
26
FFMpegCore/FFMpeg/Arguments/OutputStreamArgument.cs
Normal file
26
FFMpegCore/FFMpeg/Arguments/OutputStreamArgument.cs
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFMpegCore.Arguments
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents output stream parameter
|
||||||
|
/// </summary>
|
||||||
|
public class OutputStreamArgument : IOutputArgument
|
||||||
|
{
|
||||||
|
public readonly string Stream;
|
||||||
|
|
||||||
|
public OutputStreamArgument(string stream)
|
||||||
|
{
|
||||||
|
Stream = stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Post() { }
|
||||||
|
|
||||||
|
public Task During(CancellationToken cancellationToken = default) => Task.CompletedTask;
|
||||||
|
|
||||||
|
public void Pre() { }
|
||||||
|
|
||||||
|
public string Text => Stream;
|
||||||
|
}
|
||||||
|
}
|
|
@ -51,6 +51,8 @@ private FFMpegArguments WithInput(IInputArgument inputArgument, Action<FFMpegArg
|
||||||
|
|
||||||
public FFMpegArgumentProcessor OutputToFile(string file, bool overwrite = true, Action<FFMpegArgumentOptions>? addArguments = null) => ToProcessor(new OutputArgument(file, overwrite), addArguments);
|
public FFMpegArgumentProcessor OutputToFile(string file, bool overwrite = true, Action<FFMpegArgumentOptions>? addArguments = null) => ToProcessor(new OutputArgument(file, overwrite), addArguments);
|
||||||
public FFMpegArgumentProcessor OutputToFile(Uri uri, bool overwrite = true, Action<FFMpegArgumentOptions>? addArguments = null) => ToProcessor(new OutputArgument(uri.AbsolutePath, overwrite), addArguments);
|
public FFMpegArgumentProcessor OutputToFile(Uri uri, bool overwrite = true, Action<FFMpegArgumentOptions>? addArguments = null) => ToProcessor(new OutputArgument(uri.AbsolutePath, overwrite), addArguments);
|
||||||
|
public FFMpegArgumentProcessor OutputToStream(string uri, Action<FFMpegArgumentOptions>? addArguments = null) => ToProcessor(new OutputStreamArgument(uri), addArguments);
|
||||||
|
public FFMpegArgumentProcessor OutputToStream(Uri uri, Action<FFMpegArgumentOptions>? addArguments = null) => ToProcessor(new OutputStreamArgument(uri.ToString()), addArguments);
|
||||||
public FFMpegArgumentProcessor OutputToPipe(IPipeSink reader, Action<FFMpegArgumentOptions>? addArguments = null) => ToProcessor(new OutputPipeArgument(reader), addArguments);
|
public FFMpegArgumentProcessor OutputToPipe(IPipeSink reader, Action<FFMpegArgumentOptions>? addArguments = null) => ToProcessor(new OutputPipeArgument(reader), addArguments);
|
||||||
|
|
||||||
private FFMpegArgumentProcessor ToProcessor(IOutputArgument argument, Action<FFMpegArgumentOptions>? addArguments)
|
private FFMpegArgumentProcessor ToProcessor(IOutputArgument argument, Action<FFMpegArgumentOptions>? addArguments)
|
||||||
|
|
Loading…
Reference in a new issue