Fix build warning for format string check 61/133661/2 accepted/tizen/unified/20170616.154237 submit/tizen/20170615.061112
authorGilbok Lee <gilbok.lee@samsung.com>
Tue, 13 Jun 2017 04:55:22 +0000 (13:55 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Tue, 13 Jun 2017 05:40:56 +0000 (05:40 +0000)
[Version] 0.10.7
[Profile] Mobile, TV
[Issue Type] Fix bugs

Change-Id: I45fd42f0547cb9fab5d3100354874a6bdaa0f5b0

packaging/libmm-transcode.spec
transcode/mm_transcode.c
transcode/mm_transcode_pipeline.c
transcode/mm_transcode_seek.c

index f0164b2..cc5dd6d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-transcode
 Summary:    Multimedia Framework Video Transcode Library
-Version:    0.10.6
+Version:    0.10.7
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index f09caaf..90463d7 100755 (executable)
@@ -67,7 +67,7 @@ int mm_transcode_create(MMHandleType *MMHandle)
 
        *MMHandle = (MMHandleType)handle;
 
-       debug_log("MMHandle: 0x%2x", handle);
+       debug_log("MMHandle: %p", handle);
        handle->property->_MMHandle = 0;
 
        return ret;
@@ -222,11 +222,13 @@ int mm_transcode(MMHandleType MMHandle, unsigned int resolution_width, unsigned
 
        handle->property->progress_cb = progress_callback;
        handle->property->progress_cb_param = user_param;
-       debug_log("[MMHandle] 0x%2x [progress_cb] 0x%2x [progress_cb_param] 0x%2x", MMHandle, handle->property->progress_cb, handle->property->progress_cb_param);
+       debug_log("[MMHandle] %p [progress_cb] %p [progress_cb_param] %p",
+               MMHandle, handle->property->progress_cb, handle->property->progress_cb_param);
 
        handle->property->completed_cb = completed_callback;
        handle->property->completed_cb_param = user_param;
-       debug_log("[MMHandle] 0x%2x [completed_cb] 0x%2x [completed_cb_param] 0x%2x", MMHandle, handle->property->completed_cb, handle->property->completed_cb_param);
+       debug_log("[MMHandle] %p [completed_cb] %p [completed_cb_param] %p",
+               MMHandle, handle->property->completed_cb, handle->property->completed_cb_param);
 
        if (!handle->property) {
                debug_error("[ERROR] - handle property");
@@ -237,7 +239,7 @@ int mm_transcode(MMHandleType MMHandle, unsigned int resolution_width, unsigned
                handle_param_s *param = g_new0(handle_param_s, 1);
                if (param) {
                        /*g_value_init (param, G_TYPE_INT); */
-                       debug_log("[param] 0x%2x", param);
+                       debug_log("[param] %p", param);
                }
 
                /* set parameter */
@@ -448,7 +450,9 @@ int mm_transcode_get_attrs(MMHandleType MMHandle, mm_containerformat_e * contain
        *resolution_width = handle->param->resolution_width;
        *resolution_height = handle->param->resolution_height;
 
-       debug_log("containerformat : %d, videoencoder : %d, audioencoder : %d, current_pos : %d, duration : %d, resolution_width : %d, resolution_height : %d", *containerformat, *videoencoder, *audioencoder, *current_pos, *duration, *resolution_width, *resolution_height);
+       debug_log("containerformat : %d, videoencoder : %d, audioencoder : %d, current_pos : %lu, duration : %lu, resolution_width : %d, resolution_height : %d",
+               *containerformat, *videoencoder, *audioencoder, *current_pos,
+               *duration, *resolution_width, *resolution_height);
 
        return ret;
 }
index 269f935..c7ba91b 100755 (executable)
@@ -433,7 +433,7 @@ static int _mm_decode_audio_output_link(handle_s *handle)
 
                handle->property->audio_cb_probe_id = gst_pad_add_probe(handle->decoder_audp->sinkdecaudiopad, GST_PAD_PROBE_TYPE_BUFFER, _mm_cb_audio_output_stream_probe, handle, NULL);
                /* must use sinkpad (sinkpad => srcpad) for normal resized video buffer */
-               debug_log("audio_cb_probe_id: %d", handle->property->audio_cb_probe_id);
+               debug_log("audio_cb_probe_id: %lu", handle->property->audio_cb_probe_id);
        }
 
        gst_bin_add(GST_BIN(handle->pipeline), handle->decoder_audp->decaudiobin);
index cc5dbc3..0a25dc8 100755 (executable)
@@ -453,7 +453,7 @@ gboolean _mm_cb_transcode_bus(GstBus *bus, GstMessage *message, gpointer userdat
                        debug_log("GST_MESSAGE_ASYNC_DONE");
 
                        /* Play Transcode */
-                       debug_log("[Play Trancode] [%d ~ %d]", handle->param->start_pos, handle->property->end_pos);
+                       debug_log("[Play Trancode] [%lu ~ %lu]", handle->param->start_pos, handle->property->end_pos);
 
                        if (_mm_transcode_play(handle) != MM_ERROR_NONE) {
                                debug_error("ERROR - Play Pipeline");
@@ -490,7 +490,7 @@ gboolean _mm_cb_transcode_bus(GstBus *bus, GstMessage *message, gpointer userdat
                        /* checkpoint once more here (eos) and not unlink when Audio only */
                        if ((handle->param->start_pos > handle->property->total_length && handle->property->total_length != 0) && (handle->property->videoencoder != MM_VIDEOENCODER_NO_USE)) {
                                unlink(handle->param->outputfile);
-                               debug_log("[unlink] %s %d > %d", handle->param->outputfile, handle->param->start_pos, handle->property->total_length);
+                               debug_log("[unlink] %s %lu > %lu", handle->param->outputfile, handle->param->start_pos, handle->property->total_length);
                        }
                        g_mutex_lock(handle->property->thread_mutex);
                        handle->param->completed = TRUE;
@@ -499,7 +499,7 @@ gboolean _mm_cb_transcode_bus(GstBus *bus, GstMessage *message, gpointer userdat
                        debug_log("===> send completed signal");
                        g_mutex_unlock(handle->property->thread_mutex);
 
-                       debug_log("[MMHandle] 0x%2x [msg_cb] 0x%2x [msg_cb_param] 0x%2x", MMHandle, handle->property->completed_cb, handle->property->completed_cb_param);
+                       debug_log("[MMHandle] %p [msg_cb] %p [msg_cb_param] %p", MMHandle, handle->property->completed_cb, handle->property->completed_cb_param);
 
                        if (handle->property->progress_cb)
                                handle->property->progress_cb(handle->property->real_duration, handle->property->real_duration, handle->property->progress_cb_param);
@@ -630,7 +630,7 @@ static int _mm_transcode_exec(handle_s *handle, handle_param_s *param)
                g_mutex_unlock(handle->property->thread_mutex);
                debug_log("unlock destory");
        } else {
-               debug_log("start_pos: %d, duration: %d, seek_mode: %d output file name: %s\n", param->start_pos, param->duration, param->seek_mode, param->outputfile);
+               debug_log("start_pos: %lu, duration: %lu, seek_mode: %d output file name: %s\n", param->start_pos, param->duration, param->seek_mode, param->outputfile);
                handle->param = g_new0(handle_param_s, 1);
                /*g_value_init (handle->param, G_TYPE_INT); */
 
@@ -659,10 +659,13 @@ static int _mm_transcode_exec(handle_s *handle, handle_param_s *param)
                handle->param->segment_done = FALSE;
                handle->param->completed = FALSE;
                handle->param->printed = 0;
-               debug_log("[SEEK: %d] width: %d height: %d fps_value: %d start_pos: %d duration: %d seek_mode: %d outputfile: %s", handle->param->seeking, handle->param->resolution_width, handle->param->resolution_height, handle->param->fps_value, handle->param->start_pos, handle->param->duration, handle->param->seek_mode, handle->param->outputfile);
+               debug_log("[SEEK: %d] width: %d height: %d fps_value: %d start_pos: %lu duration: %lu seek_mode: %d outputfile: %s",
+                       handle->param->seeking, handle->param->resolution_width, handle->param->resolution_height,
+                       handle->param->fps_value, handle->param->start_pos, handle->param->duration,
+                       handle->param->seek_mode, handle->param->outputfile);
 
                if (handle->property->total_length != 0 && handle->param->start_pos > handle->property->total_length) {
-                       debug_log("[SKIP] [%s] because out of duration [%d < %d ~ %d] ", handle->param->outputfile, handle->property->total_length, handle->param->start_pos, handle->param->duration);
+                       debug_log("[SKIP] [%s] because out of duration [%lu < %lu ~ %lu] ", handle->param->outputfile, handle->property->total_length, handle->param->start_pos, handle->param->duration);
                        g_mutex_unlock(handle->property->thread_mutex);
                        debug_log("[thread_mutex unlock]");
                } else {
@@ -991,7 +994,8 @@ int _mm_transcode_set_handle_parameter(handle_param_s *param, unsigned int resol
        param->start_pos = start_pos;
        param->duration = duration;
        param->seek_mode = seek_mode;
-       debug_log("resolution_width: %d, resolution_height: %d, fps_value: %d, start_pos: %d, duration: %d, seek_mode: %d \n", param->resolution_width, param->resolution_height, fps_value, param->start_pos, param->duration, param->seek_mode);
+       debug_log("resolution_width: %d, resolution_height: %d, fps_value: %d, start_pos: %lu, duration: %lu, seek_mode: %d \n",
+               param->resolution_width, param->resolution_height, fps_value, param->start_pos, param->duration, param->seek_mode);
 
        if (start_pos == 0 && duration == 0)
                param->seeking = FALSE;
@@ -1136,7 +1140,10 @@ static int _mm_transcode_play(handle_s *handle)
                return ret;
        }
 
-       debug_log("[SEEK: %d] width: %d height: %d start_pos: %d duration: %d (%d) seek_mode: %d outputfile: %s", handle->param->seeking, handle->param->resolution_width, handle->param->resolution_height, handle->param->start_pos, handle->param->duration, handle->property->end_pos, handle->param->seek_mode, handle->param->outputfile);
+       debug_log("[SEEK: %d] width: %d height: %d start_pos: %lu duration: %lu (%lu) seek_mode: %d outputfile: %s",
+               handle->param->seeking, handle->param->resolution_width, handle->param->resolution_height,
+               handle->param->start_pos, handle->param->duration, handle->property->end_pos,
+               handle->param->seek_mode, handle->param->outputfile);
 
        if (!handle->property->progress_event_id) {
                handle->property->progress_event_id = g_timeout_add(LAZY_PAUSE_TIMEOUT_MSEC, (GSourceFunc) _mm_cb_print_position, handle);
@@ -1169,7 +1176,8 @@ static int _mm_transcode_seek(handle_s *handle)
        handle->property->end_pos = handle->param->start_pos + handle->param->duration;
 
        if (handle->param->start_pos > handle->property->total_length && handle->property->seek_idx) {
-               debug_error("[%d ~ %d] out of %d", handle->param->start_pos, handle->property->end_pos, handle->property->total_length);
+               debug_error("[%lu ~ %lu] out of %lu",
+                       handle->param->start_pos, handle->property->end_pos, handle->property->total_length);
                return MM_ERROR_TRANSCODE_SEEK_FAILED;
        } else {
                if (handle->param->duration != 0) {
@@ -1179,7 +1187,8 @@ static int _mm_transcode_seek(handle_s *handle)
                        end_pos = handle->property->total_length * G_GINT64_CONSTANT(1000000);
                }
 
-               debug_log("seek time : [ (%d msec) : (%d msec) ]\n", handle->param->start_pos, handle->property->end_pos);
+               debug_log("seek time : [ (%lu msec) : (%lu msec) ]\n",
+                       handle->param->start_pos, handle->property->end_pos);
 
                while (walk_element) {
                        GstElement *seekable_element = GST_ELEMENT(walk_element->data);
@@ -1224,7 +1233,7 @@ int _mm_transcode_thread(handle_s *handle)
        if (!handle->property->thread_mutex) {
                handle->property->thread_mutex = g_new(GMutex, 1);
                g_mutex_init(handle->property->thread_mutex);
-               debug_log("create thread_mutex: 0x%2x", handle->property->thread_mutex);
+               debug_log("create thread_mutex: %p", handle->property->thread_mutex);
        } else {
                debug_error("ERROR - thread_mutex is already created");
        }
@@ -1232,7 +1241,7 @@ int _mm_transcode_thread(handle_s *handle)
        if (!handle->property->thread_exit_mutex) {
                handle->property->thread_exit_mutex = g_new(GMutex, 1);
                g_mutex_init(handle->property->thread_exit_mutex);
-               debug_log("create exit mutex: 0x%2x", handle->property->thread_exit_mutex);
+               debug_log("create exit mutex: %p", handle->property->thread_exit_mutex);
        } else {
                debug_error("ERROR - thread_exit_mutex is already created");
        }
@@ -1248,7 +1257,7 @@ int _mm_transcode_thread(handle_s *handle)
        if (!handle->property->thread_cond) {
                handle->property->thread_cond = g_new(GCond, 1);
                g_cond_init(handle->property->thread_cond);
-               debug_log("create thread cond: 0x%2x", handle->property->thread_cond);
+               debug_log("create thread cond: %p", handle->property->thread_cond);
        } else {
                debug_error("thread cond is already created");
        }
@@ -1260,7 +1269,7 @@ int _mm_transcode_thread(handle_s *handle)
                debug_error("ERROR - create thread");
                return MM_ERROR_TRANSCODE_INTERNAL;
        } else {
-               debug_log("create thread: 0x%2x", handle->property->thread);
+               debug_log("create thread: %p", handle->property->thread);
        }
 
        return ret;
@@ -1296,7 +1305,9 @@ static gpointer _mm_transcode_thread_repeate(gpointer data)
                        debug_log("[Destroy]");
                        break;
                } else {
-                       debug_log("[pop queue] resolution_width: %d, resolution_height: %d, start_pos: %d, duration: %d, seek_mode: %d outputfile: %s\n", pop_data->resolution_width, pop_data->resolution_height, pop_data->start_pos, pop_data->duration, pop_data->seek_mode, pop_data->outputfile);
+                       debug_log("[pop queue] resolution_width: %d, resolution_height: %d, start_pos: %lu, duration: %lu, seek_mode: %d outputfile: %s\n",
+                               pop_data->resolution_width, pop_data->resolution_height, pop_data->start_pos,
+                               pop_data->duration, pop_data->seek_mode, pop_data->outputfile);
 
                        /* Need to block */
                        ret = _mm_transcode_exec(handle, pop_data);