From: Sangchul Lee Date: Wed, 10 Mar 2021 01:48:05 +0000 (+0900) Subject: media_format: Print handle mimetype in error logs X-Git-Tag: submit/tizen/20210315.032240~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13ca1f2f5eb2df4377eef5a7e34d0dbc39722176;p=platform%2Fcore%2Fapi%2Fmediatool.git media_format: Print handle mimetype in error logs Unnecessary '\n' is also removed. [Version] 0.1.38 [Issue Type] Log Change-Id: I98c630eee74b6e0949138c7e681fe3bf6269dcb9 Signed-off-by: Sangchul Lee --- diff --git a/packaging/capi-media-tool.spec b/packaging/capi-media-tool.spec index 1155738..3db7556 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.37 +Version: 0.1.38 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/media_format.c b/src/media_format.c index b5836df..08defc9 100644 --- a/src/media_format.c +++ b/src/media_format.c @@ -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; }