bool FirewireVideo::GrabNewest( unsigned char* image, bool wait ) { dc1394video_frame_t *f; err = dc1394_capture_dequeue(camera, DC1394_CAPTURE_POLICY_POLL, &f); if( err != DC1394_SUCCESS) throw VideoException("Could not capture frame", dc1394_error_get_string(err) ); if( f ) { while( true ) { dc1394video_frame_t *nf; err = dc1394_capture_dequeue(camera, DC1394_CAPTURE_POLICY_POLL, &nf); if( err != DC1394_SUCCESS) throw VideoException("Could not capture frame", dc1394_error_get_string(err) ); if( nf ) { err=dc1394_capture_enqueue(camera,f); f = nf; }else{ break; } } memcpy(image,f->image,f->image_bytes); err=dc1394_capture_enqueue(camera,f); return true; }else if(wait){ return GrabNext(image,true); } return false; }
bool VideoInput::Grab( unsigned char* buffer, std::vector<Image<unsigned char> >& images, bool wait, bool newest) { if( !video_src ) throw VideoException("No video source open"); bool success; if(newest) { success = GrabNewest(buffer, wait); }else{ success = GrabNext(buffer, wait); } if(success) { images.clear(); for(size_t s=0; s < Streams().size(); ++s) { images.push_back(Streams()[s].StreamImage(buffer)); } } return success; }
bool SharedMemoryVideo::GrabNewest(unsigned char* image, bool wait) { return GrabNext(image,wait); }
//! Implement VideoInput::GrabNewest() bool DebayerVideo::GrabNewest( unsigned char* image, bool wait ) { return GrabNext(image,wait); }
bool OpenNi2Video::GrabNewest( unsigned char* image, bool wait ) { return GrabNext(image,wait); }
bool PangoVideo::GrabNewest( unsigned char* image, bool wait ) { return GrabNext(image, wait); }
bool VideoJoiner::GrabNewest( unsigned char* image, bool wait ) { return GrabNext(image, wait); }