---
title: SendData
description: "视频流引擎客户端发送数据。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2300/armnative/kunpengcpsvideo_17_0021.html
sourcePath: /source/zh/kunpengboostkithistory/2300/armnative/kunpengcpsvideo_17_0021.html
indexId: 511da8e214e7bd86502e0fd2a2047fa8acdb740a82b0bedbe9cd9a91cd99b3f877
---
# SendData

#### 函数功能

视频流引擎客户端发送数据。


#### 约束说明

NA


#### 函数原型

uint32_t SendData(VMIMsgType type, uint8_t* data, uint32_t length)


#### 参数说明

| 参数名称 | 输入/输出 | 参数类型 | 参数描述 |
| --- | --- | --- | --- |
| type | 输入 | VMIMsgType | 发送数据类型，请参考VmiEngine.h中VMIMsgType枚举定义 |
| data | 输入 | uint8\_t\* | 代表发送type类型数据buffer地址。 |
| length | 输入 | uint32\_t | 代表发送type类型数据buffer长度。 |


#### 返回值说明

- VMI_SUCCESS：表示发送成功。
- VMI_CLIENT_EXEC_ORDER_FAIL：表示引擎执行顺序非法。
- VMI_CLIENT_SEND_FAIL：表示发送失败。


#### 调用示例

```
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
    }
}
```
