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 a154974198745f75af3943f812d1cc1fe6359bfb..08eed9b387b37b761402df45b814bc0f8294bf8e 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,22 @@ "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" + }, + { + "first_introduced": "12", + "name": "OH_AVCODEC_MIMETYPE_SUBTITLE_SRT" + }, { "first_introduced": "9", "name": "OH_ED_KEY_TIME_STAMP" @@ -263,6 +279,94 @@ "first_introduced": "11", "name": "OH_MD_KEY_AUDIO_VIVID_METADATA" }, + { + "first_introduced": "12", + "name": "OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY" + }, + { + "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_COUNT" + }, + { + "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": "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" diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 043678aab03b8fb3761b663e3a429606921e202b..6060424ae055a47561179a47f7111f8009756b87 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,21 @@ 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 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. */ + VIDEO_LOW_LATENCY = 2, +} OH_AVCapabilityFeature; + /** * @brief Get a system-recommended codec's capability. * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -350,6 +366,29 @@ 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 b26dc245406ae0c5f92e005a9b396e34784f57b8..ca9d722ce2d1652d03975b993312ad857bdf8e41 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -197,6 +197,38 @@ 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 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 type of subtitle. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_SRT; + /** * @brief The extra data's key of surface Buffer * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -242,7 +274,13 @@ 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. */ +/** + * @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. */ extern const char *OH_MD_KEY_ROTATION; @@ -326,6 +364,194 @@ 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 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. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +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 + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE; +/** + * @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. + * + * @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. + * + * @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. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +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. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +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. + * + * @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. + * + * @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. + * + * @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. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_MD_KEY_VIDEO_STRIDE; +/** + * @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; +/** + * @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; +/** + * @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/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 + */ +extern const char *OH_MD_KEY_START_TIME; + /** * @brief Media type. * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -383,6 +609,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; /** @@ -494,6 +732,66 @@ 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 = 0, + /** Refer to latest long-term reference frame. */ + JUMP_REFERENCE = 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 fa0abea85747da13073b19cd07e1109ed65b708a..5d51db899ce7ea39023f24b885814643d356d963 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -24,6 +24,21 @@ 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. 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 + * @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 +100,23 @@ 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}. + * + * @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 + * @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 +279,18 @@ 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 412adb92322f285d5a881cff4f4fa0a763c61856..0f61de3ea0adfc64ec80b58749405368c3855280 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 78ec7c3e8ba10b0f7f689e5f70835bfee5f89cc9..bc57f8e1ed30169f8125c39c8842c198885a8e59 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_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_FLAGS_DISPOSABLE = 1 << 5, } OH_AVCodecBufferFlags; /**