FYI, sorry

Begin forwarded message:

Date: Sat, 10 Jan 2009 01:59:44 +0100
From: Tino Engel <[email protected]>
To: Max Brazhnikov <[email protected]>
Subject: Re: [kde-freebsd] ports/117960: Patches to enable webcam
support in net-im/kopete


On Fri, 9 Jan 2009 12:36:02 +0300
Max Brazhnikov <[email protected]> wrote:

> On Thu, 8 Jan 2009 23:37:57 +0100, Tino Engel wrote:
> > Of course... :)
> > Here you go.
> Hi Tino, 
> 
> I asked your patches. Looks you've sent me original patches from PR,
> but they fail to apply cleanly on the latest kopete.
> 
> Cheers,
> Max 

Hi Max,

I am very sorry. This is what happens...
I took so much care to make the patches correct, test everything twice
and so on.
And finally, as you say, I have sent you the old patches I had referred
to. (The same file names, u know... ;))

So here we go with the new ones... Sorry for the inconvenience so
much... *shame

Gr33z, Tino

P.S.: Did I say already? The Makefile.diff has to be applied
manually as far as I know.

P.P.S.: GOOD THING: Webcam still working stable, kopete stable, various
conversations... :)

P.P.P.S.: bad thing: i can only send picture to one peer t once, but
this may be due to my weak pc... second sending-picture rarely pops up,
but i cannot keep it.
--- Makefile	2009-01-06 20:50:35.000000000 +0100
+++ Makefile	2009-01-06 20:47:43.000000000 +0100
@@ -17,6 +17,7 @@
 MAINTAINER=	[email protected]
 COMMENT=	KDE multi-protocol instant messenger (IM)
 
+BUILD_DEPENDS= ${LOCALBASE}/include/linux/videodev.h:${PORTSDIR}/multimedia/v4l_compat
 RUN_DEPENDS=	${QT_PREFIX}/lib/plugins/crypto/libqca-tls.so:${PORTSDIR}/security/qca-tls
 
 CONFLICTS=	kdenetwork-[0-2]* kdenetwork-3.[0-4]* kdenetwork-3.5.[0-2]* kvirc-[0-9]*
--- kopete/libkopete/avdevice/videodevice.cpp	2009-01-06 19:45:41.000000000 +0100
+++ kopete/libkopete/avdevice/videodevice.cpp	2009-01-06 19:47:03.000000000 +0100
@@ -181,7 +181,7 @@
 		m_videostream=false;
 
 		m_driver=VIDEODEV_DRIVER_NONE;
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 
 //if(!getWorkaroundBrokenDriver())
