[gst-devel] Possible bug in v4l2src element - gst-plugins-good-0.10.10

Brijesh Singh brijesh.ksingh at gmail.com
Fri Jan 30 00:30:50 CET 2009


I was porting v4l2src element on TI Davinci platform and found a
possible bug in v4l2src element.  v4l2src creates a list of supported
norms by using VIDIOC_ENUMSTD ioctl and then it calls
gst_v4l2_get_norm() to get the current norms and finally compares "if
(norm == GST_V4L2_TUNER_NORM (item->data)->index)" to return the
select norm object/

This comparison will not always return correct standard probed via the
driver.  because its possible that driver returns the subset of a
known standard instead of the real-standard. e.g NTSC instead of

see v4l2 spec on why:

The spec has a example showing how the comparison is done.

A very small patch to fix this:

diff -uNr orig/gst-plugins-good-0.10.10/sys/v4l2/gstv4l2tuner.c
--- orig/gst-plugins-good-0.10.10/sys/v4l2/gstv4l2tuner.c   2007-07-18
06:42:33.000000000 -0500
+++ gst-plugins-good-0.10.10/sys/v4l2/gstv4l2tuner.c    2009-01-29
16:11:21.000000000 -0600
@@ -244,7 +244,7 @@
   gst_v4l2_get_norm (v4l2object, &norm);

   for (item = v4l2object->norms; item != NULL; item = item->next) {
-    if (norm == GST_V4L2_TUNER_NORM (item->data)->index)
+    if (norm & GST_V4L2_TUNER_NORM (item->data)->index)
       return (GstTunerNorm *) item->data;

Please correct me if i'm wrong.

Brijesh Singh

More information about the gstreamer-devel mailing list