mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 18:15:44 +00:00
20 lines
No EOL
692 B
C#
20 lines
No EOL
692 B
C#
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Instances;
|
|
|
|
namespace FFMpegCore
|
|
{
|
|
public static class ProcessArgumentsExtensions
|
|
{
|
|
public static IProcessResult StartAndWaitForExit(this ProcessArguments processArguments)
|
|
{
|
|
using var instance = processArguments.Start();
|
|
return instance.WaitForExit();
|
|
}
|
|
public static async Task<IProcessResult> StartAndWaitForExitAsync(this ProcessArguments processArguments, CancellationToken cancellationToken = default)
|
|
{
|
|
using var instance = processArguments.Start();
|
|
return await instance.WaitForExitAsync(cancellationToken);
|
|
}
|
|
}
|
|
} |