---
title: ImportBuffer
description: "从外部导入一个buffer。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2400/armnative/kunpengcpsvideo_16_0092.html
sourcePath: /source/zh/kunpengboostkithistory/2400/armnative/kunpengcpsvideo_16_0092.html
indexId: 122c49e94fbc0d717670272c716d71f465ca8116cfe78f0e4fe149e741f4970177
---
# ImportBuffer

#### 函数功能

从外部导入一个buffer。


#### 约束说明

NA


#### 函数原型

int32_t ImportBuffer(FrameFormat format, uint64_t handle, GpuEncoderBufferT &buffer) = 0


#### 参数说明

| 字段名称 | 输入/输出 | 字段类型 | 字段描述 |
| --- | --- | --- | --- |
| format | 输入 | FrameFormat | 要导入的buffer对应的格式。 |
| handle | 输入 | uint64\_t | 要导入的buffer对应的句柄或显存地址。 |
| buffer | 输出 | GpuEncoderBufferT & | 导入完成后用于挂载buffer的指针。 |


#### 返回值说明

数据类型：GpuEncoderErrorCode

取值如下：

- OK：导入buffer成功。
- 其他：导入buffer失败。
