From 77888f4ed8989ef3c340a10ad3a5ef7887287691 Mon Sep 17 00:00:00 2001 From: jiangchunli Date: Wed, 22 May 2024 18:10:57 +0800 Subject: [PATCH] Change audio decryption interface from audio_decoder to audio_codec. Signed-off-by: jiangchunli --- .../libnative_media_acodec.ndk.json | 4 ++++ .../libnative_media_adec.ndk.json | 4 ---- .../av_codec/native_avcodec_audiocodec.h | 20 +++++++++++++++++ .../av_codec/native_avcodec_audiodecoder.h | 22 ------------------- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/multimedia/av_codec/audio_codec/libnative_media_acodec.ndk.json b/multimedia/av_codec/audio_codec/libnative_media_acodec.ndk.json index 47dfd626d6b..ec87a5d8522 100644 --- a/multimedia/av_codec/audio_codec/libnative_media_acodec.ndk.json +++ b/multimedia/av_codec/audio_codec/libnative_media_acodec.ndk.json @@ -58,5 +58,9 @@ { "first_introduced": "11", "name": "OH_AudioCodec_IsValid" + }, + { + "first_introduced": "12", + "name": "OH_AudioCodec_SetDecryptionConfig" } ] diff --git a/multimedia/av_codec/audio_decoder/libnative_media_adec.ndk.json b/multimedia/av_codec/audio_decoder/libnative_media_adec.ndk.json index 89b3bac2f99..2f11d92769b 100644 --- a/multimedia/av_codec/audio_decoder/libnative_media_adec.ndk.json +++ b/multimedia/av_codec/audio_decoder/libnative_media_adec.ndk.json @@ -58,9 +58,5 @@ { "first_introduced": "10", "name": "OH_AudioDecoder_IsValid" - }, - { - "first_introduced": "12", - "name": "OH_AudioDecoder_SetDecryptionConfig" } ] diff --git a/multimedia/av_codec/native_avcodec_audiocodec.h b/multimedia/av_codec/native_avcodec_audiocodec.h index cc34cd03786..5a29f91d99c 100644 --- a/multimedia/av_codec/native_avcodec_audiocodec.h +++ b/multimedia/av_codec/native_avcodec_audiocodec.h @@ -24,6 +24,13 @@ extern "C" { #endif +/** + * @brief MediaKeySession field. + * @since 12 + * @version 1.0 + */ +typedef struct MediaKeySession MediaKeySession; + /** * @brief Create an audio encoder or decoder instance from the mime type, which is recommended in most cases. * @syscap SystemCapability.Multimedia.Media.AudioCodec @@ -201,6 +208,19 @@ OH_AVErrCode OH_AudioCodec_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index); */ OH_AVErrCode OH_AudioCodec_IsValid(OH_AVCodec *codec, bool *isValid); +/** + * @brief Set decryption info. + * @syscap SystemCapability.Multimedia.Media.AudioCodec + * @param codec Pointer to an OH_AVCodec instance + * @param mediaKeySession A media key session instance with decryption function. + * @param secureAudio Require secure decoder or not. + * @return Returns AV_ERR_OK if the execution is successful, + * otherwise returns a specific error code, refer to {@link OH_AVErrCode} + * @since 12 + * @version 1.0 +*/ +OH_AVErrCode OH_AudioCodec_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySession *mediaKeySession, + bool secureAudio); #ifdef __cplusplus } #endif diff --git a/multimedia/av_codec/native_avcodec_audiodecoder.h b/multimedia/av_codec/native_avcodec_audiodecoder.h index 6e4d659844f..bdadfd54de9 100644 --- a/multimedia/av_codec/native_avcodec_audiodecoder.h +++ b/multimedia/av_codec/native_avcodec_audiodecoder.h @@ -24,13 +24,6 @@ extern "C" { #endif -/** - * @brief MediaKeySession field. - * @since 12 - * @version 1.0 - */ -typedef struct MediaKeySession MediaKeySession; - /** * @brief Creates an audio decoder instance from the mime type, which is recommended in most cases. * @syscap SystemCapability.Multimedia.Media.AudioDecoder @@ -251,21 +244,6 @@ OH_AVErrCode OH_AudioDecoder_FreeOutputData(OH_AVCodec *codec, uint32_t index); * @since 10 */ OH_AVErrCode OH_AudioDecoder_IsValid(OH_AVCodec *codec, bool *isValid); - -/** - * @brief Set decryption info. - * @syscap SystemCapability.Multimedia.Media.AudioDecoder - * @param codec Pointer to an OH_AVCodec instance - * @param mediaKeySession A media key session instance with decryption function. - * @param secureAudio Require secure decoder or not. - * @return Returns AV_ERR_OK if the execution is successful, - * otherwise returns a specific error code, refer to {@link OH_AVErrCode} - * @since 12 - * @version 1.0 -*/ -OH_AVErrCode OH_AudioDecoder_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySession *mediaKeySession, - bool secureAudio); - #ifdef __cplusplus } #endif -- Gitee