sys/v4l/gstv4lelement.c: If "device-name" is requested and the device is not open, try to temporarily open it to obta...

Original commit message from CVS:
Patch by: Martin Szulecki
* sys/v4l/gstv4lelement.c: (gst_v4lelement_get_property):
If "device-name" is requested and the device is not
open, try to temporarily open it to obtain this
information (#342494).
This commit is contained in:
Martin Szulecki 2006-07-19 14:46:36 +00:00 committed by Tim-Philipp Müller
parent f8e63966ad
commit 5a274b64d1
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2006-07-19 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Martin Szulecki
* sys/v4l/gstv4lelement.c: (gst_v4lelement_get_property):
If "device-name" is requested and the device is not
open, try to temporarily open it to obtain this
information (#342494).
2006-07-19 Tim-Philipp Müller <tim at centricular dot net> 2006-07-19 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/tag/gstid3tag.c: * gst-libs/gst/tag/gstid3tag.c:

View file

@ -414,8 +414,12 @@ gst_v4lelement_get_property (GObject * object,
case PROP_DEVICE_NAME:{ case PROP_DEVICE_NAME:{
gchar *new = NULL; gchar *new = NULL;
if (GST_V4L_IS_OPEN (v4lelement)) if (GST_V4L_IS_OPEN (v4lelement)) {
new = v4lelement->vcap.name; new = v4lelement->vcap.name;
} else if (gst_v4l_open (v4lelement)) {
new = v4lelement->vcap.name;
gst_v4l_close (v4lelement);
}
g_value_set_string (value, new); g_value_set_string (value, new);
break; break;
} }