video_display_write video_display_show navigation bar

Table of Contents

video_display_detach

Detach the video stream from the display.

Description

The video_display_detach function detaches the video stream from the display. No more video frames should be written to the display after detaching the video stream.

Prototype

t_error
video_display_detach(t_video_display display);
    

Parameters

t_video_display display

The handle to the display returned by video_display_attach.

Return value

The return value is 0 if the detachment is 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_NOT_SUPPORTED

This function is not supported on this platform.

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_window window;

/* Open a video display window for displaying the captured video */
result = video_display_open("Video Capture", NULL, &window);
if (result >= 0) {
    t_video_display display;

    /* Attach a display object to the window for receiving the video stream */
    result = video_display_attach(window, 30.0, 640, 480, IMAGE_FORMAT_COL_MAJOR_PLANAR_RGB, IMAGE_DATA_TYPE_UINT8, true, &display);
    if (result >= 0) {
        ...

        /* Write the frame to the display */
        video_display_write(display, image, frame_width * frame_height * 3);

        ...

        /* Detach the video stream from the display */
        video_display_detach(display);
    }

    /* Close the video display window */
    video_display_close(window);
}
    

See Also

 

navigation bar