openharmony 鸿蒙 capi-native-display-soloist-h

2026-08-25 浏览 (1)

native_display_soloist.h

Overview

This file declares the functions for obtaining and using native display soloist.

File to include: <native_display_soloist/native_display_soloist.h>

Library: libnative_display_soloist.so

System capability: SystemCapability.Graphic.Graphic2D.HyperGraphicManager

Since: 12

Related module: NativeDisplaySoloist

Summary

Structs

Nametypedef KeywordDescription
DisplaySoloist_ExpectedRateRangeDisplaySoloist_ExpectedRateRangeDescribes the expected frame rate range.
OH_DisplaySoloistOH_DisplaySoloistProvides the declaration of an OH_DisplaySoloist struct.

Functions

Nametypedef KeywordDescription
typedef void (*OH_DisplaySoloist_FrameCallback)(long long timestamp, long long targetTimestamp, void* data)OH_DisplaySoloist_FrameCallbackDefines the pointer to an OH_DisplaySoloist callback function.
OH_DisplaySoloist* OH_DisplaySoloist_Create(bool useExclusiveThread)-Creates an OH_DisplaySoloist instance. A new OH_DisplaySoloist instance is created each time this API is called.
int32_t OH_DisplaySoloist_Destroy(OH_DisplaySoloist* displaySoloist)-Destroys an OH_DisplaySoloist object and reclaims the memory occupied.
int32_t OH_DisplaySoloist_Start(OH_DisplaySoloist* displaySoloist, OH_DisplaySoloist_FrameCallback callback, void* data)-Sets a callback function for each frame. The callback function is triggered each time a VSync signal arrives.
int32_t OH_DisplaySoloist_Stop(OH_DisplaySoloist* displaySoloist)-Stops requesting the next VSync signal and triggering the callback function.
int32_t OH_DisplaySoloist_SetExpectedFrameRateRange(OH_DisplaySoloist* displaySoloist, DisplaySoloist_ExpectedRateRange* range)-Sets the expected frame rate range.

Function Description

OH_DisplaySoloist_FrameCallback()

typedef void (*OH_DisplaySoloist_FrameCallback)(long long timestamp, long long targetTimestamp, void* data)

Description

Defines the pointer to an OH_DisplaySoloist callback function.

Since: 12

Parameters

NameDescription
long long timestampCurrent frame VSync timestamp.
long long targetTimestampExpected VSync timestamp of the next frame.
void* dataPointer to user-defined data.

OH_DisplaySoloist_Create()

OH_DisplaySoloist* OH_DisplaySoloist_Create(bool useExclusiveThread)

Description

Creates an OH_DisplaySoloist instance. A new OH_DisplaySoloist instance is created each time this API is called.

Since: 12

Parameters

NameDescription
bool useExclusiveThreadWhether the OH_DisplaySoloist instance is an exclusive thread. true means yes; false otherwise.

Returns

TypeDescription
OH_DisplaySoloist*Returns the pointer to the OH_DisplaySoloist instance created if the operation is successful; returns a null pointer otherwise. The failure cause may be out of memory.

OH_DisplaySoloist_Destroy()

int32_t OH_DisplaySoloist_Destroy(OH_DisplaySoloist* displaySoloist)

Description

Destroys an OH_DisplaySoloist object and reclaims the memory occupied.

Since: 12

Parameters

NameDescription
OH_DisplaySoloist* displaySoloistPointer to the OH_DisplaySoloist instance.

Returns

TypeDescription
int32_tReturns 0 if the operation is successful; returns -1 otherwise.

OH_DisplaySoloist_Start()

int32_t OH_DisplaySoloist_Start(OH_DisplaySoloist* displaySoloist, OH_DisplaySoloist_FrameCallback callback, void* data)

Description

Sets a callback function for each frame. The callback function is triggered each time a VSync signal arrives.

Since: 12

Parameters

NameDescription
OH_DisplaySoloist* displaySoloistPointer to the OH_DisplaySoloist instance.
OH_DisplaySoloist_FrameCallback callbackCallback function to be triggered when the next VSync signal arrives.
void* dataPointer to the user-defined data struct. The type is void.

Returns

TypeDescription
int32_tReturns 0 if the operation is successful; returns -1 otherwise.

OH_DisplaySoloist_Stop()

int32_t OH_DisplaySoloist_Stop(OH_DisplaySoloist* displaySoloist)

Description

Stops requesting the next VSync signal and triggering the callback function.

Since: 12

Parameters

NameDescription
OH_DisplaySoloist* displaySoloistPointer to the OH_DisplaySoloist instance.

Returns

TypeDescription
int32_tReturns 0 if the operation is successful; returns -1 otherwise.

OH_DisplaySoloist_SetExpectedFrameRateRange()

int32_t OH_DisplaySoloist_SetExpectedFrameRateRange(OH_DisplaySoloist* displaySoloist, DisplaySoloist_ExpectedRateRange* range)

Description

Sets the expected frame rate range.

Since: 12

Parameters

NameDescription
OH_DisplaySoloist* displaySoloistPointer to the OH_DisplaySoloist instance.
DisplaySoloist_ExpectedRateRange* rangePointer to the DisplaySoloist_ExpectedRateRange instance.

Returns

TypeDescription
int32_tReturns 0 if the operation is successful; returns -1 otherwise.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-drawing-gpu-context-h

openharmony 鸿蒙 capi-drawing-nativepixelmap-

openharmony 鸿蒙 capi-nativevsync-oh-nativevsync-expectedraterange

openharmony 鸿蒙 capi-drawing-oh-drawing-brush

openharmony 鸿蒙 capi-drawing-oh-drawing-image-info

openharmony 鸿蒙 capi-drawing-text-linetypography-h

openharmony 鸿蒙 capi-oh-nativeimage-oh-nativeimage

openharmony 鸿蒙 capi-drawing-typeface-h

openharmony 鸿蒙 capi-drawing-brush-h

openharmony 鸿蒙 capi-nativewindow

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/LsE3K6IU