harmony 鸿蒙native_avformat.h

2025-06-12 浏览 (1)

native_avformat.h

概述

声明了OH_AVFormat相关的函数和枚举。

库: libnative_media_core.so

系统能力: SystemCapability.Multimedia.Media.Core

起始版本: 9

相关模块:Core

汇总

类型定义

名称描述
typedef struct OH_AVFormat OH_AVFormat为媒体格式接口定义native层对象。
typedef enum OH_AVPixelFormat OH_AVPixelFormat视频像素格式的枚举类。

枚举

名称描述
OH_AVPixelFormat {
AV_PIXEL_FORMAT_YUVI420 = 1,
AV_PIXEL_FORMAT_NV12 = 2,
AV_PIXEL_FORMAT_NV21 = 3,
AV_PIXEL_FORMAT_SURFACE_FORMAT = 4,
AV_PIXEL_FORMAT_RGBA = 5
}
视频像素格式的枚举类。

函数

名称描述
struct OH_AVFormat * OH_AVFormat_Create (void)创建OH_AVFormat实例,用于读写数据。
struct OH_AVFormat * OH_AVFormat_CreateAudioFormat (const char *mimeType, int32_t sampleRate, int32_t channelCount)创建音频OH_AVFormat实例指针并预设置指定参数,用于读写数据。
struct OH_AVFormat * OH_AVFormat_CreateVideoFormat (const char *mimeType, int32_t width, int32_t height)创建视频OH_AVFormat实例指针并预设置指定参数,用于读写数据。
void OH_AVFormat_Destroy (struct OH_AVFormat *format)销毁OH_AVFormat实例。
bool OH_AVFormat_Copy (struct OH_AVFormat *to, struct OH_AVFormat *from)复制OH_AVFormat实例。
bool OH_AVFormat_SetIntValue (struct OH_AVFormat *format, const char *key, int32_t value)对OH_AVFormat的key赋int类型的值。
bool OH_AVFormat_SetLongValue (struct OH_AVFormat *format, const char *key, int64_t value)对OH_AVFormat的key赋long类型的值。
bool OH_AVFormat_SetFloatValue (struct OH_AVFormat *format, const char *key, float value)对OH_AVFormat的key赋float类型的值。
bool OH_AVFormat_SetDoubleValue (struct OH_AVFormat *format, const char *key, double value)对OH_AVFormat的key赋double类型的值。
bool OH_AVFormat_SetStringValue (struct OH_AVFormat *format, const char *key, const char *value)对OH_AVFormat的key赋string类型的值。
bool OH_AVFormat_SetBuffer (struct OH_AVFormat *format, const char *key, const uint8_t *addr, size_t size)将指定长度的数据块写入OH_AVFormat。
bool OH_AVFormat_GetIntValue (struct OH_AVFormat *format, const char *key, int32_t *out)从OH_AVFormat的key获取int类型的值。
bool OH_AVFormat_GetLongValue (struct OH_AVFormat *format, const char *key, int64_t *out)从OH_AVFormat的key获取long类型的值。
bool OH_AVFormat_GetFloatValue (struct OH_AVFormat *format, const char *key, float *out)从OH_AVFormat的key获取float类型的值。
bool OH_AVFormat_GetDoubleValue (struct OH_AVFormat *format, const char *key, double *out)从OH_AVFormat的key获取double类型的值。
bool OH_AVFormat_GetStringValue (struct OH_AVFormat *format, const char *key, const char **out)从OH_AVFormat的key获取string类型的值。
bool OH_AVFormat_GetBuffer (struct OH_AVFormat *format, const char *key, uint8_t **addr, size_t *size)从OH_AVFormat中读取指定长度的数据块。
const char * OH_AVFormat_DumpInfo (struct OH_AVFormat *format)返回OH_AVFormat中包含的key-value组成的字符串。

你可能感兴趣的鸿蒙文章

harmony 鸿蒙AVCodec Kit(音视频编解码服务)

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVSource

harmony 鸿蒙AudioCodec

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙CodecBase

harmony 鸿蒙Core

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