diff --git a/frameworks/native/capi/avcodec/native_avcodec_base.cpp b/frameworks/native/capi/avcodec/native_avcodec_base.cpp index 816308cbda10d42d2c2a3f04701350b05232d948..dfe660cbde17f88c4bfeb5e37742a7951dda1c0f 100644 --- a/frameworks/native/capi/avcodec/native_avcodec_base.cpp +++ b/frameworks/native/capi/avcodec/native_avcodec_base.cpp @@ -29,7 +29,7 @@ const char *OH_AVCODEC_MIMETYPE_AUDIO_MPEG = "audio/mpeg"; const char *OH_AVCODEC_MIMETYPE_IMAGE_JPG = "image/jpeg"; const char *OH_AVCODEC_MIMETYPE_IMAGE_PNG = "image/png"; const char *OH_AVCODEC_MIMETYPE_IMAGE_BMP = "image/bmp"; -const char *OH_AVCODEC_MIMETYPE_AUDIO_AVS3DA = "audio/avs-3da"; +const char *OH_AVCODEC_MIMETYPE_AUDIO_VIVID = "audio/avs-3da"; const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB = "audio/3gpp"; const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB = "audio/amr-wb"; const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS = "audio/opus"; @@ -85,16 +85,8 @@ const char *OH_MD_KEY_DESCRIPTION = "description"; const char *OH_MD_KEY_LYRICS = "lyrics"; const char *OH_MD_KEY_TRACK_COUNT = "track_count"; -const char *OH_MD_KEY_FILE_TYPE = "file_type"; -const char *OH_MD_KEY_HAS_VIDEO = "has_video"; -const char *OH_MD_KEY_HAS_AUDIO = "has_audio"; -const char *OH_MD_KEY_AUTHOR = "author"; -const char *OH_MD_KEY_COMPOSER = "composer"; -const char *OH_MD_KEY_COVER = "cover"; -const char *OH_MD_KEY_COMPRESSION_LEVEL = "compression_level"; -const char *OH_MD_KEY_LEVEL = "codec_level"; -const char *OH_MD_KEY_VIDEO_CHROMA_LOCATION = "chroma_location"; -const char *OH_MD_KEY_VIDEO_CUVV_CONFIG_BOX = "cuvv_config_box"; +const char *OH_MD_KEY_AUDIO_COMPRESSION_LEVEL = "audio_compression_level"; + #ifdef __cplusplus } #endif diff --git a/interfaces/inner_api/native/media_description.h b/interfaces/inner_api/native/media_description.h index 68c910c557bc988ac3b3d5719cf68a03f3be9a35..bc7b3b5102396b1e0692b18acada325e2530888b 100644 --- a/interfaces/inner_api/native/media_description.h +++ b/interfaces/inner_api/native/media_description.h @@ -236,7 +236,7 @@ public: /** * Key for codec compression leve, value type is uint32_t */ - static constexpr std::string_view MD_KEY_COMPRESSION_LEVEL = "compression_level"; + static constexpr std::string_view MD_KEY_COMPRESSION_LEVEL = "audio_compression_level"; /** * Key for encode level, value type is int32_t diff --git a/interfaces/kits/c/native_avcodec_audiodecoder.h b/interfaces/kits/c/native_avcodec_audiodecoder.h index 6e308a8b24ba1519aa5aec66defbf9bec81ff550..ed3ac92b61d792e9b37b6836c2f0b8a9fa515913 100644 --- a/interfaces/kits/c/native_avcodec_audiodecoder.h +++ b/interfaces/kits/c/native_avcodec_audiodecoder.h @@ -32,6 +32,8 @@ extern "C" { * @syscap SystemCapability.Multimedia.Media.AudioDecoder * @param mime mime type description string, refer to {@link AVCODEC_MIME_TYPE} * @return Returns a Pointer to an OH_AVCodec instance + * @deprecated since 11 + * @useinstead OH_AudioCodec_CreateByMime * @since 9 * @version 1.0 */ @@ -43,6 +45,8 @@ OH_AVCodec *OH_AudioDecoder_CreateByMime(const char *mime); * @syscap SystemCapability.Multimedia.Media.AudioDecoder * @param name Audio codec name * @return Returns a Pointer to an OH_AVCodec instance + * @deprecated since 11 + * @useinstead OH_AudioCodec_CreateByName * @since 9 * @version 1.0 */ @@ -54,6 +58,8 @@ OH_AVCodec *OH_AudioDecoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Destroy * @since 9 * @version 1.0 */ @@ -68,6 +74,8 @@ OH_AVErrCode OH_AudioDecoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_RegisterCallback * @since 9 * @version 1.0 */ @@ -81,6 +89,8 @@ OH_AVErrCode OH_AudioDecoder_SetCallback(OH_AVCodec *codec, OH_AVCodecAsyncCallb * @param format A pointer to an OH_AVFormat giving a description of the audio 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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Configure * @since 9 * @version 1.0 */ @@ -93,6 +103,8 @@ OH_AVErrCode OH_AudioDecoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Prepare * @since 9 * @version 1.0 */ @@ -105,6 +117,8 @@ OH_AVErrCode OH_AudioDecoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Start * @since 9 * @version 1.0 */ @@ -118,6 +132,8 @@ OH_AVErrCode OH_AudioDecoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Stop * @since 9 * @version 1.0 */ @@ -131,6 +147,8 @@ OH_AVErrCode OH_AudioDecoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Flush * @since 9 * @version 1.0 */ @@ -143,6 +161,8 @@ OH_AVErrCode OH_AudioDecoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Reset * @since 9 * @version 1.0 */ @@ -157,6 +177,8 @@ OH_AVErrCode OH_AudioDecoder_Reset(OH_AVCodec *codec); * @param codec Pointer to an OH_AVCodec instance * @return Returns the OH_AVFormat handle pointer, the life cycle is refreshed with the next GetOutputMediaDescription, * or destroyed with OH_AVCodec; + * @deprecated since 11 + * @useinstead OH_AudioCodec_GetOutputDescription * @since 9 * @version 1.0 */ @@ -170,6 +192,8 @@ OH_AVFormat *OH_AudioDecoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_SetParameter * @since 9 * @version 1.0 */ @@ -188,6 +212,8 @@ OH_AVErrCode OH_AudioDecoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_PushInputBuffer * @since 9 * @version 1.0 */ @@ -200,6 +226,8 @@ OH_AVErrCode OH_AudioDecoder_PushInputData(OH_AVCodec *codec, uint32_t index, OH * @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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_FreeOutputBuffer * @since 9 * @version 1.0 */ @@ -214,6 +242,8 @@ OH_AVErrCode OH_AudioDecoder_FreeOutputData(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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_IsValid * @since 10 */ OH_AVErrCode OH_AudioDecoder_IsValid(OH_AVCodec *codec, bool *isValid); diff --git a/interfaces/kits/c/native_avcodec_audioencoder.h b/interfaces/kits/c/native_avcodec_audioencoder.h index 7493f69e06e3727fb2caa7433b8a2d4a116ef774..f070285ad34f54bec23cec6c092609c168a1ea45 100644 --- a/interfaces/kits/c/native_avcodec_audioencoder.h +++ b/interfaces/kits/c/native_avcodec_audioencoder.h @@ -31,6 +31,8 @@ extern "C" { * @syscap SystemCapability.Multimedia.Media.AudioEncoder * @param mime mime type description string, refer to {@link AVCODEC_MIME_TYPE} * @return Returns a Pointer to an OH_AVCodec instance + * @deprecated since 11 + * @useinstead OH_AudioCodec_CreateByMime * @since 9 * @version 1.0 */ @@ -42,6 +44,8 @@ OH_AVCodec *OH_AudioEncoder_CreateByMime(const char *mime); * @syscap SystemCapability.Multimedia.Media.AudioEncoder * @param name Audio encoder name * @return Returns a Pointer to an OH_AVCodec instance + * @deprecated since 11 + * @useinstead OH_AudioCodec_CreateByName * @since 9 * @version 1.0 */ @@ -53,6 +57,8 @@ OH_AVCodec *OH_AudioEncoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Destroy * @since 9 * @version 1.0 */ @@ -67,6 +73,8 @@ OH_AVErrCode OH_AudioEncoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_RegisterCallback * @since 9 * @version 1.0 */ @@ -80,6 +88,8 @@ OH_AVErrCode OH_AudioEncoder_SetCallback(OH_AVCodec *codec, OH_AVCodecAsyncCallb * @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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Configure * @since 9 * @version 1.0 */ @@ -92,6 +102,8 @@ OH_AVErrCode OH_AudioEncoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Prepare * @since 9 * @version 1.0 */ @@ -104,6 +116,8 @@ OH_AVErrCode OH_AudioEncoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Start * @since 9 * @version 1.0 */ @@ -115,6 +129,8 @@ OH_AVErrCode OH_AudioEncoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Stop * @since 9 * @version 1.0 */ @@ -128,6 +144,8 @@ OH_AVErrCode OH_AudioEncoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Flush * @since 9 * @version 1.0 */ @@ -140,6 +158,8 @@ OH_AVErrCode OH_AudioEncoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_Reset * @since 9 * @version 1.0 */ @@ -153,6 +173,8 @@ OH_AVErrCode OH_AudioEncoder_Reset(OH_AVCodec *codec); * @param codec Pointer to an OH_AVCodec instance * @return Returns the OH_AVFormat handle pointer, the life cycle is refreshed with the next GetOutputMediaDescription, * or destroyed with OH_AVCodec; + * @deprecated since 11 + * @useinstead OH_AudioCodec_GetOutputDescription * @since 9 * @version 1.0 */ @@ -166,6 +188,8 @@ OH_AVFormat *OH_AudioEncoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_SetParameter * @since 9 * @version 1.0 */ @@ -182,6 +206,8 @@ OH_AVErrCode OH_AudioEncoder_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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_PushInputBuffer * @since 9 * @version 1.0 */ @@ -194,6 +220,8 @@ OH_AVErrCode OH_AudioEncoder_PushInputData(OH_AVCodec *codec, uint32_t index, OH * @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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_FreeOutputBuffer * @since 9 * @version 1.0 */ @@ -208,6 +236,8 @@ OH_AVErrCode OH_AudioEncoder_FreeOutputData(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} + * @deprecated since 11 + * @useinstead OH_AudioCodec_IsValid * @since 10 */ OH_AVErrCode OH_AudioEncoder_IsValid(OH_AVCodec *codec, bool *isValid); diff --git a/interfaces/kits/c/native_avcodec_base.h b/interfaces/kits/c/native_avcodec_base.h index fbbcfbbd362b2da82612b0d3200a2c401343712a..b6386a6d74e95289a4f6f45f04c08efbf41b770a 100644 --- a/interfaces/kits/c/native_avcodec_base.h +++ b/interfaces/kits/c/native_avcodec_base.h @@ -170,11 +170,30 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_FLAC; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VORBIS; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_MPEG; extern const char *OH_AVCODEC_MIMETYPE_VIDEO_HEVC; + +/** + * @brief Enumerates the types of audio and video muxer + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @deprecated since 11 + * @since 10 + */ extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG4; + +/** + * @brief Enumerates the types of audio and video muxer + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 10 + */ extern const char *OH_AVCODEC_MIMETYPE_IMAGE_JPG; extern const char *OH_AVCODEC_MIMETYPE_IMAGE_PNG; extern const char *OH_AVCODEC_MIMETYPE_IMAGE_BMP; -extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AVS3DA; + +/** + * @brief Enumerates the MIME types of audio codecs + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 11 + */ +extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VIVID; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB; extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; @@ -274,18 +293,6 @@ extern const char *OH_MD_KEY_DESCRIPTION; extern const char *OH_MD_KEY_LYRICS; /* source format Key for track count, value type is uint32_t */ extern const char *OH_MD_KEY_TRACK_COUNT; -/* Key for type of file, value type is int32_t, see @OH_FileType */ -extern const char *OH_MD_KEY_FILE_TYPE; -/* Key for whether the file contains video tracks, value type is boolean */ -extern const char *OH_MD_KEY_HAS_VIDEO; -/* Key for whether the file contains audio tracks, value type is boolean */ -extern const char *OH_MD_KEY_HAS_AUDIO; -/* Key for author of file, value type is string */ -extern const char *OH_MD_KEY_AUTHOR; -/* Key for composer of file, value type is string */ -extern const char *OH_MD_KEY_COMPOSER; -/* Key for cover of file, value type is uint8_t pointer */ -extern const char *OH_MD_KEY_COVER; /* Key for the desired encoding channel layout, value type is int64_t, this key is only supported for encoders */ extern const char *OH_MD_KEY_CHANNEL_LAYOUT; /* Key for bits per coded sample, value type is uint32_t, supported for flac encoder, see @OH_BitsPerSample */ @@ -306,36 +313,20 @@ extern const char *OH_MD_KEY_SCALING_MODE; extern const char *OH_MD_MAX_INPUT_BUFFER_COUNT; /* Key for max output buffer count, value type is int32_t */ extern const char *OH_MD_MAX_OUTPUT_BUFFER_COUNT; -/* Key for codec compression level, value type is uint32_t */ -extern const char *OH_MD_KEY_COMPRESSION_LEVEL; -/* Key for encode level, value type is int32_t. see @OH_HEVCLevel. */ -extern const char *OH_MD_KEY_LEVEL; -/* Key for chroma location, value type is int32_t. see @OH_ChromaLocation. */ -extern const char *OH_MD_KEY_VIDEO_CHROMA_LOCATION; -/* Key of the video is hdr vivid. value type is bool */ -extern const char *OH_MD_KEY_VIDEO_IS_HDR_VIVID; -/* Key for HDRVivid video CUVV Configuration Box, value type is uint8_t pointer, see @OH_CUVVConfigBox. */ -extern const char *OH_MD_KEY_VIDEO_CUVV_CONFIG_BOX; /** - * @brief File type. + * @brief Provides the uniform key for storing the media description. * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 10 - * @version 1.0 + * @since 11 */ -typedef enum OH_FileType { - FILE_TYPE_UNKNOW = 0, - FILE_TYPE_MP4 = 101, - FILE_TYPE_MPEGTS = 102, - FILE_TYPE_MKV = 103, - FILE_TYPE_AMR = 201, - FILE_TYPE_AAC = 202, - FILE_TYPE_MP3 = 203, - FILE_TYPE_FLAC = 204, - FILE_TYPE_OGG = 205, - FILE_TYPE_M4A = 206, - FILE_TYPE_WAV = 207, -} OH_FileType; +/* Key for audio codec compression level, value type is uint32_t */ +extern const char *OH_MD_KEY_AUDIO_COMPRESSION_LEVEL; +/* Key of the video is hdr vivid. value type is bool */ +extern const char *OH_MD_KEY_VIDEO_IS_HDR_VIVID; +/* Key for number of audio objects. value type is int32_t */ +extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER; +/* Key for meta data of audio vivid. value type is a uint8_t pointer */ +extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA; /** * @brief Media type. @@ -372,6 +363,19 @@ typedef enum OH_AVCProfile { AVC_PROFILE_MAIN = 8, } OH_AVCProfile; +/** + * @brief HEVC Profile + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 10 + */ +typedef enum OH_HEVCProfile { + HEVC_PROFILE_MAIN = 0, + HEVC_PROFILE_MAIN_10 = 1, + HEVC_PROFILE_MAIN_STILL = 2, + HEVC_PROFILE_MAIN_10_HDR10 = 3, + HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4, +} OH_HEVCProfile; + /** * @brief Enumerates the muxer output file format * @syscap SystemCapability.Multimedia.Media.CodecBase @@ -398,38 +402,33 @@ typedef enum OH_AVSeekMode { } OH_AVSeekMode; /** - * @brief HEVC Profile + * @brief Scaling Mode * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ -typedef enum OH_HEVCProfile { - HEVC_PROFILE_MAIN = 0, - HEVC_PROFILE_MAIN_10 = 1, - HEVC_PROFILE_MAIN_STILL = 2, - HEVC_PROFILE_MAIN_10_HDR10 = 3, - HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4, -} OH_HEVCProfile; +typedef enum OH_ScalingMode { + SCALING_MODE_SCALE_TO_WINDOW = 1, + SCALING_MODE_SCALE_CROP = 2, +} OH_ScalingMode; /** - * @brief HEVC Level + * @brief enum Audio Bits Per Coded Sample * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 10 */ -enum OH_HEVCLevel { - HEVC_LEVEL_1 = 0, - HEVC_LEVEL_2 = 1, - HEVC_LEVEL_21 = 2, - HEVC_LEVEL_3 = 3, - HEVC_LEVEL_31 = 4, - HEVC_LEVEL_4 = 5, - HEVC_LEVEL_41 = 6, - HEVC_LEVEL_5 = 7, - HEVC_LEVEL_51 = 8, - HEVC_LEVEL_52 = 9, - HEVC_LEVEL_6 = 10, - HEVC_LEVEL_61 = 11, - HEVC_LEVEL_62 = 12, -}; +typedef enum OH_BitsPerSample { + SAMPLE_U8 = 0, + SAMPLE_S16LE = 1, + SAMPLE_S24LE = 2, + SAMPLE_S32LE = 3, + SAMPLE_F32LE = 4, + SAMPLE_U8P = 5, + SAMPLE_S16P = 6, + SAMPLE_S24P = 7, + SAMPLE_S32P = 8, + SAMPLE_F32P = 9, + INVALID_WIDTH = -1 +} OH_BitsPerSample; /** * @brief Color Primary @@ -497,60 +496,6 @@ typedef enum OH_MatrixCoefficient { MATRIX_COEFFICIENT_ICTCP = 14, } OH_MatrixCoefficient; -/** - * @brief Chroma Location - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 10 - */ -enum OH_ChromaLocation { - CHROMA_LOC_UNSPECIFIED = 0, - CHROMA_LOC_LEFT = 1, ///< MPEG-2/4 4:2:0, H.264 default for 4:2:0 - CHROMA_LOC_CENTER = 2, ///< MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0 - CHROMA_LOC_TOPLEFT = 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 - CHROMA_LOC_TOP = 4, - CHROMA_LOC_BOTTOMLEFT = 5, - CHROMA_LOC_BOTTOM = 6, -}; - -/** - * @brief Scaling Mode - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 10 - */ -typedef enum OH_ScalingMode { - SCALING_MODE_SCALE_TO_WINDOW = 1, - SCALING_MODE_SCALE_CROP = 2, -} OH_ScalingMode; - -/** - * @brief Cuvv Configuration Box - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 11 - */ -typedef struct OH_CUVVConfigBox { - uint16_t cuva_version_map; - uint16_t terminal_provide_code; - uint16_t terminal_provide_oriented_code; -} OH_CUVVConfigBox; - -/** - * @brief enum Audio Bits Per Coded Sample - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 10 - */ -typedef enum OH_BitsPerSample { - SAMPLE_U8 = 0, - SAMPLE_S16LE = 1, - SAMPLE_S24LE = 2, - SAMPLE_S32LE = 3, - SAMPLE_F32LE = 4, - SAMPLE_U8P = 5, - SAMPLE_S16P = 6, - SAMPLE_S24P = 7, - SAMPLE_S32P = 8, - SAMPLE_F32P = 9, - INVALID_WIDTH = -1 -} OH_BitsPerSample; #ifdef __cplusplus } #endif diff --git a/test/moduletest/demuxer/src/api_test.cpp b/test/moduletest/demuxer/src/api_test.cpp index 18894eb888010e4fe5d25c7b5097382ff65a7e3d..81569e9c1c048f50d23d6ad77c95dc5fdf3b0534 100644 --- a/test/moduletest/demuxer/src/api_test.cpp +++ b/test/moduletest/demuxer/src/api_test.cpp @@ -591,112 +591,3 @@ HWTEST_F(DemuxerApiNdkTest, DEMUXER_API_2400, TestSize.Level2) memory = nullptr; ASSERT_EQ(AV_ERR_INVALID_VAL, OH_AVMemory_Destroy(memory)); } - -/** - * @tc.number : SUB_MEDIA_DEMUXER_API_0100 - * @tc.name : Set API KEY OH_MD_KEY_LEVEL - * @tc.desc : api test - */ -HWTEST_F(DemuxerApiNdkTest, SUB_MEDIA_DEMUXER_API_0100, TestSize.Level2) -{ - OH_AVFormat *format; - source = OH_AVSource_CreateWithFD(fd1, 0, size); - ASSERT_NE(source, nullptr); - format = OH_AVSource_GetSourceFormat(source); - ASSERT_NE(format, nullptr); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_1)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_2)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_21)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_3)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_31)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_4)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_41)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_5)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_51)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_52)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_6)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_61)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, HEVC_LEVEL_62)); -} - -/** - * @tc.number : SUB_MEDIA_DEMUXER_API_0200 - * @tc.name : Set API KEY OH_MD_KEY_LEVEL NEGATIVE - * @tc.desc : api test - */ -HWTEST_F(DemuxerApiNdkTest, SUB_MEDIA_DEMUXER_API_0200, TestSize.Level2) -{ - OH_AVFormat *format; - source = OH_AVSource_CreateWithFD(fd1, 0, size); - ASSERT_NE(source, nullptr); - format = OH_AVSource_GetSourceFormat(source); - ASSERT_NE(format, nullptr); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, -1)); -} - -/** - * @tc.number : SUB_MEDIA_DEMUXER_API_0300 - * @tc.name : Set API KEY OH_MD_KEY_LEVEL OVER MAX - * @tc.desc : api test - */ -HWTEST_F(DemuxerApiNdkTest, SUB_MEDIA_DEMUXER_API_0300, TestSize.Level2) -{ - OH_AVFormat *format; - source = OH_AVSource_CreateWithFD(fd1, 0, size); - ASSERT_NE(source, nullptr); - format = OH_AVSource_GetSourceFormat(source); - ASSERT_NE(format, nullptr); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_LEVEL, 100)); -} - - -/** - * @tc.number : SUB_MEDIA_DEMUXER_API_0400 - * @tc.name : Set API KEY OH_MD_KEY_VIDEO_CHROMA_LOCATION - * @tc.desc : api test - */ -HWTEST_F(DemuxerApiNdkTest, SUB_MEDIA_DEMUXER_API_0400, TestSize.Level2) -{ - OH_AVFormat *format; - source = OH_AVSource_CreateWithFD(fd1, 0, size); - ASSERT_NE(source, nullptr); - format = OH_AVSource_GetSourceFormat(source); - ASSERT_NE(format, nullptr); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_VIDEO_CHROMA_LOCATION, CHROMA_LOC_UNSPECIFIED)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_VIDEO_CHROMA_LOCATION, CHROMA_LOC_LEFT)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_VIDEO_CHROMA_LOCATION, CHROMA_LOC_CENTER)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_VIDEO_CHROMA_LOCATION, CHROMA_LOC_TOPLEFT)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_VIDEO_CHROMA_LOCATION, CHROMA_LOC_TOP)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_VIDEO_CHROMA_LOCATION, CHROMA_LOC_BOTTOMLEFT)); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_VIDEO_CHROMA_LOCATION, CHROMA_LOC_BOTTOM)); -} - -/** - * @tc.number : SUB_MEDIA_DEMUXER_API_0500 - * @tc.name : Set API KEY OH_MD_KEY_VIDEO_CHROMA_LOCATION NEGATIVE - * @tc.desc : api test - */ -HWTEST_F(DemuxerApiNdkTest, SUB_MEDIA_DEMUXER_API_0500, TestSize.Level2) -{ - OH_AVFormat *format; - source = OH_AVSource_CreateWithFD(fd1, 0, size); - ASSERT_NE(source, nullptr); - format = OH_AVSource_GetSourceFormat(source); - ASSERT_NE(format, nullptr); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_VIDEO_CHROMA_LOCATION, -1)); -} - -/** - * @tc.number : SUB_MEDIA_DEMUXER_API_0600 - * @tc.name : Set API KEY OH_MD_KEY_VIDEO_CHROMA_LOCATION OVER MAX - * @tc.desc : api test - */ -HWTEST_F(DemuxerApiNdkTest, SUB_MEDIA_DEMUXER_API_0600, TestSize.Level2) -{ - OH_AVFormat *format; - source = OH_AVSource_CreateWithFD(fd1, 0, size); - ASSERT_NE(source, nullptr); - format = OH_AVSource_GetSourceFormat(source); - ASSERT_NE(format, nullptr); - ASSERT_TRUE(OH_AVFormat_SetIntValue(format, OH_MD_KEY_VIDEO_CHROMA_LOCATION, 100)); -}