From: Edgard Lima Date: Wed, 26 Mar 2008 15:10:08 +0000 (+0000) Subject: Add device-fd property to make it possible to apps to call ioctl's. X-Git-Tag: RELEASE-0_10_8~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70ee2ee5e08c424f76462fdc3f00f7cc219dbe44;p=platform%2Fupstream%2Fgst-plugins-good.git Add device-fd property to make it possible to apps to call ioctl's. Original commit message from CVS: Add device-fd property to make it possible to apps to call ioctl's. --- diff --git a/ChangeLog b/ChangeLog index ee738bd..d4e2d38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-03-26 Edgard Lima + + * sys/v4l2/gstv4l2object.c: + * sys/v4l2/gstv4l2object.h: + Add device-fd property to make it possible to apps to call ioctl's. + 2008-03-25 Wim Taymans * gst/qtdemux/qtdemux.c: (next_entry_size): diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index c842e8b..9dfcd34 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -37,6 +37,7 @@ #define DEFAULT_PROP_DEVICE "/dev/video0" #define DEFAULT_PROP_DEVICE_NAME NULL +#define DEFAULT_PROP_DEVICE_FD -1 #define DEFAULT_PROP_FLAGS 0 #define DEFAULT_PROP_NORM NULL #define DEFAULT_PROP_CHANNEL NULL @@ -241,6 +242,10 @@ gst_v4l2_object_install_properties_helper (GObjectClass * gobject_class) g_object_class_install_property (gobject_class, PROP_DEVICE_NAME, g_param_spec_string ("device-name", "Device name", "Name of the device", DEFAULT_PROP_DEVICE_NAME, G_PARAM_READABLE)); + g_object_class_install_property (gobject_class, PROP_DEVICE_FD, + g_param_spec_int ("device-fd", "File descriptor", + "File descriptor of the device", -1, G_MAXINT, DEFAULT_PROP_DEVICE_FD, + G_PARAM_READABLE)); g_object_class_install_property (gobject_class, PROP_FLAGS, g_param_spec_flags ("flags", "Flags", "Device type flags", GST_TYPE_V4L2_DEVICE_FLAGS, DEFAULT_PROP_FLAGS, G_PARAM_READABLE)); @@ -377,6 +382,14 @@ gst_v4l2_object_get_property_helper (GstV4l2Object * v4l2object, g_value_set_string (value, (gchar *) new); break; } + case PROP_DEVICE_FD: + { + if (GST_V4L2_IS_OPEN (v4l2object)) + g_value_set_int (value, v4l2object->video_fd); + else + g_value_set_int (value, DEFAULT_PROP_DEVICE_FD); + break; + } case PROP_FLAGS: { guint flags = 0; diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h index d08d274..0c5cdbc 100644 --- a/sys/v4l2/gstv4l2object.h +++ b/sys/v4l2/gstv4l2object.h @@ -114,6 +114,7 @@ GType gst_v4l2_object_get_type (void); #define V4L2_STD_OBJECT_PROPS \ PROP_DEVICE, \ PROP_DEVICE_NAME, \ + PROP_DEVICE_FD, \ PROP_FLAGS /* create/destroy */