Name: libmm-camcorder
Summary: Camera and recorder library
-Version: 0.10.283
+Version: 0.10.284
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
/* profiling */
void _mmcamcorder_measure_fps(void *data);
+/* property */
+void _mmcamcorder_set_property_array_int(GstElement *element, const char *property_name, int *array, unsigned int array_length);
+
#ifdef __cplusplus
}
{ "ExtraPreviewMode", CONFIGURE_VALUE_INT, {.value_int = MM_CAMCORDER_EXTRA_PREVIEW_MODE_CAMERA_CONTROL} },
{ "AltVideosrcElement", CONFIGURE_VALUE_ELEMENT, {NULL} }, /* The alternative of videosrc element, it will be used instead of "VideosrcElement" if exists. */
{ "AltUseZeroCopyFormat", CONFIGURE_VALUE_INT, {.value_int = -1} }, /* The alternative of "UseZeroCopyFormat", it will be used if it's not default(-1) value. */
- { "VideoFilterElement", CONFIGURE_VALUE_ELEMENT, {NULL} } /* The video filter element which is placed between videosrc and videosink elements. */
+ { "VideoFilterElement", CONFIGURE_VALUE_ELEMENT, {NULL} }, /* The video filter element which is placed between videosrc and videosink elements. */
+ { "VideoFilterCropX", CONFIGURE_VALUE_INT, {.value_int = 0} }, /* The VideoFilterElement is existed and these values are valid, they will be set to "crop" property. */
+ { "VideoFilterCropY", CONFIGURE_VALUE_INT, {.value_int = 0} },
+ { "VideoFilterCropW", CONFIGURE_VALUE_INT, {.value_int = 0} },
+ { "VideoFilterCropH", CONFIGURE_VALUE_INT, {.value_int = 0} }
};
/* [Strobe] matching table */
#define _MMCAMCORDER_NANOSEC_PER_1SEC 1000000000
#define _MMCAMCORDER_NANOSEC_PER_1MILISEC 1000
#define _MMCAMCORDER_SIGNAL_REQUEST_CODEC_CONFIG "request-codec-config"
+#define _MMCAMCORDER_CROP_ARRAY_LENGTH 4
/*-----------------------------------------------------------------------
hcamcorder->conf_ctrl, CONFIGURE_CATEGORY_CTRL_CAMERA, "VideoFilterElement",
&videofilt_element, &videofilt_name);
if (videofilt_element && videofilt_name) {
+ int videofilt_crop_rect[_MMCAMCORDER_CROP_ARRAY_LENGTH] = {0, };
+ const char *conf_name[_MMCAMCORDER_CROP_ARRAY_LENGTH] = {
+ "VideoFilterCropX",
+ "VideoFilterCropY",
+ "VideoFilterCropW",
+ "VideoFilterCropH"
+ };
+
_MMCAMCORDER_ELEMENT_MAKE(sc, sc->element, _MMCAMCORDER_VIDEOSRC_FILT, videofilt_name, "vsrc_f", element_list, err);
_mmcamcorder_conf_set_value_element_property(sc->element[_MMCAMCORDER_VIDEOSRC_FILT].gst, videofilt_element);
+
+ for (i = 0 ; i < _MMCAMCORDER_CROP_ARRAY_LENGTH ; i++) {
+ _mmcamcorder_conf_get_value_int((MMHandleType)hcamcorder, hcamcorder->conf_ctrl,
+ CONFIGURE_CATEGORY_CTRL_CAMERA,
+ conf_name[i], &videofilt_crop_rect[i]);
+ }
+
+ if (videofilt_crop_rect[0] >= 0 && videofilt_crop_rect[1] >= 0 &&
+ videofilt_crop_rect[2] > 0 && videofilt_crop_rect[3] > 0) {
+ _mmcamcorder_set_property_array_int(sc->element[_MMCAMCORDER_VIDEOSRC_FILT].gst,
+ "crop", videofilt_crop_rect, _MMCAMCORDER_CROP_ARRAY_LENGTH);
+ }
}
_MMCAMCORDER_ELEMENT_MAKE(sc, sc->element, _MMCAMCORDER_VIDEOSRC_QUE, "queue", "vsrc_q", element_list, err);
MMCAM_LOG_INFO("current fps[%d], average[%d]", kpi->current_fps, kpi->average_fps);
}
+
+void _mmcamcorder_set_property_array_int(GstElement *element, const char *property_name, int *array, unsigned int array_length)
+{
+ unsigned int i = 0;
+ GValue value = G_VALUE_INIT;
+ GValue tmp = G_VALUE_INIT;
+
+ mmf_return_if_fail(element);
+ mmf_return_if_fail(property_name);
+ mmf_return_if_fail(array);
+
+ g_value_init(&value, GST_TYPE_ARRAY);
+ g_value_init(&tmp, G_TYPE_INT);
+
+ MMCAM_LOG_INFO("set element[%s], property[%s], array_length[%d]",
+ GST_ELEMENT_NAME(element), property_name, array_length);
+
+ gst_value_array_init(&value, array_length);
+
+ for (i = 0 ; i < array_length ; i++) {
+ MMCAM_LOG_INFO("array[%u] %d", i, array[i]);
+ g_value_set_int(&tmp, array[i]);
+ gst_value_array_append_value(&value, &tmp);
+ }
+
+ g_object_set_property(G_OBJECT(element), property_name, &value);
+
+ g_value_unset(&tmp);
+ g_value_unset(&value);
+}