public void Export_Start() { VideoTools.Mp4Reader mp4Reader = new VideoTools.Mp4Reader(); m_cancelTokenSource = new CancellationTokenSource(); m_pauseTokenSource = new WPFTools.PauseTokenSource(); m_pauseTokenSource.IsPaused = false; mp4Reader.StartPlayback(m_inputFilename, NewFrame, m_decodeWidth, m_decodeHeight, m_startTime, m_endTime, null, 0.70f, false, m_cancelTokenSource, m_pauseTokenSource, false, null); }
public async void StartPlayback(string filename, Action <ProgressStruct> newFrameHandler, int decodeWidth, int decodeHeight, double startTimestamp, double endTimestamp, DNNTools.DNNengine dnnEngine, float confidence, bool useTracker, CancellationTokenSource tokenSource, WPFTools.PauseTokenSource pauseTokenSource, bool paceOutput, Dictionary <double, int> frameIndexLookup) { //construct Progress<T>, passing ReportProgress as the Action<T> var progressIndicator = new Progress <ProgressStruct>(newFrameHandler); //call async method long position = await PlayMp4FileAsync(filename, decodeWidth, decodeHeight, startTimestamp, endTimestamp, dnnEngine, confidence, useTracker, progressIndicator, tokenSource.Token, pauseTokenSource.Token, paceOutput, frameIndexLookup); }