[Release version 0.2.40] Fix bug - capture_cb could be called after capture_completed... 12/75912/1 accepted/tizen/common/20160627.191458 accepted/tizen/common/20160629.222216 accepted/tizen/ivi/20160629.015911 accepted/tizen/mobile/20160629.015829 accepted/tizen/tv/20160629.015928 accepted/tizen/wearable/20160629.015957 submit/tizen/20160623.063229 submit/tizen/20160627.065544
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 22 Jun 2016 06:24:46 +0000 (15:24 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 22 Jun 2016 06:25:24 +0000 (15:25 +0900)
Change-Id: I63376071672d25a5856617de3d6b5f01142a390a
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
legacy/src/legacy_camera.c
packaging/mmsvc-camera.spec

index 42bb32b..63229dd 100644 (file)
@@ -273,6 +273,11 @@ static gboolean __mm_capture_callback(MMCamcorderCaptureDataType *frame, MMCamco
                        postview.format = scrnl->format;
                }
 
+               if (handle->is_capture_completed) {
+                       LOGW("capture completed, so skip this capture callback");
+                       return 1;
+               }
+
                ((camera_capturing_cb)handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE])(&image,
                                                                                   scrnl ? &postview : NULL,
                                                                                   thumbnail ? &thumb : NULL,
@@ -415,12 +420,12 @@ static int __mm_camera_message_callback(int message, void *param, void *user_dat
                break;
        case MM_MESSAGE_CAMCORDER_CAPTURED:
                handle->current_capture_complete_count = m->code;
-               if (handle->capture_count == 1 ||
-                   m->code == handle->capture_count ||
-                   (handle->is_continuous_shot_break &&
-                    handle->state == CAMERA_STATE_CAPTURING)) {
+               if (handle->state == CAMERA_STATE_CAPTURING &&
+                       (handle->capture_count == 1 ||
+                               m->code == handle->capture_count ||
+                               handle->is_continuous_shot_break)) {
                        /* pseudo state change */
-                       previous_state = handle->state ;
+                       previous_state = handle->state;
                        handle->state = CAMERA_STATE_CAPTURED;
                        if (previous_state != handle->state &&
                            handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE]) {
@@ -3266,10 +3271,8 @@ int legacy_camera_attr_foreach_supported_af_mode(camera_h camera, camera_attr_su
        int i = 0;
        camera_s *handle = (camera_s *)camera;
        MMCamAttrsInfo af_range;
-       MMCamAttrsInfo focus_mode;
 
        ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_AF_SCAN_RANGE, &af_range);
-       ret |= mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_FOCUS_MODE, &focus_mode);
        if (ret != MM_ERROR_NONE) {
                return __convert_camera_error_code(__func__, ret);
        }
index fc5aefe..2de8658 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:       mmsvc-camera
 Summary:    A Camera module for muse server
-Version:    0.2.39
+Version:    0.2.40
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0