---
title: aclvdecCreateChannel
description: "| 产品 | 是否支持 |"
url: "https://www.hiascend.com/document/detail/zh/canncommercial/900/API/dvpp/aclcppdevg_03_0330.html"
---

# aclvdecCreateChannel

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | ☓ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |


#### 功能说明

创建视频解码处理的通道，同一个通道可以重复使用，销毁后不再可用。


#### 约束说明

- 通道为非线程安全，即不同线程要求创建不同的通道。
- 通道数的限制，请参见  功能及约束说明
。
- aclvdecCreateChannel接口内部封装了
aclrtCreateStream(https://www.hiascend.com/document/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_0066.html)接口和
aclrtSubscribeReport(https://www.hiascend.com/document/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_0125.html)：

  - 调用2次aclrtCreateStream接口创建了2个Stream，一个Stream用于视频码流解码任务，另一个用于回调函数的处理。这些Stream资源只有在调用    aclvdecDestroyChannel
接口销毁通道后才能自动释放。
  - 调用aclrtSubscribeReport接口指定处理Stream上回调函数的线程，回调函数和线程是由用户调用    aclvdecSetChannelDesc系列接口
时指定的。
用户在实现VDEC功能时，无需再单独调用aclrtCreateStream接口、aclrtSubscribeReport接口，但这两个接口的约束需要遵循，例如Stream的数量、处理Stream上回调函数的线程数量等。


#### 函数原型

```
aclError aclvdecCreateChannel(aclvdecChannelDesc *channelDesc)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| channelDesc | 输入&输出 | 通道描述信息的指针。 需提前调用aclvdecCreateChannelDesc接口创建aclvdecChannelDesc类型的数据，再调用aclvdecSetChannelDesc系列接口设置通道描述信息的属性。 |


#### 返回值说明

返回0表示成功，返回其他值表示失败，请参见aclError。


#### 参考资源

接口调用流程及示例，参见媒体数据处理V1(https://www.hiascend.com/document/detail/zh/canncommercial/900/programug/acldevg/aclcppdevg_000050.html)。
