Name: libmm-camcorder
Summary: Camera and recorder library
-Version: 0.10.151
+Version: 0.10.152
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
/* 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);
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*/
#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 */
{ "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 */
{ "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 */
}
-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;
}
_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;
}
}
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;
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);