diff --git a/FFMpegCore.Test/VideoTest.cs b/FFMpegCore.Test/VideoTest.cs
index 9d7009d..63c40d0 100644
--- a/FFMpegCore.Test/VideoTest.cs
+++ b/FFMpegCore.Test/VideoTest.cs
@@ -72,7 +72,7 @@ private void ConvertFromStreamPipe(VideoType type, ArgumentContainer container)
var input = VideoInfo.FromFileInfo(VideoLibrary.LocalVideoWebm);
using (var inputStream = System.IO.File.OpenRead(input.FullName))
{
- var pipeSource = new StreamPipeSource(inputStream);
+ var pipeSource = new StreamPipeDataWriter(inputStream);
var arguments = new ArgumentContainer { new InputPipeArgument(pipeSource) };
foreach (var arg in container)
{
@@ -183,7 +183,7 @@ public void ConvertFromPipe(VideoType type, ArgumentContainer container, PixelFo
try
{
- var videoFramesSource = new RawVideoPipeSource(BitmapSource.CreateBitmaps(128, fmt, 256, 256));
+ var videoFramesSource = new RawVideoPipeDataWriter(BitmapSource.CreateBitmaps(128, fmt, 256, 256));
var arguments = new ArgumentContainer { new InputPipeArgument(videoFramesSource) };
foreach (var arg in container)
{
diff --git a/FFMpegCore/FFMPEG/Argument/ArgumentContainer.cs b/FFMpegCore/FFMPEG/Argument/ArgumentContainer.cs
index d2e5532..03e2014 100644
--- a/FFMpegCore/FFMPEG/Argument/ArgumentContainer.cs
+++ b/FFMpegCore/FFMPEG/Argument/ArgumentContainer.cs
@@ -102,10 +102,8 @@ public void Add(params Argument[] values)
///
public bool ContainsInputOutput()
{
- return ((ContainsKey(typeof(InputArgument)) && !ContainsKey(typeof(ConcatArgument)) && !ContainsKey(typeof(InputPipeArgument))) ||
- (!ContainsKey(typeof(InputArgument)) && ContainsKey(typeof(ConcatArgument)) && !ContainsKey(typeof(InputPipeArgument))) ||
- (!ContainsKey(typeof(InputArgument)) && !ContainsKey(typeof(ConcatArgument)) && ContainsKey(typeof(InputPipeArgument))))
- && ContainsKey(typeof(OutputArgument));
+ return CountExistedKeys(typeof(InputArgument), typeof(ConcatArgument), typeof(InputPipeArgument)) == 1 &&
+ CountExistedKeys(typeof(OutputArgument), typeof(OutputPipeArgument)) == 1;
}
///
@@ -118,6 +116,16 @@ public bool ContainsKey(Type key)
return _args.ContainsKey(key);
}
+ public int CountExistedKeys(params Type[] types)
+ {
+ int count = 0;
+ for(int i =0; i < types.Length; i++)
+ if (_args.ContainsKey(types[i]))
+ count++;
+
+ return count;
+ }
+
public void CopyTo(KeyValuePair[] array, int arrayIndex)
{
_args.CopyTo(array, arrayIndex);
diff --git a/FFMpegCore/FFMPEG/FFProbe.cs b/FFMpegCore/FFMPEG/FFProbe.cs
index a7aec84..53ee313 100644
--- a/FFMpegCore/FFMPEG/FFProbe.cs
+++ b/FFMpegCore/FFMPEG/FFProbe.cs
@@ -75,7 +75,7 @@ public async Task ParseVideoInfoAsync(VideoInfo info)
public VideoInfo ParseVideoInfo(System.IO.Stream stream)
{
var info = new VideoInfo();
- var streamPipeSource = new StreamPipeSource(stream);
+ var streamPipeSource = new StreamPipeDataWriter(stream);
var pipeArgument = new InputPipeArgument(streamPipeSource);
var instance = new Instance(_ffprobePath, BuildFFProbeArguments(pipeArgument.PipePath)) { DataBufferCapacity = _outputCapacity };
@@ -105,7 +105,7 @@ public VideoInfo ParseVideoInfo(System.IO.Stream stream)
public async Task ParseVideoInfoAsync(System.IO.Stream stream)
{
var info = new VideoInfo();
- var streamPipeSource = new StreamPipeSource(stream);
+ var streamPipeSource = new StreamPipeDataWriter(stream);
var pipeArgument = new InputPipeArgument(streamPipeSource);
var instance = new Instance(_ffprobePath, BuildFFProbeArguments(pipeArgument.PipePath)) { DataBufferCapacity = _outputCapacity };