---
title: aclvdecCreateChannel
description: "创建视频解码处理的通道，同一个通道可以重复使用，销毁后不再可用，同步接口。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgc/aclcppdevg_03_0666.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgc/aclcppdevg_03_0666.html
indexId: 64bf80826b52dcca9d593cb4e642788df48fc0a58baba42d2683198cb1729f25105
---
# aclvdecCreateChannel

#### 函数功能

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


#### 约束说明

- 通道为非线程安全，即不同线程要求创建不同的通道。
- 通道数的限制，请参见  总体说明
。
- aclvdecCreateChannel接口内部封装了aclrtCreateStream接口和aclrtSubscribeReport：

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


#### 函数原型

aclError aclvdecCreateChannel(aclvdecChannelDesc *channelDesc)


#### 参数说明

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


#### 返回值说明

返回0表示成功，返回其它值表示失败。


#### 参考资源

接口调用流程及示例，参见媒体数据处理V1。
