Skip to main content

Crate ohos_native_window_sys

Crate ohos_native_window_sys 

Source

Structs§

NativeWindow
@brief native window. @since 8
OHExtDataHandle
@brief Defines the ExtData Handle @since 9 @deprecated since 10
OHHDRMetaData
@brief Defines the HDR metadata. @since 9 @deprecated since 10
OHIPCParcel
Region
@brief indicates a dirty region where content is updated. @since 8
Region_Rect
if rects is nullptr, fill the Buffer dirty size by default
__IncompleteArrayField

Constants§

NativeWindowOperation_GET_APP_FRAMEWORK_TYPE
get app framework type, variable parameter in function is [out] char** frameworkType. @since 12
NativeWindowOperation_GET_BUFFERQUEUE_SIZE
get native window bufferqueue size, variable parameter in function is [out] int32_t *size. @since 12
NativeWindowOperation_GET_BUFFER_GEOMETRY
get native window buffer geometry, variable parameter in function is [out] int32_t *height, [out] int32_t *width
NativeWindowOperation_GET_COLOR_GAMUT
get native window buffer colorGamut, variable parameter in function is [out] int32_t *colorGamut, the enumeration value refers to {@link OH_NativeBuffer_ColorGamut}.
NativeWindowOperation_GET_FORMAT
get native window buffer format, variable parameter in function is [out] int32_t *format, the enumeration value refers to {@link OH_NativeBuffer_Format}.
NativeWindowOperation_GET_SOURCE_TYPE
get surface source type, variable parameter in function is [out] int32_t *sourceType, the enumeration value refers to {@link OHSurfaceSource}. @since 12
NativeWindowOperation_GET_STRIDE
get native window buffer stride, variable parameter in function is [out] int32_t *stride. @deprecated since 16 @useinstead Use {@link OH_NativeWindow_GetBufferHandleFromNative} to get a {@link BufferHandleand} from a buffer and then retrieve the stride from the {@link BufferHandle}.
NativeWindowOperation_GET_SWAP_INTERVAL
get native window buffer swap interval, variable parameter in function is [out] int32_t *interval.
NativeWindowOperation_GET_TIMEOUT
get the timeout in milliseconds when the native window requests a buffer, the default value is 3000 milliseconds when not set, variable parameter in function is [out] int32_t *timeout, in milliseconds.
NativeWindowOperation_GET_TRANSFORM
get native window buffer transform, variable parameter in function is [out] int32_t *transform, the enumeration value refers to {@link OH_NativeBuffer_TransformType}.
NativeWindowOperation_GET_USAGE
get native window buffer usage, variable parameter in function is [out] uint64_t *usage, the enumeration value refers to {@link OH_NativeBuffer_Usage}.
NativeWindowOperation_SET_APP_FRAMEWORK_TYPE
set app framework type, variable parameter in function is [in] char* frameworkType. maximum length is 64 bytes, otherwise the setting fails. @since 12
NativeWindowOperation_SET_BUFFER_GEOMETRY
set native window buffer geometry, variable parameter in function is [in] int32_t width, [in] int32_t height
NativeWindowOperation_SET_COLOR_GAMUT
set native window buffer colorGamut, variable parameter in function is [in] int32_t colorGamut, the enumeration value refers to {@link OH_NativeBuffer_ColorGamut}.
NativeWindowOperation_SET_FORMAT
set native window buffer format, variable parameter in function is [in] int32_t format, the enumeration value refers to {@link OH_NativeBuffer_Format}.
NativeWindowOperation_SET_HDR_WHITE_POINT_BRIGHTNESS
set hdr white point brightness, variable parameter in function is [in] float brightness. the value range is 0.0f to 1.0f. @since 12
NativeWindowOperation_SET_SDR_WHITE_POINT_BRIGHTNESS
set sdr white point brightness, variable parameter in function is [in] float brightness. the value range is 0.0f to 1.0f. @since 12
NativeWindowOperation_SET_SOURCE_TYPE
set surface source type, variable parameter in function is [in] int32_t sourceType, the enumeration value refers to {@link OHSurfaceSource}. @since 12
NativeWindowOperation_SET_STRIDE
set native window buffer stride, variable parameter in function is [in] int32_t stride. @deprecated since 16
NativeWindowOperation_SET_SWAP_INTERVAL
set native window buffer swap interval, variable parameter in function is [in] int32_t interval.
NativeWindowOperation_SET_TIMEOUT
set the timeout in milliseconds when the native window requests a buffer, the default value is 3000 milliseconds when not set, variable parameter in function is [in] int32_t timeout, in milliseconds.
NativeWindowOperation_SET_TRANSFORM
set native window buffer transform, variable parameter in function is [in] int32_t transform, the enumeration value refers to {@link OH_NativeBuffer_TransformType}.
NativeWindowOperation_SET_UI_TIMESTAMP
set native window buffer uiTimestamp, variable parameter in function is [in] uint64_t uiTimestamp.
NativeWindowOperation_SET_USAGE
set native window buffer usage, variable parameter in function is [in] uint64_t usage, the enumeration value refers to {@link OH_NativeBuffer_Usage}.
OHHDRMetadataKey_OH_METAKEY_BLUE_PRIMARY_X
OHHDRMetadataKey_OH_METAKEY_BLUE_PRIMARY_Y
OHHDRMetadataKey_OH_METAKEY_GREEN_PRIMARY_X
OHHDRMetadataKey_OH_METAKEY_GREEN_PRIMARY_Y
OHHDRMetadataKey_OH_METAKEY_HDR10_PLUS
OHHDRMetadataKey_OH_METAKEY_HDR_VIVID
OHHDRMetadataKey_OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL
OHHDRMetadataKey_OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL
OHHDRMetadataKey_OH_METAKEY_MAX_LUMINANCE
OHHDRMetadataKey_OH_METAKEY_MIN_LUMINANCE
OHHDRMetadataKey_OH_METAKEY_RED_PRIMARY_X
OHHDRMetadataKey_OH_METAKEY_RED_PRIMARY_Y
OHHDRMetadataKey_OH_METAKEY_WHITE_PRIMARY_X
OHHDRMetadataKey_OH_METAKEY_WHITE_PRIMARY_Y
OHScalingModeV2_OH_SCALING_MODE_FREEZE_V2
the window content is not updated until a buffer of the window size is received
OHScalingModeV2_OH_SCALING_MODE_NO_SCALE_CROP_V2
the window is clipped to the size of the buffer’s clipping rectangle pixels outside the clipping rectangle are considered fully transparent.
OHScalingModeV2_OH_SCALING_MODE_SCALE_CROP_V2
the buffer is uniformly scaled so that the smaller size of the buffer matches the window size
OHScalingModeV2_OH_SCALING_MODE_SCALE_FIT_V2
Adapt to the buffer and scale proportionally to the buffer size. Prioritize displaying all buffer content. If the size is not the same as the window size, fill the unfilled area of the window with a background color.
OHScalingModeV2_OH_SCALING_MODE_SCALE_TO_WINDOW_V2
the buffer is scaled in two dimensions to match the window size
OHScalingMode_OH_SCALING_MODE_FREEZE
the window content is not updated until a buffer of the window size is received
OHScalingMode_OH_SCALING_MODE_NO_SCALE_CROP
the window is clipped to the size of the buffer’s clipping rectangle pixels outside the clipping rectangle are considered fully transparent.
OHScalingMode_OH_SCALING_MODE_SCALE_CROP
the buffer is uniformly scaled so that the smaller size of the buffer matches the window size
OHScalingMode_OH_SCALING_MODE_SCALE_TO_WINDOW
the buffer is scaled in two dimensions to match the window size

