Remove codes related to session backward compatibility
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_stillshot.c
index 414e6af..53adfb0 100644 (file)
@@ -26,7 +26,6 @@
 #include <sys/time.h>
 #include <sys/times.h>
 #include <gst/video/cameracontrol.h>
-#include <mm_sound.h>
 #include "mm_camcorder_internal.h"
 #include "mm_camcorder_stillshot.h"
 #include "mm_camcorder_exifinfo.h"
@@ -265,7 +264,7 @@ void _mmcamcorder_destroy_video_capture_pipeline(MMHandleType handle)
                /* set sink element pointer to attribute */
                mm_attrs_get_index((MMHandleType)attrs, MMCAM_DISPLAY_REUSE_ELEMENT, &attr_index);
                attr_item = &attrs->items[attr_index];
-               mmf_attribute_set_data(attr_item, (void *)sink_element, sizeof(sink_element));
+               mmf_attribute_set_data(attr_item, (void *)sink_element, sizeof(*sink_element));
                mmf_attribute_commit(attr_item);
 
                /* remove notify callback */
@@ -385,7 +384,7 @@ int _mmcamcorder_image_cmd_capture(MMHandleType handle)
                info->next_shot_time = 0;
                info->multi_shot_stop = FALSE;
 
-               /* sound init to pause other session */
+               /* sound init */
                _mmcamcorder_sound_init(handle);
        }
 
@@ -530,6 +529,9 @@ int _mmcamcorder_image_cmd_capture(MMHandleType handle)
 
                        info->resolution_change = TRUE;
 
+                       /* set frame stability count for capture */
+                       _mmcamcorder_video_frame_stabilize(handle, _MMCamcorder_CMD_CAPTURE);
+
                        /* make pipeline state as PLAYING */
                        ret = _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
                        if (ret != MM_ERROR_NONE) {
@@ -652,8 +654,6 @@ int _mmcamcorder_image_cmd_preview_start(MMHandleType handle)
        info->multi_shot_stop = TRUE;
        info->capturing = FALSE;
 
-       _mmcamcorder_vframe_stablize(handle);
-
        current_state = _mmcamcorder_get_state(handle);
        _mmcam_dbg_log("current state [%d]", current_state);
 
@@ -783,6 +783,9 @@ int _mmcamcorder_image_cmd_preview_start(MMHandleType handle)
                                        goto cmd_error;
                                }
 
+                               /* set frame stability count for preview */
+                               _mmcamcorder_video_frame_stabilize(handle, _MMCamcorder_CMD_PREVIEW_START);
+
                                ret = _mmcamcorder_gst_set_state(handle, pipeline, GST_STATE_PLAYING);
                                if (ret != MM_ERROR_NONE)
                                        goto cmd_error;
@@ -801,6 +804,9 @@ int _mmcamcorder_image_cmd_preview_start(MMHandleType handle)
                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", FALSE);
                MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", FALSE);
 
+               /* set frame stability count for preview */
+               _mmcamcorder_video_frame_stabilize(handle, _MMCamcorder_CMD_PREVIEW_START);
+
                traceBegin(TTRACE_TAG_CAMERA, "MMCAMCORDER:START:SET_PLAYING_TO_PIPELINE");
 
                ret = _mmcamcorder_gst_set_state(handle, pipeline, GST_STATE_PLAYING);
@@ -1202,7 +1208,9 @@ static void __mmcamcorder_image_capture_cb(GstElement *element, GstSample *sampl
 
        /* check capture state */
        if (info->type == _MMCamcorder_MULTI_SHOT && info->capture_send_count > 0)
-               mm_camcorder_get_attributes((MMHandleType)hcamcorder, NULL, "capture-break-cont-shot", &stop_cont_shot, NULL);
+               mm_camcorder_get_attributes((MMHandleType)hcamcorder, NULL,
+                       MMCAM_CAPTURE_BREAK_CONTINUOUS_SHOT, &stop_cont_shot,
+                       NULL);
 
        if (!info->capturing || stop_cont_shot) {
                _mmcam_dbg_warn("stop command[%d] or not capturing state[%d]. skip this...", stop_cont_shot, info->capturing);
@@ -1395,9 +1403,9 @@ static void __mmcamcorder_image_capture_cb(GstElement *element, GstSample *sampl
 
                /* encode thumbnail */
                if (encode_src.data) {
+                       size_t thumb_length = 0;
                        unsigned int thumb_width = 0;
                        unsigned int thumb_height = 0;
-                       unsigned int thumb_length = 0;
                        unsigned char *thumb_raw_data = NULL;
 
                        /* encode image */
@@ -1769,8 +1777,7 @@ static ExifData *__mmcamcorder_update_exif_make(MMHandleType handle, ExifData *e
                if (ret != MM_ERROR_NONE)
                        EXIF_SET_ERR(ret, EXIF_TAG_MAKE);
        } else {
-               ret = MM_ERROR_CAMCORDER_LOW_MEMORY;
-               EXIF_SET_ERR(ret, EXIF_TAG_MAKE);
+               _mmcam_dbg_err("strdup failed [%s]", MM_MAKER_NAME);
        }
 
 exit: