From 85d3732bde00a8aa6dbc2cd5017908729d1cc8ce Mon Sep 17 00:00:00 2001 From: zhenghongda <13135671+zhenghongda@user.noreply.gitee.com> Date: Sat, 25 May 2024 11:20:51 +0800 Subject: [PATCH] [DRM] Rectify API annotations. Signed-off-by: zhenghongda --- .../av_codec/native_avcodec_audiocodec.h | 6 ++-- .../av_codec/native_avcodec_videodecoder.h | 7 +++-- multimedia/av_codec/native_avdemuxer.h | 15 +++++---- multimedia/av_codec/native_cencinfo.h | 31 +++++++++++-------- 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_audiocodec.h b/multimedia/av_codec/native_avcodec_audiocodec.h index 5a29f91d9..4a577a90a 100644 --- a/multimedia/av_codec/native_avcodec_audiocodec.h +++ b/multimedia/av_codec/native_avcodec_audiocodec.h @@ -214,8 +214,10 @@ OH_AVErrCode OH_AudioCodec_IsValid(OH_AVCodec *codec, bool *isValid); * @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} + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_INVALID_VAL} 3 - If the codec instance is nullptr or invalid, + * the mediaKeySession is nullptr or invalid. + * {@link AV_ERR_INVALID_STATE} 8 - If the codec service is invalid. * @since 12 * @version 1.0 */ diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 6c41bb599..9b30b7d5d 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -309,8 +309,11 @@ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); * @param codec Pointer to an OH_AVCodec instance * @param mediaKeySession A media key session instance with decryption function. * @param secureVideoPath 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} + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_OPERATE_NOT_PERMIT} 2 - If the codec service or the media key session + * service is in wrong status. + * {@link AV_ERR_INVALID_VAL} 3 - If the codec instance is nullptr or invalid, + * the mediaKeySession is nullptr or invalid. * @since 11 * @version 1.0 */ diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 96717cf96..70417f642 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -142,8 +142,9 @@ OH_AVErrCode OH_AVDemuxer_SeekToTime(OH_AVDemuxer *demuxer, int64_t millisecond, * @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. + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_OPERATE_NOT_PERMIT} 2 - If the demuxer engine is not inited or init failed. + * {@link AV_ERR_INVALID_VAL} 3 - If the demuxer instance is nullptr or invalid. * @since 11 * @version 1.0 */ @@ -155,8 +156,9 @@ OH_AVErrCode OH_AVDemuxer_SetMediaKeySystemInfoCallback(OH_AVDemuxer *demuxer, * @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. + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_OPERATE_NOT_PERMIT} 2 - If the demuxer engine is not inited or init failed. + * {@link AV_ERR_INVALID_VAL} 3 - If the demuxer instance is nullptr or invalid. * @since 12 * @version 1.0 */ @@ -169,8 +171,9 @@ OH_AVErrCode OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback(OH_AVDemuxer *dem * @param demuxer Pointer to an OH_AVDemuxer instance * @param mediaKeySystemInfo Indicates the media key system info which ram space allocated by callee and released by caller. - * @return Returns {@link AV_ERR_OK} if the current position is get; returns an error code defined - * in {@link native_averrors.h} otherwise. + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_INVALID_VAL} 3 - If the demuxer instance is nullptr or invalid + * or the mediaKeySystemInfo is nullptr. * @since 11 * @version 1.0 */ diff --git a/multimedia/av_codec/native_cencinfo.h b/multimedia/av_codec/native_cencinfo.h index 5accda339..95ae00e50 100644 --- a/multimedia/av_codec/native_cencinfo.h +++ b/multimedia/av_codec/native_cencinfo.h @@ -140,7 +140,9 @@ typedef struct DrmSubsample { * * 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 + * @return Returns the newly created OH_AVCencInfo object. If nullptr is returned, the object failed to be created. + * The possible failure is due to the application address space being full, + * or the data in the initialization object has failed. * @since 12 * @version 1.0 */ @@ -154,8 +156,8 @@ OH_AVCencInfo *OH_AVCencInfo_Create(); * 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} + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_INVALID_VAL} 3 - cencInfo is nullptr. * @since 12 * @version 1.0 */ @@ -167,8 +169,8 @@ OH_AVErrCode OH_AVCencInfo_Destroy(OH_AVCencInfo *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. + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_INVALID_VAL} 3 - cencInfo is nullptr. * @since 12 * @version 1.0 */ @@ -183,8 +185,9 @@ OH_AVErrCode OH_AVCencInfo_SetAlgorithm(OH_AVCencInfo *cencInfo, enum DrmCencAlg * @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. + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_INVALID_VAL} 3 - If cencInfo is nullptr, or keyId is nullptr, or keyIdLen != DRM_KEY_ID_SIZE, + * or iv is nullptr, or ivLen != DRM_KEY_IV_SIZE, or keyId copy fails, or iv copy fails. * @since 12 * @version 1.0 */ @@ -201,8 +204,9 @@ OH_AVErrCode OH_AVCencInfo_SetKeyIdAndIv(OH_AVCencInfo *cencInfo, uint8_t *keyId * @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. + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_INVALID_VAL} 3 - If cencInfo is nullptr, or subsampleCount > DRM_KEY_MAX_SUB_SAMPLE_NUM, + * or subsamples is nullptr. * @since 12 * @version 1.0 */ @@ -215,8 +219,8 @@ OH_AVErrCode OH_AVCencInfo_SetSubsampleInfo(OH_AVCencInfo *cencInfo, uint32_t en * @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. + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_INVALID_VAL} 3 - cencInfo is nullptr. * @since 12 * @version 1.0 */ @@ -228,8 +232,9 @@ OH_AVErrCode OH_AVCencInfo_SetMode(OH_AVCencInfo *cencInfo, enum DrmCencInfoMode * @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. + * @return {@link AV_ERR_OK} 0 - Success + * {@link AV_ERR_INVALID_VAL} 3 - If cencInfo is nullptr, or buffer is nullptr, or buffer->buffer_ is nullptr, + * or buffer->buffer_->meta_ is nullptr. * @since 12 * @version 1.0 */ -- Gitee