mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Merge branch 'master' into ffprobe-show-packets
Former-commit-id: ebf77d0662
This commit is contained in:
commit
a0d0a87970
1 changed files with 15 additions and 0 deletions
|
@ -29,17 +29,32 @@ internal FFMpegArgumentProcessor(FFMpegArguments ffMpegArguments)
|
||||||
|
|
||||||
private event EventHandler<int> CancelEvent = null!;
|
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)
|
public FFMpegArgumentProcessor NotifyOnProgress(Action<double> onPercentageProgress, TimeSpan totalTimeSpan)
|
||||||
{
|
{
|
||||||
_totalTimespan = totalTimeSpan;
|
_totalTimespan = totalTimeSpan;
|
||||||
_onPercentageProgress = onPercentageProgress;
|
_onPercentageProgress = onPercentageProgress;
|
||||||
return this;
|
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)
|
public FFMpegArgumentProcessor NotifyOnProgress(Action<TimeSpan> onTimeProgress)
|
||||||
{
|
{
|
||||||
_onTimeProgress = onTimeProgress;
|
_onTimeProgress = onTimeProgress;
|
||||||
return this;
|
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)
|
public FFMpegArgumentProcessor NotifyOnOutput(Action<string, DataType> onOutput)
|
||||||
{
|
{
|
||||||
_onOutput = onOutput;
|
_onOutput = onOutput;
|
||||||
|
|
Loading…
Reference in a new issue