[vtkusers] Asynchronous outputs

Tim Soper tim_d_soper at yahoo.com
Mon Apr 23 18:46:28 EDT 2007


Hi-
   I am still  trying to get a follow-up to a question I had regarding how to best access a continually updating output.  I have made a video frame grabber class based on the vtkVideoSource class but I want to add functionality for saving individual frames to file at a pretty fast rate.  Currently I've just added code to the InternalGrab( ) function that saves each frame after grabbing it. It would be nice to do this asnychronously though. My idea was to make a vtkVideoSourceRecorder that would continously save frames from the associated video source inside a separate thread.  What I'd like to do is something like this:

videoSource = vtkVideoSource::New(); //create the source
videoRecorder = vtkVideoSourceRecorder::New();  //create the recorder

videoRecorder->SetInputConnection( videoSource->GetOutputPort() ); //connect the inputs/outputs

videoSource->Record( ); //start grabbing frames
videoRecorder->BeginRecord(); //start saving frames to file.

This would allow me to save and and display at separate rates. As well, it seems more practical to separate these two functions into different classes. After trying to implement this though, the program chokes and freezes. It seems to be grabbing the output when it's busy grabbing another frame or something. Is there a more correct way to do this?
 
Tim Soper

Research Assistant
University of Washington
Department of Bioengineering 
Box 352142



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the vtkusers mailing list