Functions§

OH_NativeWindow_CreateNativeWindow⚠
@brief Creates a OHNativeWindow instance. A new OHNativeWindow instance is created each time this function is called.
OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer⚠
@brief Creates a OHNativeWindowBuffer instance.\n A new OHNativeWindowBuffer instance is created each time this function is called.\n This interface needs to be used in conjunction with OH_NativeWindow_DestroyNativeWindowBuffer, otherwise memory leaks will occur.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer⚠
@brief Creates a OHNativeWindowBuffer instance. A new OHNativeWindowBuffer instance is created each time this function is called.
OH_NativeWindow_CreateNativeWindowFromSurfaceId⚠
@brief Creates an OHNativeWindow instance.\n This interface needs to be used in conjunction with OH_NativeWindow_DestroyNativeWindow, otherwise memory leaks will occur.\n If there is a concurrent destroy OHNativeWindow, you need to add once and decrement once to the OHNativeWindow reference count through OH_NativeWindow_NativeObjectReference and OH_NativeWindow_NativeObjectUnreference.\n If the surface obtained through surfaceId is created in this process, the surface cannot be obtained across processes.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_DestroyNativeWindow⚠
@brief Decreases the reference count of a OHNativeWindow instance by 1, and when the reference count reaches 0, destroys the instance.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_DestroyNativeWindowBuffer⚠
@brief Decreases the reference count of a OHNativeWindowBuffer instance by 1 and, when the reference count reaches 0, destroys the instance.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_GetBufferHandleFromNative⚠
@brief Obtains the pointer to a BufferHandle of a OHNativeWindowBuffer instance.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_GetColorSpace⚠
@brief Get the color space of the native window.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_GetLastFlushedBuffer⚠
@brief Get the last flushed OHNativeWindowBuffer from a OHNativeWindow instance.
OH_NativeWindow_GetLastFlushedBufferV2⚠
@brief Get the last flushed OHNativeWindowBuffer from an OHNativeWindow instance.\n When the fenceFd is used up, you need to close it.\n This interface needs to be used in conjunction with OH_NativeWindow_NativeObjectUnreference, otherwise memory leaks will occur.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_GetMetadataValue⚠
@brief Set the metadata type of the native window.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_GetNativeObjectMagic⚠
@brief Obtains the magic ID of a native object.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_GetSurfaceId⚠
@brief Get surfaceId from native window.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeObjectReference⚠
@brief Adds the reference count of a native object.\n This interface needs to be used in conjunction with OH_NativeWindow_NativeObjectUnreference, otherwise memory leaks will occur.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeObjectUnreference⚠
@brief Decreases the reference count of a native object and, when the reference count reaches 0, destroys this object.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeWindowAbortBuffer⚠
@brief Returns the OHNativeWindowBuffer to the buffer queue through a OHNativeWindow instance, without filling in any content. The OHNativeWindowBuffer can be used for another request.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeWindowAttachBuffer⚠
@brief Attach a buffer to an OHNativeWindow instance.\n This interface needs to be used in conjunction with OH_NativeWindow_NativeWindowDetachBuffer, otherwise buffer management will be chaotic.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeWindowDetachBuffer⚠
@brief Detach a buffer from an OHNativeWindow instance.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeWindowFlushBuffer⚠
@brief Flushes the OHNativeWindowBuffer filled with the content to the buffer queue through a OHNativeWindow instance for content consumption.\n The fenceFd will be close by system.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeWindowHandleOpt⚠
@brief Sets or obtains the attributes of a native window, including the width, height, and content format.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeWindowRequestBuffer⚠
@brief Requests a OHNativeWindowBuffer through a OHNativeWindow instance for content production.\n Before calling this interface, you need to set the width and height of OHNativeWindow through SET_BUFFER_GEOMETRY.\n This interface needs to be used in conjunction with OH_NativeWindow_NativeWindowFlushBuffer, otherwise buffer will be exhausted.\n When the fenceFd is used up, you need to close it.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeWindowSetMetaData⚠
@brief Sets metaData of a native window.
OH_NativeWindow_NativeWindowSetMetaDataSet⚠
@brief Sets metaDataSet of a native window.
OH_NativeWindow_NativeWindowSetScalingMode⚠
@brief Sets scalingMode of a native window.
OH_NativeWindow_NativeWindowSetScalingModeV2⚠
@brief Sets scalingMode of a native window.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_NativeWindowSetTunnelHandle⚠
@brief Sets tunnel handle of a native window.
OH_NativeWindow_ReadFromParcel⚠
@brief Read an OHNativeWindow from an OHIPCParcel.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_SetBufferHold⚠
@brief Set native window buffer hold.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_SetColorSpace⚠
@brief Set the color space of the native window.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_SetMetadataValue⚠
@brief Set the metadata type of the native window.\n This interface is a non-thread-safe type interface.\n
OH_NativeWindow_WriteToParcel⚠
@brief Write an OHNativeWindow to an OHIPCParcel.\n This interface is a non-thread-safe type interface.\n

Type Aliases§

NativeWindowOperation
@brief Indicates the operation code in the function OH_NativeWindow_NativeWindowHandleOpt. @since 8
OHHDRMetadataKey
@brief Enumerates the HDR metadata keys. @since 9 @deprecated since 10
OHNativeWindow
@brief define the new type name OHNativeWindow for struct NativeWindow. @since 8
OHNativeWindowBuffer
@brief define the new type name OHNativeWindowBuffer for struct NativeWindowBuffer. @since 8
OHScalingMode
@brief Indicates Scaling Mode. @since 9 @deprecated since 10 @useinstead OHScalingModeV2
OHScalingModeV2
@brief Indicates Scaling Mode. @since 12