diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-11-09 20:54:24 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-11-09 20:54:24 +0000 |
commit | ba7dfbdbb338b206857c807cf0cc6d8c405e5e4f (patch) | |
tree | 688dff70c08dcd49972c6821b3637a9d8e0a57a7 | |
parent | 3d601dbe9f89e0e003e8ec7d8b93f8a8c03e5016 (diff) | |
download | gst-plugins-bad-ba7dfbdbb338b206857c807cf0cc6d8c405e5e4f.tar.gz gst-plugins-bad-ba7dfbdbb338b206857c807cf0cc6d8c405e5e4f.tar.bz2 gst-plugins-bad-ba7dfbdbb338b206857c807cf0cc6d8c405e5e4f.zip |
Fix device probing from multiple childs. It's done once in the parent class only now, but the childs do get the corre...
Original commit message from CVS:
Fix device probing from multiple childs. It's done once in the parent class only now, but the childs do get the correct values. Also fixes an incorrect succesful state change if we opened a v4l device that doesn't have the capabilities that are needed by the plugin.
-rw-r--r-- | sys/v4l2/gstv4l2element.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/v4l2/gstv4l2element.c b/sys/v4l2/gstv4l2element.c index c9a8118c..53893fac 100644 --- a/sys/v4l2/gstv4l2element.c +++ b/sys/v4l2/gstv4l2element.c @@ -125,16 +125,17 @@ gst_v4l2_class_probe_devices (GstV4l2ElementClass *klass, gboolean check) { static gboolean init = FALSE; + static GList *devices = NULL; if (!init && !check) { gchar *dev_base[] = { "/dev/video", "/dev/v4l/video", NULL }; gint base, n, fd; - while (klass->devices) { - GList *item = klass->devices; + while (devices) { + GList *item = devices; gchar *device = item->data; - klass->devices = g_list_remove (klass->devices, item); + devices = g_list_remove (devices, item); g_free (device); } @@ -153,8 +154,8 @@ gst_v4l2_class_probe_devices (GstV4l2ElementClass *klass, if (fd > 0) close (fd); - klass->devices = - g_list_append (klass->devices, + devices = + g_list_append (devices, device); break; } @@ -166,6 +167,8 @@ gst_v4l2_class_probe_devices (GstV4l2ElementClass *klass, init = TRUE; } + klass->devices = devices; + return init; } |