mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 18:15:44 +00:00
Use CreateLinkedTokenSource to bind to TestContext cancellationtoken
This commit is contained in:
parent
1346049991
commit
919c6ef526
1 changed files with 5 additions and 7 deletions
|
|
@ -1050,7 +1050,7 @@ public class VideoTest
|
||||||
{
|
{
|
||||||
using var outputFile = new TemporaryFile("out.mp4");
|
using var outputFile = new TemporaryFile("out.mp4");
|
||||||
|
|
||||||
var cts = new CancellationTokenSource();
|
using var cts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.CancellationToken);
|
||||||
|
|
||||||
var task = FFMpegArguments
|
var task = FFMpegArguments
|
||||||
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
||||||
|
|
@ -1061,7 +1061,6 @@ public class VideoTest
|
||||||
.WithVideoCodec(VideoCodec.LibX264)
|
.WithVideoCodec(VideoCodec.LibX264)
|
||||||
.WithSpeedPreset(Speed.VeryFast))
|
.WithSpeedPreset(Speed.VeryFast))
|
||||||
.CancellableThrough(cts.Token)
|
.CancellableThrough(cts.Token)
|
||||||
.CancellableThrough(TestContext.CancellationToken)
|
|
||||||
.ProcessAsynchronously(false);
|
.ProcessAsynchronously(false);
|
||||||
|
|
||||||
cts.CancelAfter(300);
|
cts.CancelAfter(300);
|
||||||
|
|
@ -1077,7 +1076,7 @@ public class VideoTest
|
||||||
{
|
{
|
||||||
using var outputFile = new TemporaryFile("out.mp4");
|
using var outputFile = new TemporaryFile("out.mp4");
|
||||||
|
|
||||||
var cts = new CancellationTokenSource();
|
using var cts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.CancellationToken);
|
||||||
|
|
||||||
var task = FFMpegArguments
|
var task = FFMpegArguments
|
||||||
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
||||||
|
|
@ -1088,7 +1087,6 @@ public class VideoTest
|
||||||
.WithVideoCodec(VideoCodec.LibX264)
|
.WithVideoCodec(VideoCodec.LibX264)
|
||||||
.WithSpeedPreset(Speed.VeryFast))
|
.WithSpeedPreset(Speed.VeryFast))
|
||||||
.CancellableThrough(cts.Token)
|
.CancellableThrough(cts.Token)
|
||||||
.CancellableThrough(TestContext.CancellationToken)
|
|
||||||
.ProcessAsynchronously();
|
.ProcessAsynchronously();
|
||||||
|
|
||||||
cts.CancelAfter(300);
|
cts.CancelAfter(300);
|
||||||
|
|
@ -1102,7 +1100,7 @@ public class VideoTest
|
||||||
{
|
{
|
||||||
using var outputFile = new TemporaryFile("out.mp4");
|
using var outputFile = new TemporaryFile("out.mp4");
|
||||||
|
|
||||||
var cts = new CancellationTokenSource();
|
using var cts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.CancellationToken);
|
||||||
|
|
||||||
var task = FFMpegArguments
|
var task = FFMpegArguments
|
||||||
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
||||||
|
|
@ -1126,7 +1124,7 @@ public class VideoTest
|
||||||
{
|
{
|
||||||
using var outputFile = new TemporaryFile("out.mp4");
|
using var outputFile = new TemporaryFile("out.mp4");
|
||||||
|
|
||||||
var cts = new CancellationTokenSource();
|
using var cts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.CancellationToken);
|
||||||
|
|
||||||
cts.Cancel();
|
cts.Cancel();
|
||||||
var task = FFMpegArguments
|
var task = FFMpegArguments
|
||||||
|
|
@ -1149,7 +1147,7 @@ public class VideoTest
|
||||||
{
|
{
|
||||||
using var outputFile = new TemporaryFile("out.mp4");
|
using var outputFile = new TemporaryFile("out.mp4");
|
||||||
|
|
||||||
var cts = new CancellationTokenSource();
|
using var cts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.CancellationToken);
|
||||||
|
|
||||||
var task = FFMpegArguments
|
var task = FFMpegArguments
|
||||||
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue