From 7a5f50218c1852774013ce94d4ec417f439d7b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Fri, 8 Nov 2024 16:45:57 +0800 Subject: [PATCH 1/9] =?UTF-8?q?[interface=5Fsdk]=20=E4=BF=AE=E6=94=B9video?= =?UTF-8?q?decoder=E5=92=8Ccodec=5Fbase=E7=9A=84=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcodec_base.h | 89 ++++++----- .../av_codec/native_avcodec_videodecoder.h | 148 +++++++++--------- 2 files changed, 119 insertions(+), 118 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index fd4ef7373..1e4dc6400 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -67,7 +67,7 @@ typedef struct OH_AVCodec OH_AVCodec; * @syscap SystemCapability.Multimedia.Media.CodecBase * @param codec OH_AVCodec instance * @param errorCode specific error code - * @param userData User specific data + * @param userData The data that the user rely on to execute the callback. * @since 9 */ typedef void (*OH_AVCodecOnError)(OH_AVCodec *codec, int32_t errorCode, void *userData); @@ -80,7 +80,7 @@ typedef void (*OH_AVCodecOnError)(OH_AVCodec *codec, int32_t errorCode, void *us * @syscap SystemCapability.Multimedia.Media.CodecBase * @param codec OH_AVCodec instance * @param format New output stream description information - * @param userData User specific data + * @param userData The data that the user rely on to execute the callback. * @since 9 */ typedef void (*OH_AVCodecOnStreamChanged)(OH_AVCodec *codec, OH_AVFormat *format, void *userData); @@ -93,7 +93,7 @@ typedef void (*OH_AVCodecOnStreamChanged)(OH_AVCodec *codec, OH_AVFormat *format * @param codec OH_AVCodec instance * @param index The index corresponding to the newly available input buffer. * @param data New available input buffer. - * @param userData User specific data + * @param userData The data that the user rely on to execute the callback. * @deprecated since 11 * @useinstead OH_AVCodecOnNeedInputBuffer * @since 9 @@ -127,7 +127,7 @@ typedef void (*OH_AVCodecOnNewOutputData)(OH_AVCodec *codec, uint32_t index, OH_ * @param codec OH_AVCodec instance * @param index The index corresponding to the newly available input buffer. * @param buffer New available input buffer. - * @param userData User specific data + * @param userData The data that the user rely on to execute the callback. * @since 11 */ typedef void (*OH_AVCodecOnNeedInputBuffer)(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData); @@ -288,7 +288,7 @@ extern const char *OH_AVCODEC_MIMETYPE_IMAGE_PNG; extern const char *OH_AVCODEC_MIMETYPE_IMAGE_BMP; /** - * @brief Enumerates the mime types of audio vivid codec. + * @brief Enumerates the mime types of Audio Vivid codec. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 11 @@ -364,7 +364,7 @@ extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_RAW; /** - * @brief Key for timeStamp in surface's extraData, value type is int64_t. + * @brief Key for timeStamp in surfacebuffer, value type is int64_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @deprecated since 14 @@ -372,7 +372,7 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_RAW; */ extern const char *OH_ED_KEY_TIME_STAMP; /** - * @brief Key for endOfStream in surface's extraData, value type is bool. + * @brief Key for endOfStream in surfacebuffer, value type is int32_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @deprecated since 14 @@ -381,7 +381,7 @@ extern const char *OH_ED_KEY_TIME_STAMP; extern const char *OH_ED_KEY_EOS; /** - * @brief Key for track type, value type is int32_t, see {@link OH_MediaType}. + * @brief Key for track media type, value type is int32_t, see {@link OH_MediaType}. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 9 @@ -395,7 +395,7 @@ extern const char *OH_MD_KEY_TRACK_TYPE; */ extern const char *OH_MD_KEY_CODEC_MIME; /** - * @brief Key for file duration in microseconds, value type is int64_t. + * @brief Key for media file duration in microseconds, value type is int64_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 9 @@ -409,7 +409,7 @@ extern const char *OH_MD_KEY_DURATION; */ extern const char *OH_MD_KEY_BITRATE; /** - * @brief Key for max input size, value type is int32_t. + * @brief Key for setting the max decode input size, value type is int32_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 9 @@ -496,7 +496,7 @@ extern const char *OH_MD_KEY_I_FRAME_INTERVAL; extern const char *OH_MD_KEY_ROTATION; /** - * @brief Key for video YUV value range flag, value type is bool, true for full range, false for limited range. + * @brief Key for video YUV value range flag, value type is int32_t, 1 for full range, 0 for limited range. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -524,7 +524,7 @@ extern const char *OH_MD_KEY_TRANSFER_CHARACTERISTICS; */ extern const char *OH_MD_KEY_MATRIX_COEFFICIENTS; /** - * @brief Key for the request an I-Frame immediately, value type is bool. + * @brief Key for the request an I-Frame immediately, value type is int32_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -539,91 +539,91 @@ extern const char *OH_MD_KEY_REQUEST_I_FRAME; */ extern const char *OH_MD_KEY_QUALITY; /** - * @brief Key of the codec specific data. value type is a uint8_t pointer. - * + * @brief Key of the codec specific data. + * in video, SPS/PPS is transferred. in audio, extraData is transferred. * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_CODEC_CONFIG; /** - * @brief source format Key for title, value type is string. + * @brief Key for media file title, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_TITLE; /** - * @brief source format Key for artist, value type is string. + * @brief Key for Media file artist, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_ARTIST; /** - * @brief source format Key for album, value type is string. + * @brief key for the media files of the album, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_ALBUM; /** - * @brief source format Key for album artist, value type is string. + * @brief Key for album artist, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_ALBUM_ARTIST; /** - * @brief source format Key for date, value type is string. + * @brief Key for media file date, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_DATE; /** - * @brief source format Key for comment, value type is string. + * @brief Key for media file comment, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_COMMENT; /** - * @brief source format Key for genre, value type is string. + * @brief Key for media file genre, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_GENRE; /** - * @brief source format Key for copyright, value type is string. + * @brief Key for media file copyright, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_COPYRIGHT; /** - * @brief source format Key for language, value type is string. + * @brief Key for media file language, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_LANGUAGE; /** - * @brief source format Key for description, value type is string. + * @brief Key for media file description, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_DESCRIPTION; /** - * @brief source format Key for lyrics, value type is string. + * @brief Key for media file lyrics, value type is string. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_LYRICS; /** - * @brief source format Key for track count, value type is int32_t. + * @brief Key for media file track count, value type is int32_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -646,6 +646,8 @@ extern const char *OH_MD_KEY_CHANNEL_LAYOUT; extern const char *OH_MD_KEY_BITS_PER_CODED_SAMPLE; /** * @brief Key for the aac format, value type is int32_t, supported for aac decoder. + * The aac format is divided into ADTS format and LATM format. + * where 0 represents LATM format and 1 represents ADTS format. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -659,7 +661,7 @@ extern const char *OH_MD_KEY_AAC_IS_ADTS; */ extern const char *OH_MD_KEY_SBR; /** - * @brief Key for flac compliance level, value type is int32_t. + * @brief Key for flac compliance level, value type is int32_t. only used in audio encode. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -711,21 +713,21 @@ extern const char *OH_MD_MAX_OUTPUT_BUFFER_COUNT; */ extern const char *OH_MD_KEY_AUDIO_COMPRESSION_LEVEL; /** - * @brief Key of the video is hdr vivid. value type is bool. + * @brief key for whether the video track in the media file is HDR Vivid. value type is int32_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 11 */ extern const char *OH_MD_KEY_VIDEO_IS_HDR_VIVID; /** - * @brief Key for number of audio objects. value type is int32_t. + * @brief Key for number of audio objects. value type is int32_t. only used for Audio Vivid decode. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 11 */ extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER; /** - * @brief Key for meta data of audio vivid. value type is a uint8_t pointer. + * @brief Key for meta data of Audio Vivid. value type is a uint8_t pointer. only used for Audio Vivid decode. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 11 @@ -752,8 +754,9 @@ extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT; */ 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. + * @brief Key for describing the interval size at the base layer in temporal group of picture, 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 @@ -796,8 +799,8 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR; */ 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. + * @brief Key for whether the frame corresponding to output buffer in OH_AVBuffer 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 @@ -911,8 +914,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; /** * @brief Key for describing the video frame averge quantization parameter, value type is int32_t. - * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video - * frame. + * Indicate the average qp value of the current frame encode block, which is output with OH_AVBuffer. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -920,22 +922,23 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE; /** * @brief Key for describing video frame mean squared error, value type is double. - * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video - * frame. + * Indicate the MSE statistics of the current frame encode block, which is output with OH_AVBuffer. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_MSE; /** - * @brief Key for decoding timestamp of the buffer in microseconds, value type is int64_t. + * @brief Key for decoding timestamp corresponding to the sample of audio, video, or subtitles carried in OH_AVBuffer, + * 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. + * @brief Key for duration corresponding to the sample of audio, video, or subtitles carried in OH_AVBuffer, + * in microseconds, value type is int64_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -969,7 +972,7 @@ extern const char *OH_MD_KEY_TRACK_START_TIME; * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709. * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}. - * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will + * If the input video is not an HDR Vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will * be reported by callback function {@link OH_AVCodecOnError}. * * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -1119,7 +1122,7 @@ typedef enum OH_VVCProfile { } OH_VVCProfile; /** - * @brief Enumerates the muxer output file format + * @brief output file format supported by the muxer. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -1152,7 +1155,7 @@ typedef enum OH_AVOutputFormat { * @since 10 */ typedef enum OH_AVSeekMode { - /* seek to sync sample after the time */ + /* seek to sync sample after the time. If there is no I-frame after the time point, the mode may fail to seek */ SEEK_MODE_NEXT_SYNC = 0, /* seek to sync sample before the time */ SEEK_MODE_PREVIOUS_SYNC, diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 462d5011d..0bc7a5f67 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -58,7 +58,7 @@ typedef struct MediaKeySession MediaKeySession; * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param mime mime type description string, refer to {@link AVCODEC_MIME_TYPE} * @return Returns a Pointer to an OH_AVCodec instance. - * Return nullptr if memory ran out or the mime type is not supported. + * Return NULL if memory ran out or the mime type is not supported. * @since 9 */ OH_AVCodec *OH_VideoDecoder_CreateByMime(const char *mime); @@ -66,16 +66,18 @@ OH_AVCodec *OH_VideoDecoder_CreateByMime(const char *mime); /** * @brief Create a video decoder instance through the video decoder name. * The premise of using this interface is to know the exact name of the decoder. + * The decoder name can be obtained through capability query. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param name video codec name * @return Returns a Pointer to an OH_AVCodec instance. - * Return nullptr if memory ran out or the decoder name is not supported. + * Return NULL if memory ran out or the decoder name is not supported. * @since 9 */ OH_AVCodec *OH_VideoDecoder_CreateByName(const char *name); /** - * @brief Clear the internal resources of the decoder and destroy the decoder instance + * @brief Clear the internal resources of the decoder and destroy the decoder instance. + * Can not be destoryed repeatedly. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if succeed, @@ -83,7 +85,7 @@ OH_AVCodec *OH_VideoDecoder_CreateByName(const char *name); * {@link AV_ERR_NO_MEMORY}, inner resource has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Destroy(OH_AVCodec *codec); @@ -100,7 +102,7 @@ OH_AVErrCode OH_VideoDecoder_Destroy(OH_AVCodec *codec); * {@link AV_ERR_NO_MEMORY}, inner resource has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. * @deprecated since 11 * @useinstead OH_VideoDecoder_RegisterCallback @@ -120,7 +122,7 @@ OH_AVErrCode OH_VideoDecoder_SetCallback(OH_AVCodec *codec, OH_AVCodecAsyncCallb * {@link AV_ERR_NO_MEMORY}, inner resource has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. * @since 11 */ @@ -135,10 +137,9 @@ OH_AVErrCode OH_VideoDecoder_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallb * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, inner resource has already released. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, not permit to call the interface in buffer mode. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, not permit to call the interface in Buffer mode. + * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; 2.window is nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 9 */ @@ -146,18 +147,17 @@ OH_AVErrCode OH_VideoDecoder_SetSurface(OH_AVCodec *codec, OHNativeWindow *windo /** * @brief To configure the video decoder, typically, you need to configure the description information of the decoded - * video track, which can be extracted from the OH_AVSource. This interface must be called before Prepare is called. + * video, which can be extracted from the OH_AVSource. This interface must be called before Prepare is called. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param format A pointer to an OH_AVFormat to give the description of the video track to be decoded * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. Invalid param in format. + * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; 2.Invalid param in format. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. - * {@link AV_ERR_UNSUPPORT}, unsupported features. * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}, video unsupported color space conversion. * @since 9 */ @@ -173,9 +173,9 @@ OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, decoder is in buffer mode and color space conversion is configured. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, 1.internal execution error; + * 2.decoder is in Buffer mode and color space conversion is configured. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Prepare(OH_AVCodec *codec); @@ -190,16 +190,17 @@ OH_AVErrCode OH_VideoDecoder_Prepare(OH_AVCodec *codec); * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, video color space conversion is configured but decoder is not prepared. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, 1.internal execution error; + * 2.video color space conversion is configured but decoder is not prepared. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Start(OH_AVCodec *codec); /** - * @brief Stop the decoder. After stopping, you can re-enter the Started state through Start, - * but it should be noted that if Codec-Specific-Data has been input to the decoder before, it needs to be input again. + * @brief Stop the decoder and release the input and output buffer. After stopping, + * you can re-enter the Executing state through Start,but it should be noted that + * if Codec-Specific-Data has been input to the decoder before, it needs to be input again. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if the execution is successful, @@ -207,16 +208,16 @@ OH_AVErrCode OH_VideoDecoder_Start(OH_AVCodec *codec); * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Stop(OH_AVCodec *codec); /** - * @brief Clear the input and output data buffered in the decoder. After this interface is called, all the Buffer - * indexes previously reported through the asynchronous callback will be invalidated, make sure not to access - * the Buffers corresponding to these indexes. + * @brief Clear the input and output data buffered and parameters in the decoder, for example, PPS/SPS in H264 format. + * After this interface is called, all the buffer indexes previously reported through the asynchronous callback + * will be invalidated, make sure not to access the buffers corresponding to these indexes. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if the execution is successful, @@ -224,15 +225,15 @@ OH_AVErrCode OH_VideoDecoder_Stop(OH_AVCodec *codec); * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Flush(OH_AVCodec *codec); /** - * @brief Reset the decoder. To continue decoding, you need to call the Configure interface again - * to configure the decoder instance. + * @brief Reset the decoder, the decoder returns to the Initialized state. + * To continue decoding, you need to call the Configure interface again to configure the decoder instance. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if the execution is successful, @@ -240,7 +241,7 @@ OH_AVErrCode OH_VideoDecoder_Flush(OH_AVCodec *codec); * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 9 */ @@ -249,11 +250,11 @@ OH_AVErrCode OH_VideoDecoder_Reset(OH_AVCodec *codec); /** * @brief Get the description information of the output data of the decoder, refer to {@link OH_AVFormat} * 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. + * to be released by {@link OH_AVFormat_Destroy}. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @return Returns a pointer to an OH_AVFormat instance. - * Return nullptr if the decoder is nullptr or invaild. + * Return NULL if the decoder is nullptr or invaild. * @since 9 */ OH_AVFormat *OH_VideoDecoder_GetOutputDescription(OH_AVCodec *codec); @@ -267,9 +268,9 @@ OH_AVFormat *OH_VideoDecoder_GetOutputDescription(OH_AVCodec *codec); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. Invalid param in format. + * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; 2.Invalid param in format. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 9 */ @@ -284,15 +285,14 @@ OH_AVErrCode OH_VideoDecoder_SetParameter(OH_AVCodec *codec, OH_AVFormat *format * process of the decoder, such as PPS/SPS data in H264 format. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index Enter the index value corresponding to the Buffer - * @param attr Information describing the data contained in the Buffer + * @param index Enter the index value corresponding to the buffer, should be given by {@link OH_AVCodecOnNeedInputData}. + * @param attr Information describing the data contained in the buffer * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. - * Buffer index should be given by {@link OH_AVCodecOnNeedInputData}. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @deprecated since 11 * @useinstead OH_VideoDecoder_PushInputBuffer @@ -301,19 +301,18 @@ OH_AVErrCode OH_VideoDecoder_SetParameter(OH_AVCodec *codec, OH_AVFormat *format OH_AVErrCode OH_VideoDecoder_PushInputData(OH_AVCodec *codec, uint32_t index, OH_AVCodecBufferAttr attr); /** - * @brief Return the processed output Buffer to the decoder, and notify the decoder to finish rendering the - * decoded data contained in the Buffer on the output Surface. If the output surface is not configured before, + * @brief Return the processed output buffer to the decoder, and notify the decoder to finish rendering the + * decoded data contained in the buffer on the output surface. If the output surface is not configured before, * calling this interface only returns the output buffer corresponding to the specified index to the decoder. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index The index value corresponding to the output Buffer + * @param index The index value corresponding to the output buffer, should be given by {@link OH_AVCodecOnNewOutputData} * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. - * Buffer index should be given by {@link OH_AVCodecOnNewOutputData}. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @deprecated since 11 * @useinstead OH_VideoDecoder_RenderOutputBuffer @@ -322,17 +321,16 @@ OH_AVErrCode OH_VideoDecoder_PushInputData(OH_AVCodec *codec, uint32_t index, OH OH_AVErrCode OH_VideoDecoder_RenderOutputData(OH_AVCodec *codec, uint32_t index); /** - * @brief Return the processed output Buffer to the decoder. + * @brief Return the processed output buffer to the decoder. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index The index value corresponding to the output Buffer + * @param index The index value corresponding to the output buffer,should be given by {@link OH_AVCodecOnNewOutputData}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. - * Buffer index should be given by {@link OH_AVCodecOnNewOutputData}. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @deprecated since 11 * @useinstead OH_VideoDecoder_FreeOutputBuffer @@ -341,43 +339,41 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputData(OH_AVCodec *codec, uint32_t index) OH_AVErrCode OH_VideoDecoder_FreeOutputData(OH_AVCodec *codec, uint32_t index); /** - * @brief Submit the input buffer filled with data to the video decoder. The {@link OH_AVCodecOnNeedInputBuffer} - * callback will report the available input buffer and the corresponding index value. Once the buffer with the - * specified index is submitted to the video decoder, the buffer cannot be accessed again until the + * @brief Notify the video decoder that the buffer corresponding to the index has been filled with input data. + * The {@link OH_AVCodecOnNeedInputBuffer} callback will report the available input buffer and the corresponding index value. + * Once the buffer with the specified index is submitted to the video decoder, the buffer cannot be accessed again until the * {@link OH_AVCodecOnNeedInputBuffer} callback is received again reporting that the buffer with the same index is * available. In addition, for some decoders, it is required to input Codec-Specific-Data to the decoder at the * beginning to initialize the decoding process of the decoder, such as PPS/SPS data in H264 format. + * The invoker can use this interface to transfer the parameters required for decoding to the decoder, such as PPS/SPS data + * in H264 format. the parameters can be sent to the decoder independently or together with the data to be decoded. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index The index of the input buffer. + * @param index The index of the input buffer, should be given by {@link OH_AVCodecOnNeedInputBuffer}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. - * Buffer index should be given by {@link OH_AVCodecOnNeedInputBuffer}. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. - * {@link AV_ERR_DRM_DECRYPT_FAILED}, the drm-protected video buffer is decrypted failed, - * it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_VideoDecoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index); /** - * @brief Return the processed output Buffer to the decoder, and notify the decoder to finish rendering the - * decoded data contained in the Buffer on the output Surface. If the output surface is not configured before, + * @brief Return the processed output buffer to the decoder, and notify the decoder to finish rendering the + * decoded data contained in the buffer on the output surface. If the output surface is not configured before, * calling this interface only returns the output buffer corresponding to the specified index to the decoder. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index The index value corresponding to the output Buffer + * @param index The index value corresponding to the output buffer, should be given by {@link OH_AVCodecOnNewOutputBuffer}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. - * Buffer index should be given by {@link OH_AVCodecOnNewOutputBuffer}. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 11 */ @@ -392,7 +388,7 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputBuffer(OH_AVCodec *codec, uint32_t inde * timestamp). For this to work, the timestamp needs to be reasonably close to the current SystemNanoTime. A few notes: * 1. The buffer will not be returned to the codec until the timestamp has passed and the buffer is no longer used by * the surface. - * 2. Buffers are processed sequentially, so you may block subsequent buffers to be displayed on the surface. + * 2. buffers are processed sequentially, so you may block subsequent buffers to be displayed on the surface. * This is important if you want to react to user action, e.g. stop the video or seek. * 3. If multiple buffers are sent to the surface to be rendered at the same VSYNC, the last one will be shown, and the * other ones will be dropped. @@ -409,24 +405,28 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputBuffer(OH_AVCodec *codec, uint32_t inde * {@link AV_ERR_NO_MEMORY}, the codec has already released. * {@link AV_ERR_INVALID_VAL}, the parameter is invalid. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 12 */ OH_AVErrCode OH_VideoDecoder_RenderOutputBufferAtTime(OH_AVCodec *codec, uint32_t index, int64_t renderTimestampNs); /** - * @brief Return the processed output Buffer to the decoder. + * @brief Return the processed output buffer to the decoder. + * Need to call this interface to release output buffer immediately after using. + * otherwise, the decode process will be blocked. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index The index value corresponding to the output Buffer + * @param index The index value corresponding to the output buffer, + * should be given by {@link OH_AVCodecOnNewOutputBuffer}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. - * Buffer index should be given by {@link OH_AVCodecOnNewOutputBuffer}. + * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; + * 2.the index is vaild or consecutively assigned to the same index, + * the error do not affect the subsequent decode process. * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 11 */ @@ -437,14 +437,11 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index) * switchback from the background. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param isValid Output parameter. A pointer to a boolean instance, it is true if the codec instance is valid, - * false if the codec instance is invalid + * @param isValid Output parameter. A pointer to a bool instance, it is true if the codec instance is valid, + * false if the codec instance is invalid. it is recommend that the invoker initialize isValid to false * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. - * {@link AV_ERR_UNKNOWN}, unknown error. - * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. * @since 10 */ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); @@ -455,13 +452,14 @@ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @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 {@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. + * @param secureVideoPath Secure video Path. set the secure video path as true and the non secure video path as false. + * In Surface mode, both secure and non secure video Path are supported. + * In Buffer mode, only non secure video Path are supported. + * @return {@link AV_ERR_OK}, execution is successful + * {@link AV_ERR_OPERATE_NOT_PERMIT}, 1.Internal execution error; + * 2.The decode service process is abnormal; 3.The media key session service is in an wrong state. * {@link AV_ERR_NO_MEMORY}, instance has already released or no memory. - * {@link AV_ERR_INVALID_VAL} 3 - If the codec instance is nullptr or invalid, - * the mediaKeySession is nullptr or invalid. + * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; 2.mediaKeySession is nullptr or invalid. * @since 11 */ OH_AVErrCode OH_VideoDecoder_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySession *mediaKeySession, -- Gitee From 8c01c4a26e1ca0f33ff3c3c43d54f7a81e6a0310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Thu, 14 Nov 2024 11:25:15 +0800 Subject: [PATCH 2/9] [interface_sdk] fix comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcodec_base.h | 54 +++++++------- .../av_codec/native_avcodec_videodecoder.h | 73 +++++++++++-------- 2 files changed, 69 insertions(+), 58 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 1e4dc6400..4c3363792 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -103,7 +103,7 @@ typedef void (*OH_AVCodecOnNeedInputData)(OH_AVCodec *codec, uint32_t index, OH_ /** * @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be * called and carry a Buffer containing the new output data. It should be noted that the life cycle of the - * OH_AVCodecBufferAttr pointer is only valid when the function pointer is called. , which prohibits continued + * OH_AVCodecBufferAttr pointer is only valid when the function pointer is called, which prohibits continued * access after the call ends. * * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -186,7 +186,7 @@ typedef struct OH_AVCodecCallback { } OH_AVCodecCallback; /** - * @brief the function pointer will be called to get sequence media data. + * @brief The function pointer will be called to get sequence media data. * @syscap SystemCapability.Multimedia.Media.CodecBase * @param data OH_AVBuffer buffer to fill * @param length expected to read size; @@ -458,7 +458,7 @@ extern const char *OH_MD_KEY_FRAME_RATE; */ extern const char *OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE; /** - * @brief encode profile, the value type is int32_t. see {@link OH_AVCProfile}, {@link OH_HEVCProfile}, + * @brief Encode profile, the value type is int32_t. see {@link OH_AVCProfile}, {@link OH_HEVCProfile}, * {@link OH_AACProfile}. * * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -480,7 +480,7 @@ extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT; */ extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; /** - * @brief Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no + * @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 @@ -488,7 +488,7 @@ extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; */ extern const char *OH_MD_KEY_I_FRAME_INTERVAL; /** - * @brief Key of the surface rotation angle. value type is int32_t: should be {0, 90, 180, 270}, default is 0. + * @brief Key of the surface rotation angle, value type is int32_t: should be {0, 90, 180, 270}, default is 0. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 9 @@ -525,13 +525,14 @@ extern const char *OH_MD_KEY_TRANSFER_CHARACTERISTICS; extern const char *OH_MD_KEY_MATRIX_COEFFICIENTS; /** * @brief Key for the request an I-Frame immediately, value type is int32_t. + * It is used when OH_VideoEncoder_SetParameter is called or takes effect immediately with the frame. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ extern const char *OH_MD_KEY_REQUEST_I_FRAME; /** - * @brief Key for the desired encoding quality, value type is int32_t, this key is only. + * @brief Key for the desired encoding quality, value type is int32_t, this key is only * supported for encoders that are configured in constant quality mode. * * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -539,8 +540,8 @@ extern const char *OH_MD_KEY_REQUEST_I_FRAME; */ extern const char *OH_MD_KEY_QUALITY; /** - * @brief Key of the codec specific data. - * in video, SPS/PPS is transferred. in audio, extraData is transferred. + * @brief Key of the codec specific data, value type is a uint8_t pointer. + * In video, SPS/PPS is transferred. In audio, extraData is transferred. * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ @@ -647,7 +648,7 @@ extern const char *OH_MD_KEY_BITS_PER_CODED_SAMPLE; /** * @brief Key for the aac format, value type is int32_t, supported for aac decoder. * The aac format is divided into ADTS format and LATM format. - * where 0 represents LATM format and 1 represents ADTS format. + * Where 0 represents LATM format and 1 represents ADTS format. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -661,7 +662,7 @@ extern const char *OH_MD_KEY_AAC_IS_ADTS; */ extern const char *OH_MD_KEY_SBR; /** - * @brief Key for flac compliance level, value type is int32_t. only used in audio encode. + * @brief Key for flac compliance level, value type is int32_t, only used in audio encoding. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -713,21 +714,22 @@ extern const char *OH_MD_MAX_OUTPUT_BUFFER_COUNT; */ extern const char *OH_MD_KEY_AUDIO_COMPRESSION_LEVEL; /** - * @brief key for whether the video track in the media file is HDR Vivid. value type is int32_t. + * @brief key for whether the video track in the media file is HDR Vivid, value type is int32_t. + * Demuxer and muxer are supported. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 11 */ extern const char *OH_MD_KEY_VIDEO_IS_HDR_VIVID; /** - * @brief Key for number of audio objects. value type is int32_t. only used for Audio Vivid decode. + * @brief Key for number of audio objects, value type is int32_t, only used in Audio Vivid decoding. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 11 */ extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER; /** - * @brief Key for meta data of Audio Vivid. value type is a uint8_t pointer. only used for Audio Vivid decode. + * @brief Key for meta data of Audio Vivid, value type is a uint8_t pointer, only used in Audio Vivid decoding. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 11 @@ -746,8 +748,8 @@ 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. + * with enum {@link VIDEO_ENCODER_TEMPORAL_SCALABILITY}. This is an optional key that applies only to video encoding. + * It is used in Configure state. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -765,7 +767,7 @@ 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. + * This is an optional key that applies only to video encodeing. It is used in Configure state. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -775,7 +777,7 @@ 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. + * the key. This is an optional key that applies only to video encodeing. It is used in Configure state. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -784,7 +786,7 @@ 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 number 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. + * optional key that applies only to video encoding input loop. It takes effect immediately. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -792,7 +794,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT; 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. + * an optional key that applies only to video encodeing input loop. It takes effect immediately. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -800,8 +802,8 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR; extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR; /** * @brief Key for whether the frame corresponding to output buffer in OH_AVBuffer 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. + * value type is int32_t (0 or 1): 1 is LTR,0 otherwise. This is an optional key that applies only + * to video encodeing output loop. It indicates the attribute of the frame. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -809,7 +811,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR; 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. + * encodeing output loop. It indicates the attribute of the frame. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -889,8 +891,8 @@ extern const char *OH_MD_KEY_VIDEO_PIC_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. + * the codec standards. This is an optional key that applies only to video encodeing or video decoding. + * It is used in Configure state. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -914,7 +916,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; /** * @brief Key for describing the video frame averge quantization parameter, value type is int32_t. - * Indicate the average qp value of the current frame encode block, which is output with OH_AVBuffer. + * Indicate the average qp value of the current frame encoding block, which is output with OH_AVBuffer. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -922,7 +924,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE; /** * @brief Key for describing video frame mean squared error, value type is double. - * Indicate the MSE statistics of the current frame encode block, which is output with OH_AVBuffer. + * Indicate the MSE statistics of the current frame encoding block, which is output with OH_AVBuffer. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 0bc7a5f67..3a3b1e0d6 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -54,7 +54,7 @@ extern "C" { typedef struct MediaKeySession MediaKeySession; /** - * @brief Creates a video decoder instance from the mime type, which is recommended in most cases. + * @brief Creates a video decoder instance from the mime type, it is recommended to use. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param mime mime type description string, refer to {@link AVCODEC_MIME_TYPE} * @return Returns a Pointer to an OH_AVCodec instance. @@ -82,7 +82,7 @@ OH_AVCodec *OH_VideoDecoder_CreateByName(const char *name); * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if succeed, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, inner resource has already released. + * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. @@ -96,10 +96,10 @@ OH_AVErrCode OH_VideoDecoder_Destroy(OH_AVCodec *codec); * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param callback A collection of all callback functions, see {@link OH_AVCodecAsyncCallback} - * @param userData User specific data + * @param userData The data that the user rely on to execute the callback * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, inner resource has already released. + * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. @@ -116,10 +116,10 @@ OH_AVErrCode OH_VideoDecoder_SetCallback(OH_AVCodec *codec, OH_AVCodecAsyncCallb * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param callback A collection of all callback functions, see {@link OH_AVCodecCallback} - * @param userData User specific data + * @param userData The data that the user rely on to execute the callback * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, inner resource has already released. + * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. @@ -129,14 +129,14 @@ OH_AVErrCode OH_VideoDecoder_SetCallback(OH_AVCodec *codec, OH_AVCodecAsyncCallb OH_AVErrCode OH_VideoDecoder_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallback callback, void *userData); /** - * @brief Specify the output Surface to provide video decoding output, + * @brief Specify the output surface to provide video decoding output, * this interface must be called before Prepare is called * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param window A pointer to a OHNativeWindow instance, see {@link OHNativeWindow} * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, inner resource has already released. + * {@link AV_ERR_NO_MEMORY}, instance has already released. * {@link AV_ERR_OPERATE_NOT_PERMIT}, not permit to call the interface in Buffer mode. * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; 2.window is nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. @@ -154,7 +154,7 @@ OH_AVErrCode OH_VideoDecoder_SetSurface(OH_AVCodec *codec, OHNativeWindow *windo * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; 2.Invalid param in format. + * {@link AV_ERR_INVALID_VAL}, 1. the decoder is nullptr or invalid; 2. Invalid param in format. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. @@ -164,7 +164,7 @@ OH_AVErrCode OH_VideoDecoder_SetSurface(OH_AVCodec *codec, OHNativeWindow *windo OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); /** - * @brief To prepare the internal resources of the decoder, the Configure interface must be called before + * @brief Prepare the internal resources of the decoder, the Configure interface must be called before * calling this interface. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance @@ -174,8 +174,9 @@ OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, 1.internal execution error; - * 2.decoder is in Buffer mode and color space conversion is configured. + * {@link AV_ERR_OPERATE_NOT_PERMIT} + * 1. internal execution error; + * 2. decoder is in Buffer mode and color space conversion is configured. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Prepare(OH_AVCodec *codec); @@ -191,15 +192,16 @@ OH_AVErrCode OH_VideoDecoder_Prepare(OH_AVCodec *codec); * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, 1.internal execution error; - * 2.video color space conversion is configured but decoder is not prepared. + * {@link AV_ERR_OPERATE_NOT_PERMIT} + * 1. internal execution error; + * 2. video color space conversion is configured but decoder is not Prepared. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Start(OH_AVCodec *codec); /** * @brief Stop the decoder and release the input and output buffer. After stopping, - * you can re-enter the Executing state through Start,but it should be noted that + * you can re-enter the Executing state through Start, but it should be noted that * if Codec-Specific-Data has been input to the decoder before, it needs to be input again. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance @@ -268,7 +270,7 @@ OH_AVFormat *OH_VideoDecoder_GetOutputDescription(OH_AVCodec *codec); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; 2.Invalid param in format. + * {@link AV_ERR_INVALID_VAL}, 1. the decoder is nullptr or invalid; 2. invalid param in format. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -340,13 +342,14 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputData(OH_AVCodec *codec, uint32_t index); /** * @brief Notify the video decoder that the buffer corresponding to the index has been filled with input data. - * The {@link OH_AVCodecOnNeedInputBuffer} callback will report the available input buffer and the corresponding index value. - * Once the buffer with the specified index is submitted to the video decoder, the buffer cannot be accessed again until the - * {@link OH_AVCodecOnNeedInputBuffer} callback is received again reporting that the buffer with the same index is - * available. In addition, for some decoders, it is required to input Codec-Specific-Data to the decoder at the - * beginning to initialize the decoding process of the decoder, such as PPS/SPS data in H264 format. - * The invoker can use this interface to transfer the parameters required for decoding to the decoder, such as PPS/SPS data - * in H264 format. the parameters can be sent to the decoder independently or together with the data to be decoded. + * {@link OH_AVCodecOnNeedInputBuffer} callback will report the available input buffer and the corresponding index value. + * Once the buffer with the specified index is submitted to the video decoder, the buffer cannot be accessed again + * until the {@link OH_AVCodecOnNeedInputBuffer} callback is received again reporting that the buffer with + * the same index is available. In addition, for some decoders, it is required to input Codec-Specific-Data to + * the decoder at the beginning to initialize the decoding process of the decoder, such as PPS/SPS data in H264 format. + * The invoker can use this interface to transfer the parameters required for decoding to the decoder, + * such as PPS/SPS data in H264 format. The parameters can be sent to the decoder independently + * or together with the data to be decoded. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param index The index of the input buffer, should be given by {@link OH_AVCodecOnNeedInputBuffer}. @@ -367,7 +370,8 @@ OH_AVErrCode OH_VideoDecoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index); * calling this interface only returns the output buffer corresponding to the specified index to the decoder. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index The index value corresponding to the output buffer, should be given by {@link OH_AVCodecOnNewOutputBuffer}. + * @param index The index value corresponding to the output buffer, + * should be given by {@link OH_AVCodecOnNewOutputBuffer}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. @@ -392,7 +396,7 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputBuffer(OH_AVCodec *codec, uint32_t inde * This is important if you want to react to user action, e.g. stop the video or seek. * 3. If multiple buffers are sent to the surface to be rendered at the same VSYNC, the last one will be shown, and the * other ones will be dropped. - * 4. If the timestamp is not "reasonably close" to the current system time, the Surface will + * 4. If the timestamp is not "reasonably close" to the current system time, the surface will * ignore the timestamp, and display the buffer at the earliest feasible time. In this mode it will not drop frames. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance @@ -414,7 +418,7 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputBufferAtTime(OH_AVCodec *codec, uint32_ /** * @brief Return the processed output buffer to the decoder. * Need to call this interface to release output buffer immediately after using. - * otherwise, the decode process will be blocked. + * otherwise, the decoding process will be blocked. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param index The index value corresponding to the output buffer, @@ -422,8 +426,9 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputBufferAtTime(OH_AVCodec *codec, uint32_ * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; - * 2.the index is vaild or consecutively assigned to the same index, + * {@link AV_ERR_INVALID_VAL} + * 1. the decoder is nullptr or invalid; + * 2. the index is vaild or consecutively assigned to the same index, * the error do not affect the subsequent decode process. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. @@ -438,7 +443,7 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index) * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param isValid Output parameter. A pointer to a bool instance, it is true if the codec instance is valid, - * false if the codec instance is invalid. it is recommend that the invoker initialize isValid to false + * false if the codec instance is invalid. It is recommend that the invoker initialize isValid to false * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. @@ -456,10 +461,14 @@ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); * In Surface mode, both secure and non secure video Path are supported. * In Buffer mode, only non secure video Path are supported. * @return {@link AV_ERR_OK}, execution is successful - * {@link AV_ERR_OPERATE_NOT_PERMIT}, 1.Internal execution error; - * 2.The decode service process is abnormal; 3.The media key session service is in an wrong state. + * {@link AV_ERR_OPERATE_NOT_PERMIT} + * 1. internal execution error; + * 2. the decode service process is abnormal; + * 3. the media key session service is in an wrong state. * {@link AV_ERR_NO_MEMORY}, instance has already released or no memory. - * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; 2.mediaKeySession is nullptr or invalid. + * {@link AV_ERR_INVALID_VAL} + * 1. the decoder is nullptr or invalid; + * 2. mediaKeySession is nullptr or invalid. * @since 11 */ OH_AVErrCode OH_VideoDecoder_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySession *mediaKeySession, -- Gitee From 3f5e3fb9aec96f57f385557504624220750ee32d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Thu, 14 Nov 2024 11:45:46 +0800 Subject: [PATCH 3/9] [interface_sdk] fix comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcodec_base.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 4c3363792..60e1b8339 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -87,7 +87,7 @@ typedef void (*OH_AVCodecOnStreamChanged)(OH_AVCodec *codec, OH_AVFormat *format /** * @brief When OH_AVCodec needs new input data during the running process, - * the function pointer will be called and carry an available Buffer to fill in the new input data. + * the function pointer will be called and carry an available buffer to fill in the new input data. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @param codec OH_AVCodec instance @@ -102,15 +102,15 @@ typedef void (*OH_AVCodecOnNeedInputData)(OH_AVCodec *codec, uint32_t index, OH_ /** * @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be - * called and carry a Buffer containing the new output data. It should be noted that the life cycle of the + * called and carry a buffer containing the new output data. It should be noted that the life cycle of the * OH_AVCodecBufferAttr pointer is only valid when the function pointer is called, which prohibits continued * access after the call ends. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @param codec OH_AVCodec instance - * @param index The index corresponding to the new output Buffer. + * @param index The index corresponding to the new output buffer. * @param data Buffer containing the new output data - * @param attr The description of the new output Buffer, please refer to {@link OH_AVCodecBufferAttr} + * @param attr The description of the new output buffer, please refer to {@link OH_AVCodecBufferAttr} * @param userData specified data * @deprecated since 11 * @useinstead OH_AVCodecOnNewOutputBuffer @@ -121,7 +121,7 @@ typedef void (*OH_AVCodecOnNewOutputData)(OH_AVCodec *codec, uint32_t index, OH_ /** * @brief When OH_AVCodec needs new input data during the running process, - * the function pointer will be called and carry an available Buffer to fill in the new input data. + * the function pointer will be called and carry an available buffer to fill in the new input data. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @param codec OH_AVCodec instance @@ -134,11 +134,11 @@ typedef void (*OH_AVCodecOnNeedInputBuffer)(OH_AVCodec *codec, uint32_t index, O /** * @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be - * called and carry a Buffer containing the new output data. + * called and carry a buffer containing the new output data. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @param codec OH_AVCodec instance - * @param index The index corresponding to the new output Buffer. + * @param index The index corresponding to the new output buffer. * @param buffer Buffer containing the new output buffer. * @param userData specified data * @since 11 @@ -757,8 +757,8 @@ extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT; extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY; /** * @brief Key for describing the interval size at the base layer in temporal group of picture, 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. + * It takes effect only when temporal level scale is enable. This is an optional key that applies only to video encoding. + * It is used in Configure state. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -916,7 +916,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX; extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN; /** * @brief Key for describing the video frame averge quantization parameter, value type is int32_t. - * Indicate the average qp value of the current frame encoding block, which is output with OH_AVBuffer. + * Indicate the average qp value of the current frame encoding block, which is output with OH_AVBuffer. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 -- Gitee From 43dab57fd55b0d13b72711a4e00aa3132945ba2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Thu, 14 Nov 2024 17:22:57 +0800 Subject: [PATCH 4/9] [interface_sdk] fix compliance error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcodec_base.h | 3 ++- .../av_codec/native_avcodec_videodecoder.h | 20 +++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 60e1b8339..43575f35f 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -757,7 +757,8 @@ extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT; extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY; /** * @brief Key for describing the interval size at the base layer in temporal group of picture, 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 encoding. + * It takes effect only when temporal level scale is enable. + * This is an optional key that applies only to video encoding. * It is used in Configure state. * * @syscap SystemCapability.Multimedia.Media.CodecBase diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 3a3b1e0d6..b16512dfd 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -342,14 +342,14 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputData(OH_AVCodec *codec, uint32_t index); /** * @brief Notify the video decoder that the buffer corresponding to the index has been filled with input data. - * {@link OH_AVCodecOnNeedInputBuffer} callback will report the available input buffer and the corresponding index value. - * Once the buffer with the specified index is submitted to the video decoder, the buffer cannot be accessed again - * until the {@link OH_AVCodecOnNeedInputBuffer} callback is received again reporting that the buffer with - * the same index is available. In addition, for some decoders, it is required to input Codec-Specific-Data to - * the decoder at the beginning to initialize the decoding process of the decoder, such as PPS/SPS data in H264 format. - * The invoker can use this interface to transfer the parameters required for decoding to the decoder, - * such as PPS/SPS data in H264 format. The parameters can be sent to the decoder independently - * or together with the data to be decoded. + * {@link OH_AVCodecOnNeedInputBuffer} callback will report the available input buffer and the + * corresponding index value. Once the buffer with the specified index is submitted to the video decoder, + * the buffer cannot be accessed again until the {@link OH_AVCodecOnNeedInputBuffer} callback is received again + * reporting that the buffer with the same index is available. In addition, for some decoders, + * it is required to input Codec-Specific-Data to the decoder at the beginning to initialize the decoding process + * of the decoder, such as PPS/SPS data in H264 format. The invoker can use this interface to transfer the parameters + * required for decoding to the decoder, such as PPS/SPS data in H264 format. + * The parameters can be sent to the decoder independently or together with the data to be decoded. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param index The index of the input buffer, should be given by {@link OH_AVCodecOnNeedInputBuffer}. @@ -400,8 +400,8 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputBuffer(OH_AVCodec *codec, uint32_t inde * ignore the timestamp, and display the buffer at the earliest feasible time. In this mode it will not drop frames. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index The index value corresponding to the output buffer, should be given by {@link - * OH_AVCodecOnNewOutputBuffer} + * @param index The index value corresponding to the output buffer, + * should be given by {@link OH_AVCodecOnNewOutputBuffer} * @param renderTimestampNs The timestamp is associated with the output buffer when it is sent to the surface. The unit * is nanosecond * @return Returns AV_ERR_OK if the execution is successful, -- Gitee From 804fa9249c59933c471e022e4e5f71676e1e6179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Fri, 15 Nov 2024 14:16:33 +0800 Subject: [PATCH 5/9] [localsdk] fix comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- .../av_codec/native_avcodec_videodecoder.h | 78 ++++++++++--------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index b16512dfd..dd6db16ae 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -82,8 +82,8 @@ OH_AVCodec *OH_VideoDecoder_CreateByName(const char *name); * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if succeed, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * @since 9 @@ -99,8 +99,8 @@ OH_AVErrCode OH_VideoDecoder_Destroy(OH_AVCodec *codec); * @param userData The data that the user rely on to execute the callback * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. @@ -119,8 +119,8 @@ OH_AVErrCode OH_VideoDecoder_SetCallback(OH_AVCodec *codec, OH_AVCodecAsyncCallb * @param userData The data that the user rely on to execute the callback * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. @@ -136,9 +136,9 @@ OH_AVErrCode OH_VideoDecoder_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallb * @param window A pointer to a OHNativeWindow instance, see {@link OHNativeWindow} * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. * {@link AV_ERR_OPERATE_NOT_PERMIT}, not permit to call the interface in Buffer mode. - * {@link AV_ERR_INVALID_VAL}, 1.the decoder is nullptr or invalid; 2.window is nullptr. + * {@link AV_ERR_INVALID_VAL}, 1.the input codec pointer is non decoder instance or nullptr; 2.window is nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 9 @@ -153,8 +153,8 @@ OH_AVErrCode OH_VideoDecoder_SetSurface(OH_AVCodec *codec, OHNativeWindow *windo * @param format A pointer to an OH_AVFormat to give the description of the video track to be decoded * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, 1. the decoder is nullptr or invalid; 2. Invalid param in format. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, 1. the input codec pointer is non decoder instance or nullptr; 2. Invalid param in format. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. @@ -170,8 +170,8 @@ OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * {@link AV_ERR_OPERATE_NOT_PERMIT} @@ -188,8 +188,8 @@ OH_AVErrCode OH_VideoDecoder_Prepare(OH_AVCodec *codec); * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * {@link AV_ERR_OPERATE_NOT_PERMIT} @@ -201,14 +201,14 @@ OH_AVErrCode OH_VideoDecoder_Start(OH_AVCodec *codec); /** * @brief Stop the decoder and release the input and output buffer. After stopping, - * you can re-enter the Executing state through Start, but it should be noted that + * you can re-enter the Running state through Start, but it should be noted that * if Codec-Specific-Data has been input to the decoder before, it needs to be input again. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. @@ -224,8 +224,8 @@ OH_AVErrCode OH_VideoDecoder_Stop(OH_AVCodec *codec); * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -240,8 +240,8 @@ OH_AVErrCode OH_VideoDecoder_Flush(OH_AVCodec *codec); * @param codec Pointer to an OH_AVCodec instance * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -269,8 +269,10 @@ OH_AVFormat *OH_VideoDecoder_GetOutputDescription(OH_AVCodec *codec); * @param format pointer to an OH_AVFormat instance * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, 1. the decoder is nullptr or invalid; 2. invalid param in format. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL} + * 1. the input codec pointer is non decoder instance or nullptr; + * 2. invalid param in format. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -291,8 +293,8 @@ OH_AVErrCode OH_VideoDecoder_SetParameter(OH_AVCodec *codec, OH_AVFormat *format * @param attr Information describing the data contained in the buffer * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -311,8 +313,8 @@ OH_AVErrCode OH_VideoDecoder_PushInputData(OH_AVCodec *codec, uint32_t index, OH * @param index The index value corresponding to the output buffer, should be given by {@link OH_AVCodecOnNewOutputData} * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -329,8 +331,8 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputData(OH_AVCodec *codec, uint32_t index) * @param index The index value corresponding to the output buffer,should be given by {@link OH_AVCodecOnNewOutputData}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -355,8 +357,8 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputData(OH_AVCodec *codec, uint32_t index); * @param index The index of the input buffer, should be given by {@link OH_AVCodecOnNeedInputBuffer}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -374,8 +376,8 @@ OH_AVErrCode OH_VideoDecoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index); * should be given by {@link OH_AVCodecOnNewOutputBuffer}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -425,9 +427,9 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputBufferAtTime(OH_AVCodec *codec, uint32_ * should be given by {@link OH_AVCodecOnNewOutputBuffer}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_NO_MEMORY}, instance has already released. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. * {@link AV_ERR_INVALID_VAL} - * 1. the decoder is nullptr or invalid; + * 1. the input codec pointer is non decoder instance or nullptr; * 2. the index is vaild or consecutively assigned to the same index, * the error do not affect the subsequent decode process. * {@link AV_ERR_UNKNOWN}, unknown error. @@ -446,7 +448,7 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index) * false if the codec instance is invalid. It is recommend that the invoker initialize isValid to false * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_INVALID_VAL}, the decoder is nullptr or invalid. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. * @since 10 */ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); @@ -465,9 +467,9 @@ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); * 1. internal execution error; * 2. the decode service process is abnormal; * 3. the media key session service is in an wrong state. - * {@link AV_ERR_NO_MEMORY}, instance has already released or no memory. + * {@link AV_ERR_NO_MEMORY}, instance has already destoryed or no memory. * {@link AV_ERR_INVALID_VAL} - * 1. the decoder is nullptr or invalid; + * 1. the input codec pointer is non decoder instance or nullptr; * 2. mediaKeySession is nullptr or invalid. * @since 11 */ -- Gitee From 2f3ae7d89697a6784c3b5cc6de534d5a5cdebfd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Tue, 19 Nov 2024 13:55:17 +0800 Subject: [PATCH 6/9] [localsdk] fix comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcodec_videodecoder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index dd6db16ae..1f2f4101c 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -459,7 +459,7 @@ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param mediaKeySession A media key session instance with decryption function. - * @param secureVideoPath Secure video Path. set the secure video path as true and the non secure video path as false. + * @param secureVideoPath Secure video Path. Set the secure video path as true and the non secure video path as false. * In Surface mode, both secure and non secure video Path are supported. * In Buffer mode, only non secure video Path are supported. * @return {@link AV_ERR_OK}, execution is successful -- Gitee From 8e0eb223c47d18e41bcfd0150104451d9a7290f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Tue, 19 Nov 2024 14:50:06 +0800 Subject: [PATCH 7/9] [localsdk] fix comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcodec_videodecoder.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 1f2f4101c..934a9b711 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -154,7 +154,9 @@ OH_AVErrCode OH_VideoDecoder_SetSurface(OH_AVCodec *codec, OHNativeWindow *windo * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, 1. the input codec pointer is non decoder instance or nullptr; 2. Invalid param in format. + * {@link AV_ERR_INVALID_VAL}, + * 1. the input codec pointer is non decoder instance or nullptr; + * 2. Invalid param in format. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. @@ -289,7 +291,8 @@ OH_AVErrCode OH_VideoDecoder_SetParameter(OH_AVCodec *codec, OH_AVFormat *format * process of the decoder, such as PPS/SPS data in H264 format. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index Enter the index value corresponding to the buffer, should be given by {@link OH_AVCodecOnNeedInputData}. + * @param index Enter the index value corresponding to the buffer, + * should be given by {@link OH_AVCodecOnNeedInputData}. * @param attr Information describing the data contained in the buffer * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. @@ -310,7 +313,8 @@ OH_AVErrCode OH_VideoDecoder_PushInputData(OH_AVCodec *codec, uint32_t index, OH * calling this interface only returns the output buffer corresponding to the specified index to the decoder. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index The index value corresponding to the output buffer, should be given by {@link OH_AVCodecOnNewOutputData} + * @param index The index value corresponding to the output buffer, + * should be given by {@link OH_AVCodecOnNewOutputData} * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. @@ -328,7 +332,8 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputData(OH_AVCodec *codec, uint32_t index) * @brief Return the processed output buffer to the decoder. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance - * @param index The index value corresponding to the output buffer,should be given by {@link OH_AVCodecOnNewOutputData}. + * @param index The index value corresponding to the output buffer, + * should be given by {@link OH_AVCodecOnNewOutputData}. * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. -- Gitee From 95d380c4e980cdf67571721eb226493a952e3c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Thu, 5 Dec 2024 10:37:47 +0800 Subject: [PATCH 8/9] [localSDK] change nullptr to NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- .../av_codec/native_avcodec_videodecoder.h | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index 934a9b711..f712564d9 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -83,7 +83,7 @@ OH_AVCodec *OH_VideoDecoder_CreateByName(const char *name); * @return Returns AV_ERR_OK if succeed, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * @since 9 @@ -100,7 +100,7 @@ OH_AVErrCode OH_VideoDecoder_Destroy(OH_AVCodec *codec); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. @@ -120,7 +120,7 @@ OH_AVErrCode OH_VideoDecoder_SetCallback(OH_AVCodec *codec, OH_AVCodecAsyncCallb * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. @@ -138,7 +138,7 @@ OH_AVErrCode OH_VideoDecoder_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallb * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. * {@link AV_ERR_OPERATE_NOT_PERMIT}, not permit to call the interface in Buffer mode. - * {@link AV_ERR_INVALID_VAL}, 1.the input codec pointer is non decoder instance or nullptr; 2.window is nullptr. + * {@link AV_ERR_INVALID_VAL}, 1.the input codec pointer is non decoder instance or NULL; 2.window is NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 9 @@ -155,7 +155,7 @@ OH_AVErrCode OH_VideoDecoder_SetSurface(OH_AVCodec *codec, OHNativeWindow *windo * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. * {@link AV_ERR_INVALID_VAL}, - * 1. the input codec pointer is non decoder instance or nullptr; + * 1. the input codec pointer is non decoder instance or NULL; * 2. Invalid param in format. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. @@ -173,7 +173,7 @@ OH_AVErrCode OH_VideoDecoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * {@link AV_ERR_OPERATE_NOT_PERMIT} @@ -191,7 +191,7 @@ OH_AVErrCode OH_VideoDecoder_Prepare(OH_AVCodec *codec); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * {@link AV_ERR_OPERATE_NOT_PERMIT} @@ -210,7 +210,7 @@ OH_AVErrCode OH_VideoDecoder_Start(OH_AVCodec *codec); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. @@ -227,7 +227,7 @@ OH_AVErrCode OH_VideoDecoder_Stop(OH_AVCodec *codec); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -243,7 +243,7 @@ OH_AVErrCode OH_VideoDecoder_Flush(OH_AVCodec *codec); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -258,7 +258,7 @@ OH_AVErrCode OH_VideoDecoder_Reset(OH_AVCodec *codec); * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @return Returns a pointer to an OH_AVFormat instance. - * Return NULL if the decoder is nullptr or invaild. + * Return NULL if the decoder is NULL or invaild. * @since 9 */ OH_AVFormat *OH_VideoDecoder_GetOutputDescription(OH_AVCodec *codec); @@ -273,7 +273,7 @@ OH_AVFormat *OH_VideoDecoder_GetOutputDescription(OH_AVCodec *codec); * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. * {@link AV_ERR_INVALID_VAL} - * 1. the input codec pointer is non decoder instance or nullptr; + * 1. the input codec pointer is non decoder instance or NULL; * 2. invalid param in format. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. @@ -297,7 +297,7 @@ OH_AVErrCode OH_VideoDecoder_SetParameter(OH_AVCodec *codec, OH_AVFormat *format * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -318,7 +318,7 @@ OH_AVErrCode OH_VideoDecoder_PushInputData(OH_AVCodec *codec, uint32_t index, OH * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -337,7 +337,7 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputData(OH_AVCodec *codec, uint32_t index) * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -363,7 +363,7 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputData(OH_AVCodec *codec, uint32_t index); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -382,7 +382,7 @@ OH_AVErrCode OH_VideoDecoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index); * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. @@ -434,7 +434,7 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputBufferAtTime(OH_AVCodec *codec, uint32_ * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed. * {@link AV_ERR_INVALID_VAL} - * 1. the input codec pointer is non decoder instance or nullptr; + * 1. the input codec pointer is non decoder instance or NULL; * 2. the index is vaild or consecutively assigned to the same index, * the error do not affect the subsequent decode process. * {@link AV_ERR_UNKNOWN}, unknown error. @@ -453,7 +453,7 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index) * false if the codec instance is invalid. It is recommend that the invoker initialize isValid to false * @return Returns AV_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. - * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or nullptr. + * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * @since 10 */ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); @@ -474,8 +474,8 @@ OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); * 3. the media key session service is in an wrong state. * {@link AV_ERR_NO_MEMORY}, instance has already destoryed or no memory. * {@link AV_ERR_INVALID_VAL} - * 1. the input codec pointer is non decoder instance or nullptr; - * 2. mediaKeySession is nullptr or invalid. + * 1. the input codec pointer is non decoder instance or NULL; + * 2. mediaKeySession is NULL or invalid. * @since 11 */ OH_AVErrCode OH_VideoDecoder_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySession *mediaKeySession, -- Gitee From 3fccf521e38e5349c94a7a4b157ddfde602c418c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E5=BE=AE?= Date: Wed, 22 Jan 2025 11:07:25 +0800 Subject: [PATCH 9/9] [master] fix comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王子微 --- multimedia/av_codec/native_avcodec_base.h | 51 ++++++++++--------- .../av_codec/native_avcodec_videodecoder.h | 6 +-- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 43575f35f..a92abed29 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -101,17 +101,17 @@ typedef void (*OH_AVCodecOnStreamChanged)(OH_AVCodec *codec, OH_AVFormat *format typedef void (*OH_AVCodecOnNeedInputData)(OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData); /** - * @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be - * called and carry a buffer containing the new output data. It should be noted that the life cycle of the - * OH_AVCodecBufferAttr pointer is only valid when the function pointer is called, which prohibits continued - * access after the call ends. + * @brief When the resolution of the decoding input stream or the resolution of the encoding output stream changes, + * the function pointer will be called to report the new stream description information. + * It should be noted that the life cycle of the OH_AVFormat pointer is only valid when the function pointer is called, + * and it is forbidden to continue to access after the call ends. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @param codec OH_AVCodec instance * @param index The index corresponding to the new output buffer. * @param data Buffer containing the new output data * @param attr The description of the new output buffer, please refer to {@link OH_AVCodecBufferAttr} - * @param userData specified data + * @param userData The data that the user rely on to execute the callback. * @deprecated since 11 * @useinstead OH_AVCodecOnNewOutputBuffer * @since 9 @@ -140,7 +140,7 @@ typedef void (*OH_AVCodecOnNeedInputBuffer)(OH_AVCodec *codec, uint32_t index, O * @param codec OH_AVCodec instance * @param index The index corresponding to the new output buffer. * @param buffer Buffer containing the new output buffer. - * @param userData specified data + * @param userData The data that the user rely on to execute the callback. * @since 11 */ typedef void (*OH_AVCodecOnNewOutputBuffer)(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData); @@ -480,8 +480,9 @@ extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT; */ extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; /** - * @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. + * @brief Key for the interval of key frame, value type is int32_t, the unit is milliseconds. + * This key is optional and only used for video encoding. 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 @@ -489,6 +490,7 @@ extern const char *OH_MD_KEY_AUD_SAMPLE_RATE; extern const char *OH_MD_KEY_I_FRAME_INTERVAL; /** * @brief Key of the surface rotation angle, value type is int32_t: should be {0, 90, 180, 270}, default is 0. + * This key is only used in video decoding Surface mode. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 9 @@ -532,8 +534,9 @@ extern const char *OH_MD_KEY_MATRIX_COEFFICIENTS; */ extern const char *OH_MD_KEY_REQUEST_I_FRAME; /** - * @brief Key for the desired encoding quality, value type is int32_t, this key is only - * supported for encoders that are configured in constant quality mode. + * @brief Key for the desired encoding quality, value type is int32_t, the range of encoding scene values in H264 + * and H265 can be obtained based on the capability query interface {@link OH_AVCapability_GetEncoderQualityRange}, + * this key is only supported for encoders that are configured in constant quality mode. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -820,7 +823,7 @@ extern const char *OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR; 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. + * row included in the crop frame, where row indices start at 0. This key is only used for video decoding. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -828,7 +831,7 @@ extern const char *OH_MD_KEY_VIDEO_PER_FRAME_POC; 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. + * bottom-most row included in the crop frame, where row indices start at 0. This key is only used for video decoding. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -837,6 +840,7 @@ 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. + * This key is only used for video decoding. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -845,6 +849,7 @@ 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. + * This key is only used for video decoding. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 12 @@ -1034,7 +1039,7 @@ typedef enum OH_MediaType { } OH_MediaType; /** - * @brief AAC Profile + * @brief AAC Profile. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 9 @@ -1054,7 +1059,7 @@ typedef enum OH_AACProfile { } OH_AACProfile; /** - * @brief AVC Profile + * @brief AVC Profile. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 9 @@ -1066,7 +1071,7 @@ typedef enum OH_AVCProfile { } OH_AVCProfile; /** - * @brief HEVC Profile + * @brief HEVC Profile. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -1158,16 +1163,16 @@ typedef enum OH_AVOutputFormat { * @since 10 */ typedef enum OH_AVSeekMode { - /* seek to sync sample after the time. If there is no I-frame after the time point, the mode may fail to seek */ + /* Seek to sync sample after the time. If there is no I-frame after the time point, the mode may fail to seek */ SEEK_MODE_NEXT_SYNC = 0, - /* seek to sync sample before the time */ + /* Seek to sync sample before the time */ SEEK_MODE_PREVIOUS_SYNC, - /* seek to sync sample closest to time */ + /* Seek to sync sample closest to time */ SEEK_MODE_CLOSEST_SYNC, } OH_AVSeekMode; /** - * @brief Scaling Mode + * @brief Scaling Mode, only used in Surface mode. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @deprecated since 14 @@ -1188,7 +1193,7 @@ typedef enum OH_ScalingMode { } OH_ScalingMode; /** - * @brief enum Audio Bits Per Coded Sample + * @brief enum Audio Bits Per Coded Sample. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -1208,7 +1213,7 @@ typedef enum OH_BitsPerSample { } OH_BitsPerSample; /** - * @brief Color Primary + * @brief Color Primary. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -1228,7 +1233,7 @@ typedef enum OH_ColorPrimary { } OH_ColorPrimary; /** - * @brief Transfer Characteristic + * @brief Transfer Characteristic, both encoding and decoding are supported. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 @@ -1254,7 +1259,7 @@ typedef enum OH_TransferCharacteristic { } OH_TransferCharacteristic; /** - * @brief Matrix Coefficient + * @brief Matrix Coefficient. * * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 diff --git a/multimedia/av_codec/native_avcodec_videodecoder.h b/multimedia/av_codec/native_avcodec_videodecoder.h index f712564d9..eedb7ad9b 100644 --- a/multimedia/av_codec/native_avcodec_videodecoder.h +++ b/multimedia/av_codec/native_avcodec_videodecoder.h @@ -130,7 +130,8 @@ OH_AVErrCode OH_VideoDecoder_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallb /** * @brief Specify the output surface to provide video decoding output, - * this interface must be called before Prepare is called + * this interface must be called before Prepare is called. + * This interface can be directly called in the Executing state. * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance * @param window A pointer to a OHNativeWindow instance, see {@link OHNativeWindow} @@ -246,7 +247,6 @@ OH_AVErrCode OH_VideoDecoder_Flush(OH_AVCodec *codec); * {@link AV_ERR_INVALID_VAL}, the input codec pointer is non decoder instance or NULL. * {@link AV_ERR_UNKNOWN}, unknown error. * {@link AV_ERR_OPERATE_NOT_PERMIT}, internal execution error. - * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. * @since 9 */ OH_AVErrCode OH_VideoDecoder_Reset(OH_AVCodec *codec); @@ -459,7 +459,7 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index) OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid); /** - * @brief Set decryption info. + * @brief Set decryption configuration. Call this interface before calling the Prepare interface. * * @syscap SystemCapability.Multimedia.Media.VideoDecoder * @param codec Pointer to an OH_AVCodec instance -- Gitee