SendData
Function Usage
Sends data.
Restrictions
N/A
Prototype
uint32_t SendData(VMIMsgType type, uint8_t* data, uint32_t length)
Parameters
Parameter |
Input/Output |
Class |
Description |
|---|---|---|---|
type |
Input |
VMIMsgType |
Type of data to be sent. For details, see the definitions of enumerated values of VMIMsgType in VmiEngine.h. |
data |
Input |
uint8_t* |
Address of the buffer for sending the type data. |
length |
Input |
uint32_t |
Length of the buffer for sending the type data. |
Returns
- VMI_SUCCESS: The data is successfully sent.
- VMI_CLIENT_EXEC_ORDER_FAIL: The engine execution order is invalid.
- VMI_CLIENT_SEND_FAIL: Failed to send the data.
Example Call
void Test()
{
const int MAX_BUF_LEN =1048576;
uint8_t *recvBuf = new uint8_t[MAX_BUF_LEN];
uint32_t result = SendData(VMIMsgType::AUDIO, recvBuf, MAX_BUF_LEN);
if (result == VMI_SUCCESS) {
// send success
} else {
// send failed
}
}
Parent topic: External APIs of the Video Stream Engine Client (C)