#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"
info->next_shot_time = 0;
info->multi_shot_stop = FALSE;
- /* sound init to pause other session */
+ /* sound init */
_mmcamcorder_sound_init(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) {
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);
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;
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);
/* 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);
/* 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 */
_mmcam_dbg_log("Done Internal Encode - data %p, length %d", dest.data, dest.length);
}
+ if (pixtype_main < MM_PIXEL_FORMAT_ENCODED) {
+ _mmcam_dbg_log("raw capture, skip EXIF related functions");
+ goto _CAPTURE_CB_EXIF_DONE;
+ }
+
/* create EXIF info */
if (!provide_exif) { /* make new exif */
ret = mm_exif_create_exif_info(&(hcamcorder->exif_info));
mm_camcorder_get_attributes((MMHandleType)hcamcorder, NULL, MMCAM_TAG_ENABLE, &tag_enable, NULL);
/* Set extra data for JPEG if tag enabled and doesn't provide EXIF */
- if (dest.format == MM_PIXEL_FORMAT_ENCODED) {
- if (tag_enable) {
- mm_camcorder_get_attributes((MMHandleType)hcamcorder, NULL,
- MMCAM_IMAGE_ENCODER, &codectype,
- NULL);
- _mmcam_dbg_log("codectype %d", codectype);
+ if (tag_enable) {
+ mm_camcorder_get_attributes((MMHandleType)hcamcorder, NULL,
+ MMCAM_IMAGE_ENCODER, &codectype,
+ NULL);
+ _mmcam_dbg_log("codectype %d", codectype);
- switch (codectype) {
- case MM_IMAGE_CODEC_JPEG:
- case MM_IMAGE_CODEC_SRW:
- case MM_IMAGE_CODEC_JPEG_SRW:
- ret = __mmcamcorder_set_jpeg_data((MMHandleType)hcamcorder, &dest, &thumb, provide_exif);
- if (ret != MM_ERROR_NONE) {
- _mmcam_dbg_err("Error on setting extra data to jpeg");
- MMCAM_SEND_MESSAGE(hcamcorder, MM_MESSAGE_CAMCORDER_ERROR, ret);
- goto error;
- }
- break;
- default:
- _mmcam_dbg_err("The codectype is not supported. (%d)", codectype);
- MMCAM_SEND_MESSAGE(hcamcorder, MM_MESSAGE_CAMCORDER_ERROR, MM_ERROR_CAMCORDER_INTERNAL);
+ switch (codectype) {
+ case MM_IMAGE_CODEC_JPEG:
+ case MM_IMAGE_CODEC_SRW:
+ case MM_IMAGE_CODEC_JPEG_SRW:
+ ret = __mmcamcorder_set_jpeg_data((MMHandleType)hcamcorder, &dest, &thumb, provide_exif);
+ if (ret != MM_ERROR_NONE) {
+ _mmcam_dbg_err("Error on setting extra data to jpeg");
+ MMCAM_SEND_MESSAGE(hcamcorder, MM_MESSAGE_CAMCORDER_ERROR, ret);
goto error;
}
+ break;
+ default:
+ _mmcam_dbg_err("The codectype is not supported. (%d)", codectype);
+ MMCAM_SEND_MESSAGE(hcamcorder, MM_MESSAGE_CAMCORDER_ERROR, MM_ERROR_CAMCORDER_INTERNAL);
+ goto error;
}
}
+_CAPTURE_CB_EXIF_DONE:
+
/* Handle Capture Callback */
_MMCAMCORDER_LOCK_VCAPTURE_CALLBACK(hcamcorder);