video3d_open video3d_stream_open navigation bar

Table of Contents

video3d_open_file

Opens a file to emulate a 3D video device.

Description

The video3d_open_file function opens a file to emulate a 3D video capture device, such as an RGBD camera. The path to the file must be specified. The file is typically a ROS bag file containing the 3D video. The handle to the capture session returned by this function is used by the other functions in the Multimedia API to refer to the session. This handle must be closed using the video3d_close function when the session is no longer in use.

Prototype

t_error
video3d_open_file(const char * device_file, t_video3d * handle);
    

Parameters

const char * device_file

A string containing the path to the file to be opened. The file is typically a ROS bag file containing the simulated RGBD camera data.

t_video3d * handle

The address of a t_video3d variable in which the handle to the capture session will be stored. This handle is then passed to the other video3d functions to identify the capture session.

Return value

The return value is 0 if the 3D video capture session is opened 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_FILE_NOT_FOUND

The file could not be found.

QERR_OUT_OF_MEMORY

There is not enough memory to complete the operation.

Requirements

Include Files

Libraries

quanser_video3d.h

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

Examples

t_video3d capture;
t_error result = video3d_open_file("simcam.bag", &capture);
if (result >= 0) {
    ...
    video3d_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