media_format: Print handle mimetype in error logs 27/254827/3
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 10 Mar 2021 01:48:05 +0000 (10:48 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 10 Mar 2021 03:24:44 +0000 (12:24 +0900)
Unnecessary '\n' is also removed.

[Version] 0.1.38
[Issue Type] Log

Change-Id: I98c630eee74b6e0949138c7e681fe3bf6269dcb9
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-tool.spec
src/media_format.c

index 115573876cb2255e36f9f038960a20e61ca052d4..3db7556fb95cc21c88c74aea19d194e936b9d36a 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-tool
 Summary:    A Core API media tool library in Tizen Native API
-Version:    0.1.37
+Version:    0.1.38
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index b5836dfcfd3b6544d0e3d3aec91489df0e6b1948..08defc97e0ee3c3865807232d7e6ec346611e8da 100644 (file)
@@ -135,7 +135,7 @@ int media_format_get_type(media_format_h fmt, media_format_type_e *formattype)
        else if (CHECK_IS_TEXT(fmt_handle->mimetype))
                *formattype = MEDIA_FORMAT_TEXT;
        else {
-               LOGE("The format handle is not for AUDIO / VIDEO / CONTAINER / TEXT..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for AUDIO / VIDEO / CONTAINER / TEXT..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
@@ -153,7 +153,7 @@ int media_format_get_container_mime(media_format_h fmt, media_format_mimetype_e
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_CONTAINER(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_CONTAINER..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_CONTAINER..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -173,7 +173,7 @@ int media_format_get_text_info(media_format_h fmt, media_format_mimetype_e *mime
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_TEXT(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_TEXT..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_TEXT..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
@@ -196,7 +196,7 @@ int media_format_get_video_info(media_format_h fmt, media_format_mimetype_e *mim
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_VIDEO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_VIDEO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_VIDEO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
@@ -230,7 +230,7 @@ int media_format_get_audio_info(media_format_h fmt, media_format_mimetype_e *mim
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
        if (mimetype)
@@ -263,7 +263,7 @@ int media_format_get_audio_aac_type(media_format_h fmt, bool *is_adts)
        fmt_handle = (media_format_s *)fmt;
 
        if (!(fmt_handle->mimetype == MEDIA_FORMAT_AAC_LC || fmt_handle->mimetype == MEDIA_FORMAT_AAC_HE || fmt_handle->mimetype == MEDIA_FORMAT_AAC_HE_PS)) {
-               LOGE("The format handle is not aac format..\n");
+               LOGE("format[%p, mimetype:0x%x] is not aac format..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
@@ -283,7 +283,7 @@ int media_format_get_audio_aac_header_type(media_format_h fmt, media_format_aac_
        fmt_handle = (media_format_s *)fmt;
 
        if (!(fmt_handle->mimetype == MEDIA_FORMAT_AAC_LC || fmt_handle->mimetype == MEDIA_FORMAT_AAC_HE || fmt_handle->mimetype == MEDIA_FORMAT_AAC_HE_PS)) {
-               LOGE("The format handle is not aac format..\n");
+               LOGE("format[%p, mimetype:0x%x] is not aac format..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
@@ -303,7 +303,7 @@ int media_format_get_video_frame_rate(media_format_h fmt, int *frame_rate)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_VIDEO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_VIDEO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_VIDEO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
@@ -415,7 +415,7 @@ int media_format_set_video_width(media_format_h fmt, int width)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_VIDEO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_VIDEO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_VIDEO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -439,7 +439,7 @@ int media_format_set_video_height(media_format_h fmt, int height)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_VIDEO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_VIDEO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_VIDEO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -463,7 +463,7 @@ int media_format_set_video_avg_bps(media_format_h fmt, int avg_bps)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_VIDEO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_VIDEO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_VIDEO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -487,7 +487,7 @@ int media_format_set_video_max_bps(media_format_h fmt, int max_bps)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_VIDEO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_VIDEO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_VIDEO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -511,7 +511,7 @@ int media_format_set_video_frame_rate(media_format_h fmt, int frame_rate)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_VIDEO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_VIDEO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_VIDEO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -535,7 +535,7 @@ int media_format_set_audio_mime(media_format_h fmt, media_format_mimetype_e mime
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_AUDIO(mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -559,7 +559,7 @@ int media_format_set_audio_channel(media_format_h fmt, int channel)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -583,7 +583,7 @@ int media_format_set_audio_samplerate(media_format_h fmt, int samplerate)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -607,7 +607,7 @@ int media_format_set_audio_bit(media_format_h fmt, int bit)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -631,7 +631,7 @@ int media_format_set_audio_avg_bps(media_format_h fmt, int avg_bps)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -655,7 +655,7 @@ int media_format_set_audio_aac_type(media_format_h fmt, bool is_adts)
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -679,7 +679,7 @@ int media_format_set_audio_aac_header_type(media_format_h fmt, media_format_aac_
        fmt_handle = (media_format_s *)fmt;
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -716,13 +716,13 @@ int media_format_unref(media_format_h fmt)
        fmt_handle = (media_format_s *)fmt;
 
        if (MEDIA_FORMAT_GET_REFCOUNT(fmt) <= 0) {
-               LOGE("The format ref_count is less than 0..\n");
+               LOGE("The format ref_count is less than 0..");
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
        is_zero = g_atomic_int_dec_and_test(&fmt_handle->ref_count);
        if (is_zero) {
-               LOGI("The format handle(%p) will be destroyed..\n", fmt);
+               LOGI("The format handle(%p) will be destroyed..", fmt);
                /* if reference count become 0 , free fmt. */
                __media_format_destroy(fmt_handle);
        } else {
@@ -738,7 +738,7 @@ int media_format_is_writable(media_format_h fmt, bool *is_writable)
        MEDIA_FORMAT_NULL_ARG_CHECK(is_writable);
 
        if (MEDIA_FORMAT_GET_REFCOUNT(fmt) <= 0) {
-               LOGE("The format ref_count is less than 0..\n.");       //LCOV_EXCL_LINE
+               LOGE("The format ref_count is less than 0..."); //LCOV_EXCL_LINE
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
@@ -787,7 +787,7 @@ int media_format_make_writable(media_format_h fmt, media_format_h *out_fmt)
                }
 
                *out_fmt = (media_format_h) copy;
-               LOGI("the copied new format handle: %p\n", *out_fmt);
+               LOGI("the copied new format handle: %p", *out_fmt);
 
        }
 
@@ -833,12 +833,12 @@ int media_format_set_audio_channel_mask(media_format_h fmt, uint64_t channel_mas
        fmt_handle = (media_format_s *)fmt;
 
        if (MEDIA_FORMAT_GET_REFCOUNT(fmt) <= 0) {
-               LOGE("The format ref_count is less than 0..\n");
+               LOGE("The format ref_count is less than 0..");
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -858,12 +858,12 @@ int media_format_get_audio_channel_mask(media_format_h fmt, uint64_t *channel_ma
        fmt_handle = (media_format_s *)fmt;
 
        if (MEDIA_FORMAT_GET_REFCOUNT(fmt) <= 0) {
-               LOGE("The format ref_count is less than 0..\n");
+               LOGE("The format ref_count is less than 0..");
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for MEDIA_FORMAT_AUDIO..\n");
+               LOGE("format[%p, mimetype:0x%x] is not for MEDIA_FORMAT_AUDIO..", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -891,12 +891,12 @@ int media_format_is_little_endian(media_format_h fmt, bool *is_little_endian)
        fmt_handle = (media_format_s *)fmt;
 
        if (MEDIA_FORMAT_GET_REFCOUNT(fmt) <= 0) {
-               LOGE("The format ref_count is less than 0..\n");
+               LOGE("The format ref_count is less than 0..");
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype) || !CHECK_IS_RAW(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for PCM\n");
+               LOGE("format[%p, mimetype:0x%x] is not for PCM", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -920,7 +920,7 @@ int media_format_is_little_endian(media_format_h fmt, bool *is_little_endian)
                *is_little_endian = false;
                break;
        default:
-               LOGE("The format handle is not for PCM\n");
+               LOGE("invalid mimetype(0x%x)", fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
@@ -938,12 +938,12 @@ int media_format_get_audio_bit_depth(media_format_h fmt, int *bit_depth)
        fmt_handle = (media_format_s *)fmt;
 
        if (MEDIA_FORMAT_GET_REFCOUNT(fmt) <= 0) {
-               LOGE("The format ref_count is less than 0..\n");
+               LOGE("The format ref_count is less than 0..");
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
        if (!CHECK_IS_AUDIO(fmt_handle->mimetype) || !CHECK_IS_RAW(fmt_handle->mimetype)) {
-               LOGE("The format handle is not for AUDIO");
+               LOGE("format[%p, mimetype:0x%x] is not for AUDIO", fmt_handle, fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
        }
 
@@ -969,7 +969,7 @@ int media_format_get_audio_bit_depth(media_format_h fmt, int *bit_depth)
                *bit_depth = 32;
                break;
        default:
-               LOGE("The format handle is not for PCM\n");
+               LOGE("invalid mimetype(0x%x)", fmt_handle->mimetype);
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }
 
@@ -987,7 +987,7 @@ int media_format_channel_positions_from_mask(media_format_h fmt, uint64_t channe
        fmt_handle = (media_format_s *)fmt;
 
        if (MEDIA_FORMAT_GET_REFCOUNT(fmt) <= 0) {
-               LOGE("The format ref_count is less than 0..\n");
+               LOGE("The format ref_count is less than 0..");
                return MEDIA_FORMAT_ERROR_INVALID_OPERATION;
        }