Logo Search packages:      
Sourcecode: zebra version File versions  Download package

int zebra_video_enable ( zebra_video_t video,
int  enable 
)

start/stop video capture. all buffered images are retired when capture is disabled.

Returns:
0 if successful or -1 if an error occurs

Definition at line 207 of file video.c.

References ZEBRA_ERR_INVALID, zebra_negotiate_format(), and zebra_video_enable().

Referenced by zebra::Video::enable(), zebra_process_one(), zebra_processor_set_active(), and zebra_video_enable().

{
    if(vdo->active == enable)
        return(0);

    if(enable) {
        if(vdo->fd < 0)
            return(err_capture(vdo, SEV_ERROR, ZEBRA_ERR_INVALID, __func__,
                               "video device not opened"));

        if(!vdo->initialized &&
           zebra_negotiate_format(vdo, NULL))
            return(-1);
    }

    if(video_lock(vdo))
        return(-1);
    vdo->active = enable;
    if(enable)
        return(vdo->start(vdo));
    else
        return(vdo->stop(vdo));
}


Generated by  Doxygen 1.6.0   Back to index