GNOME Bugzilla – Bug 628118
wrong format detection in gstv4l2object.c
Last modified: 2010-12-08 02:40:51 UTC
I have a v4l2 camera, which supports only the UYVY format. When using the v4l2src source element, the format detection loop in gst_v4l2_object_fill_format_list : /* format enumeration */ for (n = 0;; n++) { format = g_new0 (struct v4l2_fmtdesc, 1); format->index = n; format->type = v4l2object->type; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_ENUM_FMT, format) < 0) { if (errno == EINVAL) { g_free (format); break; /* end of enumeration */ } else { goto failed; } } ---- some logging --- v4l2object->formats = g_slist_insert_sorted (v4l2object->formats, format, (GCompareFunc) format_cmp_func); } On the "kernel side", ie using printk and strace, I see only one (successful) call to ENUM_FMT. On the library side, however, the code is looping five time. In GDB, i can see n being incremented to 5, but it seems the ioctl line is skipped after the first loop. If logging is enabled, I can also see the log output five time, and finally, when looking at the caps of the source pad, I can see the good format, plus the other four ones. What is more strange is that the loop exits without an invalid ENUM_FMT ioctl call, Since the code (as I understand it) and the program behaviour disagree, I am stuck here. This is with gstreamer 0.10.28, the plugin-good version is 0.10.21, and all this is from the ubuntu 10.04 gstreamer packages
If I manually compile version 0.10.21, using the source tarball, and configure / make, the libgstvideo4linux2.so generated behave correctly, so it looks like an ubuntu bug. However it now spits message like : (gst-plugin-scanner:8643): GLib-GObject-WARNING **: cannot register existing type `GstV4l2Src' (gst-plugin-scanner:8643): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (gst-plugin-scanner:8643): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (gst-plugin-scanner:8643): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (gst-plugin-scanner:8643): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (gst-plugin-scanner:8643): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (gst-plugin-scanner:8643): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (gst-plugin-scanner:8643): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed (gst-plugin-scanner:8643): GStreamer-CRITICAL **: gst_element_register: assertion `g_type_is_a (type, GST_TYPE_ELEMENT)' failed How can I get rid of them ?
This is probably caused by libv4l then. The Ubuntu packages use libv4l, which abstracts the v4l interface and probably has some magic for the format enumeration. I assume your own compiled version doesn't use libv4l? (You can get rid of the warnings if you don't have two versions of the v4l plugin installed)
> This is with gstreamer 0.10.28, the plugin-good version is 0.10.21, and all > this is from the ubuntu 10.04 gstreamer packages I'm not really sure what problem/bug you're trying to solve here exact, but whatever it is, you should probably try the lastest pre-release, or at least the last release first..
It seems to be an ubuntu specific problem, since compiling from source gives me a working enumeration
(In reply to comment #4) > It seems to be an ubuntu specific problem, since compiling from source > gives me a working enumeration Is your own compilation using libv4l too?
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!