未验证 提交 2e530d80 编写于 作者: O openharmony_ci 提交者: Gitee

!20340 master:graphic_2d native api优化

Merge pull request !20340 from 葛亚芳/master
# NativeVsync # NativeVsync
## 概述
提供NativeVsync功能。 提供NativeVsync功能。
\@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
@syscap SystemCapability.Graphic.Graphic2D.NativeVsync **起始版本:**
9
**起始版本:**
## 汇总
8
### 文件
## 汇总 | 名称 | 描述 |
| -------- | -------- |
| [native_vsync.h](native__vsync_8h.md) | 定义获取和使用NativeVsync的相关函数<br/>引用文件:&lt;native_vsync/native_vsync.h&gt; |
### 文件 ### 类型定义
| 文件名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [native_vsync.h](native__vsync_8h.md) | 定义获取和使用NativeVsync的相关函数<br>引用文件:<native_vsync/native_vsync.h> | | [OH_NativeVSync](#oh_nativevsync) | 提供OH_NativeVSync结构体声明 |
| (\*[OH_NativeVSync_FrameCallback](#oh_nativevsync_framecallback)) (long long timestamp, void \*data) | VSync回调函数类型 |
### 函数 ### 函数
| 函数名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeVSync_Create](#oh_nativevsync_create) (const char \*name, unsigned int length) | 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例 | | [OH_NativeVSync_Create](#oh_nativevsync_create) (const char \*name, unsigned int length) | 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例 |
| [OH_NativeVSync_Destroy](#oh_nativevsync_destroy) (OH_NativeVSync \*nativeVsync) | 销毁OH_NativeVSync实例 | | [OH_NativeVSync_Destroy](#oh_nativevsync_destroy) ([OH_NativeVSync](#oh_nativevsync) \*nativeVsync) | 销毁OH_NativeVSync实例 |
| [OH_NativeVSync_RequestFrame](#oh_nativevsync_requestframe) (OH_NativeVSync \*nativeVsync, OH_NativeVSync_FrameCallback callback, void \*data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback | | [OH_NativeVSync_RequestFrame](#oh_nativevsync_requestframe) ([OH_NativeVSync](#oh_nativevsync) \*nativeVsync, [OH_NativeVSync_FrameCallback](#oh_nativevsync_framecallback) callback, void \*data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback |
## 类型定义说明
### OH_NativeVSync
```
typedef struct OH_NativeVSync OH_NativeVSync
```
**描述:**
提供OH_NativeVSync结构体声明
## 详细描述 ### OH_NativeVSync_FrameCallback
```
typedef void(* OH_NativeVSync_FrameCallback) (long long timestamp, void *data)
```
**描述:**
VSync回调函数类型
\@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**参数:**
| 名称 | 描述 |
| -------- | -------- |
| timestamp | VSync时间戳 |
| data | 用户自定义数据 |
## 函数说明 ## 函数说明
...@@ -45,27 +85,23 @@ ...@@ -45,27 +85,23 @@
OH_NativeVSync* OH_NativeVSync_Create (const char * name, unsigned int length ) OH_NativeVSync* OH_NativeVSync_Create (const char * name, unsigned int length )
``` ```
**描述** **描述:**
创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例
@syscap SystemCapability.Graphic.Graphic2D.NativeVsync \@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| name | 参数表示一个vsync连接的名字 | | name | 表示一个名字,与创建的OH_NativeVSync实例关联 |
| length | 参数是name的长度 | | length | name的长度 |
**返回** **返回:**
返回一个指向OH_NativeVSync实例的指针 返回一个指向OH_NativeVSync实例的指针
**起始版本:**
8
### OH_NativeVSync_Destroy() ### OH_NativeVSync_Destroy()
...@@ -74,21 +110,17 @@ OH_NativeVSync* OH_NativeVSync_Create (const char * name, unsigned int length ) ...@@ -74,21 +110,17 @@ OH_NativeVSync* OH_NativeVSync_Create (const char * name, unsigned int length )
void OH_NativeVSync_Destroy (OH_NativeVSync * nativeVsync) void OH_NativeVSync_Destroy (OH_NativeVSync * nativeVsync)
``` ```
**描述** **描述:**
销毁OH_NativeVSync实例 销毁OH_NativeVSync实例
@syscap SystemCapability.Graphic.Graphic2D.NativeVsync \@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| nativeVsync | 参数是一个指向OH_NativeVSync实例的指针 | | nativeVsync | 一个指向OH_NativeVSync实例的指针 |
**起始版本:**
8
### OH_NativeVSync_RequestFrame() ### OH_NativeVSync_RequestFrame()
...@@ -98,24 +130,20 @@ void OH_NativeVSync_Destroy (OH_NativeVSync * nativeVsync) ...@@ -98,24 +130,20 @@ void OH_NativeVSync_Destroy (OH_NativeVSync * nativeVsync)
int OH_NativeVSync_RequestFrame (OH_NativeVSync * nativeVsync, OH_NativeVSync_FrameCallback callback, void * data ) int OH_NativeVSync_RequestFrame (OH_NativeVSync * nativeVsync, OH_NativeVSync_FrameCallback callback, void * data )
``` ```
**描述** **描述:**
请求下一次vsync信号,当信号到来时,调用回调函数callback 请求下一次vsync信号,当信号到来时,调用回调函数callback
@syscap SystemCapability.Graphic.Graphic2D.NativeVsync \@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| nativeVsync | 参数是一个指向OH_NativeVSync实例的指针 | | nativeVsync | 一个指向OH_NativeVSync实例的指针 |
| callback | 参数是一个OH_NativeVSync_FrameCallback类型的函数指针,当下一次vsync信号到来时会被调用 | | callback | 一个OH_NativeVSync_FrameCallback类型的函数指针,当下一次vsync信号到来时会被调用 |
| data | 参数是一个指向用户自定义数据结构的指针,类型是void\* | | data | 一个指向用户自定义数据结构的指针,类型是void\* |
**返回:**
返回一个由GSError定义的int32_t类型的错误码
**起始版本:** **返回:**
8 返回值为0表示执行成功
# OH_NativeBuffer # OH_NativeBuffer
提供NativeBuffer功能 ## 概述
提供NativeBuffer功能,通过提供的接口,可以实现共享内存的申请、使用、属性查询、释放等操作。
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**起始版本:**
**起始版本:**
9 9
...@@ -18,32 +17,51 @@ ...@@ -18,32 +17,51 @@
### 文件 ### 文件
| 文件名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [native_buffer.h](native__buffer_8h.md) | 定义获取和使用NativeBuffer的相关函数<br>引用文件:<native_buffer/native_buffer.h> | | [native_buffer.h](native__buffer_8h.md) | 定义获取和使用NativeBuffer的相关函数<br/>引用文件:&lt;native_buffer/native_buffer.h&gt; |
### 结构体 ### 结构体
| 结构体名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) | OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查询现有实例的相关属性 | | [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) | OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查询现有实例的相关属性。 |
### 类型定义
| 名称 | 描述 |
| -------- | -------- |
| [OH_NativeBuffer](#oh_nativebuffer) | 提供OH_NativeBuffer结构体声明。 |
### 函数 ### 函数
| 函数名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeBuffer_Alloc](#oh_nativebuffer_alloc) (const [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 通过OH_NativeBuffer_Config创建OH_NativeBuffer实例,每次调用都会产生一个新的OH_NativeBuffer实例 | | [OH_NativeBuffer_Alloc](#oh_nativebuffer_alloc) (const [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 通过OH_NativeBuffer_Config创建OH_NativeBuffer实例,每次调用都会产生一个新的OH_NativeBuffer实例。 |
| [OH_NativeBuffer_Reference](#oh_nativebuffer_reference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数加1 | | [OH_NativeBuffer_Reference](#oh_nativebuffer_reference) ([OH_NativeBuffer](#oh_nativebuffer) \*buffer) | 将OH_NativeBuffer对象的引用计数加1。 |
| [OH_NativeBuffer_Unreference](#oh_nativebuffer_unreference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数减1,当引用计数为0的时候,该NativeBuffer对象会被析构掉 | | [OH_NativeBuffer_Unreference](#oh_nativebuffer_unreference) ([OH_NativeBuffer](#oh_nativebuffer) \*buffer) | 将OH_NativeBuffer对象的引用计数减1,当引用计数为0的时候,该NativeBuffer对象会被析构掉。 |
| [OH_NativeBuffer_GetConfig](#oh_nativebuffer_getconfig) (OH_NativeBuffer \*buffer, [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 用于获取OH_NativeBuffer的属性 | | [OH_NativeBuffer_GetConfig](#oh_nativebuffer_getconfig) ([OH_NativeBuffer](#oh_nativebuffer) \*buffer, [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 用于获取OH_NativeBuffer的属性。 |
| [OH_NativeBuffer_Map](#oh_nativebuffer_map) (OH_NativeBuffer \*buffer, void \*\*virAddr) | 将OH_NativeBuffer对应的ION内存映射到进程空间 | | [OH_NativeBuffer_Map](#oh_nativebuffer_map) ([OH_NativeBuffer](#oh_nativebuffer) \*buffer, void \*\*virAddr) | 将OH_NativeBuffer对应的ION内存映射到进程空间。 |
| [OH_NativeBuffer_Unmap](#oh_nativebuffer_unmap) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对应的ION内存从进程空间移除 | | [OH_NativeBuffer_Unmap](#oh_nativebuffer_unmap) ([OH_NativeBuffer](#oh_nativebuffer) \*buffer) | 将OH_NativeBuffer对应的ION内存从进程空间移除。 |
| [OH_NativeBuffer_GetSeqNum](#oh_nativebuffer_getseqnum) (OH_NativeBuffer \*buffer) | 获取OH_NativeBuffer的序列号 | | [OH_NativeBuffer_GetSeqNum](#oh_nativebuffer_getseqnum) ([OH_NativeBuffer](#oh_nativebuffer) \*buffer) | 获取OH_NativeBuffer的序列号。 |
## 类型定义说明
### OH_NativeBuffer
## 详细描述
```
typedef struct OH_NativeBuffer OH_NativeBuffer
```
**描述:**
提供OH_NativeBuffer结构体声明。
## 函数说明 ## 函数说明
...@@ -56,25 +74,21 @@ ...@@ -56,25 +74,21 @@
OH_NativeBuffer* OH_NativeBuffer_Alloc (const OH_NativeBuffer_Config * config) OH_NativeBuffer* OH_NativeBuffer_Alloc (const OH_NativeBuffer_Config * config)
``` ```
**描述** **描述:**
通过OH_NativeBuffer_Config创建OH_NativeBuffer实例,每次调用都会产生一个新的OH_NativeBuffer实例 通过OH_NativeBuffer_Config创建OH_NativeBuffer实例,每次调用都会产生一个新的OH_NativeBuffer实例
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| config | 参数是一个指向OH_NativeBuffer属性的指针,类型为OH_NativeBuffer_Config | | config | 一个指向OH_NativeBuffer_Config类型的指针。 |
**返回** **返回:**
创建成功则返回一个指向OH_NativeBuffer结构体实例的指针,否则返回NULL 创建成功则返回一个指向OH_NativeBuffer结构体实例的指针,否则返回NULL。
**起始版本:**
9
### OH_NativeBuffer_GetConfig() ### OH_NativeBuffer_GetConfig()
...@@ -84,22 +98,18 @@ OH_NativeBuffer* OH_NativeBuffer_Alloc (const OH_NativeBuffer_Config * config) ...@@ -84,22 +98,18 @@ OH_NativeBuffer* OH_NativeBuffer_Alloc (const OH_NativeBuffer_Config * config)
void OH_NativeBuffer_GetConfig (OH_NativeBuffer * buffer, OH_NativeBuffer_Config * config ) void OH_NativeBuffer_GetConfig (OH_NativeBuffer * buffer, OH_NativeBuffer_Config * config )
``` ```
**描述** **描述:**
用于获取OH_NativeBuffer的属性 用于获取OH_NativeBuffer的属性
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 | | buffer | 一个指向OH_NativeBuffer实例的指针。 |
| config | 参数是一个指向OH_NativeBuffer_Config的指针,用于接收OH_NativeBuffer的属性 | | config | 一个指向OH_NativeBuffer_Config的指针,用于接收OH_NativeBuffer的属性。 |
**起始版本:**
9
### OH_NativeBuffer_GetSeqNum() ### OH_NativeBuffer_GetSeqNum()
...@@ -109,25 +119,21 @@ void OH_NativeBuffer_GetConfig (OH_NativeBuffer * buffer, OH_NativeBuffer_Config ...@@ -109,25 +119,21 @@ void OH_NativeBuffer_GetConfig (OH_NativeBuffer * buffer, OH_NativeBuffer_Config
uint32_t OH_NativeBuffer_GetSeqNum (OH_NativeBuffer * buffer) uint32_t OH_NativeBuffer_GetSeqNum (OH_NativeBuffer * buffer)
``` ```
**描述** **描述:**
获取OH_NativeBuffer的序列号 获取OH_NativeBuffer的序列号
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 | | buffer | 一个指向OH_NativeBuffer实例的指针。 |
**返回:**
返回对应OH_NativeBuffer的唯一序列号 **返回:**
**起始版本:** 返回对应OH_NativeBuffer的唯一序列号。
9
### OH_NativeBuffer_Map() ### OH_NativeBuffer_Map()
...@@ -137,26 +143,22 @@ uint32_t OH_NativeBuffer_GetSeqNum (OH_NativeBuffer * buffer) ...@@ -137,26 +143,22 @@ uint32_t OH_NativeBuffer_GetSeqNum (OH_NativeBuffer * buffer)
int32_t OH_NativeBuffer_Map (OH_NativeBuffer * buffer, void ** virAddr ) int32_t OH_NativeBuffer_Map (OH_NativeBuffer * buffer, void ** virAddr )
``` ```
**描述** **描述:**
将OH_NativeBuffer对应的ION内存映射到进程空间 将OH_NativeBuffer对应的ION内存映射到进程空间
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 | | buffer | 一个指向OH_NativeBuffer实例的指针。 |
| virAddr | 参数是一个二级指针,二级指针指向虚拟内存的地址 | | virAddr | 一个二级指针,二级指针指向映射到当前进程的虚拟内存的地址。 |
**返回** **返回:**
返回一个由GSError定义的int32_t类型的错误码 返回值为0表示执行成功。
**起始版本:**
9
### OH_NativeBuffer_Reference() ### OH_NativeBuffer_Reference()
...@@ -166,25 +168,21 @@ int32_t OH_NativeBuffer_Map (OH_NativeBuffer * buffer, void ** virAddr ) ...@@ -166,25 +168,21 @@ int32_t OH_NativeBuffer_Map (OH_NativeBuffer * buffer, void ** virAddr )
int32_t OH_NativeBuffer_Reference (OH_NativeBuffer * buffer) int32_t OH_NativeBuffer_Reference (OH_NativeBuffer * buffer)
``` ```
**描述** **描述:**
将OH_NativeBuffer对象的引用计数加1 将OH_NativeBuffer对象的引用计数加1
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 | | buffer | 一个指向OH_NativeBuffer实例的指针。 |
**返回** **返回:**
返回一个由GSError定义的int32_t类型的错误码 返回值为0表示执行成功。
**起始版本:**
9
### OH_NativeBuffer_Unmap() ### OH_NativeBuffer_Unmap()
...@@ -194,25 +192,21 @@ int32_t OH_NativeBuffer_Reference (OH_NativeBuffer * buffer) ...@@ -194,25 +192,21 @@ int32_t OH_NativeBuffer_Reference (OH_NativeBuffer * buffer)
int32_t OH_NativeBuffer_Unmap (OH_NativeBuffer * buffer) int32_t OH_NativeBuffer_Unmap (OH_NativeBuffer * buffer)
``` ```
**描述** **描述:**
将OH_NativeBuffer对应的ION内存从进程空间移除 将OH_NativeBuffer对应的ION内存从进程空间移除
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 | | buffer | 一个指向OH_NativeBuffer实例的指针。 |
**返回:**
返回一个由GSError定义的int32_t类型的错误码
**起始版本:** **返回:**
9 返回值为0表示执行成功。
### OH_NativeBuffer_Unreference() ### OH_NativeBuffer_Unreference()
...@@ -222,22 +216,18 @@ int32_t OH_NativeBuffer_Unmap (OH_NativeBuffer * buffer) ...@@ -222,22 +216,18 @@ int32_t OH_NativeBuffer_Unmap (OH_NativeBuffer * buffer)
int32_t OH_NativeBuffer_Unreference (OH_NativeBuffer * buffer) int32_t OH_NativeBuffer_Unreference (OH_NativeBuffer * buffer)
``` ```
**描述** **描述:**
将OH_NativeBuffer对象的引用计数减1,当引用计数为0的时候,该NativeBuffer对象会被析构掉 将OH_NativeBuffer对象的引用计数减1,当引用计数为0的时候,该NativeBuffer对象会被析构掉
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| buffer | 参数是一个指向OH_NativeBuffer实例的指针 | | buffer | 一个指向OH_NativeBuffer实例的指针。 |
**返回:**
返回一个由GSError定义的int32_t类型的错误码 **返回:**
**起始版本:** 返回值为0表示执行成功。
9
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查询现有实例的相关属性。 OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查询现有实例的相关属性。
**起始版本:** \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**起始版本:**
9 9
**相关模块** **相关模块:**
[OH_NativeBuffer](_o_h___native_buffer.md) [OH_NativeBuffer](_o_h___native_buffer.md)
...@@ -19,9 +21,9 @@ OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查 ...@@ -19,9 +21,9 @@ OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查
### 成员变量 ### 成员变量
| 成员变量名称 | 描述 | | 成员变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| width | 宽度(像素) | | width | 宽度(像素)。 |
| height | 高度(像素) | | height | 高度(像素)。 |
| format | 像素格式 | | format | 像素格式。 |
| usage | buffer的用途说明 | | usage | buffer的用途说明。 |
# OH_NativeImage # OH_NativeImage
提供NativeImage功能。 ## 概述
提供NativeImage功能,作为数据消费者,主要用来将数据和OpenGL纹理对接,需在OpenGL环境下使用
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**起始版本:**
**起始版本:**
9 9
...@@ -18,26 +17,58 @@ ...@@ -18,26 +17,58 @@
### 文件 ### 文件
| 文件名称 | 描述 | | 名称 | 描述 |
| -------- | -------- |
| [native_image.h](native__image_8h.md) | 定义获取和使用NativeImage的相关函数<br/>引用文件:&lt;native_image/native_image.h&gt; |
### 类型定义
| 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [native_image.h](native__image_8h.md) | 定义获取和使用NativeImage的相关函数。<br>引用文件:<native_image/native_image.h> | | [OH_NativeImage](#oh_nativeimage) | 提供OH_NativeImage结构体声明 |
| [OHNativeWindow](#ohnativewindow) | 提供对NativeWindow的访问功能 |
### 函数 ### 函数
| 函数名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeImage_Create]( #oh_nativeimage_create) (uint32_t textureId, uint32_t textureTarget) | 创建一个**OH_NativeImage**实例,该实例与OPENGL ES的纹理ID和纹理目标相关联。 | | [OH_NativeImage_Create](#oh_nativeimage_create) (uint32_t textureId, uint32_t textureTarget) | 创建一个**OH_NativeImage**实例,该实例与OpenGL ES的纹理ID和纹理目标相关联 |
| [OH_NativeImage_AcquireNativeWindow]( #oh_nativeimage_acquirenativewindow) (OH_NativeImage \*image) | 获取与OH_NativeImage相关联的OHNativeWindow指针. 该OHNativeWindow后续不再需要时需要调用 OH_NativeWindow_DestroyNativeWindow释放。 | | [OH_NativeImage_AcquireNativeWindow](#oh_nativeimage_acquirenativewindow) (OH_NativeImage \*image) | 获取与OH_NativeImage相关联的OHNativeWindow指针. 该OHNativeWindow后续不再需要时需要调用<br/>OH_NativeWindow_DestroyNativeWindow释放 |
| [OH_NativeImage_AttachContext]( #oh_nativeimage_attachcontext) (OH_NativeImage \*image, uint32_t textureId) | 将OH_NativeImage实例附加到当前OPENGL ES上下文, 且该OPENGL ES纹理会绑定到 GL_TEXTURE_EXTERNAL_OES, 并通过OH_NativeImage进行更新。 | | [OH_NativeImage_AttachContext](#oh_nativeimage_attachcontext) (OH_NativeImage \*image, uint32_t textureId) | 将OH_NativeImage实例附加到当前OpenGL ES上下文, 且该OpenGL ES纹理会绑定到<br/>GL_TEXTURE_EXTERNAL_OES, 并通过OH_NativeImage进行更新 |
| [OH_NativeImage_DetachContext]( #oh_nativeimage_detachcontext) (OH_NativeImage \*image) | 将OH_NativeImage实例从当前OPENGL ES上下文分离。 | | [OH_NativeImage_DetachContext](#oh_nativeimage_detachcontext) (OH_NativeImage \*image) | 将OH_NativeImage实例从当前OpenGL ES上下文分离 |
| [OH_NativeImage_UpdateSurfaceImage]( #oh_nativeimage_updatesurfaceimage) (OH_NativeImage \*image) | 通过OH_NativeImage获取最新帧更新相关联的OPENGL ES纹理。 | | [OH_NativeImage_UpdateSurfaceImage](#oh_nativeimage_updatesurfaceimage) (OH_NativeImage \*image) | 通过OH_NativeImage获取最新帧更新相关联的OpenGL ES纹理 |
| [OH_NativeImage_GetTimestamp]( #oh_nativeimage_gettimestamp) (OH_NativeImage \*image) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的相关时间戳。 | | [OH_NativeImage_GetTimestamp](#oh_nativeimage_gettimestamp) (OH_NativeImage*image) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的相关时间戳 |
| [OH_NativeImage_GetTransformMatrix]( #oh_nativeimage_gettransformmatrix) (OH_NativeImage \*image, float matrix[16]) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的变化矩阵。 | | [OH_NativeImage_GetTransformMatrix](#oh_nativeimage_gettransformmatrix) (OH_NativeImage \*image, float matrix[16]) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的变化矩阵 |
| [OH_NativeImage_Destroy]( #oh_nativeimage_destroy) (OH_NativeImage \*\*image) | 销毁通过OH_NativeImage_Create创建的**OH_NativeImage**实例, 销毁后该 **OH_NativeImage**指针会被赋值为空。 | | [OH_NativeImage_Destroy](#oh_nativeimage_destroy) (OH_NativeImage \*\*image) | 销毁通过OH_NativeImage_Create创建的**OH_NativeImage**实例, 销毁后该<br/>**OH_NativeImage**指针会被赋值为空 |
## 详细描述 ## 类型定义说明
### OH_NativeImage
```
typedef struct OH_NativeImage OH_NativeImage
```
**描述:**
提供OH_NativeImage结构体声明
### OHNativeWindow
```
typedef struct NativeWindow OHNativeWindow
```
**描述:**
提供对NativeWindow的访问功能
## 函数说明 ## 函数说明
...@@ -50,25 +81,23 @@ ...@@ -50,25 +81,23 @@
OHNativeWindow* OH_NativeImage_AcquireNativeWindow (OH_NativeImage * image) OHNativeWindow* OH_NativeImage_AcquireNativeWindow (OH_NativeImage * image)
``` ```
**描述:** **描述:**
获取与OH_NativeImage相关联的OHNativeWindow指针. 该OHNativeWindow后续不再需要时需要调用
获取与OH_NativeImage相关联的OHNativeWindow指针。该OHNativeWindow后续不再需要时需要调用 OH_NativeWindow_DestroyNativeWindow释放。 OH_NativeWindow_DestroyNativeWindow释放
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 | | image | 指向OH_NativeImage实例的指针。 |
**返回** **返回:**
成功则返回一个指向OHNativeWindow实例的指针,否则返回**NULL** 成功则返回一个指向OHNativeWindow实例的指针,否则返回**NULL**
**起始版本:**
9
### OH_NativeImage_AttachContext() ### OH_NativeImage_AttachContext()
...@@ -78,26 +107,24 @@ OHNativeWindow* OH_NativeImage_AcquireNativeWindow (OH_NativeImage * image) ...@@ -78,26 +107,24 @@ OHNativeWindow* OH_NativeImage_AcquireNativeWindow (OH_NativeImage * image)
int32_t OH_NativeImage_AttachContext (OH_NativeImage * image, uint32_t textureId ) int32_t OH_NativeImage_AttachContext (OH_NativeImage * image, uint32_t textureId )
``` ```
**描述** **描述:**
将OH_NativeImage实例附加到当前OPENGL ES上下文,且该OPENGL ES纹理会绑定到 GL_TEXTURE_EXTERNAL_OES,并通过OH_NativeImage进行更新。 将OH_NativeImage实例附加到当前OpenGL ES上下文, 且该OpenGL ES纹理会绑定到
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage GL_TEXTURE_EXTERNAL_OES, 并通过OH_NativeImage进行更新
**参数:** \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
| Name | 描述 | **参数:**
| 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 | | image | 指向OH_NativeImage实例的指针。 |
| textureId | OH_NativeImage要附加到的OPENGL ES纹理的id。 | | textureId | OH_NativeImage要附加到的OpenGL ES纹理的id。 |
**返回:**
返回一个由**SurfaceError**定义的int32_t类型的错误码。
**起始版本:** **返回:**
9 返回值为0表示执行成功
### OH_NativeImage_Create() ### OH_NativeImage_Create()
...@@ -107,26 +134,22 @@ int32_t OH_NativeImage_AttachContext (OH_NativeImage * image, uint32_t textureId ...@@ -107,26 +134,22 @@ int32_t OH_NativeImage_AttachContext (OH_NativeImage * image, uint32_t textureId
OH_NativeImage* OH_NativeImage_Create (uint32_t textureId, uint32_t textureTarget ) OH_NativeImage* OH_NativeImage_Create (uint32_t textureId, uint32_t textureTarget )
``` ```
**描述** **描述:**
创建一个**OH_NativeImage**实例,该实例与OPENGL ES的纹理ID和纹理目标相关联。 创建一个**OH_NativeImage**实例,该实例与OpenGL ES的纹理ID和纹理目标相关联
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| textureId | OPENGL ES的纹理ID,OH_NativeImage实例会与之相关联。 | | textureId | OpenGL ES的纹理ID,OH_NativeImage实例会与之相关联 |
| textureTarget | OPENGL ES的纹理目标。 | | textureTarget | OpenGL ES的纹理目标 |
**返回:**
返回一个指向**OH_NativeImage**实例的指针,否则返回**NULL**
**起始版本:** **返回:**
9 返回一个指向**OH_NativeImage**实例的指针 returns **NULL** otherwise
### OH_NativeImage_Destroy() ### OH_NativeImage_Destroy()
...@@ -136,15 +159,17 @@ OH_NativeImage* OH_NativeImage_Create (uint32_t textureId, uint32_t textureTarge ...@@ -136,15 +159,17 @@ OH_NativeImage* OH_NativeImage_Create (uint32_t textureId, uint32_t textureTarge
void OH_NativeImage_Destroy (OH_NativeImage ** image) void OH_NativeImage_Destroy (OH_NativeImage ** image)
``` ```
**描述:** **描述:**
销毁通过OH_NativeImage_Create创建的**OH_NativeImage**实例, 销毁后该
销毁通过OH_NativeImage_Create创建的**OH_NativeImage**实例, 销毁后该 **OH_NativeImage**指针会被赋值为空. **OH_NativeImage**指针会被赋值为空
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 | | image | 指向OH_NativeImage实例的指针。 |
...@@ -156,25 +181,21 @@ void OH_NativeImage_Destroy (OH_NativeImage ** image) ...@@ -156,25 +181,21 @@ void OH_NativeImage_Destroy (OH_NativeImage ** image)
int32_t OH_NativeImage_DetachContext (OH_NativeImage * image) int32_t OH_NativeImage_DetachContext (OH_NativeImage * image)
``` ```
**描述** **描述:**
将OH_NativeImage实例从当前OPENGL ES上下文分离。 将OH_NativeImage实例从当前OpenGL ES上下文分离
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 | | image | 指向OH_NativeImage实例的指针。 |
**返回** **返回:**
返回一个由**SurfaceError**定义的int32_t类型的错误码。 返回值为0表示执行成功
**起始版本:**
9
### OH_NativeImage_GetTimestamp() ### OH_NativeImage_GetTimestamp()
...@@ -184,25 +205,21 @@ int32_t OH_NativeImage_DetachContext (OH_NativeImage * image) ...@@ -184,25 +205,21 @@ int32_t OH_NativeImage_DetachContext (OH_NativeImage * image)
int64_t OH_NativeImage_GetTimestamp (OH_NativeImage * image) int64_t OH_NativeImage_GetTimestamp (OH_NativeImage * image)
``` ```
**描述** **描述:**
获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的相关时间戳 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的相关时间戳
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 | | image | 指向OH_NativeImage实例的指针。 |
**返回:** **返回:**
返回纹理图像的相关时间戳。
**起始版本:** 返回纹理图像的相关时间戳
9
### OH_NativeImage_GetTransformMatrix() ### OH_NativeImage_GetTransformMatrix()
...@@ -212,26 +229,22 @@ int64_t OH_NativeImage_GetTimestamp (OH_NativeImage * image) ...@@ -212,26 +229,22 @@ int64_t OH_NativeImage_GetTimestamp (OH_NativeImage * image)
int32_t OH_NativeImage_GetTransformMatrix (OH_NativeImage * image, float matrix[16] ) int32_t OH_NativeImage_GetTransformMatrix (OH_NativeImage * image, float matrix[16] )
``` ```
**描述** **描述:**
获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的变化矩阵 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的变化矩阵
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 | | image | 指向OH_NativeImage实例的指针。 |
| matrix | 用来存储要获取的4\*4的变化矩阵。 | | matrix | 用来存储要获取的4\*4的变化矩阵。 |
**返回** **返回:**
返回一个由**SurfaceError**定义的int32_t类型的错误码。 返回值为0表示执行成功
**起始版本:**
9
### OH_NativeImage_UpdateSurfaceImage() ### OH_NativeImage_UpdateSurfaceImage()
...@@ -241,22 +254,18 @@ int32_t OH_NativeImage_GetTransformMatrix (OH_NativeImage * image, float matrix[ ...@@ -241,22 +254,18 @@ int32_t OH_NativeImage_GetTransformMatrix (OH_NativeImage * image, float matrix[
int32_t OH_NativeImage_UpdateSurfaceImage (OH_NativeImage * image) int32_t OH_NativeImage_UpdateSurfaceImage (OH_NativeImage * image)
``` ```
**描述** **描述:**
通过OH_NativeImage获取最新帧更新相关联的OPENGL ES纹理。 通过OH_NativeImage获取最新帧更新相关联的OpenGL ES纹理
@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage \@syscap SystemCapability.Graphic.Graphic2D.OH_NativeImage
**参数** **参数:**
| Name | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| image | 指向OH_NativeImage实例的指针。 | | image | 指向OH_NativeImage实例的指针。 |
**返回:** **返回:**
返回一个由**SurfaceError**定义的int32_t类型的错误码。
**起始版本:** 返回值为0表示执行成功
9
...@@ -3,9 +3,17 @@ ...@@ -3,9 +3,17 @@
## 概述 ## 概述
扩展数据句柄结构体定义 扩展数据句柄结构体定义
**相关模块:** **起始版本:**
9
**弃用:**
从API version 10开始废弃,不再提供替代接口
**相关模块:**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
...@@ -15,11 +23,11 @@ ...@@ -15,11 +23,11 @@
### 成员变量 ### 成员变量
| 成员变量名称 | 描述 | | 成员变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [fd](#fd) | 句柄 Fd, -1代表不支持 | | [fd](#fd) | 句柄 Fd, -1代表不支持 |
| [reserveInts](#reserveints) | Reserve数组的个数 | | [reserveInts](#reserveints) | Reserve数组的个数 |
| [reserve](#reserve) [0] | Reserve数组 | | [reserve](#reserve) [0] | Reserve数组 |
## 结构体成员变量说明 ## 结构体成员变量说明
...@@ -27,35 +35,35 @@ ...@@ -27,35 +35,35 @@
### fd ### fd
``` ```
int32_t OHExtDataHandle::fd int32_t OHExtDataHandle::fd
``` ```
**描述** **描述:**
句柄 Fd, -1代表不支持 句柄 Fd, -1代表不支持
### reserve ### reserve
``` ```
int32_t OHExtDataHandle::reserve[0] int32_t OHExtDataHandle::reserve[0]
``` ```
**描述** **描述:**
Reserve数组 Reserve数组
### reserveInts ### reserveInts
``` ```
uint32_t OHExtDataHandle::reserveInts uint32_t OHExtDataHandle::reserveInts
``` ```
**描述** **描述:**
Reserve数组的个数 Reserve数组的个数
...@@ -3,9 +3,17 @@ ...@@ -3,9 +3,17 @@
## 概述 ## 概述
扩展数据句柄结构体定义。 HDR元数据结构体定义
**相关模块:** **起始版本:**
9
**弃用:**
从API version 10开始废弃,不再提供替代接口
**相关模块:**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
...@@ -15,10 +23,10 @@ ...@@ -15,10 +23,10 @@
### 成员变量 ### 成员变量
| 成员变量名称 | 描述 | | 成员变量名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [key](#key) | HDR元数据关键字 | | [key](#key) | HDR元数据关键字 |
| [value](#value) | 关键字对应的值 | | [value](#value) | 关键字对应的值 |
## 结构体成员变量说明 ## 结构体成员变量说明
...@@ -26,23 +34,23 @@ ...@@ -26,23 +34,23 @@
### key ### key
``` ```
OHHDRMetadataKey OHHDRMetaData::key OHHDRMetadataKey OHHDRMetaData::key
``` ```
**描述** **描述:**
HDR元数据关键字 HDR元数据关键字
### value ### value
``` ```
float OHHDRMetaData::value float OHHDRMetaData::value
``` ```
**描述** **描述:**
关键字对应的值 关键字对应的值
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
矩形区域。 矩形区域。
**起始版本:**
8
**相关模块:** **相关模块:**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
表示本地窗口NativeWindow需要更新内容的矩形区域(脏区)。 表示本地窗口NativeWindow需要更新内容的矩形区域(脏区)。
**起始版本:**
8
**相关模块:** **相关模块:**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
## 概述 ## 概述
定义获取和使用NativeWindow的相关函数 定义获取和使用NativeWindow的相关函数
**起始版本** **起始版本:**
8 8
**相关模块** **相关模块:**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
...@@ -19,49 +19,49 @@ ...@@ -19,49 +19,49 @@
### 结构体 ### 结构体
| 结构体名称 | 描述 | | 结构体名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [Region](_region.md) | 表示本地窗口NativeWindow需要更新内容的矩形区域(脏区)。 | | [Region](_region.md) | 表示本地窗口OHNativeWindow需要更新内容的矩形区域(脏区) |
| [Region::Rect](_rect.md) | 矩形区域。 | | [Region::Rect](_rect.md) | 矩形区域 |
| [OHHDRMetaData](_o_h_h_d_r_meta_data.md) | HDR元数据结构体定义 。 | | [OHHDRMetaData](_o_h_h_d_r_meta_data.md) | HDR元数据结构体定义 |
| [OHExtDataHandle](_o_h_ext_data_handle.md) | 扩展数据句柄结构体定义 。 | | [OHExtDataHandle](_o_h_ext_data_handle.md) | 扩展数据句柄结构体定义 |
### 类型定义 ### 类型定义
| 类型定义名称 | 描述 | | 类型名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| OHNativeWindow | 提供对NativeWindow的访问功能 | | [OHNativeWindow](_native_window.md#ohnativewindow) | 提供对OHNativeWindow的访问功能 |
| OHNativeWindowBuffer | 提供对NativeWindowBuffer的访问功能 | | [OHNativeWindowBuffer](_native_window.md#ohnativewindowbuffer) | 提供对OHNativeWindowBuffer的访问功能 |
| [Region](_region.md) | 表示本地窗口NativeWindow需要更新内容的矩形区域(脏区) | | [Region](_native_window.md#region) | 表示本地窗口OHNativeWindow需要更新内容的矩形区域(脏区) |
### 枚举 ### 枚举
| 枚举名称 | 描述 | | 枚举名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [NativeWindowOperation](_native_window.md#nativewindowoperation) { SET_BUFFER_GEOMETRY, GET_BUFFER_GEOMETRY, GET_FORMAT, SET_FORMAT, GET_USAGE, SET_USAGE, SET_STRIDE, GET_STRIDE, SET_SWAP_INTERVAL, GET_SWAP_INTERVAL, SET_TIMEOUT, GET_TIMEOUT, SET_COLOR_GAMUT, GET_COLOR_GAMUT, SET_TRANSFORM, GET_TRANSFORM, SET_UI_TIMESTAMP } | OH_NativeWindow_NativeWindowHandleOpt函数中的操作码 | | [NativeWindowOperation](_native_window.md#nativewindowoperation) {<br/>[SET_BUFFER_GEOMETRY](_native_window.md), [GET_BUFFER_GEOMETRY](_native_window.md), [GET_FORMAT](_native_window.md), [SET_FORMAT](_native_window.md),<br/>[GET_USAGE](_native_window.md), [SET_USAGE](_native_window.md), [SET_STRIDE](_native_window.md), [GET_STRIDE](_native_window.md),<br/>[SET_SWAP_INTERVAL](_native_window.md), [GET_SWAP_INTERVAL](_native_window.md), [SET_TIMEOUT](_native_window.md), [GET_TIMEOUT](_native_window.md),<br/>[SET_COLOR_GAMUT](_native_window.md), [GET_COLOR_GAMUT](_native_window.md), [SET_TRANSFORM](_native_window.md), [GET_TRANSFORM](_native_window.md),<br/>[SET_UI_TIMESTAMP](_native_window.md)<br/>} | OH_NativeWindow_NativeWindowHandleOpt函数中的操作码 |
| [OHScalingMode](_native_window.md#ohscalingmode) { OH_SCALING_MODE_FREEZE = 0, OH_SCALING_MODE_SCALE_TO_WINDOW, OH_SCALING_MODE_SCALE_CROP, OH_SCALING_MODE_NO_SCALE_CROP } | 缩放模式 Scaling Mode | | [OHScalingMode](_native_window.md#ohscalingmode) { [OH_SCALING_MODE_FREEZE](_native_window.md) = 0, [OH_SCALING_MODE_SCALE_TO_WINDOW](_native_window.md), [OH_SCALING_MODE_SCALE_CROP](_native_window.md), [OH_SCALING_MODE_NO_SCALE_CROP](_native_window.md) } | 缩放模式 Scaling Mode |
| [OHHDRMetadataKey](_native_window.md#ohhdrmetadatakey) { OH_METAKEY_RED_PRIMARY_X = 0, OH_METAKEY_RED_PRIMARY_Y = 1, OH_METAKEY_GREEN_PRIMARY_X = 2, OH_METAKEY_GREEN_PRIMARY_Y = 3, OH_METAKEY_BLUE_PRIMARY_X = 4, OH_METAKEY_BLUE_PRIMARY_Y = 5, OH_METAKEY_WHITE_PRIMARY_X = 6, OH_METAKEY_WHITE_PRIMARY_Y = 7, OH_METAKEY_MAX_LUMINANCE = 8, OH_METAKEY_MIN_LUMINANCE = 9, OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL = 10, OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11, OH_METAKEY_HDR10_PLUS = 12, OH_METAKEY_HDR_VIVID = 13 } | 枚举HDR元数据关键字 | | [OHHDRMetadataKey](_native_window.md#ohhdrmetadatakey) {<br/>[OH_METAKEY_RED_PRIMARY_X](_native_window.md) = 0, [OH_METAKEY_RED_PRIMARY_Y](_native_window.md) = 1, [OH_METAKEY_GREEN_PRIMARY_X](_native_window.md) = 2, [OH_METAKEY_GREEN_PRIMARY_Y](_native_window.md) = 3,<br/>[OH_METAKEY_BLUE_PRIMARY_X](_native_window.md) = 4, [OH_METAKEY_BLUE_PRIMARY_Y](_native_window.md) = 5, [OH_METAKEY_WHITE_PRIMARY_X](_native_window.md) = 6, [OH_METAKEY_WHITE_PRIMARY_Y](_native_window.md) = 7,<br/>[OH_METAKEY_MAX_LUMINANCE](_native_window.md) = 8, [OH_METAKEY_MIN_LUMINANCE](_native_window.md) = 9, [OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL](_native_window.md) = 10, [OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL](_native_window.md) = 11,<br/>[OH_METAKEY_HDR10_PLUS](_native_window.md) = 12, [OH_METAKEY_HDR_VIVID](_native_window.md) = 13<br/>} | 枚举HDR元数据关键字 |
### 函数 ### 函数
| 函数名称 | 描述 | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeWindow_CreateNativeWindow](_native_window.md#oh_nativewindow_createnativewindow) (void \*pSurface) | 创建NativeWindow实例,每次调用都会产生一个新的NativeWindow实例 | | [OH_NativeWindow_CreateNativeWindow](_native_window.md#oh_nativewindow_createnativewindow) (void \*pSurface) | 创建OHNativeWindow实例,每次调用都会产生一个新的OHNativeWindow实例 |
| [OH_NativeWindow_DestroyNativeWindow](_native_window.md#oh_nativewindow_destroynativewindow) (OHNativeWindow \*window) | 将NativeWindow对象的引用计数减1,当引用计数为0的时候,该NativeWindow对象会被析构掉 | | [OH_NativeWindow_DestroyNativeWindow](_native_window.md#oh_nativewindow_destroynativewindow) (OHNativeWindow \*window) | 将OHNativeWindow对象的引用计数减1,当引用计数为0的时候,该OHNativeWindow对象会被析构掉 |
| [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](_native_window.md#oh_nativewindow_createnativewindowbufferfromsurfacebuffer) (void \*pSurfaceBuffer) | 创建NativeWindowBuffer实例,每次调用都会产生一个新的NativeWindowBuffer实例 | | [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](_native_window.md#oh_nativewindow_createnativewindowbufferfromsurfacebuffer) (void \*pSurfaceBuffer) | 创建OHNativeWindowBuffer实例,每次调用都会产生一个新的OHNativeWindowBuffer实例 |
| [OH_NativeWindow_DestroyNativeWindowBuffer](_native_window.md#oh_nativewindow_destroynativewindowbuffer) (OHNativeWindowBuffer \*buffer) | 将NativeWindowBuffer对象的引用计数减1,当引用计数为0的时候,该NativeWindowBuffer对象会被析构掉 | | [OH_NativeWindow_DestroyNativeWindowBuffer](_native_window.md#oh_nativewindow_destroynativewindowbuffer) (OHNativeWindowBuffer \*buffer) | 将OHNativeWindowBuffer对象的引用计数减1,当引用计数为0的时候,该OHNativeWindowBuffer对象会被析构掉 |
| [OH_NativeWindow_NativeWindowRequestBuffer](_native_window.md#oh_nativewindow_nativewindowrequestbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*\*buffer, int \*fenceFd) | 通过NativeWindow对象申请一块NativeWindowBuffer,用以内容生产 | | [OH_NativeWindow_NativeWindowRequestBuffer](_native_window.md#oh_nativewindow_nativewindowrequestbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*\*buffer, int \*fenceFd) | 通过OHNativeWindow对象申请一块OHNativeWindowBuffer,用以内容生产 |
| [OH_NativeWindow_NativeWindowFlushBuffer](_native_window.md#oh_nativewindow_nativewindowflushbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer, int fenceFd, [Region](_region.md) region) | 通过NativeWindow将生产好内容的NativeWindowBuffer放回到Buffer队列中,用以内容消费 | | [OH_NativeWindow_NativeWindowFlushBuffer](_native_window.md#oh_nativewindow_nativewindowflushbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer, int fenceFd, Region region) | 通过OHNativeWindow将生产好内容的OHNativeWindowBuffer放回到Buffer队列中,用以内容消费 |
| [OH_NativeWindow_NativeWindowAbortBuffer](_native_window.md#oh_nativewindow_nativewindowabortbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer) | 通过NativeWindow将之前申请出来的NativeWindowBuffer返还到Buffer队列中,供下次再申请 | | [OH_NativeWindow_NativeWindowAbortBuffer](_native_window.md#oh_nativewindow_nativewindowabortbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer) | 通过OHNativeWindow将之前申请出来的OHNativeWindowBuffer返还到Buffer队列中,供下次再申请 |
| [OH_NativeWindow_NativeWindowHandleOpt](_native_window.md#oh_nativewindow_nativewindowhandleopt) (OHNativeWindow \*window, int code,...) | 设置/获取NativeWindow的属性,包括设置/获取宽高、内容格式等 | | [OH_NativeWindow_NativeWindowHandleOpt](_native_window.md#oh_nativewindow_nativewindowhandleopt) (OHNativeWindow*window, int code,...) | 设置/获取OHNativeWindow的属性,包括设置/获取宽高、内容格式等 |
| [OH_NativeWindow_GetBufferHandleFromNative](_native_window.md#oh_nativewindow_getbufferhandlefromnative) (OHNativeWindowBuffer \*buffer) | 通过NativeWindowBuffer获取该buffer的BufferHandle指针 | | [OH_NativeWindow_GetBufferHandleFromNative](_native_window.md#oh_nativewindow_getbufferhandlefromnative) (OHNativeWindowBuffer \*buffer) | 通过OHNativeWindowBuffer获取该buffer的BufferHandle指针 |
| [OH_NativeWindow_NativeObjectReference](_native_window.md#oh_nativewindow_nativeobjectreference) (void \*obj) | 增加一个NativeObject的引用计数 | | [OH_NativeWindow_NativeObjectReference](_native_window.md#oh_nativewindow_nativeobjectreference) (void \*obj) | 增加一个NativeObject的引用计数 |
| [OH_NativeWindow_NativeObjectUnreference](_native_window.md#oh_nativewindow_nativeobjectunreference) (void \*obj) | 减少一个NativeObject的引用计数,当引用计数减少为0时,该NativeObject将被析构掉 | | [OH_NativeWindow_NativeObjectUnreference](_native_window.md#oh_nativewindow_nativeobjectunreference) (void \*obj) | 减少一个NativeObject的引用计数,当引用计数减少为0时,该NativeObject将被析构 |
| [OH_NativeWindow_GetNativeObjectMagic](_native_window.md#oh_nativewindow_getnativeobjectmagic) (void \*obj) | 获取NativeObject的MagicId | | [OH_NativeWindow_GetNativeObjectMagic](_native_window.md#oh_nativewindow_getnativeobjectmagic) (void \*obj) | 获取NativeObject的MagicId |
| [OH_NativeWindow_NativeWindowSetScalingMode](_native_window.md#oh_nativewindow_nativewindowsetscalingmode) (OHNativeWindow \*window, uint32_t sequence, [OHScalingMode](_native_window.md#ohscalingmode) scalingMode) | 设置NativeWindow的ScalingMode | | [OH_NativeWindow_NativeWindowSetScalingMode](_native_window.md#oh_nativewindow_nativewindowsetscalingmode) (OHNativeWindownative_window.md#ohscalingmode) scalingMode) | 设置OHNativeWindow的ScalingMode |
| [OH_NativeWindow_NativeWindowSetMetaData](_native_window.md#oh_nativewindow_nativewindowsetmetadata) (OHNativeWindow \*window, uint32_t sequence, int32_t size, const [OHHDRMetaData](_o_h_h_d_r_meta_data.md) \*metaData) | 设置NativeWindow的元数据 | | [OH_NativeWindow_NativeWindowSetMetaData](_native_window.md#oh_nativewindow_nativewindowsetmetadata) (OHNativeWindow \*window, uint32_t sequence, int32_t size, const OHHDRMetaData \*metaData) | 设置OHNativeWindow的元数据 |
| [OH_NativeWindow_NativeWindowSetMetaDataSet](_native_window.md#oh_nativewindow_nativewindowsetmetadataset) (OHNativeWindow \*window, uint32_t sequence, [OHHDRMetadataKey](_native_window.md#ohhdrmetadatakey) key, int32_t size, const uint8_t \*metaData) | 设置NativeWindow的元数据集。 | | [OH_NativeWindow_NativeWindowSetMetaDataSet](_native_window.md#oh_nativewindow_nativewindowsetmetadataset) (OHNativeWindow \*window, uint32_t sequence, OHHDRMetadataKey key, int32_t size, const uint8_t \*metaData) | 设置OHNativeWindow的元数据集。 |
| [OH_NativeWindow_NativeWindowSetTunnelHandle](_native_window.md#oh_nativewindow_nativewindowsettunnelhandle) (OHNativeWindow \*window, const [OHExtDataHandle](_o_h_ext_data_handle.md) \*handle) | 设置NativeWindow的TunnelHandle。 | | [OH_NativeWindow_NativeWindowSetTunnelHandle](_native_window.md#oh_nativewindow_nativewindowsettunnelhandle) (OHNativeWindow \*window, const OHExtDataHandle \*handle) | 设置OHNativeWindow的TunnelHandle。 |
\ No newline at end of file
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
## 概述 ## 概述
定义获取和使用NativeBuffer的相关函数 定义获取和使用NativeBuffer的相关函数
**起始版本** **起始版本:**
9 9
**相关模块** **相关模块:**
[OH_NativeBuffer](_o_h___native_buffer.md) [OH_NativeBuffer](_o_h___native_buffer.md)
...@@ -21,17 +21,24 @@ ...@@ -21,17 +21,24 @@
| 结构体名称 | 描述 | | 结构体名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) | OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查询现有实例的相关属性。 | | [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) | OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查询现有实例的相关属性 |
### 类型定义
| 类型名称 | 描述 |
| -------- | -------- |
| [OH_NativeBuffer](_o_h___native_buffer.md#oh_nativebuffer) | 提供OH_NativeBuffer结构体声明 |
### 函数 ### 函数
| 函数名称 | 描述 | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeBuffer_Alloc](_o_h___native_buffer.md#oh_nativebuffer_alloc) (const [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 通过OH_NativeBuffer_Config创建OH_NativeBuffer实例,每次调用都会产生一个新的OH_NativeBuffer实例。 | | [OH_NativeBuffer_Alloc](_o_h___native_buffer.md#oh_nativebuffer_alloc) (const OH_NativeBuffer_Config \*config) | 通过OH_NativeBuffer_Config创建OH_NativeBuffer实例,每次调用都会产生一个新的OH_NativeBuffer实例 |
| [OH_NativeBuffer_Reference](_o_h___native_buffer.md#oh_nativebuffer_reference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数加1 | | [OH_NativeBuffer_Reference](_o_h___native_buffer.md#oh_nativebuffer_reference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数加1 |
| [OH_NativeBuffer_Unreference](_o_h___native_buffer.md#oh_nativebuffer_unreference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数减1,当引用计数为0的时候,该NativeBuffer对象会被析构掉 | | [OH_NativeBuffer_Unreference](_o_h___native_buffer.md#oh_nativebuffer_unreference) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对象的引用计数减1,当引用计数为0的时候,该NativeBuffer对象会被析构掉 |
| [OH_NativeBuffer_GetConfig](_o_h___native_buffer.md#oh_nativebuffer_getconfig) (OH_NativeBuffer \*buffer, [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) \*config) | 用于获取OH_NativeBuffer的属性。 | | [OH_NativeBuffer_GetConfig](_o_h___native_buffer.md#oh_nativebuffer_getconfig) (OH_NativeBuffer \*buffer, OH_NativeBuffer_Config \*config) | 用于获取OH_NativeBuffer的属性 |
| [OH_NativeBuffer_Map](_o_h___native_buffer.md#oh_nativebuffer_map) (OH_NativeBuffer \*buffer, void \*\*virAddr) | 将OH_NativeBuffer对应的ION内存映射到进程空间 | | [OH_NativeBuffer_Map](_o_h___native_buffer.md#oh_nativebuffer_map) (OH_NativeBuffer \*buffer, void \*\*virAddr) | 将OH_NativeBuffer对应的ION内存映射到进程空间 |
| [OH_NativeBuffer_Unmap](_o_h___native_buffer.md#oh_nativebuffer_unmap) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对应的ION内存从进程空间移除 | | [OH_NativeBuffer_Unmap](_o_h___native_buffer.md#oh_nativebuffer_unmap) (OH_NativeBuffer \*buffer) | 将OH_NativeBuffer对应的ION内存从进程空间移除 |
| [OH_NativeBuffer_GetSeqNum](_o_h___native_buffer.md#oh_nativebuffer_getseqnum) (OH_NativeBuffer \*buffer) | 获取OH_NativeBuffer的序列号 | | [OH_NativeBuffer_GetSeqNum](_o_h___native_buffer.md#oh_nativebuffer_getseqnum) (OH_NativeBuffer \*buffer) | 获取OH_NativeBuffer的序列号 |
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
## 概述 ## 概述
定义获取和使用NativeImage的相关函数 定义获取和使用NativeImage的相关函数
**起始版本** **起始版本:**
9 9
**相关模块** **相关模块:**
[OH_NativeImage](_o_h___native_image.md) [OH_NativeImage](_o_h___native_image.md)
...@@ -17,15 +17,23 @@ ...@@ -17,15 +17,23 @@
## 汇总 ## 汇总
### 类型定义
| 类型名称 | 描述 |
| -------- | -------- |
| [OH_NativeImage](_o_h___native_image.md#oh_nativeimage) | 提供OH_NativeImage结构体声明 |
| [OHNativeWindow](_o_h___native_image.md#ohnativewindow) | 提供对NativeWindow的访问功能 |
### 函数 ### 函数
| 函数名称 | 描述 | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeImage_Create](_o_h___native_image.md#oh_nativeimage_create) (uint32_t textureId, uint32_t textureTarget) | 创建一个**OH_NativeImage**实例,该实例与OPENGL ES的纹理ID和纹理目标相关联. | | [OH_NativeImage_Create](_o_h___native_image.md#oh_nativeimage_create) (uint32_t textureId, uint32_t textureTarget) | 创建一个**OH_NativeImage**实例,该实例与OpenGL ES的纹理ID和纹理目标相关联 |
| [OH_NativeImage_AcquireNativeWindow](_o_h___native_image.md#oh_nativeimage_acquirenativewindow) (OH_NativeImage \*image) | 获取与OH_NativeImage相关联的OHNativeWindow指针. 该OHNativeWindow后续不再需要时需要调用 OH_NativeWindow_DestroyNativeWindow释放. | | [OH_NativeImage_AcquireNativeWindow](_o_h___native_image.md#oh_nativeimage_acquirenativewindow) (OH_NativeImage \*image) | 获取与OH_NativeImage相关联的OHNativeWindow指针. 该OHNativeWindow后续不再需要时需要调用<br/>OH_NativeWindow_DestroyNativeWindow释放 |
| [OH_NativeImage_AttachContext](_o_h___native_image.md#oh_nativeimage_attachcontext) (OH_NativeImage \*image, uint32_t textureId) | 将OH_NativeImage实例附加到当前OPENGL ES上下文, 且该OPENGL ES纹理会绑定到 GL_TEXTURE_EXTERNAL_OES, 并通过OH_NativeImage进行更新. | | [OH_NativeImage_AttachContext](_o_h___native_image.md#oh_nativeimage_attachcontext) (OH_NativeImage \*image, uint32_t textureId) | 将OH_NativeImage实例附加到当前OpenGL ES上下文, 且该OpenGL ES纹理会绑定到<br/>GL_TEXTURE_EXTERNAL_OES, 并通过OH_NativeImage进行更新 |
| [OH_NativeImage_DetachContext](_o_h___native_image.md#oh_nativeimage_detachcontext) (OH_NativeImage \*image) | 将OH_NativeImage实例从当前OPENGL ES上下文分离. | | [OH_NativeImage_DetachContext](_o_h___native_image.md#oh_nativeimage_detachcontext) (OH_NativeImage \*image) | 将OH_NativeImage实例从当前OpenGL ES上下文分离 |
| [OH_NativeImage_UpdateSurfaceImage](_o_h___native_image.md#oh_nativeimage_updatesurfaceimage) (OH_NativeImage \*image) | 通过OH_NativeImage获取最新帧更新相关联的OPENGL ES纹理. | | [OH_NativeImage_UpdateSurfaceImage](_o_h___native_image.md#oh_nativeimage_updatesurfaceimage) (OH_NativeImage \*image) | 通过OH_NativeImage获取最新帧更新相关联的OpenGL ES纹理 |
| [OH_NativeImage_GetTimestamp](_o_h___native_image.md#oh_nativeimage_gettimestamp) (OH_NativeImage \*image) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的相关时间戳. | | [OH_NativeImage_GetTimestamp](_o_h___native_image.md#oh_nativeimage_gettimestamp) (OH_NativeImage \*image) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的相关时间戳 |
| [OH_NativeImage_GetTransformMatrix](_o_h___native_image.md#oh_nativeimage_gettransformmatrix) (OH_NativeImage \*image, float matrix[16]) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的变化矩阵. | | [OH_NativeImage_GetTransformMatrix](_o_h___native_image.md#oh_nativeimage_gettransformmatrix) (OH_NativeImage \*image, float matrix[16]) | 获取最近调用OH_NativeImage_UpdateSurfaceImage的纹理图像的变化矩阵 |
| [OH_NativeImage_Destroy](_o_h___native_image.md#oh_nativeimage_destroy) (OH_NativeImage \*\*image) | 销毁通过OH_NativeImage_Create创建的**OH_NativeImage**实例, 销毁后该 **OH_NativeImage**指针会被赋值为空. | | [OH_NativeImage_Destroy](_o_h___native_image.md#oh_nativeimage_destroy) (OH_NativeImage \*\*image) | 销毁通过OH_NativeImage_Create创建的**OH_NativeImage**实例, 销毁后该<br/>**OH_NativeImage**指针会被赋值为空 |
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
## 概述 ## 概述
定义获取和使用NativeVsync的相关函数 定义获取和使用NativeVsync的相关函数
**起始版本** **起始版本:**
8 9
**相关模块** **相关模块:**
[NativeVsync](_native_vsync.md) [NativeVsync](_native_vsync.md)
...@@ -17,10 +17,18 @@ ...@@ -17,10 +17,18 @@
## 汇总 ## 汇总
### 类型定义
| 类型名称 | 描述 |
| -------- | -------- |
| [OH_NativeVSync](_native_vsync.md#oh_nativevsync) | 提供OH_NativeVSync结构体声明 |
| (\*[OH_NativeVSync_FrameCallback](_native_vsync.md#oh_nativevsync_framecallback)) (long long timestamp, void \*data) | VSync回调函数类型 |
### 函数 ### 函数
| 函数名称 | 描述 | | 函数名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| [OH_NativeVSync_Create](_native_vsync.md#oh_nativevsync_create) (const char \*name, unsigned int length) | 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例 | | [OH_NativeVSync_Create](_native_vsync.md#oh_nativevsync_create) (const char \*name, unsigned int length) | 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例 |
| [OH_NativeVSync_Destroy](_native_vsync.md#oh_nativevsync_destroy) (OH_NativeVSync \*nativeVsync) | 销毁OH_NativeVSync实例 | | [OH_NativeVSync_Destroy](_native_vsync.md#oh_nativevsync_destroy) (OH_NativeVSync \*nativeVsync) | 销毁OH_NativeVSync实例 |
| [OH_NativeVSync_RequestFrame](_native_vsync.md#oh_nativevsync_requestframe) (OH_NativeVSync \*nativeVsync, OH_NativeVSync_FrameCallback callback, void \*data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback | | [OH_NativeVSync_RequestFrame](_native_vsync.md#oh_nativevsync_requestframe) (OH_NativeVSync \*nativeVsync, OH_NativeVSync_FrameCallback callback, void \*data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册