Esempio n. 1
0
void CameraIIDC::startCapture(){

    dc1394error_t err;

    // Print camera information
    dc1394_camera_print_info(cam, stdout);
    fflush(stdout);

    if(triggerMode == triggerModeHardware){

        // Set hardware trigger
        err=dc1394_external_trigger_set_power(cam, DC1394_ON);
        if (err!=DC1394_SUCCESS)
            cerr << "libdc1394: Could not set external trigger on!";

        err=dc1394_external_trigger_set_source(cam, DC1394_TRIGGER_SOURCE_0);
        if (err!=DC1394_SUCCESS)
            cerr << "libdc1394: Could not set external trigger source!";

        err=dc1394_external_trigger_set_mode(cam, DC1394_TRIGGER_MODE_14);
        if (err!=DC1394_SUCCESS)
            cerr << "libdc1394: Could not set external trigger mode!";

        err=dc1394_external_trigger_set_polarity(cam, DC1394_TRIGGER_ACTIVE_HIGH);
        if (err!=DC1394_SUCCESS)
            cerr << "libdc1394: Could not set external trigger polarity!";

    } else if(triggerMode == triggerModeSoftware) {

        // Disable hardware trigger
        err=dc1394_external_trigger_set_power(cam, DC1394_OFF);
        if (err!=DC1394_SUCCESS)
            cerr << "libdc1394: Could not set external trigger off!";

    }

    // Begin transmission
	err = dc1394_video_set_transmission(cam, DC1394_ON);
	if (err!=DC1394_SUCCESS)
	{
		cerr << "ERROR: Could not begin transmission!" << endl;
	}    

    capturing = true;
}
Esempio n. 2
0
void FirewireVideo::SetExternalTrigger(dc1394trigger_mode_t mode, dc1394trigger_polarity_t polarity, dc1394trigger_source_t source)
{
    dc1394error_t err = dc1394_external_trigger_set_polarity(camera, polarity);
    if (err < 0) {
        throw VideoException("Could not set external trigger polarity");
    }

    err = dc1394_external_trigger_set_mode(camera, mode);
    if (err < 0) {
        throw VideoException("Could not set external trigger mode");
    }

    err = dc1394_external_trigger_set_source(camera, source);
    if (err < 0) {
        throw VideoException("Could not set external trigger source");
    }

    err = dc1394_external_trigger_set_power(camera, DC1394_ON);
    if (err < 0) {
        throw VideoException("Could not set external trigger power");
    }
}