FFMpegCore/FFMpegCore/FFMpeg/Pipes/StreamPipeDataWriter.cs
Malte Rosenbjerg ca86c86f44 Slight renaming
Former-commit-id: f896ec126f
2020-05-11 00:50:49 +02:00

24 lines
761 B
C#

using System.Threading;
using System.Threading.Tasks;
namespace FFMpegCore.Pipes
{
/// <summary>
/// Implementation of <see cref="IPipeDataWriter"/> used for stream redirection
/// </summary>
public class StreamPipeDataWriter : IPipeDataWriter
{
public System.IO.Stream Source { get; }
public int BlockSize { get; } = 4096;
public string StreamFormat { get; } = string.Empty;
public StreamPipeDataWriter(System.IO.Stream source)
{
Source = source;
}
public Task CopyAsync(System.IO.Stream outputStream, CancellationToken cancellationToken) => Source.CopyToAsync(outputStream, BlockSize, cancellationToken);
public string GetFormat() => StreamFormat;
}
}