mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Merge pull request #179 from Codinlab/OutputStream
Add OutputStreamArgument
This commit is contained in:
commit
ce7eb9228b
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;
|
||||
}
|
||||
}
|
|
@ -50,6 +50,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(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);
|
||||
|
||||
private FFMpegArgumentProcessor ToProcessor(IOutputArgument argument, Action<FFMpegArgumentOptions>? addArguments)
|
||||
|
|
Loading…
Reference in a new issue