mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 18:15:44 +00:00
Fix formatting
This commit is contained in:
parent
066ca894ba
commit
5f2147e207
3 changed files with 52 additions and 52 deletions
|
|
@ -5,6 +5,8 @@ namespace FFMpegCore.Test;
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class FFProbeTests
|
public class FFProbeTests
|
||||||
{
|
{
|
||||||
|
public TestContext TestContext { get; set; }
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task Audio_FromStream_Duration()
|
public async Task Audio_FromStream_Duration()
|
||||||
{
|
{
|
||||||
|
|
@ -97,7 +99,8 @@ public class FFProbeTests
|
||||||
[Ignore("Consistently fails on GitHub Workflow ubuntu agents")]
|
[Ignore("Consistently fails on GitHub Workflow ubuntu agents")]
|
||||||
public async Task Uri_Duration()
|
public async Task Uri_Duration()
|
||||||
{
|
{
|
||||||
var fileAnalysis = await FFProbe.AnalyseAsync(new Uri("https://github.com/rosenbjerg/FFMpegCore/raw/master/FFMpegCore.Test/Resources/input_3sec.webm"), cancellationToken: TestContext.CancellationToken);
|
var fileAnalysis = await FFProbe.AnalyseAsync(new Uri("https://github.com/rosenbjerg/FFMpegCore/raw/master/FFMpegCore.Test/Resources/input_3sec.webm"),
|
||||||
|
cancellationToken: TestContext.CancellationToken);
|
||||||
Assert.IsNotNull(fileAnalysis);
|
Assert.IsNotNull(fileAnalysis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,6 +285,4 @@ public class FFProbeTests
|
||||||
var info = FFProbe.Analyse(TestResources.Mp4Video, customArguments: "-headers \"Hello: World\"");
|
var info = FFProbe.Analyse(TestResources.Mp4Video, customArguments: "-headers \"Hello: World\"");
|
||||||
Assert.AreEqual(3, info.Duration.Seconds);
|
Assert.AreEqual(3, info.Duration.Seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TestContext TestContext { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ public class VideoTest
|
||||||
{
|
{
|
||||||
private const int BaseTimeoutMilliseconds = 15_000;
|
private const int BaseTimeoutMilliseconds = 15_000;
|
||||||
|
|
||||||
|
public TestContext TestContext { get; set; }
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
|
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
|
||||||
public void Video_ToOGV()
|
public void Video_ToOGV()
|
||||||
|
|
@ -1072,6 +1074,4 @@ public class VideoTest
|
||||||
Assert.AreEqual("h264", outputInfo.PrimaryVideoStream.CodecName);
|
Assert.AreEqual("h264", outputInfo.PrimaryVideoStream.CodecName);
|
||||||
Assert.AreEqual("aac", outputInfo.PrimaryAudioStream!.CodecName);
|
Assert.AreEqual("aac", outputInfo.PrimaryAudioStream!.CodecName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TestContext TestContext { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,10 @@
|
||||||
using System.IO.Pipes;
|
using System.IO.Pipes;
|
||||||
using FFMpegCore.Pipes;
|
using FFMpegCore.Pipes;
|
||||||
|
|
||||||
namespace FFMpegCore.Arguments
|
namespace FFMpegCore.Arguments;
|
||||||
{
|
|
||||||
public abstract class PipeArgument
|
public abstract class PipeArgument
|
||||||
{
|
{
|
||||||
private string PipeName { get; }
|
|
||||||
public string PipePath => PipeHelpers.GetPipePath(PipeName);
|
|
||||||
|
|
||||||
protected NamedPipeServerStream Pipe { get; private set; } = null!;
|
|
||||||
private readonly PipeDirection _direction;
|
private readonly PipeDirection _direction;
|
||||||
|
|
||||||
protected PipeArgument(PipeDirection direction)
|
protected PipeArgument(PipeDirection direction)
|
||||||
|
|
@ -18,6 +14,12 @@ namespace FFMpegCore.Arguments
|
||||||
_direction = direction;
|
_direction = direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string PipeName { get; }
|
||||||
|
public string PipePath => PipeHelpers.GetPipePath(PipeName);
|
||||||
|
|
||||||
|
protected NamedPipeServerStream Pipe { get; private set; } = null!;
|
||||||
|
public abstract string Text { get; }
|
||||||
|
|
||||||
public void Pre()
|
public void Pre()
|
||||||
{
|
{
|
||||||
if (Pipe != null)
|
if (Pipe != null)
|
||||||
|
|
@ -33,7 +35,6 @@ namespace FFMpegCore.Arguments
|
||||||
Debug.WriteLine($"Disposing NamedPipeServerStream on {GetType().Name}");
|
Debug.WriteLine($"Disposing NamedPipeServerStream on {GetType().Name}");
|
||||||
lock (Pipe)
|
lock (Pipe)
|
||||||
{
|
{
|
||||||
|
|
||||||
Pipe?.Dispose();
|
Pipe?.Dispose();
|
||||||
Pipe = null!;
|
Pipe = null!;
|
||||||
}
|
}
|
||||||
|
|
@ -66,6 +67,4 @@ namespace FFMpegCore.Arguments
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract Task ProcessDataAsync(CancellationToken token);
|
protected abstract Task ProcessDataAsync(CancellationToken token);
|
||||||
public abstract string Text { get; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue