From 5fd286131dd0d4801664dd80b19969e847fd3fc8 Mon Sep 17 00:00:00 2001 From: peng Date: Wed, 5 Jun 2024 14:28:22 +0000 Subject: [PATCH 1/3] add audio codec err code description Signed-off-by: peng --- .../av_codec/native_avcodec_audiocodec.h | 55 ++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_audiocodec.h b/multimedia/av_codec/native_avcodec_audiocodec.h index 4a577a90a5e..813d90e9c08 100644 --- a/multimedia/av_codec/native_avcodec_audiocodec.h +++ b/multimedia/av_codec/native_avcodec_audiocodec.h @@ -57,6 +57,10 @@ OH_AVCodec *OH_AudioCodec_CreateByName(const char *name); * @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_INVALID_VAL}, the codec is nullptr or invalid. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. + * {@link AV_ERR_NO_MEMORY}, inner resource has already released. + * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_AudioCodec_Destroy(OH_AVCodec *codec); @@ -70,6 +74,8 @@ OH_AVErrCode OH_AudioCodec_Destroy(OH_AVCodec *codec); * @param userData User specific data * @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}, input parameter is empty or invalid. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. * @since 11 */ OH_AVErrCode OH_AudioCodec_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallback callback, void *userData); @@ -82,6 +88,11 @@ OH_AVErrCode OH_AudioCodec_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallbac * @param format A pointer to an OH_AVFormat giving a description of the audio track to be encoded or 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_INVALID_VAL}, input parameter is empty or invalid. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due + * to incorrect status or unsupported operation. + * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_AudioCodec_Configure(OH_AVCodec *codec, const OH_AVFormat *format); @@ -93,6 +104,11 @@ OH_AVErrCode OH_AudioCodec_Configure(OH_AVCodec *codec, const OH_AVFormat *forma * @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_INVALID_VAL}, the codec is nullptr or invalid. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due + * to incorrect status or unsupported operation. + * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_AudioCodec_Prepare(OH_AVCodec *codec); @@ -104,6 +120,11 @@ OH_AVErrCode OH_AudioCodec_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_INVALID_VAL}, the codec is nullptr or invalid. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due + * to incorrect status or unsupported operation. + * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_AudioCodec_Start(OH_AVCodec *codec); @@ -116,6 +137,11 @@ OH_AVErrCode OH_AudioCodec_Start(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_INVALID_VAL}, the codec is nullptr or invalid. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due + * to incorrect status or unsupported operation. + * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_AudioCodec_Stop(OH_AVCodec *codec); @@ -128,6 +154,11 @@ OH_AVErrCode OH_AudioCodec_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_INVALID_VAL}, the codec is nullptr or invalid. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due + * to incorrect status or unsupported operation. + * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_AudioCodec_Flush(OH_AVCodec *codec); @@ -139,6 +170,8 @@ OH_AVErrCode OH_AudioCodec_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_INVALID_VAL}, the codec is nullptr or invalid. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. * @since 11 */ @@ -164,14 +197,19 @@ OH_AVFormat *OH_AudioCodec_GetOutputDescription(OH_AVCodec *codec); * @param format OH_AVFormat handle pointer * @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}, input parameter is empty or invalid. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due + * to incorrect status or unsupported operation. + * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_AudioCodec_SetParameter(OH_AVCodec *codec, const OH_AVFormat *format); /** - * @brief Submit the input buffer filled with data to the audio codec. The {@link OH_AVCodecOnNeedInputData} callback + * @brief Submit the input buffer filled with data to the audio codec. 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 audio codec, the buffer cannot be accessed again until the {@link OH_AVCodecOnNeedInputData} + * is submitted to the audio codec, 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 * codecs, it is required to input Codec-Specific-Data to the codec at the beginning to initialize the encoding or * decoding process of the codec. @@ -180,6 +218,12 @@ OH_AVErrCode OH_AudioCodec_SetParameter(OH_AVCodec *codec, const OH_AVFormat *fo * @param index Enter the index value corresponding to 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_INVALID_VAL}, input parameter is empty or invalid. Buffer index + * should be given by {@link OH_AVCodecOnNeedInputBuffer}. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due + * to incorrect status or unsupported operation. + * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_AudioCodec_PushInputBuffer(OH_AVCodec *codec, uint32_t index); @@ -191,6 +235,12 @@ OH_AVErrCode OH_AudioCodec_PushInputBuffer(OH_AVCodec *codec, uint32_t index); * @param index The index value corresponding to the output 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_INVALID_VAL}, input parameter is empty or invalid. Buffer index + * should be given by {@link OH_AVCodecOnNewOutputBuffer}. + * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due + * to incorrect status or unsupported operation. + * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ OH_AVErrCode OH_AudioCodec_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index); @@ -204,6 +254,7 @@ OH_AVErrCode OH_AudioCodec_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index); * false if the codec instance is invalid * @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}, input parameter is empty or invalid. * @since 11 */ OH_AVErrCode OH_AudioCodec_IsValid(OH_AVCodec *codec, bool *isValid); -- Gitee From 0e41f8f8e52927d81db5ab6b2a69f6f4d46daa53 Mon Sep 17 00:00:00 2001 From: peng Date: Thu, 6 Jun 2024 02:03:24 +0000 Subject: [PATCH 2/3] modify comments Signed-off-by: peng --- .../av_codec/native_avcodec_audiocodec.h | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_audiocodec.h b/multimedia/av_codec/native_avcodec_audiocodec.h index 813d90e9c08..a3829423e28 100644 --- a/multimedia/av_codec/native_avcodec_audiocodec.h +++ b/multimedia/av_codec/native_avcodec_audiocodec.h @@ -90,8 +90,8 @@ OH_AVErrCode OH_AudioCodec_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallbac * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, input parameter is empty or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due - * to incorrect status or unsupported operation. + * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ @@ -106,8 +106,8 @@ OH_AVErrCode OH_AudioCodec_Configure(OH_AVCodec *codec, const OH_AVFormat *forma * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, the codec is nullptr or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due - * to incorrect status or unsupported operation. + * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ @@ -122,8 +122,8 @@ OH_AVErrCode OH_AudioCodec_Prepare(OH_AVCodec *codec); * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, the codec is nullptr or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due - * to incorrect status or unsupported operation. + * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ @@ -139,8 +139,8 @@ OH_AVErrCode OH_AudioCodec_Start(OH_AVCodec *codec); * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, the codec is nullptr or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due - * to incorrect status or unsupported operation. + * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ @@ -156,8 +156,8 @@ OH_AVErrCode OH_AudioCodec_Stop(OH_AVCodec *codec); * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, the codec is nullptr or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due - * to incorrect status or unsupported operation. + * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ @@ -199,8 +199,8 @@ OH_AVFormat *OH_AudioCodec_GetOutputDescription(OH_AVCodec *codec); * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, input parameter is empty or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due - * to incorrect status or unsupported operation. + * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ @@ -221,8 +221,8 @@ OH_AVErrCode OH_AudioCodec_SetParameter(OH_AVCodec *codec, const OH_AVFormat *fo * {@link AV_ERR_INVALID_VAL}, input parameter is empty or invalid. Buffer index * should be given by {@link OH_AVCodecOnNeedInputBuffer}. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due - * to incorrect status or unsupported operation. + * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ @@ -238,8 +238,8 @@ OH_AVErrCode OH_AudioCodec_PushInputBuffer(OH_AVCodec *codec, uint32_t index); * {@link AV_ERR_INVALID_VAL}, input parameter is empty or invalid. Buffer index * should be given by {@link OH_AVCodecOnNewOutputBuffer}. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not be permitted. It may be due - * to incorrect status or unsupported operation. + * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 */ -- Gitee From e06b13e239f124a4fd1129849606a658ffdb899f Mon Sep 17 00:00:00 2001 From: peng Date: Thu, 6 Jun 2024 02:30:21 +0000 Subject: [PATCH 3/3] modify comments Signed-off-by: peng --- multimedia/av_codec/native_avcodec_audiocodec.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_audiocodec.h b/multimedia/av_codec/native_avcodec_audiocodec.h index a3829423e28..4f1af4b2c08 100644 --- a/multimedia/av_codec/native_avcodec_audiocodec.h +++ b/multimedia/av_codec/native_avcodec_audiocodec.h @@ -90,7 +90,7 @@ OH_AVErrCode OH_AudioCodec_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallbac * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, input parameter is empty or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 @@ -106,7 +106,7 @@ OH_AVErrCode OH_AudioCodec_Configure(OH_AVCodec *codec, const OH_AVFormat *forma * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, the codec is nullptr or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 @@ -122,7 +122,7 @@ OH_AVErrCode OH_AudioCodec_Prepare(OH_AVCodec *codec); * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, the codec is nullptr or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 @@ -139,7 +139,7 @@ OH_AVErrCode OH_AudioCodec_Start(OH_AVCodec *codec); * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, the codec is nullptr or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 @@ -156,7 +156,7 @@ OH_AVErrCode OH_AudioCodec_Stop(OH_AVCodec *codec); * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, the codec is nullptr or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 @@ -199,7 +199,7 @@ OH_AVFormat *OH_AudioCodec_GetOutputDescription(OH_AVCodec *codec); * otherwise returns a specific error code, refer to {@link OH_AVErrCode} * {@link AV_ERR_INVALID_VAL}, input parameter is empty or invalid. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 @@ -221,7 +221,7 @@ OH_AVErrCode OH_AudioCodec_SetParameter(OH_AVCodec *codec, const OH_AVFormat *fo * {@link AV_ERR_INVALID_VAL}, input parameter is empty or invalid. Buffer index * should be given by {@link OH_AVCodecOnNeedInputBuffer}. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 @@ -238,7 +238,7 @@ OH_AVErrCode OH_AudioCodec_PushInputBuffer(OH_AVCodec *codec, uint32_t index); * {@link AV_ERR_INVALID_VAL}, input parameter is empty or invalid. Buffer index * should be given by {@link OH_AVCodecOnNewOutputBuffer}. * {@link AV_ERR_INVALID_STATE}, the interface was called in an invalid state. - * {@Link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. + * {@link AV_ERR_OPERATE_NOT_PERMIT}, operation not permitted. * This could be due to an incorrect state or an unsupported operation. * {@link AV_ERR_UNKNOWN}, internal error occurred, it is recommended to check the logs. * @since 11 -- Gitee