video_sink_write End of trail navigation bar

Table of Contents

video_sink_close

Close the video sink.

Description

The video_sink_close function closes the video sink. The sink should not be used after it is closed.

Prototype

t_error
video_sink_close(t_video_sink sink);
    

Parameters

t_video_sink sink

The handle to the video sink returned by video_sink_open.

Return value

The return value is 0 if the video sink 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

One of the arguments is invalid.

QERR_OUT_OF_MEMORY

There is not enough memory to complete the operation.

Requirements

Include Files

Libraries

quanser_video.h

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

Examples

t_video_sink sink;
t_error result = video_sink_open("C:\my_video.mp4", 30.0, 2000000, 640, 480, VIDEO_OUTPUT_FORMAT_H264, IMAGE_FORMAT_COL_MAJOR_PLANAR_RGB, IMAGE_DATA_TYPE_UINT8, &sink);
if (result >= 0) {
        ...
        result = video_sink_write(sink, image, image_length);
        ...
        video_sink_close(sink);
} else {
    TCHAR message[512];
    msg_get_error_message(NULL, result, message, sizeof(message));
    _tprintf(_T("Failed to open video sink. %s (error %d)\n"), message, -result);
}
    

See Also

 

navigation bar