简体   繁体   中英

How can i tell when a Directshow.net conversion is done?

right now I have a Directshow.net graph that takes in a video file and encodes it to a file, however it just continues to run

int x = program.Run() 

in DirectShow.net and i want the program to close when the full conversion is done instead of me having to guess.

how can i tell if its done encoding programatically?

If you have a mediaEvent variable you can check against the WaitForCompletion function to see if the code is done running. if the result of the waitforcompletion ( gh in this case) is not 0, it is running, if it is equal to 0, then its done.

const int E_Abort = unchecked((int)0x80004004); 
EventCode evCode; 
int gh = mediaEvent.WaitForCompletion(1000, out evCode); 
DsROTEntry rot = new DsROTEntry(filter); 
while (gh == E_Abort) 
{ System.Windows.Forms.Application.DoEvents(); 
gh = this.mediaEvent.WaitForCompletion(1000, out evCode); }  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM