mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 10:05:44 +00:00
* Move PosterWithAudio to FFMpegCore * Reduce windows only tests * Update Directory.Build.props * Create .editorconfig * More cleanup * Enable implicit usings * Remove unused method * Apply dotnet format * Fix unused variable in AudioGateArgument * Fix boolean conditions in AudioGateArgument * Merge boolean conditions into pattern * Use target-typed new * Add linting to CI * Add CUDA to HardwareAccelerationDevice enum * Increase timeout for Video_Join_Image_Sequence * Adjust Video_Join_Image_Sequence timeout * Fix expected seconds in Video_Join_Image_Sequence * Increase timeout for Video_TranscodeToMemory due to macos agents
28 lines
760 B
C#
28 lines
760 B
C#
using System.IO.Pipes;
|
|
using FFMpegCore.Pipes;
|
|
|
|
namespace FFMpegCore.Arguments
|
|
{
|
|
public class OutputPipeArgument : PipeArgument, IOutputArgument
|
|
{
|
|
public readonly IPipeSink Reader;
|
|
|
|
public OutputPipeArgument(IPipeSink reader) : base(PipeDirection.In)
|
|
{
|
|
Reader = reader;
|
|
}
|
|
|
|
public override string Text => $"\"{PipePath}\" -y";
|
|
|
|
protected override async Task ProcessDataAsync(CancellationToken token)
|
|
{
|
|
await Pipe.WaitForConnectionAsync(token).ConfigureAwait(false);
|
|
if (!Pipe.IsConnected)
|
|
{
|
|
throw new TaskCanceledException();
|
|
}
|
|
|
|
await Reader.ReadAsync(Pipe, token).ConfigureAwait(false);
|
|
}
|
|
}
|
|
}
|