Logo Search packages:      
Sourcecode: libdc1394-22 version File versions  Download package

dc1394error_t dc1394_feature_get_mode ( dc1394camera_t camera,
dc1394feature_t  feature,
dc1394feature_mode_t mode 
)

Gets the current control modes for a feature

Definition at line 1465 of file control.c.

References dc1394_get_control_register().

{
    dc1394error_t err;
    uint64_t offset;
    uint32_t quadval;

    if ( (feature<DC1394_FEATURE_MIN) || (feature>DC1394_FEATURE_MAX) )
        return DC1394_INVALID_FEATURE;

    if ((feature == DC1394_FEATURE_TRIGGER)||
        (feature == DC1394_FEATURE_TRIGGER_DELAY)) {
        *mode=DC1394_FEATURE_MODE_MANUAL;
    }

    FEATURE_TO_VALUE_OFFSET(feature, offset);

    err=dc1394_get_control_register(camera, offset, &quadval);
    DC1394_ERR_RTN(err, "Could not get feature auto status");

    if (quadval & 0x04000000UL) {
        *mode= DC1394_FEATURE_MODE_ONE_PUSH_AUTO;
    }
    else if (quadval & 0x01000000UL) {
        *mode= DC1394_FEATURE_MODE_AUTO;
    }
    else {
        *mode= DC1394_FEATURE_MODE_MANUAL;
    }

    return err;
}


Generated by  Doxygen 1.6.0   Back to index