Merge branch 'master' into ffprobe-show-packets

This commit is contained in:
Alex Zhukov 2021-11-17 07:36:13 -08:00 committed by GitHub
commit ebf77d0662
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,17 +29,32 @@ internal FFMpegArgumentProcessor(FFMpegArguments ffMpegArguments)
private event EventHandler<int> CancelEvent = null!;
/// <summary>
/// Register action that will be invoked during the ffmpeg processing, when a progress time is output and parsed and progress percentage is calculated.
/// Total time is needed to calculate the percentage that has been processed of the full file.
/// </summary>
/// <param name="onPercentageProgress">Action to invoke when progress percentage is updated</param>
/// <param name="totalTimeSpan">The total timespan of the mediafile being processed</param>
public FFMpegArgumentProcessor NotifyOnProgress(Action<double> onPercentageProgress, TimeSpan totalTimeSpan)
{
_totalTimespan = totalTimeSpan;
_onPercentageProgress = onPercentageProgress;
return this;
}
/// <summary>
/// Register action that will be invoked during the ffmpeg processing, when a progress time is output and parsed
/// </summary>
/// <param name="onTimeProgress">Action that will be invoked with the parsed timestamp as argument</param>
public FFMpegArgumentProcessor NotifyOnProgress(Action<TimeSpan> onTimeProgress)
{
_onTimeProgress = onTimeProgress;
return this;
}
/// <summary>
/// Register action that will be invoked during the ffmpeg processing, when a line is output
/// </summary>
/// <param name="onOutput"></param>
public FFMpegArgumentProcessor NotifyOnOutput(Action<string, DataType> onOutput)
{
_onOutput = onOutput;