@@ -512,7 +512,7 @@
 	m_io_method = IO_METHOD_NONE;
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			if(V4L2_capabilities.capabilities & V4L2_CAP_READWRITE)
@@ -558,7 +558,7 @@
 	}
 
 // Select video input, video standard and tune here.
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 	cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	if (-1 == xioctl (VIDIOC_CROPCAP, &cropcap))
@@ -676,7 +676,7 @@
 // Change resolution for the video device
 		switch(m_driver)
 		{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 			case VIDEODEV_DRIVER_V4L2:
 //				CLEAR (fmt);
@@ -778,7 +778,7 @@
 // Change the pixel format for the video device
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 //			CLEAR (fmt);
@@ -867,7 +867,7 @@
 	{
 		switch (m_driver)
 		{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 			case VIDEODEV_DRIVER_V4L2:
 				if (-1 == ioctl (descriptor, VIDIOC_S_INPUT, &newinput))
@@ -935,7 +935,7 @@
 			case IO_METHOD_READ: // Nothing to do
 				break;
 			case IO_METHOD_MMAP:
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 				{
 					unsigned int loop;
@@ -957,7 +957,7 @@
 #endif
 				break;
 			case IO_METHOD_USERPTR:
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 				{
 					unsigned int loop;
@@ -995,7 +995,7 @@
     /// @todo implement me
 	ssize_t bytesread;
 
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 	struct v4l2_buffer v4l2buffer;
 #endif
@@ -1029,7 +1029,7 @@
 				}
 				break;
 			case IO_METHOD_MMAP:
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 				CLEAR (v4l2buffer);
 				v4l2buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
@@ -1089,7 +1089,7 @@
 #endif
 				break;
 			case IO_METHOD_USERPTR:
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 				{
 					unsigned int i;
@@ -1475,7 +1475,7 @@
 
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			{
@@ -1545,7 +1545,7 @@
 
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			{
@@ -1615,7 +1615,7 @@
 
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			{
@@ -1685,7 +1685,7 @@
 
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			{
@@ -1755,7 +1755,7 @@
 
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			{
@@ -1876,7 +1876,7 @@
 {
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			switch(palette)
@@ -1939,7 +1939,6 @@
 				case VIDEO_PALETTE_RGB32	: return PIXELFORMAT_RGB32;	break;
 				case VIDEO_PALETTE_YUYV		: return PIXELFORMAT_YUYV;	break;
 				case VIDEO_PALETTE_UYVY		: return PIXELFORMAT_UYVY;	break;
-				case VIDEO_PALETTE_YUV420	:
 				case VIDEO_PALETTE_YUV420P	: return PIXELFORMAT_YUV420P;	break;
 				case VIDEO_PALETTE_YUV422P	: return PIXELFORMAT_YUV422P;	break;
 			}
@@ -1956,7 +1955,7 @@
 {
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			switch(pixelformat)
@@ -2031,7 +2030,7 @@
 				case PIXELFORMAT_GREY	: return VIDEO_PALETTE_GREY;	break;
 				case PIXELFORMAT_YUYV	: return VIDEO_PALETTE_YUYV;	break;
 				case PIXELFORMAT_UYVY	: return VIDEO_PALETTE_UYVY;	break;
-				case PIXELFORMAT_YUV420P: return VIDEO_PALETTE_YUV420;	break;
+				case PIXELFORMAT_YUV420P: return VIDEO_PALETTE_YUV420P;	break;
 				case PIXELFORMAT_YUV422P: return VIDEO_PALETTE_YUV422P;	break;
 
 // Compressed formats
@@ -2084,7 +2083,11 @@
 		case PIXELFORMAT_GREY	: return 8;	break;
 		case PIXELFORMAT_YUYV	: return 16;	break;
 		case PIXELFORMAT_UYVY	: return 16;	break;
+#if defined(__FreeBSD__)
+		case PIXELFORMAT_YUV420P: return 24;	break;
+#else
 		case PIXELFORMAT_YUV420P: return 16;	break;
+#endif
 		case PIXELFORMAT_YUV422P: return 16;	break;
 
 // Compressed formats
@@ -2162,7 +2165,7 @@
 	returnvalue = "None";
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			switch(pixelformat)
@@ -2224,7 +2227,6 @@
 				case VIDEO_PALETTE_RGB32	: returnvalue = pixelFormatName(PIXELFORMAT_RGB32);	break;
 				case VIDEO_PALETTE_YUYV		: returnvalue = pixelFormatName(PIXELFORMAT_YUYV);	break;
 				case VIDEO_PALETTE_UYVY		: returnvalue = pixelFormatName(PIXELFORMAT_UYVY);	break;
-				case VIDEO_PALETTE_YUV420	:
 				case VIDEO_PALETTE_YUV420P	: returnvalue = pixelFormatName(PIXELFORMAT_YUV420P);	break;
 				case VIDEO_PALETTE_YUV422P	: returnvalue = pixelFormatName(PIXELFORMAT_YUV422P);	break;
 			}
@@ -2242,7 +2244,7 @@
 			int err = 0;
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			fmtdesc.index = 0;
@@ -2319,7 +2321,7 @@
 {
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			switch(standard)
@@ -2461,7 +2463,7 @@
 	returnvalue = "None";
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			switch(standard)
@@ -2531,7 +2533,7 @@
 {
 	switch(m_driver)
 	{
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 		case VIDEODEV_DRIVER_V4L2:
 			break;
--- kopete/libkopete/avdevice/videodevice.h	2009-01-06 19:45:45.000000000 +0100
+++ kopete/libkopete/avdevice/videodevice.h	2009-01-06 19:47:07.000000000 +0100
@@ -33,9 +33,12 @@
 #include <unistd.h>
 #include <signal.h>
 
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 
+#if defined(__linux__)
 #include <asm/types.h>
+#endif
+
 #undef __STRICT_ANSI__
 #ifndef __u64 //required by videodev.h
 #define __u64 unsigned long long
@@ -50,8 +53,11 @@
 #define pgoff_t unsigned long
 #endif
 
+#if defined(__linux__)
 #include <linux/fs.h>
 #include <linux/kernel.h>
+#endif
+
 #include <linux/videodev.h>
 #define VIDEO_MODE_PAL_Nc  3
 #define VIDEO_MODE_PAL_M   4
@@ -80,8 +86,8 @@
 typedef enum
 {
 	VIDEODEV_DRIVER_NONE
-#if defined( __linux__) && defined(ENABLE_AV)
-        ,
+#if (defined( __linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
+		,
 	VIDEODEV_DRIVER_V4L
 #ifdef V4L2_CAP_VIDEO_CAPTURE
         ,
@@ -276,7 +282,7 @@
 	int descriptor;
 
 //protected:
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
 #ifdef V4L2_CAP_VIDEO_CAPTURE
 	struct v4l2_capability V4L2_capabilities;
 	struct v4l2_cropcap cropcap;
--- kopete/libkopete/avdevice/videodevicepool.cpp	2009-01-06 19:45:59.000000000 +0100
+++ kopete/libkopete/avdevice/videodevicepool.cpp	2009-01-06 19:47:13.000000000 +0100
@@ -608,7 +608,7 @@
     /// @todo implement me
 
 	kdDebug(14010) <<  k_funcinfo << "called" << endl;
-#if defined(__linux__) && defined(ENABLE_AV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)	
 	QDir videodevice_dir;
 	const QString videodevice_dir_path=QString::fromLocal8Bit("/dev/v4l/");
 	const QString videodevice_dir_filter=QString::fromLocal8Bit("video*");
_______________________________________________
kde-freebsd mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-freebsd
See also http://freebsd.kde.org/ for latest information

Reply via email to