Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 1e995a422e81265c83652ba73ff19f36 > files > 2

kvirc-4.0.4-1.fc15.src.rpm

--- src/kvilib/ext/avdevice/videodevice.cpp	2010-07-04 19:31:27.000000000 +0300
+++ src/kvilib/ext/avdevice/videodevice.cpp	2011-02-10 01:35:01.000000000 +0200
@@ -141,6 +141,8 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
+
 		VIDEODEV_DRIVER_V4L:
 			{
 				NumericVideoControl numCtrl;
@@ -165,6 +167,7 @@
 				m_numericCtrls.push_back( numCtrl );
 			}
 			break;
+#endif //COMPILE_V4L1_CODE
 #endif
 		VIDEODEV_DRIVER_NONE:
 		default:
@@ -510,6 +513,7 @@
 
 #endif
 
+#ifdef COMPILE_V4L1_CODE
 		CLEAR(V4L_capabilities);
 
 		if(m_driver==VIDEODEV_DRIVER_NONE)
@@ -573,6 +577,7 @@
 
 			}
 		}
+#endif //COMPILE_V4L1_CODE
 #endif
 		m_name=m_model; // Take care about changing the name to be different from the model itself...
 
@@ -702,6 +707,7 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 			m_videoread=true;
 			m_io_method=IO_METHOD_READ;
@@ -712,6 +718,7 @@
 				qDebug() << "    Streaming interface";
 			}
 			break;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -886,6 +893,7 @@
 				}
 				break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 			case VIDEODEV_DRIVER_V4L:
 				{
 					struct video_window V4L_videowindow;
@@ -912,6 +920,7 @@
 
 				}
 				break;
+#endif //COMPILE_V4L1_CODE
 #endif
 			case VIDEODEV_DRIVER_NONE:
 			default:
@@ -984,6 +993,7 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 			{
 			struct video_picture V4L_picture;
@@ -1011,6 +1021,7 @@
 
 			}
 			break;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -1061,6 +1072,7 @@
 				setupControls();
 				break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 			case VIDEODEV_DRIVER_V4L:
 				struct video_channel V4L_input;
 				V4L_input.channel=newinput;
@@ -1072,6 +1084,7 @@
 				}
 				setupControls();
 				break;
+#endif //COMPILE_V4L1_CODE
 #endif
 			case VIDEODEV_DRIVER_NONE:
 			default:
@@ -1839,6 +1852,7 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 			struct video_picture V4L_picture;
 			if(-1 == xioctl(VIDIOCGPICT, &V4L_picture))
@@ -1868,6 +1882,7 @@
 			}
 			qDebug() << "Reported current value is" << *value << ".";
 			return EXIT_SUCCESS;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -1985,6 +2000,7 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 			struct video_picture V4L_picture;
 			if(-1 == xioctl(VIDIOCGPICT, &V4L_picture))
@@ -2029,6 +2045,7 @@
 				return EXIT_FAILURE;
 			}
 			return EXIT_SUCCESS;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -2092,6 +2109,7 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 			switch(palette)
 			{
@@ -2109,6 +2127,7 @@
 				case VIDEO_PALETTE_YUV422P	: return PIXELFORMAT_YUV422P;	break;
 			}
 			break;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -2172,6 +2191,7 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 			switch(pixelformat)
 			{
@@ -2216,6 +2236,7 @@
 				case PIXELFORMAT_YYUV	: return 0;			break;
 			}
 			break;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -2378,6 +2399,7 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 			switch(pixelformat)
 			{
@@ -2394,6 +2416,7 @@
 				case VIDEO_PALETTE_YUV422P	: returnvalue = pixelFormatName(PIXELFORMAT_YUV422P);	break;
 			}
 			break;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -2430,6 +2453,7 @@
 			}
 //			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 // TODO: THis thing can be used to detec what pixel formats are supported in a API-independent way, but V4L2 has VIDIOC_ENUM_PIXFMT.
 // The correct thing to do is to isolate these calls and do a proper implementation for V4L and another for V4L2 when this thing will be migrated to a plugin architecture.
@@ -2473,6 +2497,7 @@
 			if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_WNVA))	{ qDebug() << pixelFormatName(PIXELFORMAT_WNVA); }
 			if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YYUV))	{ qDebug() << pixelFormatName(PIXELFORMAT_YYUV); }
 			break;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -2542,6 +2567,7 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 			switch(standard)
 			{
@@ -2596,6 +2622,7 @@
 				case STANDARD_ALL	: return VIDEO_MODE_AUTO;	break;
 			}
 			break;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -2723,6 +2750,7 @@
 			}
 			break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 		case VIDEODEV_DRIVER_V4L:
 			switch(standard)
 			{
@@ -2736,6 +2764,7 @@
 				case VIDEO_MODE_NTSC_JP	: returnvalue = signalStandardName(STANDARD_NTSC_M_JP);	break;	// Undocumented value found to be compatible with V4L bttv driver
 			}
 			break;
+#endif //COMPILE_V4L1_CODE
 #endif
 		case VIDEODEV_DRIVER_NONE:
 		default:
@@ -2801,8 +2830,10 @@
 
 				break;
 #endif
+#ifdef COMPILE_V4L1_CODE
 			case VIDEODEV_DRIVER_V4L:
 				break;
+#endif //COMPILE_V4L1_CODE
 #endif
 			case VIDEODEV_DRIVER_NONE:
 			default:
--- src/kvilib/ext/avdevice/videodevice.h	2010-07-04 19:31:27.000000000 +0300
+++ src/kvilib/ext/avdevice/videodevice.h	2011-02-10 01:15:48.000000000 +0200
@@ -56,6 +56,9 @@
 
 #include "kvi_settings.h"
 
+// V4L1 was removed in kernel 2.6.38
+#undef COMPILE_V4L1_CODE
+
 #ifndef COMPILE_DISABLE_AVDEVICE
 
 #include <asm/types.h>
@@ -74,7 +77,7 @@
 
 #include <linux/fs.h>
 #include <linux/kernel.h>
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
 #define VIDEO_MODE_PAL_Nc  3
 #define VIDEO_MODE_PAL_M   4
 #define VIDEO_MODE_PAL_N   5
@@ -105,8 +108,10 @@
 {
 	VIDEODEV_DRIVER_NONE
 #ifndef COMPILE_DISABLE_AVDEVICE
+#ifdef COMPILE_V4L1_CODE
         ,
 	VIDEODEV_DRIVER_V4L
+#endif //COMPILE_V4L1_CODE
 #ifdef V4L2_CAP_VIDEO_CAPTURE
         ,
 	VIDEODEV_DRIVER_V4L2
@@ -386,8 +391,10 @@
 	struct v4l2_format fmt;
 //	struct v4l2_input m_input;
 #endif
+#ifdef COMPILE_V4L1_CODE
 	struct video_capability V4L_capabilities;
 	struct video_buffer V4L_videobuffer;
+#endif
 #endif	
 	int currentwidth, minwidth, maxwidth, currentheight, minheight, maxheight;