From 0c60bec578a38fc96369b03566e01fd6b6016931 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Wed, 20 Mar 2024 11:51:28 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20AVCodec=E6=96=B0=E5=A2=9EAPI12=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- .../libnative_media_codecbase.ndk.json | 76 ++++++++ multimedia/av_codec/native_avcapability.h | 36 ++++ multimedia/av_codec/native_avcodec_base.h | 163 ++++++++++++++++++ .../av_codec/native_avcodec_videoencoder.h | 39 +++++ .../libnative_media_venc.ndk.json | 8 + .../media_foundation/native_avbuffer_info.h | 20 ++- 6 files changed, 337 insertions(+), 5 deletions(-) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index a15497419..3d186198e 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -59,6 +59,10 @@ "first_introduced": "11", "name": "OH_AVCODEC_MIMETYPE_AUDIO_G711MU" }, + { + "first_introduced": "12", + "name": "OH_AVCODEC_MIMETYPE_VIDEO_VVC" + }, { "first_introduced": "9", "name": "OH_ED_KEY_TIME_STAMP" @@ -263,6 +267,78 @@ "first_introduced": "11", "name": "OH_MD_KEY_AUDIO_VIVID_METADATA" }, + { + "first_introduced": "12", + "name": "OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_NUM" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_LEVEL_SCALE" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_NUM" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_PER_FRAME_POC" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_CROP_TOP" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_CROP_BOTTOM" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_CROP_LEFT" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_CROP_RIGHT" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_STRIDE" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_SLICE_HEIGHT" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENCODER_QP_MAX" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENCODER_QP_MIN" + }, { "first_introduced": "10", "name": "OH_AVCodec_GetCapability" diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 043678aab..caff3d290 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -18,6 +18,7 @@ #include #include "native_averrors.h" +#include "native_avformat.h" #ifdef __cplusplus extern "C" { @@ -59,6 +60,20 @@ typedef enum OH_AVCodecCategory { SOFTWARE } OH_AVCodecCategory; +/** + * @brief The enum of optional features that can be used in specific codec seenarios. + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +typedef enum OH_AVCapabilityFeature { + /** Feature for codec supports temporal level scale. It is only used in video encoder. */ + VIDEO_ENCODER_TEMPORAL_LEVEL_SCALE = 0, + /** Feature for codec supports long-term reference. It is only used in video encoder. */ + VIDEO_ENCODER_LONG_TERM_REFERENCE = 1, + /** Feature for codec supports low latency. It is used in video encoder and video decoder. */ + VIDEO_LOW_LATENCY = 2, +} OH_AVCapabilityFeature; + /** * @brief Get a system-recommended codec's capability. * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -350,6 +365,27 @@ OH_AVErrCode OH_AVCapability_GetSupportedLevelsForProfile(OH_AVCapability *capab */ bool OH_AVCapability_AreProfileAndLevelSupported(OH_AVCapability *capability, int32_t profile, int32_t level); +/** + * @brief Check if the codec supports the specified feature. + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @param capability Codec capability pointer + * @param feature Feature enum, refer to {@link OH_AVCapabilityFeature} for details + * @return Returns true if the feature is supported, false if it is not supported + * @since 12 + */ +bool OH_AVCapability_IsFeatureSupported(OH_AVCapability *capability, OH_AVCapabilityFeature feature); + +/** + * @brief Get the properties of the specified feature. It should be noted that the life cycle of the OH_AVFormat + * instance pointed to by the return value * needs to be manually released by the caller. + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @param capability Codec capability pointer + * @param feature Feature enum, refer to {@link OH_AVCapabilityFeature} for details + * @return Returns a pointer to an OH_AVFormat instance + * @since 12 + */ +OH_AVFormat *OH_AVCapability_GetFeatureProperties(OH_AVCapability *capability, OH_AVCapabilityFeature feature); + #ifdef __cplusplus } #endif diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index b26dc2454..42d1152aa 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -197,6 +197,13 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; +/** + * @brief Enumerates the MIME types of audio and video codecs + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC; + /** * @brief The extra data's key of surface Buffer * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -326,6 +333,105 @@ extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER; /* Key for meta data of audio vivid. value type is a uint8_t pointer */ extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA; +/** + * @brief Provides the uniform key for storing the feature preporty. + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +/** Key for querying the maximum long-term reference number of video encoder, value type is int32_t. + * You should query the number through interface {@link OH_AVCapability_GetFeatureProperties} + * with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}. + */ +extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_NUM; + +/** + * @brief Provides the uniform key for storing the media description. + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +/** Key for enable the temporal level scale mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. + * The default value is 0. To query supported, you should use the interface {@link OH_AVCapability_IsFeatureSupported} + * with enum {@link VIDEO_ENCODER_TEMPORAL_LEVEL_SCALE}. This is an optional key that applies only to video encoder. + * It is used in configure. + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_LEVEL_SCALE; +/** Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when temporal + * level scale is enable. This is an optional key that applies only to video encoder. It is used in configure. + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE; +/** Key for describing the reference mode in temporal group of picture, value type is int32_t, see enum + * {@link OH_TemporalGopReferenceMode}. It takes effect only when temporal level sacle is enabled. + * This is an optional key that applies only to video encoder. It is used in configure. + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE; +/** Key for describing the number of used long-term reference frames, value type is int32_t, must be within the + * supported range. To get supported range, you should query wthether the capability is supported through the interface + * {@link OH_AVCapability_GetFeatureProperties} with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}, otherwise, not set + * the key. This is an optional key that applies only to video encoder. It is used in configure. + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_NUM; +/** Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark, 0 + * otherwise. It takes effect only when the number of used long term reference frames is configured. + * This is an optional key that applies only to video encoder input loop. It takes effect immediately. + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR; +/** Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is an + * optional key that applies only to video encoder input loop. It takes effect immediately. + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR; +/** Key for indicating this frame is a long-term reference frame, value type is int32_t (0 or 1): 1 is LTR, + * 0 otherwise. This is an optional key that applies only to video encoder output loop. + * It indicates the attribute of the frame. + */ +extern const char *OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR; +/** Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video encoder + * output loop. It indicates the attribute of the frame. + */ +extern const char *OH_MD_KEY_VIDEO_PER_FRAME_POC; +/** Key for describing the top-coordinate (y) of the crop rectangle, value type is int32_t. This is the top-most + * row included in the crop frame, where row indices start at 0. + */ +extern const char *OH_MD_KEY_VIDEO_CROP_TOP; +/** Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the bottom-most + * row included in the crop frame, where row indices start at 0. + */ +extern const char *OH_MD_KEY_VIDEO_CROP_BOTTOM; +/** Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t. This is the left-most + * column included in the crop frame, where column indices start at 0. + */ +extern const char *OH_MD_KEY_VIDEO_CROP_LEFT; +/** Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the right-most + * column included in the crop frame, where column indices start at 0. + */ +extern const char *OH_MD_KEY_VIDEO_CROP_RIGHT; +/** Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is the + * difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the stride + * corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format, though it + * is generally undefined and depends on the device and release. + */ +extern const char *OH_MD_KEY_VIDEO_STRIDE; +/** Key for describing the plane height of a multi-planar (YUV) video buffer layout, value type is int32_t. + * Slice height (or plane height/vertical stride) is the number of rows that must be skipped to get from + * the top of the Y plane to the top of the U plane in the buffer. In essence the offset of the U plane + * is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format, + * though it is generally undefined and depends on the device and release. + */ +extern const char *OH_MD_KEY_VIDEO_SLICE_HEIGHT; +/** Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise. + * If enabled, the video encoder or video decoder doesn't hold input and output data more than required by + * the codec standards. This is an optional key that applies only to video encoder or video decoder. + * It is used in configure. + */ +extern const char *OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY; +/** Key for describing the maximum Quantization Parameter allowed for video encoder, value type is int32_t. + * It is used in configure or takes effect immediately with the frame. + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; +/** Key for describing the minimum Quantization Parameter allowed for video encoder, value type is int32_t. + * It is used in configure or takes effect immediately with the frame. + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; + /** * @brief Media type. * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -494,6 +600,63 @@ typedef enum OH_MatrixCoefficient { MATRIX_COEFFICIENT_ICTCP = 14, } OH_MatrixCoefficient; +/** + * @brief AVC Level. + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +typedef enum OH_AVCLevel { + AVC_LEVEL_1 = 0, + AVC_LEVEL_1b = 1, + AVC_LEVEL_11 = 2, + AVC_LEVEL_12 = 3, + AVC_LEVEL_13 = 4, + AVC_LEVEL_2 = 5, + AVC_LEVEL_21 = 6, + AVC_LEVEL_22 = 7, + AVC_LEVEL_3 = 8, + AVC_LEVEL_31 = 9, + AVC_LEVEL_32 = 10, + AVC_LEVEL_4 = 11, + AVC_LEVEL_41 = 12, + AVC_LEVEL_42 = 13, + AVC_LEVEL_5 = 14, + AVC_LEVEL_51 = 15, +} OH_AVCLevel; + +/** + * @brief HEVC Level. + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +typedef enum OH_HEVCLevel { + HEVC_LEVEL_1 = 0, + HEVC_LEVEL_2 = 1, + HEVC_LEVEL_21 = 2, + HEVC_LEVEL_3 = 3, + HEVC_LEVEL_31 = 4, + HEVC_LEVEL_4 = 5, + HEVC_LEVEL_41 = 6, + HEVC_LEVEL_5 = 7, + HEVC_LEVEL_51 = 8, + HEVC_LEVEL_52 = 9, + HEVC_LEVEL_6 = 10, + HEVC_LEVEL_61 = 11, + HEVC_LEVEL_62 = 12, +} OH_HEVCLevel; + +/** + * @brief The reference mode in temporal group of picture. + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +typedef enum OH_TemporalGopReferenceMode { + /** Refer to latest short-term reference frame. */ + ADJACENT_REFERENCE_MODE = 0, + /** Refer to latest long-term reference frame. */ + JUMP_REFERENCE_MODE = 1, +} OH_TemporalGopReferenceMode; + #ifdef __cplusplus } #endif diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index fa0abea85..25e7d4cbc 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -24,6 +24,19 @@ extern "C" { #endif +/** + * @brief When OH_AVCodec needs new input parameter during the running process, + * the function pointer will be called and carry an available OH_AVFormat to fill in the new input parameter. + * @syscap SystemCapability.Multimedia.Media.VideoEncoder + * @param codec OH_AVCodec instance + * @param index The index corresponding to the new OH_AVFormat instance + * @param parameter Parameter containing the new OH_AVFormat instance + * @param userData specified data + * @since 12 + */ +typedef void (*OH_VideoEncoder_OnNeedInputParameter)(OH_AVCodec *codec, uint32_t index, OH_AVFormat *parameter, + void *userData); + /** * @brief Creates a video encoder instance from the mime type, which is recommended in most cases. * @syscap SystemCapability.Multimedia.Media.VideoEncoder @@ -85,6 +98,21 @@ OH_AVErrCode OH_VideoEncoder_SetCallback(OH_AVCodec *codec, OH_AVCodecAsyncCallb */ OH_AVErrCode OH_VideoEncoder_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallback callback, void *userData); +/** + * @brief Set the asynchronous callback function so that your application can respond to the events generated by the + * video encoder. This interface is optional only for input surface. If this interface is used, it must be invoked + * before {@link OH_VideoEncoder_Configure}. + * @param codec Pointer to an OH_AVCodec instance + * @param onInputParameter A callback functions, see {@link OH_VideoEncoder_OnNeedInputParameter} + * @param userData User specific data + * @return Returns AV_ERR_OK if the execution is successful, otherwise returns a specific error code, refer to {@link + * OH_AVErrCode} + * @since 12 + */ +OH_AVErrCode OH_VideoEncoder_RegisterParameterCallback(OH_AVCodec *codec, + OH_VideoEncoder_OnNeedInputParameter onInputParameter, + void *userData); + /** * @brief To configure the video encoder, typically, you need to configure the description information of the * encoded video track. This interface must be called before Prepare is called. @@ -247,6 +275,17 @@ OH_AVErrCode OH_VideoEncoder_PushInputData(OH_AVCodec *codec, uint32_t index, OH */ OH_AVErrCode OH_VideoEncoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index); +/** + * @brief Submit the input parameter filled with data to the video encoder. + * @syscap SystemCapability.Multimedia.Media.VideoEncoder + * @param codec Pointer to an OH_AVCodec instance + * @param index Enter the index value corresponding to the input parameter + * @return Returns AV_ERR_OK if the execution is successful, + * otherwise returns a specific error code, refer to {@link OH_AVErrCode} + * @since 12 + */ +OH_AVErrCode OH_VideoEncoder_PushInputParameter(OH_AVCodec *codec, uint32_t index); + /** * @brief Return the processed output Buffer to the encoder. * @syscap SystemCapability.Multimedia.Media.VideoEncoder diff --git a/multimedia/av_codec/video_encoder/libnative_media_venc.ndk.json b/multimedia/av_codec/video_encoder/libnative_media_venc.ndk.json index 412adb923..0f61de3ea 100644 --- a/multimedia/av_codec/video_encoder/libnative_media_venc.ndk.json +++ b/multimedia/av_codec/video_encoder/libnative_media_venc.ndk.json @@ -82,5 +82,13 @@ { "first_introduced": "11", "name": "OH_VideoEncoder_FreeOutputBuffer" + }, + { + "first_introduced": "12", + "name": "OH_VideoEncoder_RegisterParameterCallback" + }, + { + "first_introduced": "12", + "name": "OH_VideoEncoder_PushInputParameter" } ] diff --git a/multimedia/media_foundation/native_avbuffer_info.h b/multimedia/media_foundation/native_avbuffer_info.h index 78ec7c3e8..0a67bfbce 100644 --- a/multimedia/media_foundation/native_avbuffer_info.h +++ b/multimedia/media_foundation/native_avbuffer_info.h @@ -23,20 +23,30 @@ extern "C" { #endif /** - * @brief Enumerate the categories of OH_AVCodec's Buffer tags + * @brief Enumerate the categories of OH_AVCodec's Buffer tags. * @syscap SystemCapability.Multimedia.Media.Core * @since 9 */ typedef enum OH_AVCodecBufferFlags { AVCODEC_BUFFER_FLAGS_NONE = 0, - /* Indicates that the Buffer is an End-of-Stream frame */ + /** Indicates that the Buffer is an End-of-Stream frame. */ AVCODEC_BUFFER_FLAGS_EOS = 1 << 0, - /* Indicates that the Buffer contains keyframes */ + /** Indicates that the Buffer contains keyframes. */ AVCODEC_BUFFER_FLAGS_SYNC_FRAME = 1 << 1, - /* Indicates that the data contained in the Buffer is only part of a frame */ + /** Indicates that the data contained in the Buffer is only part of a frame. */ AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME = 1 << 2, - /* Indicates that the Buffer contains Codec-Specific-Data */ + /** Indicates that the Buffer contains Codec-Specific-Data. */ AVCODEC_BUFFER_FLAGS_CODEC_DATA = 1 << 3, + /** Flag is used to discard packets which are required to maintain valid decoder state but are not required + * for output and should be dropped after decoding. + * @since 12 + */ + AVCODEC_BUFFER_FLAG_DISCRAD = 1 << 4, + /** Flag is used to indicate packets that contain frames that can be discarded by the decoder, + * I.e. Non-reference frames. + * @since 12 + */ + AVCODEC_BUFFER_FLAG_DISPOSABLE = 1 << 5, } OH_AVCodecBufferFlags; /** -- Gitee From 2f8664dc1a69d626a6461f02a146f41cc9025e23 Mon Sep 17 00:00:00 2001 From: peng Date: Fri, 22 Mar 2024 16:23:37 +0800 Subject: [PATCH 02/16] add audio codec & muxer api12 NDK Signed-off-by: peng --- .../codec_base/libnative_media_codecbase.ndk.json | 8 ++++++++ multimedia/av_codec/native_avcodec_base.h | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index 3d186198e..a29ac53bf 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -59,6 +59,14 @@ "first_introduced": "11", "name": "OH_AVCODEC_MIMETYPE_AUDIO_G711MU" }, + { + "first_introduced": "12", + "name": "OH_AVCODEC_MIMETYPE_AUDIO_LBVC" + }, + { + "first_introduced": "12", + "name": "OH_AVCODEC_MIMETYPE_AUDIO_APE" + }, { "first_introduced": "12", "name": "OH_AVCODEC_MIMETYPE_VIDEO_VVC" diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 42d1152aa..e9de61797 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -202,6 +202,8 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ +extern const char *OH_AVCODEC_MIMETYPE_AUDIO_LBVC; +extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE; extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC; /** @@ -489,6 +491,18 @@ typedef enum OH_AVOutputFormat { AV_OUTPUT_FORMAT_DEFAULT = 0, AV_OUTPUT_FORMAT_MPEG_4 = 2, AV_OUTPUT_FORMAT_M4A = 6, + /** The muxer output amr file format. + * @since 12 + */ + AV_OUTPUT_FORMAT_AMR = 8, + /** The muxer output mp3 file format. + * @since 12 + */ + AV_OUTPUT_FORMAT_MP3 = 9, + /** The muxer output wav file format. + * @since 12 + */ + AV_OUTPUT_FORMAT_WAV = 10, } OH_AVOutputFormat; /** -- Gitee From 07cb8328e73b39b518281b328c9d8929aad08b3d Mon Sep 17 00:00:00 2001 From: yangjunhui10 Date: Mon, 25 Mar 2024 06:52:46 +0000 Subject: [PATCH 03/16] =?UTF-8?q?=E8=A7=A3=E5=B0=81=E8=A3=85=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangjunhui10 --- multimedia/av_codec/native_avcodec_base.h | 11 ++++++++++- multimedia/media_foundation/native_avbuffer_info.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index e9de61797..1955ff9d6 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -198,13 +198,14 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; /** - * @brief Enumerates the MIME types of audio and video codecs + * @brief Enumerates the MIME types of audio, video and subtitle codecs * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_LBVC; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE; extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC; +extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_SRT; /** * @brief The extra data's key of surface Buffer @@ -433,6 +434,14 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; * It is used in configure or takes effect immediately with the frame. */ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; +/* Key for decoding timestamp of the buffer in microseconds, value type is int64_t. */ +extern const char *OH_MD_KEY_DECODING_TIMESTAMP; +/* Key for duration of the buffer in microseconds, value type is uint64_t. */ +extern const char *OH_MD_KEY_BUFFER_DURATION; +/* Key for sample aspect ratio, value type is double. */ +extern const char *OH_MD_KEY_VIDEO_SAR; +/* Key for start time of file, value type is int64_t. */ +extern const char *OH_MD_KEY_START_TIME; /** * @brief Media type. diff --git a/multimedia/media_foundation/native_avbuffer_info.h b/multimedia/media_foundation/native_avbuffer_info.h index 0a67bfbce..b6016e093 100644 --- a/multimedia/media_foundation/native_avbuffer_info.h +++ b/multimedia/media_foundation/native_avbuffer_info.h @@ -41,7 +41,7 @@ typedef enum OH_AVCodecBufferFlags { * for output and should be dropped after decoding. * @since 12 */ - AVCODEC_BUFFER_FLAG_DISCRAD = 1 << 4, + AVCODEC_BUFFER_FLAG_DISCARD = 1 << 4, /** Flag is used to indicate packets that contain frames that can be discarded by the decoder, * I.e. Non-reference frames. * @since 12 -- Gitee From 97f02bd0a6201d29f1c10a1e92d765b455eb3f7b Mon Sep 17 00:00:00 2001 From: yangjunhui10 Date: Mon, 25 Mar 2024 07:21:31 +0000 Subject: [PATCH 04/16] =?UTF-8?q?=E8=A7=A3=E5=B0=81=E8=A3=85=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangjunhui10 --- multimedia/av_codec/native_avcodec_base.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 1955ff9d6..477fd5857 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -198,13 +198,19 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; /** - * @brief Enumerates the MIME types of audio, video and subtitle codecs + * @brief Enumerates the MIME types of audio and video codecs * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_LBVC; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE; extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC; + +/** + * @brief Enumerates the MIME types of subtitle + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_SRT; /** -- Gitee From df3314ac57873cd4017906f7787bd955823791de Mon Sep 17 00:00:00 2001 From: yangjunhui10 Date: Mon, 25 Mar 2024 08:57:39 +0000 Subject: [PATCH 05/16] =?UTF-8?q?=E8=A7=A3=E5=B0=81=E8=A3=85=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangjunhui10 --- multimedia/av_codec/native_avcodec_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 477fd5857..c0ce36c71 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -442,7 +442,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; /* Key for decoding timestamp of the buffer in microseconds, value type is int64_t. */ extern const char *OH_MD_KEY_DECODING_TIMESTAMP; -/* Key for duration of the buffer in microseconds, value type is uint64_t. */ +/* Key for duration of the buffer in microseconds, value type is int64_t. */ extern const char *OH_MD_KEY_BUFFER_DURATION; /* Key for sample aspect ratio, value type is double. */ extern const char *OH_MD_KEY_VIDEO_SAR; -- Gitee From 0820368ac55ca23237b107babb5c7b89e9836c06 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Mon, 25 Mar 2024 19:36:38 +0800 Subject: [PATCH 06/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_base.h | 24 +++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index c0ce36c71..c81cea9cd 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -198,16 +198,28 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; /** - * @brief Enumerates the MIME types of audio and video codecs + * @brief Enumerates the MIME type of audio low bitrate voice codec * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_LBVC; + +/** + * @brief Enumerates the MIME type of audio ape codec + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE; + +/** + * @brief Enumerates the MIME type of versatile video coding + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC; /** - * @brief Enumerates the MIME types of subtitle + * @brief Enumerates the MIME type of subtitle * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -440,13 +452,13 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; * It is used in configure or takes effect immediately with the frame. */ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; -/* Key for decoding timestamp of the buffer in microseconds, value type is int64_t. */ +/** Key for decoding timestamp of the buffer in microseconds, value type is int64_t. */ extern const char *OH_MD_KEY_DECODING_TIMESTAMP; -/* Key for duration of the buffer in microseconds, value type is int64_t. */ +/** Key for duration of the buffer in microseconds, value type is int64_t. */ extern const char *OH_MD_KEY_BUFFER_DURATION; -/* Key for sample aspect ratio, value type is double. */ +/** Key for sample aspect ratio, value type is double. */ extern const char *OH_MD_KEY_VIDEO_SAR; -/* Key for start time of file, value type is int64_t. */ +/** Key for start time of file, value type is int64_t. */ extern const char *OH_MD_KEY_START_TIME; /** -- Gitee From becc73600da3ef18bee7fce3d9c4a5fdcf038930 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Mon, 25 Mar 2024 21:51:55 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcapability.h | 3 +++ multimedia/av_codec/native_avcodec_base.h | 17 +++++++++++++---- .../av_codec/native_avcodec_videoencoder.h | 4 ++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index caff3d290..81abe53a3 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -62,6 +62,7 @@ typedef enum OH_AVCodecCategory { /** * @brief The enum of optional features that can be used in specific codec seenarios. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -367,6 +368,7 @@ bool OH_AVCapability_AreProfileAndLevelSupported(OH_AVCapability *capability, in /** * @brief Check if the codec supports the specified feature. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @param capability Codec capability pointer * @param feature Feature enum, refer to {@link OH_AVCapabilityFeature} for details @@ -378,6 +380,7 @@ bool OH_AVCapability_IsFeatureSupported(OH_AVCapability *capability, OH_AVCapabi /** * @brief Get the properties of the specified feature. It should be noted that the life cycle of the OH_AVFormat * instance pointed to by the return value * needs to be manually released by the caller. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @param capability Codec capability pointer * @param feature Feature enum, refer to {@link OH_AVCapabilityFeature} for details diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index c81cea9cd..cd7e7c2de 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -198,28 +198,32 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; /** - * @brief Enumerates the MIME type of audio low bitrate voice codec + * @brief Enumerates the MIME type of audio low bitrate voice codec. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_LBVC; /** - * @brief Enumerates the MIME type of audio ape codec + * @brief Enumerates the MIME type of audio ape codec. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE; /** - * @brief Enumerates the MIME type of versatile video coding + * @brief Enumerates the MIME type of versatile video coding. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC; /** - * @brief Enumerates the MIME type of subtitle + * @brief Enumerates the MIME type of subtitle. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -356,6 +360,7 @@ extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA; /** * @brief Provides the uniform key for storing the feature preporty. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -367,6 +372,7 @@ extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_NUM; /** * @brief Provides the uniform key for storing the media description. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -643,6 +649,7 @@ typedef enum OH_MatrixCoefficient { /** * @brief AVC Level. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -667,6 +674,7 @@ typedef enum OH_AVCLevel { /** * @brief HEVC Level. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -688,6 +696,7 @@ typedef enum OH_HEVCLevel { /** * @brief The reference mode in temporal group of picture. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index 25e7d4cbc..cc7381a00 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -27,6 +27,7 @@ extern "C" { /** * @brief When OH_AVCodec needs new input parameter during the running process, * the function pointer will be called and carry an available OH_AVFormat to fill in the new input parameter. + * * @syscap SystemCapability.Multimedia.Media.VideoEncoder * @param codec OH_AVCodec instance * @param index The index corresponding to the new OH_AVFormat instance @@ -102,6 +103,8 @@ OH_AVErrCode OH_VideoEncoder_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallb * @brief Set the asynchronous callback function so that your application can respond to the events generated by the * video encoder. This interface is optional only for input surface. If this interface is used, it must be invoked * before {@link OH_VideoEncoder_Configure}. + * + * @syscap SystemCapability.Multimedia.Media.VideoEncoder * @param codec Pointer to an OH_AVCodec instance * @param onInputParameter A callback functions, see {@link OH_VideoEncoder_OnNeedInputParameter} * @param userData User specific data @@ -277,6 +280,7 @@ OH_AVErrCode OH_VideoEncoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index); /** * @brief Submit the input parameter filled with data to the video encoder. + * * @syscap SystemCapability.Multimedia.Media.VideoEncoder * @param codec Pointer to an OH_AVCodec instance * @param index Enter the index value corresponding to the input parameter -- Gitee From 41374ca0a54a367ee3b6944b203674194644d5af Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Tue, 26 Mar 2024 09:36:07 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_videoencoder.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index cc7381a00..f7340cc4e 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -25,9 +25,10 @@ extern "C" { #endif /** - * @brief When OH_AVCodec needs new input parameter during the running process, - * the function pointer will be called and carry an available OH_AVFormat to fill in the new input parameter. - * + * @brief When OH_AVCodec needs new input parameter during the running process, the function pointer will be called and + * carry an available OH_AVFormat to fill in the new input parameter. This parameter takes effect immediately with the + * frame. + * * @syscap SystemCapability.Multimedia.Media.VideoEncoder * @param codec OH_AVCodec instance * @param index The index corresponding to the new OH_AVFormat instance -- Gitee From d3ee37efc5eee46b22fd2c09f60fca7004d4e976 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Tue, 26 Mar 2024 10:29:36 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20OH=5FAVCodecBufferFlags=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/media_foundation/native_avbuffer_info.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/media_foundation/native_avbuffer_info.h b/multimedia/media_foundation/native_avbuffer_info.h index b6016e093..bc57f8e1e 100644 --- a/multimedia/media_foundation/native_avbuffer_info.h +++ b/multimedia/media_foundation/native_avbuffer_info.h @@ -41,12 +41,12 @@ typedef enum OH_AVCodecBufferFlags { * for output and should be dropped after decoding. * @since 12 */ - AVCODEC_BUFFER_FLAG_DISCARD = 1 << 4, + AVCODEC_BUFFER_FLAGS_DISCARD = 1 << 4, /** Flag is used to indicate packets that contain frames that can be discarded by the decoder, * I.e. Non-reference frames. * @since 12 */ - AVCODEC_BUFFER_FLAG_DISPOSABLE = 1 << 5, + AVCODEC_BUFFER_FLAGS_DISPOSABLE = 1 << 5, } OH_AVCodecBufferFlags; /** -- Gitee From ea3040b97d024c1121babd33a7b30e09344f0066 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Tue, 26 Mar 2024 11:38:43 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_base.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index cd7e7c2de..25bebcea9 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -274,7 +274,9 @@ extern const char *OH_MD_KEY_PROFILE; extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT; /* Key for audio sample rate, value type is uint32_t */ extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; -/* Key for the interval of key frame. value type is int32_t, the unit is milliseconds. */ +/** Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no key + * frames are requested after the first frame. A zero value means a stream containing all key frames is requested. + */ extern const char *OH_MD_KEY_I_FRAME_INTERVAL; /* Key of the surface rotation angle. value type is int32_t: should be {0, 90, 180, 270}, default is 0. */ extern const char *OH_MD_KEY_ROTATION; -- Gitee From 711c4da8dc54e3c03b92ff86e61e859ebc6bacd1 Mon Sep 17 00:00:00 2001 From: yangjunhui10 Date: Tue, 26 Mar 2024 03:46:28 +0000 Subject: [PATCH 11/16] =?UTF-8?q?=E8=A7=A3=E5=B0=81=E8=A3=85=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangjunhui10 --- .../libnative_media_codecbase.ndk.json | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index a29ac53bf..c0f9aeb21 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -71,6 +71,10 @@ "first_introduced": "12", "name": "OH_AVCODEC_MIMETYPE_VIDEO_VVC" }, + { + "first_introduced": "12", + "name": "OH_AVCODEC_MIMETYPE_SUBTITLE_SRT" + }, { "first_introduced": "9", "name": "OH_ED_KEY_TIME_STAMP" @@ -347,6 +351,22 @@ "first_introduced": "12", "name": "OH_MD_KEY_VIDEO_ENCODER_QP_MIN" }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_DECODING_TIMESTAMP" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_BUFFER_DURATION" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_SAR" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_START_TIME" + }, { "first_introduced": "10", "name": "OH_AVCodec_GetCapability" -- Gitee From fc9190fc7638a4f6c747622754208e5c5708c04d Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Tue, 26 Mar 2024 19:37:01 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_base.h | 149 +++++++++++++++++----- 1 file changed, 116 insertions(+), 33 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 25bebcea9..559698a2b 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -274,8 +274,12 @@ extern const char *OH_MD_KEY_PROFILE; extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT; /* Key for audio sample rate, value type is uint32_t */ extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; -/** Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no key +/** + * @brief Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no key * frames are requested after the first frame. A zero value means a stream containing all key frames is requested. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 9 */ extern const char *OH_MD_KEY_I_FRAME_INTERVAL; /* Key of the surface rotation angle. value type is int32_t: should be {0, 90, 180, 270}, default is 0. */ @@ -361,112 +365,191 @@ extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER; extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA; /** - * @brief Provides the uniform key for storing the feature preporty. - * - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 12 - */ -/** Key for querying the maximum long-term reference number of video encoder, value type is int32_t. + * @brief Key for querying the maximum long-term reference number of video encoder, value type is int32_t. * You should query the number through interface {@link OH_AVCapability_GetFeatureProperties} * with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}. - */ -extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_NUM; - -/** - * @brief Provides the uniform key for storing the media description. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ -/** Key for enable the temporal level scale mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. +extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_NUM; +/** + * @brief Key for enable the temporal level scale mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. * The default value is 0. To query supported, you should use the interface {@link OH_AVCapability_IsFeatureSupported} * with enum {@link VIDEO_ENCODER_TEMPORAL_LEVEL_SCALE}. This is an optional key that applies only to video encoder. * It is used in configure. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_LEVEL_SCALE; -/** Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when temporal +/** + * @brief Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when temporal * level scale is enable. This is an optional key that applies only to video encoder. It is used in configure. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE; -/** Key for describing the reference mode in temporal group of picture, value type is int32_t, see enum +/** + * @brief Key for describing the reference mode in temporal group of picture, value type is int32_t, see enum * {@link OH_TemporalGopReferenceMode}. It takes effect only when temporal level sacle is enabled. * This is an optional key that applies only to video encoder. It is used in configure. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE; -/** Key for describing the number of used long-term reference frames, value type is int32_t, must be within the +/** + * @brief Key for describing the number of used long-term reference frames, value type is int32_t, must be within the * supported range. To get supported range, you should query wthether the capability is supported through the interface * {@link OH_AVCapability_GetFeatureProperties} with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}, otherwise, not set * the key. This is an optional key that applies only to video encoder. It is used in configure. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_NUM; -/** Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark, 0 +/** + * @brief Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark, 0 * otherwise. It takes effect only when the number of used long term reference frames is configured. * This is an optional key that applies only to video encoder input loop. It takes effect immediately. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR; -/** Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is an +/** + * @brief Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is an * optional key that applies only to video encoder input loop. It takes effect immediately. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR; -/** Key for indicating this frame is a long-term reference frame, value type is int32_t (0 or 1): 1 is LTR, +/** + * @brief Key for indicating this frame is a long-term reference frame, value type is int32_t (0 or 1): 1 is LTR, * 0 otherwise. This is an optional key that applies only to video encoder output loop. * It indicates the attribute of the frame. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR; -/** Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video encoder +/** + * @brief Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video encoder * output loop. It indicates the attribute of the frame. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_PER_FRAME_POC; -/** Key for describing the top-coordinate (y) of the crop rectangle, value type is int32_t. This is the top-most +/** + * @brief Key for describing the top-coordinate (y) of the crop rectangle, value type is int32_t. This is the top-most * row included in the crop frame, where row indices start at 0. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_CROP_TOP; -/** Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the bottom-most +/** + * @brief Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the bottom-most * row included in the crop frame, where row indices start at 0. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_CROP_BOTTOM; -/** Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t. This is the left-most +/** + * @brief Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t. This is the left-most * column included in the crop frame, where column indices start at 0. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_CROP_LEFT; -/** Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the right-most +/** + * @brief Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the right-most * column included in the crop frame, where column indices start at 0. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_CROP_RIGHT; -/** Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is the +/** + * @brief Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is the * difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the stride * corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format, though it * is generally undefined and depends on the device and release. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_STRIDE; -/** Key for describing the plane height of a multi-planar (YUV) video buffer layout, value type is int32_t. +/** + * @brief Key for describing the plane height of a multi-planar (YUV) video buffer layout, value type is int32_t. * Slice height (or plane height/vertical stride) is the number of rows that must be skipped to get from * the top of the Y plane to the top of the U plane in the buffer. In essence the offset of the U plane * is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format, * though it is generally undefined and depends on the device and release. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_SLICE_HEIGHT; -/** Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise. +/** + * @brief Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise. * If enabled, the video encoder or video decoder doesn't hold input and output data more than required by * the codec standards. This is an optional key that applies only to video encoder or video decoder. * It is used in configure. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY; -/** Key for describing the maximum Quantization Parameter allowed for video encoder, value type is int32_t. +/** + * @brief Key for describing the maximum Quantization Parameter allowed for video encoder, value type is int32_t. * It is used in configure or takes effect immediately with the frame. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; -/** Key for describing the minimum Quantization Parameter allowed for video encoder, value type is int32_t. +/** + * @brief Key for describing the minimum Quantization Parameter allowed for video encoder, value type is int32_t. * It is used in configure or takes effect immediately with the frame. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; -/** Key for decoding timestamp of the buffer in microseconds, value type is int64_t. */ +/** + * @brief Key for decoding timestamp of the buffer in microseconds, value type is int64_t. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ extern const char *OH_MD_KEY_DECODING_TIMESTAMP; -/** Key for duration of the buffer in microseconds, value type is int64_t. */ +/** + * @brief Key for duration of the buffer in microseconds, value type is int64_t. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ extern const char *OH_MD_KEY_BUFFER_DURATION; -/** Key for sample aspect ratio, value type is double. */ +/** + * @brief Key for sample aspect ratio, value type is double. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ extern const char *OH_MD_KEY_VIDEO_SAR; -/** Key for start time of file, value type is int64_t. */ +/** + * @brief Key for start time of file, value type is int64_t. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ extern const char *OH_MD_KEY_START_TIME; /** -- Gitee From 8d994fcb4deac027f36363676a2ce2ecf9965baf Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Wed, 27 Mar 2024 16:25:04 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=20=E6=A0=B9=E6=8D=AE=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E6=84=8F=E8=A7=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- .../libnative_media_codecbase.ndk.json | 6 ++--- multimedia/av_codec/native_avcapability.h | 4 ++-- multimedia/av_codec/native_avcodec_base.h | 22 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index c0f9aeb21..08eed9b38 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -281,11 +281,11 @@ }, { "first_introduced": "12", - "name": "OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_NUM" + "name": "OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT" }, { "first_introduced": "12", - "name": "OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_LEVEL_SCALE" + "name": "OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY" }, { "first_introduced": "12", @@ -297,7 +297,7 @@ }, { "first_introduced": "12", - "name": "OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_NUM" + "name": "OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT" }, { "first_introduced": "12", diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 81abe53a3..6060424ae 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -67,8 +67,8 @@ typedef enum OH_AVCodecCategory { * @since 12 */ typedef enum OH_AVCapabilityFeature { - /** Feature for codec supports temporal level scale. It is only used in video encoder. */ - VIDEO_ENCODER_TEMPORAL_LEVEL_SCALE = 0, + /** Feature for codec supports temporal scalability. It is only used in video encoder. */ + VIDEO_ENCODER_TEMPORAL_SCALABILITY = 0, /** Feature for codec supports long-term reference. It is only used in video encoder. */ VIDEO_ENCODER_LONG_TERM_REFERENCE = 1, /** Feature for codec supports low latency. It is used in video encoder and video decoder. */ diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 559698a2b..99c2dce0e 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -365,24 +365,24 @@ extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER; extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA; /** - * @brief Key for querying the maximum long-term reference number of video encoder, value type is int32_t. - * You should query the number through interface {@link OH_AVCapability_GetFeatureProperties} + * @brief Key for querying the maximum long-term reference count of video encoder, value type is int32_t. + * You should query the count through interface {@link OH_AVCapability_GetFeatureProperties} * with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ -extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_NUM; +extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT; /** - * @brief Key for enable the temporal level scale mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. + * @brief Key for enable the temporal scalability mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. * The default value is 0. To query supported, you should use the interface {@link OH_AVCapability_IsFeatureSupported} - * with enum {@link VIDEO_ENCODER_TEMPORAL_LEVEL_SCALE}. This is an optional key that applies only to video encoder. + * with enum {@link VIDEO_ENCODER_TEMPORAL_SCALABILITY}. This is an optional key that applies only to video encoder. * It is used in configure. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ -extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_LEVEL_SCALE; +extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY; /** * @brief Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when temporal * level scale is enable. This is an optional key that applies only to video encoder. It is used in configure. @@ -401,7 +401,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE; */ extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE; /** - * @brief Key for describing the number of used long-term reference frames, value type is int32_t, must be within the + * @brief Key for describing the count of used long-term reference frames, value type is int32_t, must be within the * supported range. To get supported range, you should query wthether the capability is supported through the interface * {@link OH_AVCapability_GetFeatureProperties} with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}, otherwise, not set * the key. This is an optional key that applies only to video encoder. It is used in configure. @@ -409,10 +409,10 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE; * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ -extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_NUM; +extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT; /** * @brief Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark, 0 - * otherwise. It takes effect only when the number of used long term reference frames is configured. + * otherwise. It takes effect only when the count of used long term reference frames is configured. * This is an optional key that applies only to video encoder input loop. It takes effect immediately. * * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -787,9 +787,9 @@ typedef enum OH_HEVCLevel { */ typedef enum OH_TemporalGopReferenceMode { /** Refer to latest short-term reference frame. */ - ADJACENT_REFERENCE_MODE = 0, + ADJACENT_REFERENCE = 0, /** Refer to latest long-term reference frame. */ - JUMP_REFERENCE_MODE = 1, + JUMP_REFERENCE = 1, } OH_TemporalGopReferenceMode; #ifdef __cplusplus -- Gitee From 878c8e5359d2afe75f94e5812f4a06f577851dd0 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Thu, 28 Mar 2024 11:13:17 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_base.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 99c2dce0e..aac129df5 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -508,16 +508,16 @@ extern const char *OH_MD_KEY_VIDEO_SLICE_HEIGHT; */ extern const char *OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY; /** - * @brief Key for describing the maximum Quantization Parameter allowed for video encoder, value type is int32_t. - * It is used in configure or takes effect immediately with the frame. + * @brief Key for describing the maximum quantization parameter allowed for video encoder, value type is int32_t. + * It is used in configure/setparameter or takes effect immediately with the frame. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; /** - * @brief Key for describing the minimum Quantization Parameter allowed for video encoder, value type is int32_t. - * It is used in configure or takes effect immediately with the frame. + * @brief Key for describing the minimum quantization parameter allowed for video encoder, value type is int32_t. + * It is used in configure/setparameter or takes effect immediately with the frame. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 -- Gitee From 9daafaf31f1f298111ebb8e64facec6c5c7fe5d5 Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Thu, 28 Mar 2024 14:29:37 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_base.h | 86 +++++++++++------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index aac129df5..1e10c5e5a 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -368,25 +368,25 @@ extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA; * @brief Key for querying the maximum long-term reference count of video encoder, value type is int32_t. * You should query the count through interface {@link OH_AVCapability_GetFeatureProperties} * with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT; -/** +/** * @brief Key for enable the temporal scalability mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise. * The default value is 0. To query supported, you should use the interface {@link OH_AVCapability_IsFeatureSupported} * with enum {@link VIDEO_ENCODER_TEMPORAL_SCALABILITY}. This is an optional key that applies only to video encoder. * It is used in configure. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY; /** - * @brief Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when temporal - * level scale is enable. This is an optional key that applies only to video encoder. It is used in configure. - * + * @brief Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when + * temporal level scale is enable. This is an optional key that applies only to video encoder. It is used in configure. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -395,7 +395,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE; * @brief Key for describing the reference mode in temporal group of picture, value type is int32_t, see enum * {@link OH_TemporalGopReferenceMode}. It takes effect only when temporal level sacle is enabled. * This is an optional key that applies only to video encoder. It is used in configure. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -405,24 +405,24 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE; * supported range. To get supported range, you should query wthether the capability is supported through the interface * {@link OH_AVCapability_GetFeatureProperties} with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}, otherwise, not set * the key. This is an optional key that applies only to video encoder. It is used in configure. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT; /** - * @brief Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark, 0 - * otherwise. It takes effect only when the count of used long term reference frames is configured. - * This is an optional key that applies only to video encoder input loop. It takes effect immediately. - * + * @brief Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark, + * 0 otherwise. It takes effect only when the count of used long term reference frames is configured. This is an + * optional key that applies only to video encoder input loop. It takes effect immediately. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR; /** - * @brief Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is an - * optional key that applies only to video encoder input loop. It takes effect immediately. - * + * @brief Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is + * an optional key that applies only to video encoder input loop. It takes effect immediately. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -431,15 +431,15 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR; * @brief Key for indicating this frame is a long-term reference frame, value type is int32_t (0 or 1): 1 is LTR, * 0 otherwise. This is an optional key that applies only to video encoder output loop. * It indicates the attribute of the frame. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR; /** - * @brief Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video encoder - * output loop. It indicates the attribute of the frame. - * + * @brief Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video + * encoder output loop. It indicates the attribute of the frame. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -447,41 +447,41 @@ extern const char *OH_MD_KEY_VIDEO_PER_FRAME_POC; /** * @brief Key for describing the top-coordinate (y) of the crop rectangle, value type is int32_t. This is the top-most * row included in the crop frame, where row indices start at 0. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_CROP_TOP; /** - * @brief Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the bottom-most - * row included in the crop frame, where row indices start at 0. - * + * @brief Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the + * bottom-most row included in the crop frame, where row indices start at 0. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_CROP_BOTTOM; /** - * @brief Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t. This is the left-most - * column included in the crop frame, where column indices start at 0. - * + * @brief Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t. + * This is the left-most column included in the crop frame, where column indices start at 0. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_CROP_LEFT; /** - * @brief Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the right-most - * column included in the crop frame, where column indices start at 0. - * + * @brief Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the + * right-most column included in the crop frame, where column indices start at 0. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_CROP_RIGHT; /** - * @brief Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is the - * difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the stride - * corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format, though it - * is generally undefined and depends on the device and release. - * + * @brief Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is + * the difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the + * stride corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format, + * though it is generally undefined and depends on the device and release. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -492,7 +492,7 @@ extern const char *OH_MD_KEY_VIDEO_STRIDE; * the top of the Y plane to the top of the U plane in the buffer. In essence the offset of the U plane * is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format, * though it is generally undefined and depends on the device and release. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -502,7 +502,7 @@ extern const char *OH_MD_KEY_VIDEO_SLICE_HEIGHT; * If enabled, the video encoder or video decoder doesn't hold input and output data more than required by * the codec standards. This is an optional key that applies only to video encoder or video decoder. * It is used in configure. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -510,7 +510,7 @@ extern const char *OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY; /** * @brief Key for describing the maximum quantization parameter allowed for video encoder, value type is int32_t. * It is used in configure/setparameter or takes effect immediately with the frame. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -518,35 +518,35 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; /** * @brief Key for describing the minimum quantization parameter allowed for video encoder, value type is int32_t. * It is used in configure/setparameter or takes effect immediately with the frame. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; /** * @brief Key for decoding timestamp of the buffer in microseconds, value type is int64_t. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_DECODING_TIMESTAMP; /** * @brief Key for duration of the buffer in microseconds, value type is int64_t. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_BUFFER_DURATION; /** * @brief Key for sample aspect ratio, value type is double. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_SAR; -/** +/** * @brief Key for start time of file, value type is int64_t. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ -- Gitee From a88bc748da457e1722334ebd9b5f001f00559e2d Mon Sep 17 00:00:00 2001 From: li-jianchao1993 Date: Thu, 28 Mar 2024 14:39:25 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=91=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-jianchao1993 --- multimedia/av_codec/native_avcodec_base.h | 20 +++++++++---------- .../av_codec/native_avcodec_videoencoder.h | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 1e10c5e5a..ca9d722ce 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -199,7 +199,7 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; /** * @brief Enumerates the MIME type of audio low bitrate voice codec. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -207,7 +207,7 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_LBVC; /** * @brief Enumerates the MIME type of audio ape codec. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -215,7 +215,7 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE; /** * @brief Enumerates the MIME type of versatile video coding. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -223,7 +223,7 @@ extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC; /** * @brief Enumerates the MIME type of subtitle. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -275,9 +275,9 @@ extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT; /* Key for audio sample rate, value type is uint32_t */ extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; /** - * @brief Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no key - * frames are requested after the first frame. A zero value means a stream containing all key frames is requested. - * + * @brief Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no + * key frames are requested after the first frame. A zero value means a stream containing all key frames is requested. + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 9 */ @@ -734,7 +734,7 @@ typedef enum OH_MatrixCoefficient { /** * @brief AVC Level. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -759,7 +759,7 @@ typedef enum OH_AVCLevel { /** * @brief HEVC Level. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ @@ -781,7 +781,7 @@ typedef enum OH_HEVCLevel { /** * @brief The reference mode in temporal group of picture. - * + * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index f7340cc4e..5d51db899 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -104,7 +104,7 @@ OH_AVErrCode OH_VideoEncoder_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallb * @brief Set the asynchronous callback function so that your application can respond to the events generated by the * video encoder. This interface is optional only for input surface. If this interface is used, it must be invoked * before {@link OH_VideoEncoder_Configure}. - * + * * @syscap SystemCapability.Multimedia.Media.VideoEncoder * @param codec Pointer to an OH_AVCodec instance * @param onInputParameter A callback functions, see {@link OH_VideoEncoder_OnNeedInputParameter} @@ -281,7 +281,7 @@ OH_AVErrCode OH_VideoEncoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index); /** * @brief Submit the input parameter filled with data to the video encoder. - * + * * @syscap SystemCapability.Multimedia.Media.VideoEncoder * @param codec Pointer to an OH_AVCodec instance * @param index Enter the index value corresponding to the input parameter -- Gitee