Writing priority question

Hi all,

I'm writing an application which captures video from a video source (like a webcam). I'm using Media Foundation. It should write the captured video to a file and process the video to preview it. The processing can be detecting motion, changing contrast or just doing nothing. My idea at the moment is to have another thread than the main thread record the video, and by recording I mean when I grab a new frame I will release the previous frame and save the pointer to the frame in a variable which will always hold the latest frame. I'll process and preview the latest images in the main thread. Both threads will use a mutex to acces the last frame.

My main concern is if the recording thread will slow down when the application pushes the computer to its limits. If that happens, I like to give the recording thread the top priority for the best video quality. The previewing shouldn't slow down the recording. I'm thinking of just setting the recording thread's priority to 'time critical' (http://msdn.microsoft.com/en-us/library/ms686277(VS.85).aspx), but my question is:

Will that be enough? If not, what should I do?



I really appreciate any help. ;)

Thanks.
Withought knowing why the application is slowing down, you'll most probably make things worse by tinkering with priorities. The OS does a pretty good job most of the time.
Topic archived. No new replies allowed.