[Psi-Devel] [PATCH] V4L fixes

Matt Newell newellm at blur.com
Tue Jul 12 12:52:26 PDT 2011


Psimedia no longer compiles with recent kernels/libv4l2.  This patch makes the 
old V4L api a build time option and uses the correct #include for V4L2.

The psi-plus project has an alternative patch that removes V4L1 completely if 
that is desired.  One or the other should be merged upstream though so 
Psimedia will compile on recent distributions.

Matt

PS. I tried sending this to the delta mailing list but I was rejected.  I 
applied for a subscription so hopefully next time I can send it there, unless 
psi-devel is preferred.

Index: gstprovider/deviceenum/deviceenum_unix.cpp
===================================================================
--- gstprovider/deviceenum/deviceenum_unix.cpp  (revision 811)
+++ gstprovider/deviceenum/deviceenum_unix.cpp  (working copy)
@@ -35,8 +35,11 @@
 # include <sys/stat.h>
 # include <dirent.h>
 # include <sys/ioctl.h>
+#ifdef USE_OLD_V4L
 # include <linux/videodev.h>
 #endif
+# include <linux/videodev2.h>
+#endif
 
 namespace DeviceEnum {
 
@@ -478,7 +481,7 @@
 // v4l detection scheme adapted from PWLib (used by Ekiga/Gnomemeeting)
 static QList<Item> get_v4l_items()
 {
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) && defined(USE_OLD_V4L)
        QList<Item> out;
 
        QList<V4LName> list = get_v4l_names("/sys/class/video4linux", true);
Index: gstprovider/deviceenum/README
===================================================================
--- gstprovider/deviceenum/README       (revision 811)
+++ gstprovider/deviceenum/README       (working copy)
@@ -4,3 +4,6 @@
 GStreamer does actually support device detection on its own, but results are
 spotty.  If the day comes where detection through GStreamer works 100% then 
we
 can deprecate DeviceEnum.
+
+On Unix the old Video4Linux Version 1 api has been removed from recent 
kernels. If
+support for this is needed, then uncomment the USE_OLD_V4L define in 
deviceenum.pri.
Index: gstprovider/deviceenum/deviceenum.pri
===================================================================
--- gstprovider/deviceenum/deviceenum.pri       (revision 811)
+++ gstprovider/deviceenum/deviceenum.pri       (working copy)
@@ -5,6 +5,8 @@
 }
 unix:!mac: {
        SOURCES += $$PWD/deviceenum_unix.cpp
+# Uncomment this if the old V4L version 1 api is needed, removed in recent 
kernels
+#      DEFINES += USE_OLD_V4L
 }
 mac: {
        SOURCES += $$PWD/deviceenum_mac.cpp


More information about the Psi-Devel mailing list