Example #1
0
  uvc_error_t RealSenseDriver::getFrame(uvc_stream_handle_t *streamh, uvc_frame_t **frame)
  {
    uvc_error_t err;
    err = uvc_stream_get_frame(streamh, frame, -1); //use the latest acquired frame
    if(err != UVC_SUCCESS)
      {
	uvc_perror(err, "uvc_get_frame");
      }
    return err;
  }
Example #2
0
bool UvcVideo::GrabNext( unsigned char* image, bool wait )
{
    uvc_frame_t* frame = NULL;
    uvc_error_t err = uvc_stream_get_frame(strm_, &frame, wait ? 0 : -1);
    
    if(err!= UVC_SUCCESS) {
        pango_print_error("UvcVideo Error: %s", uvc_strerror(err) );
        return false;
    }else{
        if(frame) {
            memcpy(image, frame->data, frame->data_bytes );
            return true;
        }else{
            if(wait) {
                pango_print_debug("UvcVideo: No frame data");
            }
            return false;
        }
    }
}