From 6bb03f6e14f2a26c25892369b5a10c369f8b47b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=91=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D1=8F=D0=BD=D1=86=D0=B5=D0=B2?= Date: Tue, 28 Apr 2020 18:42:50 +0300 Subject: [PATCH] Renamed IPipeSource to IpipeDataWriter Former-commit-id: b7099f6709c86907b480f834c1ca26deb36503aa --- .../FFMPEG/Argument/Atoms/InputPipeArgument.cs | 8 ++++---- .../Pipes/{IPipeSource.cs => IPipeDataWriter.cs} | 6 +++--- ...wVideoPipeSource.cs => RawVideoPipeDataWriter.cs} | 12 ++++++------ FFMpegCore/FFMPEG/Pipes/StreamPipeDataReader.cs | 4 ++-- .../{StreamPipeSource.cs => StreamPipeDataWriter.cs} | 10 +++++----- 5 files changed, 20 insertions(+), 20 deletions(-) rename FFMpegCore/FFMPEG/Pipes/{IPipeSource.cs => IPipeDataWriter.cs} (68%) rename FFMpegCore/FFMPEG/Pipes/{RawVideoPipeSource.cs => RawVideoPipeDataWriter.cs} (77%) rename FFMpegCore/FFMPEG/Pipes/{StreamPipeSource.cs => StreamPipeDataWriter.cs} (74%) diff --git a/FFMpegCore/FFMPEG/Argument/Atoms/InputPipeArgument.cs b/FFMpegCore/FFMPEG/Argument/Atoms/InputPipeArgument.cs index ee6b19b..cd818d8 100644 --- a/FFMpegCore/FFMPEG/Argument/Atoms/InputPipeArgument.cs +++ b/FFMpegCore/FFMPEG/Argument/Atoms/InputPipeArgument.cs @@ -17,11 +17,11 @@ public class InputPipeArgument : Argument { public string PipeName { get; private set; } public string PipePath => PipeHelpers.GetPipePath(PipeName); - public IPipeSource Source { get; private set; } + public IPipeDataWriter Source { get; private set; } private NamedPipeServerStream pipe; - public InputPipeArgument(IPipeSource source) + public InputPipeArgument(IPipeDataWriter source) { Source = source; PipeName = PipeHelpers.GetUnqiuePipeName(); @@ -49,14 +49,14 @@ public override string GetStringValue() public void FlushPipe() { pipe.WaitForConnection(); - Source.FlushData(pipe); + Source.WriteData(pipe); } public async Task FlushPipeAsync() { await pipe.WaitForConnectionAsync(); - await Source.FlushDataAsync(pipe); + await Source.WriteDataAsync(pipe); } } } diff --git a/FFMpegCore/FFMPEG/Pipes/IPipeSource.cs b/FFMpegCore/FFMPEG/Pipes/IPipeDataWriter.cs similarity index 68% rename from FFMpegCore/FFMPEG/Pipes/IPipeSource.cs rename to FFMpegCore/FFMPEG/Pipes/IPipeDataWriter.cs index 80d3ddf..aa4bbc8 100644 --- a/FFMpegCore/FFMPEG/Pipes/IPipeSource.cs +++ b/FFMpegCore/FFMPEG/Pipes/IPipeDataWriter.cs @@ -9,10 +9,10 @@ namespace FFMpegCore.FFMPEG.Pipes /// /// Interface for ffmpeg pipe source data IO /// - public interface IPipeSource + public interface IPipeDataWriter { string GetFormat(); - void FlushData(System.IO.Stream pipe); - Task FlushDataAsync(System.IO.Stream pipe); + void WriteData(System.IO.Stream pipe); + Task WriteDataAsync(System.IO.Stream pipe); } } diff --git a/FFMpegCore/FFMPEG/Pipes/RawVideoPipeSource.cs b/FFMpegCore/FFMPEG/Pipes/RawVideoPipeDataWriter.cs similarity index 77% rename from FFMpegCore/FFMPEG/Pipes/RawVideoPipeSource.cs rename to FFMpegCore/FFMPEG/Pipes/RawVideoPipeDataWriter.cs index c6f3b27..c7d3df0 100644 --- a/FFMpegCore/FFMPEG/Pipes/RawVideoPipeSource.cs +++ b/FFMpegCore/FFMPEG/Pipes/RawVideoPipeDataWriter.cs @@ -7,9 +7,9 @@ namespace FFMpegCore.FFMPEG.Pipes { /// - /// Implementation of for a raw video stream that is gathered from + /// Implementation of for a raw video stream that is gathered from /// - public class RawVideoPipeSource : IPipeSource + public class RawVideoPipeDataWriter : IPipeDataWriter { public string StreamFormat { get; set; } public int Width { get; set; } @@ -17,12 +17,12 @@ public class RawVideoPipeSource : IPipeSource public int FrameRate { get; set; } = 25; private IEnumerator framesEnumerator; - public RawVideoPipeSource(IEnumerator framesEnumerator) + public RawVideoPipeDataWriter(IEnumerator framesEnumerator) { this.framesEnumerator = framesEnumerator; } - public RawVideoPipeSource(IEnumerable framesEnumerator) : this(framesEnumerator.GetEnumerator()) { } + public RawVideoPipeDataWriter(IEnumerable framesEnumerator) : this(framesEnumerator.GetEnumerator()) { } public string GetFormat() { @@ -40,7 +40,7 @@ public string GetFormat() return $"-f rawvideo -r {FrameRate} -pix_fmt {StreamFormat} -s {Width}x{Height}"; } - public void FlushData(System.IO.Stream stream) + public void WriteData(System.IO.Stream stream) { if (framesEnumerator.Current != null) { @@ -53,7 +53,7 @@ public void FlushData(System.IO.Stream stream) } } - public async Task FlushDataAsync(System.IO.Stream stream) + public async Task WriteDataAsync(System.IO.Stream stream) { if (framesEnumerator.Current != null) { diff --git a/FFMpegCore/FFMPEG/Pipes/StreamPipeDataReader.cs b/FFMpegCore/FFMPEG/Pipes/StreamPipeDataReader.cs index c59a475..d080806 100644 --- a/FFMpegCore/FFMPEG/Pipes/StreamPipeDataReader.cs +++ b/FFMpegCore/FFMPEG/Pipes/StreamPipeDataReader.cs @@ -5,12 +5,12 @@ namespace FFMpegCore.FFMPEG.Pipes { - public class StreamPipedataReader : IPipeDataReader + public class StreamPipeDataReader : IPipeDataReader { public System.IO.Stream DestanationStream { get; private set; } public int BlockSize { get; set; } = 4096; - public StreamPipedataReader(System.IO. Stream destanationStream) + public StreamPipeDataReader(System.IO. Stream destanationStream) { DestanationStream = destanationStream; } diff --git a/FFMpegCore/FFMPEG/Pipes/StreamPipeSource.cs b/FFMpegCore/FFMPEG/Pipes/StreamPipeDataWriter.cs similarity index 74% rename from FFMpegCore/FFMPEG/Pipes/StreamPipeSource.cs rename to FFMpegCore/FFMPEG/Pipes/StreamPipeDataWriter.cs index 1028562..441a28f 100644 --- a/FFMpegCore/FFMPEG/Pipes/StreamPipeSource.cs +++ b/FFMpegCore/FFMPEG/Pipes/StreamPipeDataWriter.cs @@ -6,19 +6,19 @@ namespace FFMpegCore.FFMPEG.Pipes { /// - /// Implementation of used for stream redirection + /// Implementation of used for stream redirection /// - public class StreamPipeSource : IPipeSource + public class StreamPipeDataWriter : IPipeDataWriter { public System.IO.Stream Source { get; private set; } public int BlockSize { get; set; } = 4096; - public StreamPipeSource(System.IO.Stream stream) + public StreamPipeDataWriter(System.IO.Stream stream) { Source = stream; } - public void FlushData(System.IO.Stream pipe) + public void WriteData(System.IO.Stream pipe) { var buffer = new byte[BlockSize]; int read; @@ -28,7 +28,7 @@ public void FlushData(System.IO.Stream pipe) } } - public async Task FlushDataAsync(System.IO.Stream pipe) + public async Task WriteDataAsync(System.IO.Stream pipe) { var buffer = new byte[BlockSize]; int read;