openharmony 鸿蒙 capi-native-avmemory-h

2026-08-25 浏览 (1)

native_avmemory.h

Overview

The file declares the attribute definition of the media struct AVMemory.

File to include: <multimedia/player_framework/native_avmemory.h>

Library: libnative_media_core.so

System capability: SystemCapability.Multimedia.Media.Core

Since: 9

Related module: Core

Summary

Structs

Nametypedef KeywordDescription
OH_AVMemoryOH_AVMemoryDescribes a native object for the audio and video memory interface.

Functions

NameDescription
OH_AVMemory *OH_AVMemory_Create(int32_t size)Creates an OH_AVMemory instance.
uint8_t *OH_AVMemory_GetAddr(struct OH_AVMemory *mem)Obtains the virtual memory address.
int32_t OH_AVMemory_GetSize(struct OH_AVMemory *mem)Obtains the memory length.
OH_AVErrCode OH_AVMemory_Destroy(struct OH_AVMemory *mem)Releases an OH_AVMemory instance.

Function Description

OH_AVMemory_Create()

OH_AVMemory *OH_AVMemory_Create(int32_t size)

Description

Creates an OH_AVMemory instance.

System capability: SystemCapability.Multimedia.Media.Core

Since: 10

Deprecated from: 11

Substitute: OH_AVBuffer_Create

Parameters

NameDescription
int32_t sizeSize of the created memory, in bytes.

Returns

TypeDescription
OH_AVMemory *Pointer to the OH_AVMemory instance created. If the operation fails, NULL is returned.
The instance must be released by calling OH_AVMemory_Destroy when it is no longer required.
The possible causes of an operation failure are as follows:
1. The value of size is less than or equal to 0.
2. The OH_AVMemory instance fails to be created.
3. Memory allocation fails.

OH_AVMemory_GetAddr()

uint8_t *OH_AVMemory_GetAddr(struct OH_AVMemory *mem)

Description

Obtains the virtual memory address.

System capability: SystemCapability.Multimedia.Media.Core

Since: 9

Deprecated from: 11

Substitute: OH_AVBuffer_GetAddr

Parameters

NameDescription
struct OH_AVMemory *memPointer to an OH_AVMemory instance.

Returns

TypeDescription
uint8_t *Pointer to the virtual memory address. If the memory is invalid, NULL is returned.
The possible causes of an operation failure are as follows:
1. The value of mem is nullptr.
2. The value of mem fails parameter structure verification.
3. The memory in the passed-in value of mem is nullptr.

OH_AVMemory_GetSize()

int32_t OH_AVMemory_GetSize(struct OH_AVMemory *mem)

Description

Obtains the memory length.

System capability: SystemCapability.Multimedia.Media.Core

Since: 9

Deprecated from: 11

Substitute: OH_AVBuffer_GetCapacity

Parameters

NameDescription
struct OH_AVMemory *memPointer to an OH_AVMemory instance.

Returns

TypeDescription
int32_tMemory size. If the memory is invalid, -1 is returned.
The possible causes of an operation failure are as follows:
1. The value of mem is nullptr.
2. The value of mem fails parameter structure verification.
3. The memory in the passed-in value of mem is nullptr.

OH_AVMemory_Destroy()

OH_AVErrCode OH_AVMemory_Destroy(struct OH_AVMemory *mem)

Description

Releases an OH_AVMemory instance.

System capability: SystemCapability.Multimedia.Media.Core

Since: 10

Deprecated from: 11

Substitute: OH_AVBuffer_Destroy

Parameters

NameDescription
struct OH_AVMemory *memPointer to an OH_AVMemory instance.

Returns

TypeDescription
OH_AVErrCodeAV_ERR_OK: The release operation is successful.
AV_ERR_INVALID_VAL:
1. The value of mem is nullptr.
2. The value of mem fails parameter structure verification.
3. The value of mem is not created by the caller.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-native-avcodec-audiocodec-h

openharmony 鸿蒙 capi-avsource-oh-avsource

openharmony 鸿蒙 capi-native-cencinfo-h

openharmony 鸿蒙 capi-avmuxer

openharmony 鸿蒙 capi-multimedia-drm-oh-avcencinfo

openharmony 鸿蒙 capi-native-avdemuxer-h

openharmony 鸿蒙 capi-media-types-h

openharmony 鸿蒙 capi-native-audio-channel-layout-h

openharmony 鸿蒙 capi-native-avbuffer-info-h

openharmony 鸿蒙 capi-codecbase-oh-avcodecasynccallback

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