static gboolean gst_niimaqsrc_start_acquisition (GstNiImaqSrc * src) { int i; gint32 rval; g_assert (!src->session_started); GST_DEBUG_OBJECT (src, "Starting acquisition"); /* try to open the camera five times */ for (i = 0; i < 5; i++) { rval = imgSessionStartAcquisition (src->sid); if (rval == IMG_ERR_GOOD) { return TRUE; } else { gst_niimaqsrc_report_imaq_error (rval); GST_LOG_OBJECT (src, "camera is still off , wait 50ms and retry"); g_usleep (50000); } } /* we tried five times and failed, so we error */ gst_niimaqsrc_close_interface (src); return FALSE; }
void FastCMOS::start() { checkIMAQ(imgSessionStartAcquisition(session)); }