视频流引擎客户端接收数据。
NA
int32_t RecvData(VMIMsgType type, uint8_t* data, uint32_t length)
参数名称 |
输入/输出 |
参数类型 |
参数描述 |
---|---|---|---|
type |
输入 |
VMIMsgType |
接收数据类型,请参考VmiEngine.h中VMIMsgType枚举定义。 |
data |
输出 |
uint8_t* |
代表接收type类型数据buffer地址。 |
length |
输入 |
uint32_t |
代表接收type类型数据buffer的长度。 |
void Test() { const int MAX_BUF_LEN =1048576; uint8_t *recvBuf = new uint8_t[MAX_BUF_LEN]; while (!stopFlag) { int packetLen = RecvData(VMIMsgType::AUDIO, recvBuf, MAX_BUF_LEN); if (packetLen > 0) { // continue recv data when there is data found … continue; } } }