/** @name : TRRO_connect* @brief : Initiates a video connection. Multiple calls can be made to connect different streams. Asynchronous mode, confirms successful video connection based on the onState status callback* @input : gwid ID of the target on-site equipment to connect* record_config:* Default is to use global recording configuration. When the default naming rules cannot meet the needs, use a JSON string to configure each stream. e.g.: "{\\"file_names\\": [{\\"file\\":\\"test\\", \\"duration\\":15}, {\\"file\\":\\"test01\\", \\"duration\\":15}]}" ps: file - filename, duration - chunk duration in seconds* streams_num is the number of live device video streams to be pulled, matching the length of the conn_fds and streams_num arrays, with values ranging from 1 to the number of device_streams supported by the live device* streams_id Array of field device video stream IDs. The field device video stream ID starts from 0, with a maximum value of the number of device_streams supported by the on-site equipment - 1* conn_fds is the array of conn_fd, where conn_fd represents the handle identifier for receiving video streams. It is numbered by the user, starting from 0, with the maximum value being max_streams - 1. max_streams is configured in the remote device configuration file* @return : 1 for success; <= 0 for failure*/int TRRO_connect(const char* gwid, const char* record_config, int streams_num, int* streams_id, int* conn_fds);
Parameter | Meaning |
gwid | field device ID |
record_config | video recording configuration.json string, each video stream to be connected needs to be configured. It is recommended to use the global recording configuration by default, and use this method when it cannot be satisfied.
The parameters are described as follows: file: File Name duration: slice duration (unit: seconds) |
streams_num | number of video streams to be connected |
streams_id | Array of video stream IDs of field device to be connected |
conn_fds | Array of handles used to receive video streams |
Returned values | Success 1 Failed <= 0 |
/** @name : TRRO_setWindows* @brief : Set the display window handle corresponding to the receiving stream handle* @input : conn_fds Array of handles used to receive video streams* windows Array of display window handles. The display window handle is the handle/pointer of the display form, such as HWND on the Windows platform;* When rendering externally, configure the display window handles in the array as nullptr* num Set the number of display windows to match the length of conn_fds and Windows arrays* @return :void*/void TRRO_setWindows(int* conn_fds, WindowIdType * windows, int num);
Parameter | Meaning |
conn_fds | Array of handles used to receive video streams |
windows | Array of display window handles, can be set to a null pointer array for external rendering |
num | Consistent length with conn_fds and windows arrays |
/** @name : TRRO_disconnect* @brief : Close the video connection corresponding to conn_fds* @input : conn_fds Array of handles for the video connections to be closed* fd_num Length of the conn_fd array* @return : 1 for success; <= 0 for failure*/int TRRO_disconnect(int* conn_fds, int fd_num);
Parameter | Meaning |
conn_fd | Array of video receiving handles |
fd_num | Array length |
Returned values | Success 1 Failed <= 0 |
/** @name : TRRO_disconnectAll* @brief : Close all video connections* @input : void* @return : 1 for success; <= 0 for failure*/int TRRO_disconnectAll();