mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 10:05:44 +00:00
24 lines
745 B
C#
24 lines
745 B
C#
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace FFMpegCore.Pipes
|
|
{
|
|
/// <summary>
|
|
/// Implementation of <see cref="IPipeSource"/> used for stream redirection
|
|
/// </summary>
|
|
public class StreamPipeSource : IPipeSource
|
|
{
|
|
public System.IO.Stream Source { get; }
|
|
public int BlockSize { get; } = 4096;
|
|
public string StreamFormat { get; } = string.Empty;
|
|
|
|
public StreamPipeSource(System.IO.Stream source)
|
|
{
|
|
Source = source;
|
|
}
|
|
|
|
public Task CopyAsync(System.IO.Stream outputStream, CancellationToken cancellationToken) => Source.CopyToAsync(outputStream, BlockSize, cancellationToken);
|
|
|
|
public string GetFormat() => StreamFormat;
|
|
}
|
|
}
|