From 170934b00eec68d3492264772505a06f22d6649b Mon Sep 17 00:00:00 2001 From: y30025806 Date: Wed, 4 Jun 2025 15:41:36 +0800 Subject: [PATCH 1/2] support auxiliary Signed-off-by: y30025806 --- multimedia/av_codec/native_avcodec_base.h | 28 +++++++++++++++++++ multimedia/media_foundation/native_avformat.h | 15 ++++++++++ 2 files changed, 43 insertions(+) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 705b0d651..f78c1227d 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1063,6 +1063,26 @@ extern const char *OH_MD_KEY_SQR_FACTOR; * @since 20 */ extern const char *OH_MD_KEY_MAX_BITRATE; +/** + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 20 +*/ +extern const char *OH_MD_KEY_REFERENCE_TRACK_IDS; +/** + * @brief Key for describing the track reference type, value type is string. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 20 +*/ +extern const char *OH_MD_KEY_TRACK_REFERENCE_TYPE; +/** + * @brief Key for describing the track description, value type is string. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 20 +*/ +extern const char *OH_MD_KEY_TRACK_DESCRIPTION; /** * @brief Media type. @@ -1079,6 +1099,14 @@ typedef enum OH_MediaType { * @since 12 */ MEDIA_TYPE_SUBTITLE = 2, + /** track is timed meta. + * @since 20 + */ + MEDIA_TYPE_TIMED_METADATA=5, + /** track is auxiliary. + * @since 20 + */ + MEDIA_TYPE_AUXILIARY=6, } OH_MediaType; /** diff --git a/multimedia/media_foundation/native_avformat.h b/multimedia/media_foundation/native_avformat.h index ac30d2d47..deb7f0625 100644 --- a/multimedia/media_foundation/native_avformat.h +++ b/multimedia/media_foundation/native_avformat.h @@ -322,6 +322,21 @@ bool OH_AVFormat_GetBuffer(struct OH_AVFormat *format, const char *key, uint8_t */ const char *OH_AVFormat_DumpInfo(struct OH_AVFormat *format); +/** + * @brief Read a list of int32_t data of specified length from OH_AVFormat. + * + * @syscap SystemCapability.Multimedia.Media.Core + * @param format pointer to an OH_AVFormat instance + * @param key Key value for reading and writing data + * @param addr The life cycle is held by the format, with the destruction of the format, + * if the caller needs to hold it for a long time, it must copy the memory + * @param size Length of read and write data + * @return The return value is TRUE for success, FALSE for failure + * Possible failure causes: 1. input format is nullptr. 2. input format's magic error. 3. key is nullptr. + * 4. addr is nullptr. 5. size is nullptr. + * @since 20 + */ +bool OH_AVFormat_GetIntBuffer(struct OH_AVFormat *format, const char *key, int32_t **addr, size_t *size); #ifdef __cplusplus } #endif -- Gitee From 2033e36493782e4014da174a624d8793639b942c Mon Sep 17 00:00:00 2001 From: y30025806 Date: Mon, 16 Jun 2025 10:48:34 +0800 Subject: [PATCH 2/2] modify interface note Signed-off-by: y30025806 --- multimedia/av_codec/native_avcodec_base.h | 1 + multimedia/media_foundation/native_avformat.h | 23 +++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index f78c1227d..b788175c5 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1064,6 +1064,7 @@ extern const char *OH_MD_KEY_SQR_FACTOR; */ extern const char *OH_MD_KEY_MAX_BITRATE; /** + * @brief Key for describing the reference relationship between tracks, value type is int32_t*. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 20 diff --git a/multimedia/media_foundation/native_avformat.h b/multimedia/media_foundation/native_avformat.h index deb7f0625..98cc98b42 100644 --- a/multimedia/media_foundation/native_avformat.h +++ b/multimedia/media_foundation/native_avformat.h @@ -323,20 +323,29 @@ bool OH_AVFormat_GetBuffer(struct OH_AVFormat *format, const char *key, uint8_t const char *OH_AVFormat_DumpInfo(struct OH_AVFormat *format); /** - * @brief Read a list of int32_t data of specified length from OH_AVFormat. + * @brief Read an array of int32_t values from an OH_AVFormat object. + * + * Note that the obtained buffer's lifetime bound to the OH_AVFormat object, + * it's automatically invalidated when the format object is destroyed.\n + * Applications must explicitly copy the data to newly allocated memory if + * the data needs to outlive the OH_AVFormat instance.\n * * @syscap SystemCapability.Multimedia.Media.Core * @param format pointer to an OH_AVFormat instance - * @param key Key value for reading and writing data - * @param addr The life cycle is held by the format, with the destruction of the format, - * if the caller needs to hold it for a long time, it must copy the memory - * @param size Length of read and write data + * @param key Data identifier key + * @param addr Pointer to receive the data buffer reference + * @param size Pointer to receive the element count * @return The return value is TRUE for success, FALSE for failure - * Possible failure causes: 1. input format is nullptr. 2. input format's magic error. 3. key is nullptr. - * 4. addr is nullptr. 5. size is nullptr. + * Possible failure causes: + * 1. input format is nullptr. + * 2. input format's magic error. + * 3. key is nullptr. + * 4. addr is nullptr. + * 5. size is nullptr. * @since 20 */ bool OH_AVFormat_GetIntBuffer(struct OH_AVFormat *format, const char *key, int32_t **addr, size_t *size); + #ifdef __cplusplus } #endif -- Gitee