video_capture_stop End of trail navigation bar

Table of Contents

video_capture_close

Closes a video capture session.

Description

The video_capture_close function closes a video capture session, releasing any allocated resources associated with the session. Once the video capture session has been closed, the handle is no longer valid and may not be used.

Prototype

t_error
video_capture_close(t_video_capture capture);
    

Parameters

t_video_capture capture

A handle to the video capture session, as returned by video_capture_open.

Return value

The return value is 0 if the video capture session is closed successfully. Otherwise a negative error code is returned. Error codes are defined in quanser_errors.h. A suitable error message may be retrieved using msg_get_error_message.

Error codes

QERR_INVALID_ARGUMENT

An invalid capture session was passed as an argument. Once a capture session has been closed using video_capture_close the session handle is invalid.

Requirements

Include Files

Libraries

quanser_video.h

quanser_media.lib;quanser_communications.lib;quanser_runtime.lib;quanser_common.lib

Examples

t_video_capture capture;
t_uint8 image[640*480*3];
t_error result = video_capture_open("video://localhost:0", 30.0, 640, 480, IMAGE_FORMAT_COL_MAJOR_PLANAR_RGB, IMAGE_DATA_TYPE_UINT8, image, &capture, NULL, 0);
if (result >= 0) {
    ...
    video_capture_close(capture);
} else {
    TCHAR message[512];
    msg_get_error_message(NULL, result, message, sizeof(message));
    _tprintf(_T("Failed to open video capture session. %s (error %d)\n"), message, -result);
}
    

See Also

 

navigation bar