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 8077a4119567a7bc3f9a471c6a9ffd51076c841b..5da23bba59a24e8a472940a550bea99942e1d151 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -423,6 +423,18 @@ "first_introduced": "18", "name": "OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT" }, + { + "first_introduced": "20", + "name": "OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS" + }, + { + "first_introduced": "20", + "name": "OH_MD_KEY_SQR_FACTOR" + }, + { + "first_introduced": "20", + "name": "OH_MD_KEY_MAX_BITRATE" + }, { "first_introduced": "10", "name": "OH_AVCodec_GetCapability" diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 609dc238e0af050156bd7952e9cbb0237a1cc935..705b0d651d53c8ce94987ad8876f725ebb211faf 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1031,6 +1031,38 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER; * @since 18 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT; +/** + * @brief Key to set the region of interest(ROI) as QpOffset-Rects, value type is string in the format + * "Top1,Left1-Bottom1,Right1=Offset1;Top2,Left2-Bottom2,Right2=Offset2;". Each "Top,Left-Bottom,Right=Offset" + * represents the coordinate information and quantization parameter of one ROI. Each "=Offset" in the string + * can be omitted, like "Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2=Offset2;", the encoder + * will use the default quantization parameter to perform the ROI encoding on the first ROI and + * use Offset2 on the second ROI. + * + * This is an optional key that applies only to video encoder. + * It is used in running process and is set with each frame. + * In surface mode, it is used in {@link OH_VideoEncoder_OnNeedInputParameter}. + * In buffer mode, it is configured via {@link OH_AVBuffer_SetParameter}. + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 20 + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS; +/** + * @brief Key for the desired encoding quality, value type is int32_t, this key is only + * supported for encoders that are configured in Stable Quality RateControl, the higher + * values generally result in more efficient(smaller-sized) encoding. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 20 + */ +extern const char *OH_MD_KEY_SQR_FACTOR; +/** + * @brief Key for maximum bitrate, value type is int64_t. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 20 + */ +extern const char *OH_MD_KEY_MAX_BITRATE; /** * @brief Media type. @@ -1562,7 +1594,11 @@ typedef enum OH_BitrateMode { /** Variable Bit rate mode. */ BITRATE_MODE_VBR = 1, /** Constant Quality mode. */ - BITRATE_MODE_CQ = 2 + BITRATE_MODE_CQ = 2, + /** Stable Quality Rate Control mode. + * @since 20 + */ + BITRATE_MODE_SQR = 3 } OH_BitrateMode; #ifdef __cplusplus