[ACR-1621] media_format: Revise media_format_get_type() 82/254882/3
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 10 Mar 2021 08:10:37 +0000 (17:10 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 11 Mar 2021 02:51:30 +0000 (11:51 +0900)
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 <sc11.lee@samsung.com>
include/media_format.h
packaging/capi-media-tool.spec
src/media_format.c

index 33da5f6439167b7b8c5d19a1ab367f4a9e60e617..d195a236a553068c400aecff27c161ce362ada38 100644 (file)
@@ -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);
 
index f3c86f58b2ab9ce871aaf7aed9dd036814dce785..d5fe504f4da4a6499e8f269f0d5caea09aa3f9ed 100755 (executable)
@@ -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
index a787f651c084ab01c1f691d24c1b2ef7a09d9f59..275d31fc2e3dd5512b2412f4aa43b38dcbba00d1 100644 (file)
@@ -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);