int count; /**< Multi-shot capture count */
int capture_cur_count; /**< Multi-shot capture current count */
int capture_send_count; /**< Multi-shot capture send count */
- unsigned long long next_shot_time; /**< next still capture time */
+ GstClockTime next_shot_time; /**< next still capture time */
gboolean multi_shot_stop; /**< Multi-shot stop flag */
gboolean capturing; /**< whether MSL is on capturing */
gboolean resolution_change; /**< whether on resolution changing for capturing. After changing to capture resolution, it sets to FALSE again. */
/* Set capture count */
count = ++(info->capture_send_count);
+ info->next_shot_time = GST_BUFFER_PTS(gst_sample_get_buffer(sample1)) + (GST_MSECOND * info->interval);
send_captured_message = TRUE;
err_release_exif:
{
mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(u_data);
_MMCamcorderSubContext *sc = NULL;
+ _MMCamcorderImageInfo *info = NULL;
mmf_return_val_if_fail(hcamcorder, FALSE);
+ mmf_return_val_if_fail(buffer, FALSE);
sc = MMF_CAMCORDER_SUBCONTEXT(hcamcorder);
mmf_return_val_if_fail(sc && sc->element, FALSE);
MMCAM_LOG_INFO("");
+ info = sc->info_image;
+
+ if (info->capture_send_count > 0 && info->next_shot_time > GST_BUFFER_PTS(buffer)) {
+ MMCAM_LOG_INFO("next capture time[%"GST_TIME_FORMAT"], but buffer[%"GST_TIME_FORMAT"]",
+ GST_TIME_ARGS(info->next_shot_time), GST_TIME_ARGS(GST_BUFFER_PTS(buffer)));
+ return TRUE;
+ }
+
/* FIXME. How could you get a thumbnail? */
__mmcamcorder_image_capture_cb(fakesink, gst_sample_new(buffer, gst_pad_get_current_caps(pad), NULL, NULL), NULL, NULL, u_data);
- if (sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst) {
+ if ((info->capture_send_count == info->count || info->capturing == FALSE) &&
+ sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst) {
MMCAMCORDER_G_OBJECT_SET(sc->encode_element[_MMCAMCORDER_ENCSINK_SINK].gst, "signal-handoffs", FALSE);
MMCAMCORDER_G_OBJECT_SET(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "block", TRUE);
sc->info_video->push_encoding_buffer = PUSH_ENCODING_BUFFER_STOP;