From cae3cbb94a2122e309f0b579aad2e0d1a9866176 Mon Sep 17 00:00:00 2001 From: bao92 Date: Wed, 8 May 2024 20:24:55 +0800 Subject: [PATCH 1/5] =?UTF-8?q?drm=20API12=E6=8E=A5=E5=8F=A3=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bao92 --- .../libnative_media_adec.ndk.json | 4 + multimedia/av_codec/avcencinfo/BUILD.gn | 30 +++ .../libnative_media_avcencinfo.ndk.json | 30 +++ .../libnative_media_avdemuxer.ndk.json | 4 + .../av_codec/native_avcodec_audiodecoder.h | 21 ++ multimedia/av_codec/native_avdemuxer.h | 23 ++ multimedia/av_codec/native_cencinfo.h | 210 ++++++++++++++++++ .../drm_framework/libnative_drm.ndk.json | 12 +- .../drm_framework/native_mediakeysession.h | 53 +++++ .../drm_framework/native_mediakeysystem.h | 43 +++- 10 files changed, 417 insertions(+), 13 deletions(-) create mode 100644 multimedia/av_codec/avcencinfo/BUILD.gn create mode 100644 multimedia/av_codec/avcencinfo/libnative_media_avcencinfo.ndk.json create mode 100644 multimedia/av_codec/native_cencinfo.h 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 2f11d9276..89b3bac2f 100644 --- a/multimedia/av_codec/audio_decoder/libnative_media_adec.ndk.json +++ b/multimedia/av_codec/audio_decoder/libnative_media_adec.ndk.json @@ -58,5 +58,9 @@ { "first_introduced": "10", "name": "OH_AudioDecoder_IsValid" + }, + { + "first_introduced": "12", + "name": "OH_AudioDecoder_SetDecryptionConfig" } ] diff --git a/multimedia/av_codec/avcencinfo/BUILD.gn b/multimedia/av_codec/avcencinfo/BUILD.gn new file mode 100644 index 000000000..a1f43c09a --- /dev/null +++ b/multimedia/av_codec/avcencinfo/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright (C) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") +ohos_ndk_headers("native_media_avcencinfo_header") { + dest_dir = "$ndk_headers_out_dir/multimedia/player_framework" + sources = [ "../native_cencinfo.h" ] +} + +ohos_ndk_library("libnative_media_avcencinfo") { + ndk_description_file = "./libnative_media_avcencinfo.ndk.json" + min_compact_version = "12" + output_name = "native_media_avcencinfo" + output_extension = "so" + + system_capability = "SystemCapability.Multimedia.Media.Spliter" + system_capability_headers = + [ "multimedia/player_framework/native_cencinfo.h" ] +} diff --git a/multimedia/av_codec/avcencinfo/libnative_media_avcencinfo.ndk.json b/multimedia/av_codec/avcencinfo/libnative_media_avcencinfo.ndk.json new file mode 100644 index 000000000..be84ad9ae --- /dev/null +++ b/multimedia/av_codec/avcencinfo/libnative_media_avcencinfo.ndk.json @@ -0,0 +1,30 @@ +[ + { + "first_introduced": "12", + "name": "OH_AVCencInfo_Create" + }, + { + "first_introduced": "12", + "name": "OH_AVCencInfo_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_AVCencInfo_SetAlgo" + }, + { + "first_introduced": "12", + "name": "OH_AVCencInfo_SetKeyIdAndIv" + }, + { + "first_introduced": "12", + "name": "OH_AVCencInfo_SetSubsampleInfo" + }, + { + "first_introduced": "12", + "name": "OH_AVCencInfo_SetMode" + }, + { + "first_introduced": "12", + "name": "OH_AVCencInfo_SetAVBuffer" + } +] diff --git a/multimedia/av_codec/avdemuxer/libnative_media_avdemuxer.ndk.json b/multimedia/av_codec/avdemuxer/libnative_media_avdemuxer.ndk.json index 2a3cb212f..dcddf3df4 100644 --- a/multimedia/av_codec/avdemuxer/libnative_media_avdemuxer.ndk.json +++ b/multimedia/av_codec/avdemuxer/libnative_media_avdemuxer.ndk.json @@ -34,5 +34,9 @@ { "first_introduced": "11", "name": "OH_AVDemuxer_GetMediaKeySystemInfo" + }, + { + "first_introduced": "12", + "name": "OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback" } ] diff --git a/multimedia/av_codec/native_avcodec_audiodecoder.h b/multimedia/av_codec/native_avcodec_audiodecoder.h index e834aa233..6e4d65984 100644 --- a/multimedia/av_codec/native_avcodec_audiodecoder.h +++ b/multimedia/av_codec/native_avcodec_audiodecoder.h @@ -24,6 +24,13 @@ 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 @@ -245,6 +252,20 @@ OH_AVErrCode OH_AudioDecoder_FreeOutputData(OH_AVCodec *codec, uint32_t index); */ 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 diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 84634687e..96717cf96 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -28,6 +28,16 @@ typedef struct OH_AVDemuxer OH_AVDemuxer; typedef struct DRM_MediaKeySystemInfo DRM_MediaKeySystemInfo; typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo* mediaKeySystemInfo); +/** + * @brief Call back will be invoked when updating DRM information. + * @param demuxer Player OH_AVDemuxer. + * @param mediaKeySystemInfo DRM information. + * @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully. + * @since 12 + * @version 1.0 + */ +typedef void (*Demuxer_MediaKeySystemInfoCallback)(OH_AVDemuxer *demuxer, DRM_MediaKeySystemInfo *mediaKeySystemInfo); + /** * @brief Creates an OH_AVDemuxer instance for getting samples from source. * Free the resources of the instance by calling OH_AVDemuxer_Destroy. @@ -140,6 +150,19 @@ OH_AVErrCode OH_AVDemuxer_SeekToTime(OH_AVDemuxer *demuxer, int64_t millisecond, OH_AVErrCode OH_AVDemuxer_SetMediaKeySystemInfoCallback(OH_AVDemuxer *demuxer, DRM_MediaKeySystemInfoCallback callback); +/** + * @brief Method to set player media key system info callback. + * @syscap SystemCapability.Multimedia.Media.Spliter + * @param demuxer Pointer to an OH_AVDemuxer instance + * @param callback object pointer. + * @return Returns {@link AV_ERR_OK} if the drm info callback is set; returns an error code defined + * in {@link native_averrors.h} otherwise. + * @since 12 + * @version 1.0 + */ +OH_AVErrCode OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback(OH_AVDemuxer *demuxer, + Demuxer_MediaKeySystemInfoCallback callback); + /** * @brief Obtains media key system info to create media key session. * @syscap SystemCapability.Multimedia.Media.Spliter diff --git a/multimedia/av_codec/native_cencinfo.h b/multimedia/av_codec/native_cencinfo.h new file mode 100644 index 000000000..b7dbf5fba --- /dev/null +++ b/multimedia/av_codec/native_cencinfo.h @@ -0,0 +1,210 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NATIVE_AVCENCINFO_H +#define NATIVE_AVCENCINFO_H + +#include +#include "native_averrors.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief AVBuffer Structure. + * @since 12 + * @version 1.0 + */ +typedef struct OH_AVBuffer OH_AVBuffer; +/** + * @brief AVCencInfo Structure. + * @since 12 + * @version 1.0 + */ +typedef struct OH_AVCencInfo OH_AVCencInfo; +/** + * @brief Key id size. + * @since 12 + * @version 1.0 + */ +#define DRM_KEY_ID_SIZE 16 +/** + * @brief Iv size. + * @since 12 + * @version 1.0 + */ +#define DRM_KEY_IV_SIZE 16 +/** + * @brief Max subsample num. + * @since 12 + * @version 1.0 + */ +#define DRM_KEY_MAX_SUB_SAMPLE_NUM 64 + +/** + * @brief Drm cenc algorithm type. + * @since 12 + * @version 1.0 + */ +typedef enum DrmCencAlgorithm { + /** + * Unencrypted. + */ + DRM_ALG_CENC_UNENCRYPTED = 0x0, + /** + * Aes ctr. + */ + DRM_ALG_CENC_AES_CTR = 0x1, + /** + * Aes wv. + */ + DRM_ALG_CENC_AES_WV = 0x2, + /** + * Aes cbc. + */ + DRM_ALG_CENC_AES_CBC = 0x3, + /** + * Sm4 cbc. + */ + DRM_ALG_CENC_SM4_CBC = 0x4, + /** + * Sm4 ctr. + */ + DRM_ALG_CENC_SM4_CTR = 0x5 +} DrmCencAlgorithm; + +/** + * @brief Mode of cend info like set or not. + * @since 12 + * @version 1.0 + */ +typedef enum DrmCencInfoMode { + /* key/iv/subsample set. */ + DRM_CENC_INFO_KEY_IV_SUBSAMPLES_SET = 0x0, + /* key/iv/subsample not set. */ + DRM_CENC_INFO_KEY_IV_SUBSAMPLES_NOT_SET = 0x1 +} DrmCencInfoMode; + +/** + * @brief Subsample info of media. + * @since 12 + * @version 1.0 + */ +typedef struct DrmSubsample { + /* Clear header len. */ + uint32_t clearHeaderLen; + /* Payload Len. */ + uint32_t payLoadLen; +} DrmSubsample; + +/** + * @brief Creates an OH_AVCencInfo instance for setting cencinfo. + * Free the resources of the instance by calling OH_AVCencInfo_Destory. + * @syscap SystemCapability.Multimedia.Media.Spliter + * @return Returns a pointer to an OH_AVCencInfo instance + * @since 12 + * @version 1.0 + */ +OH_AVCencInfo *OH_AVCencInfo_Create(); + +/** + * @brief Destroy the OH_AVCencInfo instance and free the internal resources. + * The same instance can only be destroyed once. The destroyed instance + * should not be used before it is created again. It is recommended setting + * the instance pointer to NULL right after the instance is destroyed successfully. + * @syscap SystemCapability.Multimedia.Media.Spliter + * @param cencInfo Pointer to an OH_AVCencInfo instance. + * @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_AVCencInfo_Destroy(OH_AVCencInfo *cencInfo); + +/** + * @brief Method to set algo of cencinfo. + * @syscap SystemCapability.Multimedia.Media.Spliter + * @param cencInfo Pointer to an OH_AVCencInfo instance. + * @param algo Cenc algo. + * @return Returns {@link AV_ERR_OK} if the algo is set; returns an error code defined + * in {@link native_averrors.h} otherwise. + * @since 12 + * @version 1.0 + */ +OH_AVErrCode OH_AVCencInfo_SetAlgorithm(OH_AVCencInfo *cencInfo, enum DrmCencAlgorithm algo); + +/** + * @brief Method to set key id and iv of cencinfo. + * @syscap SystemCapability.Multimedia.Media.Spliter + * @param cencInfo Pointer to an OH_AVCencInfo instance. + * @param keyId Key id. + * @param keyIdLen Key id len. + * @param iv Iv. + * @param ivLen Iv len. + * @return Returns {@link AV_ERR_OK} if the key id and iv is set; returns an error code defined + * in {@link native_averrors.h} otherwise. + * @since 12 + * @version 1.0 + */ +OH_AVErrCode OH_AVCencInfo_SetKeyIdAndIv(OH_AVCencInfo *cencInfo, uint8_t *keyId, + uint32_t keyIdLen, uint8_t *iv, uint32_t ivLen); + +/** + * @brief Method to set subsample info of cencinfo. + * @syscap SystemCapability.Multimedia.Media.Spliter + * @param cencInfo Pointer to an OH_AVCencInfo instance. + * @param encryptedBlockCount Number of encrypted blocks. + * @param skippedBlockCount Number of skip(clear) blocks. + * @param firstEncryptedOffset Offset of first encrypted payload. + * @param subsampleCount Subsample num. + * @param subsamples Subsample info + * @return Returns {@link AV_ERR_OK} if the subsample info is set; returns an error code defined + * in {@link native_averrors.h} otherwise. + * @since 12 + * @version 1.0 + */ +OH_AVErrCode OH_AVCencInfo_SetSubsampleInfo(OH_AVCencInfo *cencInfo, uint32_t encryptedBlockCount, + uint32_t skippedBlockCount, uint32_t firstEncryptedOffset, uint32_t subsampleCount, DrmSubsample *subsamples); + +/** + * @brief Method to set mode of cencinfo. + * @syscap SystemCapability.Multimedia.Media.Spliter + * @param cencInfo Pointer to an OH_AVCencInfo instance. + * @param mode Cenc mode, indicate whether key/iv/subsample set or not. + * @return Returns {@link AV_ERR_OK} if the mode is set; returns an error code defined + * in {@link native_averrors.h} otherwise. + * @since 12 + * @version 1.0 + */ +OH_AVErrCode OH_AVCencInfo_SetMode(OH_AVCencInfo *cencInfo, enum DrmCencInfoMode mode); + +/** + * @brief Method to attach cencinfo to AVBuffer. + * @syscap SystemCapability.Multimedia.Media.Spliter + * @param cencInfo Pointer to an OH_AVCencInfo instance. + * @param buffer AVBuffer to attach cencinfo. + * @return Returns {@link AV_ERR_OK} if the cencinfo is set; returns an error code defined + * in {@link native_averrors.h} otherwise. + * @since 12 + * @version 1.0 + */ +OH_AVErrCode OH_AVCencInfo_SetAVBuffer(OH_AVCencInfo *cencInfo, OH_AVBuffer *buffer); + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_AVCENCINFO_H diff --git a/multimedia/drm_framework/libnative_drm.ndk.json b/multimedia/drm_framework/libnative_drm.ndk.json index 41e94c3ab..0e453e4d5 100644 --- a/multimedia/drm_framework/libnative_drm.ndk.json +++ b/multimedia/drm_framework/libnative_drm.ndk.json @@ -111,10 +111,6 @@ "first_introduced": "11", "name": "OH_MediaKeySession_RequireSecureDecoderModule" }, - { - "first_introduced": "11", - "name": "OH_MediaKeySession_SetMediaKeySessionCallback" - }, { "first_introduced": "11", "name": "OH_MediaKeySession_Destroy" @@ -122,5 +118,13 @@ { "first_introduced": "12", "name": "OH_MediaKeySystem_GetMediaKeySystems" + }, + { + "first_introduced": "12", + "name": "OH_MediaKeySession_SetMediaKeySessionCallback" + }, + { + "first_introduced": "12", + "name": "OH_MediaKeySystem_SetCallback" } ] \ No newline at end of file diff --git a/multimedia/drm_framework/native_mediakeysession.h b/multimedia/drm_framework/native_mediakeysession.h index 999aa04e1..8394da5da 100644 --- a/multimedia/drm_framework/native_mediakeysession.h +++ b/multimedia/drm_framework/native_mediakeysession.h @@ -86,6 +86,48 @@ typedef struct MediaKeySession_Callback { MediaKeySession_KeyChangeCallback keyChangeCallback; } MediaKeySession_Callback; +/** + * @brief Call back will be invoked when event triggers. + * @param mediaKeySessoin MediaKeySession instance. + * @param eventType Event type. + * @param info Event info gotten from media key session. + * @param infoLen Event info len. + * @param extra Extra info gotten from media key session. + * @return Drm_ErrCode. + * @since 12 + * @version 1.0 + */ +typedef Drm_ErrCode (*OH_MediaKeySession_EventCallback)(MediaKeySession *mediaKeySessoin, DRM_EventType eventType, + uint8_t *info, int32_t infoLen, char *extra); + +/** + * @brief Call back will be invoked when key changes. + * @param mediaKeySessoin MediaKeySession instance. + * @param keysInfo Key info gotten from media key system. + * @param newKeysAvailable Whether new keys available. + * @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully. + * @since 12 + * @version 1.0 + */ +typedef Drm_ErrCode (*OH_MediaKeySession_KeyChangeCallback)(MediaKeySession *mediaKeySessoin, DRM_KeysInfo *keysInfo, + bool newKeysAvailable); + +/** + * @brief MediaKeySession_Callback struct, used to listen event like key expired and key change etc.. + * @since 12 + * @version 1.0 + */ +typedef struct OH_MediaKeySession_Callback { + /** + * Normal event callback like key expired etc.. + */ + OH_MediaKeySession_EventCallback eventCallback; + /** + * Key change callback for keys change event. + */ + OH_MediaKeySession_KeyChangeCallback keyChangeCallback; +} OH_MediaKeySession_Callback; + /** * @brief Generate media key request. * @param mediaKeySession Media key session instance. @@ -208,6 +250,17 @@ Drm_ErrCode OH_MediaKeySession_RequireSecureDecoderModule(MediaKeySession *media Drm_ErrCode OH_MediaKeySession_SetMediaKeySessionCallback(MediaKeySession *mediaKeySessoin, MediaKeySession_Callback *callback); +/** + * @brief Set media key session event callback. + * @param mediaKeySession Media key session instance. + * @param callback Callback to be set to the media key session. + * @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully. + * @since 12 + * @version 1.0 + */ +Drm_ErrCode OH_MediaKeySession_SetCallback(MediaKeySession *mediaKeySessoin, + OH_MediaKeySession_Callback *callback); + /** * @brief Release the resource before the session gonna be unused. * @param mediaKeySession Media key session instance. diff --git a/multimedia/drm_framework/native_mediakeysystem.h b/multimedia/drm_framework/native_mediakeysystem.h index 88f27fdf9..9f84618f0 100644 --- a/multimedia/drm_framework/native_mediakeysystem.h +++ b/multimedia/drm_framework/native_mediakeysystem.h @@ -62,6 +62,40 @@ extern "C" { typedef Drm_ErrCode (*MediaKeySystem_Callback)(DRM_EventType eventType, uint8_t *info, int32_t infoLen, char *extra); +/** + * @brief Call back will be invoked when event triggers. + * @param mediaKeySystem MediaKeySystem instance. + * @param eventType Event type. + * @param info Event info gotten from media key system. + * @param infoLen Event info len. + * @param extra Extra info gotten from media key system. + * @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully. + * @since 12 + * @version 1.0 + */ +typedef Drm_ErrCode (*OH_MediaKeySystem_Callback)(MediaKeySystem *mediaKeySystem, DRM_EventType eventType, + uint8_t *info, int32_t infoLen, char *extra); + +/** + * @brief Set media key system event callback. + * @param mediaKeySystem Media key system instance. + * @param callback Callback to be set to the media key system. + * @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully. + * @since 12 + * @version 1.0 + */ +Drm_ErrCode OH_MediaKeySystem_SetCallback(MediaKeySystem *mediaKeySystem, OH_MediaKeySystem_Callback callback); + +/** + * @brief Acquire supported media key systems' name and uuid. + * @param descs Array used to save media key systems' name and uuid. + * @param count Used to indicate count of struct DRM_MediaKeySystemDescription. + * @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully. + * @since 12 + * @version 1.0 + */ +Drm_ErrCode OH_MediaKeySystem_GetMediaKeySystems(DRM_MediaKeySystemDescription *descs, uint32_t *count); + /** * @brief Query if media key system is supported. * @param name Used to point a Digital Right Management solution. @@ -273,15 +307,6 @@ Drm_ErrCode OH_MediaKeySystem_GetCertificateStatus(MediaKeySystem *mediaKeySyste */ Drm_ErrCode OH_MediaKeySystem_Destroy(MediaKeySystem *mediaKeySystem); -/** - * @brief Acquire supported media key systems' name and uuid. - * @param descs Array used to save media key systems' name and uuid. - * @param count Used to indicate count of struct DRM_MediaKeySystemDescription. - * @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully. - * @since 12 - * @version 1.0 - */ -Drm_ErrCode OH_MediaKeySystem_GetMediaKeySystems(DRM_MediaKeySystemDescription *descs, uint32_t *count); #ifdef __cplusplus } -- Gitee From 472a74aa0329d89a168a02818a1e1c72661e5c24 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Thu, 9 May 2024 06:27:01 +0000 Subject: [PATCH 2/5] update multimedia/av_codec/native_cencinfo.h. Signed-off-by: baoxy92 --- multimedia/av_codec/native_cencinfo.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/multimedia/av_codec/native_cencinfo.h b/multimedia/av_codec/native_cencinfo.h index b7dbf5fba..29d774649 100644 --- a/multimedia/av_codec/native_cencinfo.h +++ b/multimedia/av_codec/native_cencinfo.h @@ -112,6 +112,7 @@ typedef struct DrmSubsample { /** * @brief Creates an OH_AVCencInfo instance for setting cencinfo. + * * Free the resources of the instance by calling OH_AVCencInfo_Destory. * @syscap SystemCapability.Multimedia.Media.Spliter * @return Returns a pointer to an OH_AVCencInfo instance @@ -122,6 +123,7 @@ OH_AVCencInfo *OH_AVCencInfo_Create(); /** * @brief Destroy the OH_AVCencInfo instance and free the internal resources. + * * The same instance can only be destroyed once. The destroyed instance * should not be used before it is created again. It is recommended setting * the instance pointer to NULL right after the instance is destroyed successfully. @@ -136,6 +138,7 @@ OH_AVErrCode OH_AVCencInfo_Destroy(OH_AVCencInfo *cencInfo); /** * @brief Method to set algo of cencinfo. + * * @syscap SystemCapability.Multimedia.Media.Spliter * @param cencInfo Pointer to an OH_AVCencInfo instance. * @param algo Cenc algo. @@ -148,6 +151,7 @@ OH_AVErrCode OH_AVCencInfo_SetAlgorithm(OH_AVCencInfo *cencInfo, enum DrmCencAlg /** * @brief Method to set key id and iv of cencinfo. + * * @syscap SystemCapability.Multimedia.Media.Spliter * @param cencInfo Pointer to an OH_AVCencInfo instance. * @param keyId Key id. @@ -164,6 +168,7 @@ OH_AVErrCode OH_AVCencInfo_SetKeyIdAndIv(OH_AVCencInfo *cencInfo, uint8_t *keyId /** * @brief Method to set subsample info of cencinfo. + * * @syscap SystemCapability.Multimedia.Media.Spliter * @param cencInfo Pointer to an OH_AVCencInfo instance. * @param encryptedBlockCount Number of encrypted blocks. @@ -181,6 +186,7 @@ OH_AVErrCode OH_AVCencInfo_SetSubsampleInfo(OH_AVCencInfo *cencInfo, uint32_t en /** * @brief Method to set mode of cencinfo. + * * @syscap SystemCapability.Multimedia.Media.Spliter * @param cencInfo Pointer to an OH_AVCencInfo instance. * @param mode Cenc mode, indicate whether key/iv/subsample set or not. @@ -193,6 +199,7 @@ OH_AVErrCode OH_AVCencInfo_SetMode(OH_AVCencInfo *cencInfo, enum DrmCencInfoMode /** * @brief Method to attach cencinfo to AVBuffer. + * * @syscap SystemCapability.Multimedia.Media.Spliter * @param cencInfo Pointer to an OH_AVCencInfo instance. * @param buffer AVBuffer to attach cencinfo. -- Gitee From d65a3389e72b018a6e4db191cf07e73d4f1233be Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Thu, 9 May 2024 11:36:51 +0000 Subject: [PATCH 3/5] update multimedia/av_codec/native_cencinfo.h. Signed-off-by: baoxy92 --- multimedia/av_codec/native_cencinfo.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/multimedia/av_codec/native_cencinfo.h b/multimedia/av_codec/native_cencinfo.h index 29d774649..0c16be2f4 100644 --- a/multimedia/av_codec/native_cencinfo.h +++ b/multimedia/av_codec/native_cencinfo.h @@ -13,6 +13,25 @@ * limitations under the License. */ +/** + * @addtogroup Multimedia_Drm + * @{ + * + * @brief This feature enables third-party applications to implement the media decapsulation and demultiplexing functions by themselves instead of using the functions provided by the system. After the DRM instance and session are created, the decryption interface provided by the DRM can be invoked for decryption. The decryption parameter structure defines the transmission format of decryption parameters. + * + * @since 12 + */ + +/** + * @file native_cencinfo.h + * + * @brief Provides a unified entry for the native module APIs. + * + * @library libnative_media_avcencinfo.so + * @syscap SystemCapability.Multimedia.Drm.Core + * @since 12 + */ + #ifndef NATIVE_AVCENCINFO_H #define NATIVE_AVCENCINFO_H -- Gitee From b3f77b3d908baa5103357d1e0dde7da86bda7804 Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Thu, 9 May 2024 14:01:25 +0000 Subject: [PATCH 4/5] update multimedia/av_codec/native_cencinfo.h. Signed-off-by: baoxy92 --- multimedia/av_codec/native_cencinfo.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_cencinfo.h b/multimedia/av_codec/native_cencinfo.h index 0c16be2f4..2b17c1d10 100644 --- a/multimedia/av_codec/native_cencinfo.h +++ b/multimedia/av_codec/native_cencinfo.h @@ -17,7 +17,13 @@ * @addtogroup Multimedia_Drm * @{ * - * @brief This feature enables third-party applications to implement the media decapsulation and demultiplexing functions by themselves instead of using the functions provided by the system. After the DRM instance and session are created, the decryption interface provided by the DRM can be invoked for decryption. The decryption parameter structure defines the transmission format of decryption parameters. + * @brief This feature enables third-party applications to implement the + * media decapsulation and demultiplexing functions by themselves instead + * of using the functions provided by the system. + * + * After the DRM instance and session are created, the decryption interface + * provided by the DRM can be invoked for decryption. The decryption parameter + * structure defines the transmission format of decryption parameters. * * @since 12 */ -- Gitee From 8cfef5f3ef2deec5139c525eaa3b783913692d4d Mon Sep 17 00:00:00 2001 From: baoxy92 Date: Fri, 10 May 2024 01:43:48 +0000 Subject: [PATCH 5/5] update multimedia/av_codec/native_cencinfo.h. Signed-off-by: baoxy92 --- multimedia/av_codec/native_cencinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_cencinfo.h b/multimedia/av_codec/native_cencinfo.h index 2b17c1d10..5accda339 100644 --- a/multimedia/av_codec/native_cencinfo.h +++ b/multimedia/av_codec/native_cencinfo.h @@ -19,7 +19,7 @@ * * @brief This feature enables third-party applications to implement the * media decapsulation and demultiplexing functions by themselves instead - * of using the functions provided by the system. + * of using the functions provided by the system. * * After the DRM instance and session are created, the decryption interface * provided by the DRM can be invoked for decryption. The decryption parameter -- Gitee