Fix invalid format usage 41/194741/1 accepted/tizen/unified/20181210.060050 submit/tizen/20181207.091640
authorJeongmo Yang <jm80.yang@samsung.com>
Fri, 7 Dec 2018 05:53:14 +0000 (14:53 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Fri, 7 Dec 2018 05:53:14 +0000 (14:53 +0900)
[Version] 0.10.176
[Profile] Common
[Issue Type] Bug fix
[Dependency module] N/A

Change-Id: I3b084d794bffc31414475f724957d6328879de07
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/libmm-camcorder.spec
src/mm_camcorder_audiorec.c
src/mm_camcorder_configure.c
src/mm_camcorder_gstcommon.c
src/mm_camcorder_stillshot.c
src/mm_camcorder_util.c
src/mm_camcorder_videorec.c

index baefce8..89bb287 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-camcorder
 Summary:    Camera and recorder library
-Version:    0.10.175
+Version:    0.10.176
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 71930c6..eef54db 100644 (file)
@@ -484,11 +484,11 @@ _mmcamcorder_audio_command(MMHandleType handle, int command)
                        if (info->filesize > 0) {
                                break;
                        } else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
-                               _mmcam_dbg_err("Pause fail, wait 200 ms, but file size is %lld",
+                               _mmcam_dbg_err("Pause fail, wait 200 ms, but file size is %lu",
                                        info->filesize);
                                return MM_ERROR_CAMCORDER_INVALID_CONDITION;
                        } else {
-                               _mmcam_dbg_warn("Wait for enough audio frame, retry count[%d], file size is %lld",
+                               _mmcam_dbg_warn("Wait for enough audio frame, retry count[%d], file size is %lu",
                                        count, info->filesize);
                        }
                        usleep(_MMCAMCORDER_FRAME_WAIT_TIME);
@@ -551,11 +551,11 @@ _mmcamcorder_audio_command(MMHandleType handle, int command)
                        if (info->filesize > 0) {
                                break;
                        } else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
-                               _mmcam_dbg_err("Commit fail, waited 200 ms, but file size is %lld", info->filesize);
+                               _mmcam_dbg_err("Commit fail, waited 200 ms, but file size is %lu", info->filesize);
                                        info->b_commiting = FALSE;
                                return MM_ERROR_CAMCORDER_INVALID_CONDITION;
                        } else {
-                               _mmcam_dbg_warn("Waiting for enough audio frame, re-count[%d], file size is %lld",
+                               _mmcam_dbg_warn("Waiting for enough audio frame, re-count[%d], file size is %lu",
                                        count, info->filesize);
                        }
                        usleep(_MMCAMCORDER_FRAME_WAIT_TIME);
@@ -1106,7 +1106,7 @@ static gboolean __mmcamcorder_audio_add_metadata_info_m4a(MMHandleType handle)
 
                nread = fread(&buf, sizeof(char), sizeof(buf), f);
 
-               _mmcam_dbg_log("recorded file fread %d", nread);
+               _mmcam_dbg_log("recorded file fread %zu", nread);
 
                udta_size = _mmcamcorder_get_container_size(buf);
 
index 79a79bc..575a073 100644 (file)
@@ -977,13 +977,13 @@ int _mmcamcorder_conf_parse_info(MMHandleType handle, int type, FILE *fp, camera
 
        new_conf = (camera_conf *)g_malloc0(sizeof(camera_conf));
        if (new_conf == NULL) {
-               _mmcam_dbg_err("new_conf alloc failed : %d", sizeof(camera_conf));
+               _mmcam_dbg_err("new_conf alloc failed : %zu", sizeof(camera_conf));
                return MM_ERROR_CAMCORDER_LOW_MEMORY;
        }
 
        buffer_string = (char*)g_malloc0(sizeof(char) * BUFFER_LENGTH_STRING);
        if (buffer_string == NULL) {
-               _mmcam_dbg_err("buffer_string alloc failed : %d", sizeof(char) * BUFFER_LENGTH_STRING);
+               _mmcam_dbg_err("buffer_string alloc failed : %zu", sizeof(char) * BUFFER_LENGTH_STRING);
                g_free(new_conf);
                return MM_ERROR_CAMCORDER_LOW_MEMORY;
        }
@@ -1626,7 +1626,7 @@ int _mmcamcorder_conf_add_info(MMHandleType handle, int type, conf_detail **info
                                                }
                                        }
                                } else {
-                                       _mmcam_dbg_err("malloc failed : %d", sizeof(type_string2*)*(new_element->count_string));
+                                       _mmcam_dbg_err("malloc failed : %zu", sizeof(type_string2*)*(new_element->count_string));
                                }
                        } else {
                                /*_mmcam_dbg_err("invalid count - %d", new_element->count_string);*/
@@ -2765,7 +2765,7 @@ _mmcamcorder_get_available_format(MMHandleType handle, int conf_category, int **
 
                arr = (int*) g_malloc0(count * sizeof(int));
                if (arr == NULL) {
-                       _mmcam_dbg_err("malloc failed : %d", count * sizeof(int));
+                       _mmcam_dbg_err("malloc failed : %zu", count * sizeof(int));
                        return 0;
                }
 
index cd1db49..275576d 100644 (file)
@@ -2164,7 +2164,7 @@ GstPadProbeReturn __mmcamcorder_eventprobe_monitor(GstPad *pad, GstPadProbeInfo
                        const GstSegment *segment;
                        gst_event_parse_segment(event, &segment);
                        if (segment->format == GST_FORMAT_BYTES) {
-                               _mmcam_dbg_log("change current offset %llu -> %llu",
+                               _mmcam_dbg_log("change current offset %llu -> %lu",
                                        sc->muxed_stream_offset, segment->start);
 
                                sc->muxed_stream_offset = (unsigned long long)segment->start;
index 3841091..1cab27e 100644 (file)
@@ -1305,7 +1305,7 @@ static void __mmcamcorder_image_capture_cb(GstElement *element, GstSample *sampl
                goto error;
        } else {
                if ((mapinfo1.data == NULL) && (mapinfo1.size == 0)) {
-                       _mmcam_dbg_err("mapinfo1 is wrong (%p, size %d)", mapinfo1.data, mapinfo1.size);
+                       _mmcam_dbg_err("mapinfo1 is wrong (%p, size %zu)", mapinfo1.data, mapinfo1.size);
                        MMCAM_SEND_MESSAGE(hcamcorder, MM_MESSAGE_CAMCORDER_ERROR, MM_ERROR_CAMCORDER_INTERNAL);
                        gst_buffer_unmap(gst_sample_get_buffer(sample1), &mapinfo1);
                        goto error;
@@ -1325,14 +1325,14 @@ static void __mmcamcorder_image_capture_cb(GstElement *element, GstSample *sampl
        mm_attrs_get_index(attrs, MMCAM_CAPTURED_SCREENNAIL, &attr_index_for_screennail);
 
        if (sample3 && mapinfo3.data && mapinfo3.size != 0) {
-               _mmcam_dbg_log("Screennail (sample3=%p,size=%d)", sample3, mapinfo3.size);
+               _mmcam_dbg_log("Screennail (sample3=%p,size=%zu)", sample3, mapinfo3.size);
 
                pixtype_scrnl = _mmcamcorder_get_pixel_format(gst_sample_get_caps(sample3));
                __mmcamcorder_get_capture_data_from_buffer(&scrnail, pixtype_scrnl, sample3);
 
                /* Set screennail attribute for application */
                ret = mm_attrs_set_data(attrs, attr_index_for_screennail, &scrnail, sizeof(scrnail));
-               _mmcam_dbg_log("Screennail set attribute data %p, size %d, ret %x", &scrnail, sizeof(scrnail), ret);
+               _mmcam_dbg_log("Screennail set attribute data %p, size %zu, ret %x", &scrnail, sizeof(scrnail), ret);
        } else {
                _mmcam_dbg_log("Sample3 has wrong pointer. Not Error. (sample3=%p)", sample3);
                mm_attrs_set_data(attrs, attr_index_for_screennail, NULL, 0);
index 8647211..171eda4 100644 (file)
@@ -255,7 +255,7 @@ gint _mmcamcorder_find_tag(FILE *f, guint32 tag_fourcc, gboolean do_rewind)
                uint32_t buf_fourcc = 0;
 
                if (read_item < 8) {
-                       _mmcam_dbg_err("fread failed : %d", read_item);
+                       _mmcam_dbg_err("fread failed : %zu", read_item);
                        break;
                }
 
@@ -284,7 +284,7 @@ gint _mmcamcorder_find_tag(FILE *f, guint32 tag_fourcc, gboolean do_rewind)
                                buf_size = buf_size - 8; /* include tag */
                        }
 
-                       _mmcam_dbg_log("seek %llu", buf_size);
+                       _mmcam_dbg_log("seek %lu", buf_size);
                        if (fseeko(f, (off_t)buf_size, SEEK_CUR) != 0) {
                                _mmcam_dbg_err("fseeko() fail");
                                return FALSE;
@@ -310,7 +310,7 @@ gboolean _mmcamcorder_find_fourcc(FILE *f, guint32 tag_fourcc, gboolean do_rewin
                uint32_t buf_fourcc = 0;
 
                if (read_item < 8) {
-                       _mmcam_dbg_err("fread failed : %d", read_item);
+                       _mmcam_dbg_err("fread failed : %zu", read_item);
                        break;
                }
 
@@ -345,7 +345,7 @@ gboolean _mmcamcorder_find_fourcc(FILE *f, guint32 tag_fourcc, gboolean do_rewin
                                buf_size = buf_size - 8; /* include tag */
                        }
 
-                       _mmcam_dbg_log("seek %llu", buf_size);
+                       _mmcam_dbg_log("seek %lu", buf_size);
                        if (fseeko(f, (off_t)buf_size, SEEK_CUR) != 0) {
                                _mmcam_dbg_err("fseeko() fail");
                                return FALSE;
@@ -603,7 +603,7 @@ guint64 _mmcamcorder_get_container_size(const guchar *size)
        result = result | (temp << 8);
        result = result | size[3];
 
-       _mmcam_dbg_log("result : %llu", result);
+       _mmcam_dbg_log("result : %lu", result);
 
        return result;
 }
@@ -630,7 +630,7 @@ guint64 _mmcamcorder_get_container_size64(const guchar *size)
        result = result | (temp << 8);
        result = result | size[7];
 
-       _mmcam_dbg_log("result : %llu", result);
+       _mmcam_dbg_log("result : %lu", result);
 
        return result;
 }
@@ -764,7 +764,7 @@ int _mmcamcorder_get_freespace(storage_type_e type, guint64 *free_space)
        *free_space = vfs.f_bsize * vfs.f_bavail;
        /*
        _mmcam_dbg_log("vfs.f_bsize [%lu], vfs.f_bavail [%lu]", vfs.f_bsize, vfs.f_bavail);
-       _mmcam_dbg_log("memory size %llu [%s]", *free_space, path);
+       _mmcam_dbg_log("memory size %lu [%s]", *free_space, path);
        */
        return 0;
 }
index cb4c3f1..f6aaf57 100644 (file)
@@ -923,10 +923,10 @@ int _mmcamcorder_video_command(MMHandleType handle, int command)
                                if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME) {
                                        break;
                                } else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
-                                       _mmcam_dbg_err("Pause fail, frame count %llu", info->video_frame_count);
+                                       _mmcam_dbg_err("Pause fail, frame count %lu", info->video_frame_count);
                                        return MM_ERROR_CAMCORDER_INVALID_CONDITION;
                                } else {
-                                       _mmcam_dbg_warn("Waiting for enough video frame, retrial[%d], frame %llu", count, info->video_frame_count);
+                                       _mmcam_dbg_warn("Waiting for enough video frame, retrial[%d], frame %lu", count, info->video_frame_count);
                                }
 
                                usleep(_MMCAMCORDER_FRAME_WAIT_TIME);
@@ -935,11 +935,11 @@ int _mmcamcorder_video_command(MMHandleType handle, int command)
                                if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME && info->audio_frame_count) {
                                        break;
                                } else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
-                                       _mmcam_dbg_err("Pause fail, frame count VIDEO[%llu], AUDIO [%llu]",
+                                       _mmcam_dbg_err("Pause fail, frame count VIDEO[%lu], AUDIO [%lu]",
                                                info->video_frame_count, info->audio_frame_count);
                                        return MM_ERROR_CAMCORDER_INVALID_CONDITION;
                                } else {
-                                       _mmcam_dbg_warn("Waiting for enough frames, retrial [%d], VIDEO[%llu], AUDIO [%llu]",
+                                       _mmcam_dbg_warn("Waiting for enough frames, retrial [%d], VIDEO[%lu], AUDIO [%lu]",
                                                count, info->video_frame_count, info->audio_frame_count);
                                }
 
@@ -1069,7 +1069,7 @@ int _mmcamcorder_video_command(MMHandleType handle, int command)
                                    hcamcorder->capture_in_recording == FALSE) {
                                        break;
                                } else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
-                                       _mmcam_dbg_err("Commit fail, frame count is %llu, capturing %d",
+                                       _mmcam_dbg_err("Commit fail, frame count is %lu, capturing %d",
                                                info->video_frame_count, hcamcorder->capture_in_recording);
 
                                        if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME) {
@@ -1079,7 +1079,7 @@ int _mmcamcorder_video_command(MMHandleType handle, int command)
                                                return MM_ERROR_CAMCORDER_INVALID_CONDITION;
                                        }
                                } else {
-                                       _mmcam_dbg_warn("Waiting for enough video frame, retrial [%d], frame %llu, capturing %d",
+                                       _mmcam_dbg_warn("Waiting for enough video frame, retrial [%d], frame %lu, capturing %d",
                                                count, info->video_frame_count, hcamcorder->capture_in_recording);
                                }
                        } else {
@@ -1089,7 +1089,7 @@ int _mmcamcorder_video_command(MMHandleType handle, int command)
                                    hcamcorder->capture_in_recording == FALSE) {
                                        break;
                                } else if (count == _MMCAMCORDER_RETRIAL_COUNT) {
-                                       _mmcam_dbg_err("Commit fail, VIDEO[%llu], AUDIO [%llu], capturing %d",
+                                       _mmcam_dbg_err("Commit fail, VIDEO[%lu], AUDIO [%lu], capturing %d",
                                                info->video_frame_count, info->audio_frame_count, hcamcorder->capture_in_recording);
 
                                        if (info->video_frame_count >= _MMCAMCORDER_MINIMUM_FRAME && info->audio_frame_count) {
@@ -1101,7 +1101,7 @@ int _mmcamcorder_video_command(MMHandleType handle, int command)
 
                                        return MM_ERROR_CAMCORDER_INVALID_CONDITION;
                                } else {
-                                       _mmcam_dbg_warn("Waiting for enough frames, retrial [%d], VIDEO[%llu], AUDIO [%llu], capturing %d",
+                                       _mmcam_dbg_warn("Waiting for enough frames, retrial [%d], VIDEO[%lu], AUDIO [%lu], capturing %d",
                                                count, info->video_frame_count, info->audio_frame_count, hcamcorder->capture_in_recording);
                                }
                        }
@@ -1248,7 +1248,7 @@ int _mmcamcorder_video_handle_eos(MMHandleType handle)
        /* Check file size */
        if (info->max_size > 0) {
                _mmcamcorder_get_file_size(info->filename, &file_size);
-               _mmcam_dbg_log("MAX size %lld byte - created filesize %lld byte",
+               _mmcam_dbg_log("MAX size %lu byte - created filesize %lu byte",
                                           info->max_size, file_size);
 
                if (file_size > info->max_size) {
@@ -1945,7 +1945,7 @@ static gboolean __mmcamcorder_add_metadata_mp4(MMHandleType handle)
 
                nread = fread(&buf, sizeof(char), sizeof(buf), f);
 
-               _mmcam_dbg_log("recorded file fread %d", nread);
+               _mmcam_dbg_log("recorded file fread %zu", nread);
 
                udta_size = _mmcamcorder_get_container_size(buf);