From 1feba48951f569c00e2e69cb1a27ba5e20cc9e1f Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Fri, 24 Mar 2017 16:39:13 +0900 Subject: [PATCH] Remove delay when force stop is called while continuous capturing - "capturing" flag is not updated although continuous shot break attribute is set as TRUE [Version] 0.10.133 [Profile] Common [Issue Type] Bug fix [Dependency module] N/A Change-Id: Id0a3341530b061943b13e94d05dfbfe87a4c87a6 Signed-off-by: Jeongmo Yang --- packaging/libmm-camcorder.spec | 2 +- src/mm_camcorder_attribute.c | 12 ++++++++++++ src/mm_camcorder_stillshot.c | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec index 0e97076..d804c54 100644 --- a/packaging/libmm-camcorder.spec +++ b/packaging/libmm-camcorder.spec @@ -1,6 +1,6 @@ Name: libmm-camcorder Summary: Camera and recorder library -Version: 0.10.132 +Version: 0.10.133 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_camcorder_attribute.c b/src/mm_camcorder_attribute.c index bc6799e..4e80004 100644 --- a/src/mm_camcorder_attribute.c +++ b/src/mm_camcorder_attribute.c @@ -2004,6 +2004,7 @@ bool _mmcamcorder_commit_capture_break_cont_shot(MMHandleType handle, int attr_i const char *videosrc_name = NULL; mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle); _MMCamcorderSubContext *sc = NULL; + _MMCamcorderImageInfo *info = NULL; GstCameraControl *control = NULL; type_element *VideosrcElement = NULL; @@ -2022,7 +2023,18 @@ bool _mmcamcorder_commit_capture_break_cont_shot(MMHandleType handle, int attr_i if (!sc) return TRUE; + info = sc->info_image; + if (!info) { + _mmcam_dbg_err("info image is NULL"); + return FALSE; + } + if (ivalue && current_state == MM_CAMCORDER_STATE_CAPTURING) { + if (info->capture_send_count > 0) { + info->capturing = FALSE; + _mmcam_dbg_warn("capturing -> FALSE and skip capture callback since now"); + } + if (!GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) { _mmcam_dbg_warn("Can't cast Video source into camera control."); return TRUE; diff --git a/src/mm_camcorder_stillshot.c b/src/mm_camcorder_stillshot.c index 0539c50..f6d1b7d 100644 --- a/src/mm_camcorder_stillshot.c +++ b/src/mm_camcorder_stillshot.c @@ -1209,6 +1209,10 @@ static void __mmcamcorder_image_capture_cb(GstElement *element, GstSample *sampl if (!info->capturing || stop_cont_shot) { _mmcam_dbg_warn("stop command[%d] or not capturing state[%d]. skip this...", stop_cont_shot, info->capturing); + /* set FALSE here for the case that info->capturing is still FALSE + (== capture_send_count is 0 at the time _mmcamcorder_commit_capture_break_cont_shot is called) */ + info->capturing = FALSE; + /*free GstBuffer*/ if (sample1) gst_sample_unref(sample1); -- 2.7.4