From 9095ee429a28c7f6c3033d0b0f353ca16d12130d Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 29 Nov 2010 10:46:38 -0300 Subject: [PATCH] v4l2camerasrc: Adds mode property Adds mode property to v4l2camerasrc --- gst/camerabin2/gstv4l2camerasrc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gst/camerabin2/gstv4l2camerasrc.c b/gst/camerabin2/gstv4l2camerasrc.c index 8d4995d..d475c8c 100644 --- a/gst/camerabin2/gstv4l2camerasrc.c +++ b/gst/camerabin2/gstv4l2camerasrc.c @@ -69,6 +69,10 @@ gst_v4l2_camera_src_set_property (GObject * object, GstV4l2CameraSrc *self = GST_V4L2_CAMERA_SRC (object); switch (prop_id) { + case ARG_MODE: + self->mode = g_value_get_enum (value); + gst_base_camera_src_set_mode (GST_BASE_CAMERA_SRC (self), self->mode); + break; case ARG_FILTER_CAPS: GST_OBJECT_LOCK (self); gst_caps_replace (&self->view_finder_caps, @@ -112,6 +116,9 @@ gst_v4l2_camera_src_get_property (GObject * object, GstV4l2CameraSrc *self = GST_V4L2_CAMERA_SRC (object); switch (prop_id) { + case ARG_MODE: + g_value_set_enum (value, self->mode); + break; case ARG_FILTER_CAPS: gst_value_set_caps (value, self->view_finder_caps); break; @@ -1022,6 +1029,12 @@ gst_v4l2_camera_src_class_init (GstV4l2CameraSrcClass * klass) gobject_class->get_property = gst_v4l2_camera_src_get_property; // g_object_class_install_property .... + g_object_class_install_property (gobject_class, ARG_MODE, + g_param_spec_enum ("mode", "Mode", + "The capture mode (still image capture, video recording or " + "viewfinder)", + GST_TYPE_CAMERABIN_MODE, MODE_PREVIEW, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); gstbasecamerasrc_class->construct_pipeline = gst_v4l2_camera_src_construct_pipeline; -- 2.7.4