未验证 提交 6cbff5ef 编写于 作者: O openharmony_ci 提交者: Gitee

!22818 master:add Native API in NativeVsync and NativeBuffer

Merge pull request !22818 from 葛亚芳/master
......@@ -19,7 +19,7 @@
| 名称 | 描述 |
| -------- | -------- |
| [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/>**引用文件:** &lt;native_vsync/native_vsync.h&gt; <br/>**库:** libnative_vsync.so |
### 类型定义
......@@ -37,7 +37,7 @@
| [OH_NativeVSync_Create](#oh_nativevsync_create) (const char \*name, unsigned int length) | 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例 |
| [OH_NativeVSync_Destroy](#oh_nativevsync_destroy) ([OH_NativeVSync](#oh_nativevsync) \*nativeVsync) | 销毁OH_NativeVSync实例 |
| [OH_NativeVSync_RequestFrame](#oh_nativevsync_requestframe) ([OH_NativeVSync](#oh_nativevsync) \*nativeVsync, [OH_NativeVSync_FrameCallback](#oh_nativevsync_framecallback) callback, void \*data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback |
| [OH_NativeVSync_GetPeriod](#oh_nativevsync_getperiod) ([OH_NativeVSync](#oh_nativevsync) \*nativeVsync, long long \*period) |获取vsync周期。|
## 类型定义说明
......@@ -77,6 +77,34 @@ VSync回调函数类型
## 函数说明
### OH_NativeVSync_GetPeriod()
```
int OH_NativeVSync_GetPeriod (OH_NativeVSync * nativeVsync, long long * period )
```
**描述:**
获取vsync周期。
\@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**参数:**
| 名称 | 描述 |
| -------- | -------- |
| nativeVsync | 一个指向OH_NativeVSync实例的指针。|
| period | 用于获取vsync周期的变量。 |
**返回:**
返回值为0表示执行成功。
**起始版本:**
10
### OH_NativeVSync_Create()
......
......@@ -19,7 +19,7 @@
| 名称 | 描述 |
| -------- | -------- |
| [native_buffer.h](native__buffer_8h.md) | 定义获取和使用NativeBuffer的相关函数。<br/>引用文件:&lt;native_buffer/native_buffer.h&gt; |
| [native_buffer.h](native__buffer_8h.md) | 定义获取和使用NativeBuffer的相关函数。<br/>**引用文件:** &lt;native_buffer/native_buffer.h&gt; <br/>**库:** libnative_buffer.so|
### 结构体
......@@ -35,6 +35,12 @@
| -------- | -------- |
| [OH_NativeBuffer](#oh_nativebuffer) | 提供OH_NativeBuffer结构体声明。 |
### 枚举
| 名称 | 描述 |
| -------- | -------- |
| [OH_NativeBuffer_Usage](#oh_nativebuffer_usage) { NATIVEBUFFER_USAGE_CPU_READ = (1ULL &lt;&lt; 0), NATIVEBUFFER_USAGE_CPU_WRITE = (1ULL &lt;&lt; 1), NATIVEBUFFER_USAGE_MEM_DMA = (1ULL &lt;&lt; 3) } | OH_NativeBuffer的用途。 |
| [OH_NativeBuffer_Format](#oh_nativebuffer_format) {<br/>NATIVEBUFFER_PIXEL_FMT_RGB_565 = 3, NATIVEBUFFER_PIXEL_FMT_RGBA_5658, NATIVEBUFFER_PIXEL_FMT_RGBX_4444, NATIVEBUFFER_PIXEL_FMT_RGBA_4444,<br/>NATIVEBUFFER_PIXEL_FMT_RGB_444, NATIVEBUFFER_PIXEL_FMT_RGBX_5551, NATIVEBUFFER_PIXEL_FMT_RGBA_5551, NATIVEBUFFER_PIXEL_FMT_RGB_555,<br/>NATIVEBUFFER_PIXEL_FMT_RGBX_8888, NATIVEBUFFER_PIXEL_FMT_RGBA_8888, NATIVEBUFFER_PIXEL_FMT_RGB_888, NATIVEBUFFER_PIXEL_FMT_BGR_565,<br/>NATIVEBUFFER_PIXEL_FMT_BGRX_4444, NATIVEBUFFER_PIXEL_FMT_BGRA_4444, NATIVEBUFFER_PIXEL_FMT_BGRX_5551, NATIVEBUFFER_PIXEL_FMT_BGRA_5551,<br/>NATIVEBUFFER_PIXEL_FMT_BGRX_8888, NATIVEBUFFER_PIXEL_FMT_BGRA_8888, NATIVEBUFFER_PIXEL_FMT_BUTT = 0X7FFFFFFF<br/>} | OH_NativeBuffer的格式。 |
### 函数
......@@ -63,6 +69,70 @@ typedef struct OH_NativeBuffer OH_NativeBuffer
提供OH_NativeBuffer结构体声明。
## 枚举类型说明
### OH_NativeBuffer_Format
```
enum OH_NativeBuffer_Format
```
**描述:**
OH_NativeBuffer的格式。
\@SysCap SystemCapability.Graphic.Graphic2D.NativeBuffer
| 枚举值 | 描述 |
| -------- | -------- |
| NATIVEBUFFER_PIXEL_FMT_RGB_565 | RGB565格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBA_5658 | RGBA5658格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBX_4444 | RGBX4444格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBA_4444 | RGBA4444格式 |
| NATIVEBUFFER_PIXEL_FMT_RGB_444 | RGB444格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBX_5551 | RGBX5551格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBA_5551 | RGBA5551格式 |
| NATIVEBUFFER_PIXEL_FMT_RGB_555 | RGB555格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBX_8888 | RGBX8888格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBA_8888 | RGBA8888格式 |
| NATIVEBUFFER_PIXEL_FMT_RGB_888 | RGB888格式 |
| NATIVEBUFFER_PIXEL_FMT_BGR_565 | BGR565格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRX_4444 | BGRX4444格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRA_4444 | BGRA4444格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRX_5551 | BGRX5551格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRA_5551 | BGRA5551格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRX_8888 | BGRX8888格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRA_8888 | BGRA8888格式 |
| NATIVEBUFFER_PIXEL_FMT_BUTT | 无效格式 |
**起始版本:**
10
### OH_NativeBuffer_Usage
```
enum OH_NativeBuffer_Usage
```
**描述:**
OH_NativeBuffer的用途。
\@SysCap SystemCapability.Graphic.Graphic2D.NativeBuffer
| 枚举值 | 描述 |
| -------- | -------- |
| NATIVEBUFFER_USAGE_CPU_READ | CPU可读 |
| NATIVEBUFFER_USAGE_CPU_WRITE | CPU可写 |
| NATIVEBUFFER_USAGE_MEM_DMA | 直接内存访问缓冲区 |
**起始版本:**
10
## 函数说明
......
......@@ -21,9 +21,72 @@ OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查
### 成员变量
| 成员变量名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| width | 宽度(像素)。 |
| height | 高度(像素)。 |
| format | 像素格式。 |
| usage | buffer的用途说明。 |
| [width](#width) | 宽度(像素)。 |
| [height](#height) | 高度(像素)。 |
| [format](#format) | 像素格式。 |
| [usage](#usage) | buffer的用途说明。 |
| [stride](#stride) | 本地窗口缓冲区步幅。 |
## 结构体成员变量说明
### format
```
int32_t OH_NativeBuffer_Config::format
```
**描述:**
像素格式
### height
```
int32_t OH_NativeBuffer_Config::height
```
**描述:**
高度(像素)。
### stride
```
int32_t OH_NativeBuffer_Config::stride
```
**描述:**
本地窗口缓冲区步幅。
**起始版本:**
10
### usage
```
int32_t OH_NativeBuffer_Config::usage
```
**描述:**
buffer的用途说明。
### width
```
int32_t OH_NativeBuffer_Config::width
```
**描述:**
宽度(像素)。
......@@ -30,6 +30,12 @@
| -------- | -------- |
| [OH_NativeBuffer](_o_h___native_buffer.md#oh_nativebuffer) | 提供OH_NativeBuffer结构体声明 |
### 枚举
| 名称 | 描述 |
| -------- | -------- |
| [OH_NativeBuffer_Usage](_o_h___native_buffer.md#oh_nativebuffer_usage) { NATIVEBUFFER_USAGE_CPU_READ = (1ULL &lt;&lt; 0), NATIVEBUFFER_USAGE_CPU_WRITE = (1ULL &lt;&lt; 1), NATIVEBUFFER_USAGE_MEM_DMA = (1ULL &lt;&lt; 3) } | OH_NativeBuffer的用途。 |
| [OH_NativeBuffer_Format](_o_h___native_buffer.md#oh_nativebuffer_format) {<br/>NATIVEBUFFER_PIXEL_FMT_RGB_565 = 3, NATIVEBUFFER_PIXEL_FMT_RGBA_5658, NATIVEBUFFER_PIXEL_FMT_RGBX_4444, NATIVEBUFFER_PIXEL_FMT_RGBA_4444,<br/>NATIVEBUFFER_PIXEL_FMT_RGB_444, NATIVEBUFFER_PIXEL_FMT_RGBX_5551, NATIVEBUFFER_PIXEL_FMT_RGBA_5551, NATIVEBUFFER_PIXEL_FMT_RGB_555,<br/>NATIVEBUFFER_PIXEL_FMT_RGBX_8888, NATIVEBUFFER_PIXEL_FMT_RGBA_8888, NATIVEBUFFER_PIXEL_FMT_RGB_888, NATIVEBUFFER_PIXEL_FMT_BGR_565,<br/>NATIVEBUFFER_PIXEL_FMT_BGRX_4444, NATIVEBUFFER_PIXEL_FMT_BGRA_4444, NATIVEBUFFER_PIXEL_FMT_BGRX_5551, NATIVEBUFFER_PIXEL_FMT_BGRA_5551,<br/>NATIVEBUFFER_PIXEL_FMT_BGRX_8888, NATIVEBUFFER_PIXEL_FMT_BGRA_8888, NATIVEBUFFER_PIXEL_FMT_BUTT = 0X7FFFFFFF<br/>} | OH_NativeBuffer的格式。 |
### 函数
......
......@@ -32,3 +32,4 @@
| [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_RequestFrame](_native_vsync.md#oh_nativevsync_requestframe) (OH_NativeVSync \*nativeVsync, OH_NativeVSync_FrameCallback callback, void \*data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback |
| [OH_NativeVSync_GetPeriod](_native_vsync.md#oh_nativevsync_getperiod) (OH_NativeVSync \*nativeVsync, long long \*period) |获取vsync周期。|
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册