summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/libmm-camcorder.spec2
-rw-r--r--src/include/mm_camcorder_gstcommon.h2
-rw-r--r--src/include/mm_camcorder_internal.h2
-rw-r--r--src/include/mm_camcorder_platform.h1
-rw-r--r--src/mm_camcorder_configure.c4
-rw-r--r--src/mm_camcorder_gstcommon.c30
-rw-r--r--src/mm_camcorder_internal.c2
-rw-r--r--src/mm_camcorder_stillshot.c11
8 files changed, 38 insertions, 16 deletions
diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec
index f7f5b52..52b45b6 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.141
+Version: 0.10.142
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
diff --git a/src/include/mm_camcorder_gstcommon.h b/src/include/mm_camcorder_gstcommon.h
index 42c46c1..01250aa 100644
--- a/src/include/mm_camcorder_gstcommon.h
+++ b/src/include/mm_camcorder_gstcommon.h
@@ -162,7 +162,7 @@ bool _mmcamcorder_recreate_decoder_for_encoded_preview(MMHandleType handle);
/* etc */
int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element *VideosinkElement);
-int _mmcamcorder_vframe_stablize(MMHandleType handle);
+int _mmcamcorder_video_frame_stabilize(MMHandleType handle, int cmd);
gboolean _mmcamcorder_get_device_info(MMHandleType handle);
int _mmcamcorder_get_eos_message(MMHandleType handle);
void _mmcamcorder_remove_element_handle(MMHandleType handle, void *element, int first_elem, int last_elem);
diff --git a/src/include/mm_camcorder_internal.h b/src/include/mm_camcorder_internal.h
index 550af99..7528afc 100644
--- a/src/include/mm_camcorder_internal.h
+++ b/src/include/mm_camcorder_internal.h
@@ -676,7 +676,7 @@ typedef struct {
bool isMaxtimePausing; /**< Because of time limit, pipeline is paused. */
int element_num; /**< count of element */
int encode_element_num; /**< count of encode element */
- int cam_stability_count; /**< camsensor stability count. the count of frame will drop */
+ int frame_stability_count; /**< camsensor stability count. the count of frame will drop */
GstClockTime pipeline_time; /**< current time of Gstreamer Pipeline */
GstClockTime pause_time; /**< amount of time while pipeline is in PAUSE state.*/
GstClockTime stillshot_time; /**< pipeline time of capturing moment*/
diff --git a/src/include/mm_camcorder_platform.h b/src/include/mm_camcorder_platform.h
index f375ca9..f1f2954 100644
--- a/src/include/mm_camcorder_platform.h
+++ b/src/include/mm_camcorder_platform.h
@@ -135,7 +135,6 @@ extern "C" {
#define MMF_CROP_CIF_BOTTOM 0
/* Camera etc */
-#define _MMCAMCORDER_CAMSTABLE_COUNT 0 /* stablize count of camsensor */
#define _MMCAMCORDER_MINIMUM_SPACE (512*1024) /* byte */
#define _MMCAMCORDER_MMS_MARGIN_SPACE (512) /* byte */
diff --git a/src/mm_camcorder_configure.c b/src/mm_camcorder_configure.c
index f140d6e..c84487d 100644
--- a/src/mm_camcorder_configure.c
+++ b/src/mm_camcorder_configure.c
@@ -779,11 +779,12 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure
{ "FPS9", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
{ "PictureFormat", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
{ "Overlay", CONFIGURE_VALUE_INT_RANGE, {NULL} },
- { "RecommendDisplayRotation", CONFIGURE_VALUE_INT, {.value_int = 3} },
+ { "RecommendDisplayRotation", CONFIGURE_VALUE_INT, {.value_int = 3} },
{ "RecommendPreviewFormatCapture", CONFIGURE_VALUE_INT, {.value_int = MM_PIXEL_FORMAT_YUYV} },
{ "RecommendPreviewFormatRecord", CONFIGURE_VALUE_INT, {.value_int = MM_PIXEL_FORMAT_NV12} },
{ "RecommendPreviewResolution", CONFIGURE_VALUE_INT_PAIR_ARRAY, {NULL} },
{ "FacingDirection", CONFIGURE_VALUE_INT, {.value_int = MM_CAMCORDER_CAMERA_FACING_DIRECTION_REAR} },
+ { "FrameStabilityCount", CONFIGURE_VALUE_INT, {.value_int = 0} },
};
/* [Strobe] matching table */
@@ -840,6 +841,7 @@ int _mmcamcorder_conf_init(MMHandleType handle, int type, camera_conf *configure
{ "SensorEncodedCapture", CONFIGURE_VALUE_INT, {.value_int = 1} },
{ "SupportHDR", CONFIGURE_VALUE_INT_ARRAY, {NULL} },
{ "SupportZSL", CONFIGURE_VALUE_INT, {.value_int = FALSE} },
+ { "FrameStabilityCount", CONFIGURE_VALUE_INT, {.value_int = 0} },
};
/* [Detect] matching table */
diff --git a/src/mm_camcorder_gstcommon.c b/src/mm_camcorder_gstcommon.c
index 1af154a..86d6bc8 100644
--- a/src/mm_camcorder_gstcommon.c
+++ b/src/mm_camcorder_gstcommon.c
@@ -1471,21 +1471,35 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
}
-int _mmcamcorder_vframe_stablize(MMHandleType handle)
+int _mmcamcorder_video_frame_stabilize(MMHandleType handle, int cmd)
{
+ int category = 0;
mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
_MMCamcorderSubContext *sc = NULL;
- _mmcam_dbg_log("%d", _MMCAMCORDER_CAMSTABLE_COUNT);
-
mmf_return_val_if_fail(hcamcorder, MM_ERROR_CAMCORDER_NOT_INITIALIZED);
sc = MMF_CAMCORDER_SUBCONTEXT(handle);
mmf_return_val_if_fail(sc, MM_ERROR_CAMCORDER_NOT_INITIALIZED);
- if (sc->cam_stability_count != _MMCAMCORDER_CAMSTABLE_COUNT)
- sc->cam_stability_count = _MMCAMCORDER_CAMSTABLE_COUNT;
+ switch (cmd) {
+ case _MMCamcorder_CMD_PREVIEW_START:
+ category = CONFIGURE_CATEGORY_CTRL_CAMERA;
+ break;
+ case _MMCamcorder_CMD_CAPTURE:
+ category = CONFIGURE_CATEGORY_CTRL_CAPTURE;
+ break;
+ default:
+ _mmcam_dbg_warn("unknown command : %d", cmd);
+ return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
+ }
+
+ _mmcamcorder_conf_get_value_int(handle, hcamcorder->conf_ctrl,
+ category, "FrameStabilityCount", &sc->frame_stability_count);
+
+ _mmcam_dbg_log("[cmd %d] frame stability count : %d",
+ cmd, sc->frame_stability_count);
return MM_ERROR_NONE;
}
@@ -1577,9 +1591,9 @@ static GstPadProbeReturn __mmcamcorder_video_dataprobe_preview(GstPad *pad, GstP
_mmcam_dbg_log("Drop video frame by drop_vframe");
return GST_PAD_PROBE_DROP;
}
- } else if (sc->cam_stability_count > 0) {
- sc->cam_stability_count--;
- _mmcam_dbg_log("Drop video frame by cam_stability_count");
+ } else if (sc->frame_stability_count > 0) {
+ sc->frame_stability_count--;
+ _mmcam_dbg_log("Drop video frame by frame_stability_count");
return GST_PAD_PROBE_DROP;
}
diff --git a/src/mm_camcorder_internal.c b/src/mm_camcorder_internal.c
index ce6442f..b78638d 100644
--- a/src/mm_camcorder_internal.c
+++ b/src/mm_camcorder_internal.c
@@ -2667,7 +2667,7 @@ _MMCamcorderSubContext *_mmcamcorder_alloc_subcontext(int type)
}
sc->fourcc = 0x80000000;
- sc->cam_stability_count = 0;
+ sc->frame_stability_count = 0;
sc->drop_vframe = 0;
sc->pass_first_vframe = 0;
sc->is_modified_rate = FALSE;
diff --git a/src/mm_camcorder_stillshot.c b/src/mm_camcorder_stillshot.c
index 1b718bf..c4f4a4a 100644
--- a/src/mm_camcorder_stillshot.c
+++ b/src/mm_camcorder_stillshot.c
@@ -530,6 +530,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 +655,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 +784,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 +805,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);