From 1fbba30197cb2a0a28a740ea3ed06a795a593ffc Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Wed, 10 Mar 2021 17:10:37 +0900 Subject: [PATCH] [ACR-1621] media_format: Revise media_format_get_type() When a mimetype is not set after creating handle, this function fills MEDIA_FORMAT_NONE to the out-parameter(formattype) instead of returning MEDIA_FORMAT_ERROR_INVALID_OPERATION. Declare deprecation to the MEDIA_FORMAT_UNKNOWN not used. [Version] 0.1.41 [Issue Type] Improvement Change-Id: I4ee6bfb15a92c808419785f875b8ecd613c502a4 Signed-off-by: Sangchul Lee --- include/media_format.h | 8 ++++++-- packaging/capi-media-tool.spec | 2 +- src/media_format.c | 6 ++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/media_format.h b/include/media_format.h index 33da5f6..d195a23 100644 --- a/include/media_format.h +++ b/include/media_format.h @@ -63,7 +63,7 @@ typedef enum { MEDIA_FORMAT_VIDEO = 0x02000000, /**< media format type is VIDEO */ MEDIA_FORMAT_TEXT = 0x03000000, /**< media format type is TEXT */ MEDIA_FORMAT_CONTAINER = 0x04000000, /**< media format type is CONTAINER */ - MEDIA_FORMAT_UNKNOWN = 0x08000000, /**< media format type is UNKNOWN */ + MEDIA_FORMAT_UNKNOWN = 0x08000000, /**< media format type is UNKNOWN (Deprecated since 6.5) */ } media_format_type_e; /** @@ -294,6 +294,7 @@ int media_format_create(media_format_h *fmt); /** * @brief Gets format type of media format. * @since_tizen 3.0 + * @remarks Since 6.5, #MEDIA_FORMAT_ERROR_INVALID_OPERATION is removed. * @param[in] fmt The #media_format_h to get format type * @param[out] formattype The #media_format_type_e, ex) #MEDIA_FORMAT_AUDIO * @@ -301,7 +302,10 @@ int media_format_create(media_format_h *fmt); * otherwise a negative error value * @retval #MEDIA_FORMAT_ERROR_NONE Successful * @retval #MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation + * @see media_format_set_container_mime() + * @see media_format_set_text_mime() + * @see media_format_set_audio_mime() + * @see media_format_set_video_mime() */ int media_format_get_type(media_format_h fmt, media_format_type_e *formattype); diff --git a/packaging/capi-media-tool.spec b/packaging/capi-media-tool.spec index f3c86f5..d5fe504 100755 --- a/packaging/capi-media-tool.spec +++ b/packaging/capi-media-tool.spec @@ -1,6 +1,6 @@ Name: capi-media-tool Summary: A Core API media tool library in Tizen Native API -Version: 0.1.40 +Version: 0.1.41 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/media_format.c b/src/media_format.c index a787f65..275d31f 100644 --- a/src/media_format.c +++ b/src/media_format.c @@ -134,10 +134,8 @@ int media_format_get_type(media_format_h fmt, media_format_type_e *formattype) *formattype = MEDIA_FORMAT_CONTAINER; else if (CHECK_IS_TEXT(fmt_handle->mimetype)) *formattype = MEDIA_FORMAT_TEXT; - else { - LOGE("format[%p, mimetype:0x%x] is not for AUDIO / VIDEO / CONTAINER / TEXT..", fmt_handle, fmt_handle->mimetype); - return MEDIA_FORMAT_ERROR_INVALID_OPERATION; - } + else + *formattype = MEDIA_FORMAT_NONE; LOGI("format[%p] type[0x%x]", fmt, *formattype); -- 2.34.1