From durian@boogie.com  Sat Nov 10 16:02:54 2007
Return-Path: <durian@boogie.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8AB7D16A421
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 10 Nov 2007 16:02:54 +0000 (UTC)
	(envelope-from durian@boogie.com)
Received: from mailhost.boogie.com (mailhost.boogie.com [70.91.170.29])
	by mx1.freebsd.org (Postfix) with ESMTP id 1684313C480
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 10 Nov 2007 16:02:54 +0000 (UTC)
	(envelope-from durian@boogie.com)
Received: from boogie.com (carwash.boogie.com [192.168.1.11])
	by mailhost.boogie.com (8.13.8/8.13.8) with ESMTP id lAAFSC1x073450
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 10 Nov 2007 08:28:12 -0700 (MST)
	(envelope-from durian@fever.boogie.com)
Received: from carwash.boogie.com (localhost [127.0.0.1])
	by boogie.com (8.14.1/8.14.1) with ESMTP id lAAFSCnX060284
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 10 Nov 2007 08:28:12 -0700 (MST)
	(envelope-from durian@carwash.boogie.com)
Received: (from durian@localhost)
	by carwash.boogie.com (8.14.1/8.14.1/Submit) id lAAFSC93060283;
	Sat, 10 Nov 2007 08:28:12 -0700 (MST)
	(envelope-from durian)
Message-Id: <200711101528.lAAFSC93060283@carwash.boogie.com>
Date: Sat, 10 Nov 2007 08:28:12 -0700 (MST)
From: Mike Durian <durian@boogie.com>
Reply-To: Mike Durian <durian@boogie.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Patches to enable webcam support in kopete
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         117960
>Category:       ports
>Synopsis:       Patches to enable webcam support in net-im/kopete
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kde
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 10 16:10:00 UTC 2007
>Closed-Date:    Sat Jan 10 13:57:48 UTC 2009
>Last-Modified:  Sat Jan 10 14:00:14 UTC 2009
>Originator:     Mike Durian
>Release:        FreeBSD 6.3-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD carwash.boogie.com 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #7: Wed Oct 31 09:38:00 MDT 2007 root@carwash.boogie.com:/usr/obj/usr/src/sys/BOOGIE i386


	
>Description:
	A few basic patches that enable webcam support in the
	net-im/kopete port.  It adds a dependancy on multimedia/v4l_compat.
	Perhaps there should be a RUN_DEPEND on multimedia/pwcbsd too.
	I'm not sure.  Are there other Video4Linux compatbile webcam
	drivers in the port tree?  If not, then I'm thinking the
	RUN_DEPEND on multimedia/pwcbsd should be added.
>How-To-Repeat:
	I tested with a Logitech QuickCam Pro 4000.  Actually, I've
	only tested in the configuration window.  I haven't verified
	that the feed makes it across the network.

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile.diff
#	patch-kopete__libkopete__avdevice__videodevice.cpp
#	patch-kopete__libkopete__avdevice__videodevice.h
#	patch-kopete__libkopete__avdevice__videodevicepool.cpp
#
echo x - Makefile.diff
sed 's/^X//' >Makefile.diff << 'END-of-Makefile.diff'
X--- Makefile.orig	2007-11-10 08:08:53.000000000 -0700
X+++ Makefile	2007-11-10 08:13:04.000000000 -0700
X@@ -17,6 +17,7 @@
X MAINTAINER=	kde@FreeBSD.org
X COMMENT=	KDE multi-protocol instant messenger (IM)
X 
X+BUILD_DEPENDS=	${LOCALBASE}/include/linux/videodev.h:multimedia/v4l_compat
X RUN_DEPENDS=	${QT_PREFIX}/lib/plugins/crypto/libqca-tls.so:${PORTSDIR}/security/qca-tls
X 
X CONFLICTS=	kdenetwork-[0-2]* kdenetwork-3.[0-4]* kdenetwork-3.5.[0-2]* kvirc-[0-9]*
END-of-Makefile.diff
echo x - patch-kopete__libkopete__avdevice__videodevice.cpp
sed 's/^X//' >patch-kopete__libkopete__avdevice__videodevice.cpp << 'END-of-patch-kopete__libkopete__avdevice__videodevice.cpp'
X--- kopete/libkopete/avdevice/videodevice.cpp.orig	2007-11-09 17:22:19.000000000 -0700
X+++ kopete/libkopete/avdevice/videodevice.cpp	2007-11-10 08:07:05.000000000 -0700
X@@ -139,7 +139,7 @@
X 		m_videostream=false;
X 
X 		m_driver=VIDEODEV_DRIVER_NONE;
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 
X if(!getWorkaroundBrokenDriver())
X@@ -425,7 +425,7 @@
X 	m_io_method = IO_METHOD_NONE;
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			if(V4L2_capabilities.capabilities & V4L2_CAP_READWRITE)
X@@ -471,7 +471,7 @@
X 	}
X 
X // Select video input, video standard and tune here.
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 	cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
X 	if (-1 == xioctl (VIDIOC_CROPCAP, &cropcap))
X@@ -568,7 +568,7 @@
X // Change resolution for the video device
X 		switch(m_driver)
X 		{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 			case VIDEODEV_DRIVER_V4L2:
X //				CLEAR (fmt);
X@@ -670,7 +670,7 @@
X // Change the pixel format for the video device
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X //			CLEAR (fmt);
X@@ -756,7 +756,7 @@
X 	{
X 		switch (m_driver)
X 		{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 			case VIDEODEV_DRIVER_V4L2:
X 				if (-1 == ioctl (descriptor, VIDIOC_S_INPUT, &newinput))
X@@ -824,7 +824,7 @@
X 			case IO_METHOD_READ: // Nothing to do
X 				break;
X 			case IO_METHOD_MMAP:
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 				{
X 					unsigned int loop;
X@@ -846,7 +846,7 @@
X #endif
X 				break;
X 			case IO_METHOD_USERPTR:
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 				{
X 					unsigned int loop;
X@@ -884,7 +884,7 @@
X     /// @todo implement me
X 	ssize_t bytesread;
X 
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 	struct v4l2_buffer v4l2buffer;
X #endif
X@@ -918,7 +918,7 @@
X 				}
X 				break;
X 			case IO_METHOD_MMAP:
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 				CLEAR (v4l2buffer);
X 				v4l2buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
X@@ -978,7 +978,7 @@
X #endif
X 				break;
X 			case IO_METHOD_USERPTR:
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 				{
X 					unsigned int i;
X@@ -1304,7 +1304,7 @@
X 
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			break;
X@@ -1342,7 +1342,7 @@
X 
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			break;
X@@ -1380,7 +1380,7 @@
X 
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			break;
X@@ -1418,7 +1418,7 @@
X 
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			break;
X@@ -1456,7 +1456,7 @@
X 
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			break;
X@@ -1569,7 +1569,7 @@
X {
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			switch(palette)
X@@ -1604,7 +1604,7 @@
X 				case VIDEO_PALETTE_RGB32	: return PIXELFORMAT_RGB32;	break;
X 				case VIDEO_PALETTE_YUYV		: return PIXELFORMAT_YUYV;	break;
X 				case VIDEO_PALETTE_UYVY		: return PIXELFORMAT_UYVY;	break;
X-				case VIDEO_PALETTE_YUV420	: return PIXELFORMAT_YUV420P;	break;
X+				case VIDEO_PALETTE_YUV420P	: return PIXELFORMAT_YUV420P;	break;
X 				case VIDEO_PALETTE_YUV422P	: return PIXELFORMAT_YUV422P;	break;
X 			}
X 			break;
X@@ -1620,7 +1620,7 @@
X {
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			switch(pixelformat)
X@@ -1659,7 +1659,7 @@
X 				case PIXELFORMAT_BGR32	: return PIXELFORMAT_NONE;	break;
X 				case PIXELFORMAT_YUYV	: return VIDEO_PALETTE_YUYV;	break;
X 				case PIXELFORMAT_UYVY	: return VIDEO_PALETTE_UYVY;	break;
X-				case PIXELFORMAT_YUV420P: return VIDEO_PALETTE_YUV420;	break;
X+				case PIXELFORMAT_YUV420P: return VIDEO_PALETTE_YUV420P;	break;
X 				case PIXELFORMAT_YUV422P: return VIDEO_PALETTE_YUV422P;	break;
X 			}
X 			break;
X@@ -1688,7 +1688,11 @@
X 		case PIXELFORMAT_BGR32	: return 32;	break;
X 		case PIXELFORMAT_YUYV	: return 16;	break;
X 		case PIXELFORMAT_UYVY	: return 16;	break;
X+#if defined(__FreeBSD__)
X+		case PIXELFORMAT_YUV420P: return 24;	break;
X+#else
X 		case PIXELFORMAT_YUV420P: return 16;	break;
X+#endif
X 		case PIXELFORMAT_YUV422P: return 16;	break;
X 	}
X 	return 0;
X@@ -1725,7 +1729,7 @@
X 	returnvalue = "None";
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			switch(pixelformat)
X@@ -1758,7 +1762,7 @@
X 				case VIDEO_PALETTE_RGB32	: returnvalue = pixelFormatName(PIXELFORMAT_RGB32);	break;
X 				case VIDEO_PALETTE_YUYV		: returnvalue = pixelFormatName(PIXELFORMAT_YUYV);	break;
X 				case VIDEO_PALETTE_UYVY		: returnvalue = pixelFormatName(PIXELFORMAT_UYVY);	break;
X-				case VIDEO_PALETTE_YUV420	: returnvalue = pixelFormatName(PIXELFORMAT_YUV420P);	break;
X+				case VIDEO_PALETTE_YUV420P	: returnvalue = pixelFormatName(PIXELFORMAT_YUV420P);	break;
X 				case VIDEO_PALETTE_YUV422P	: returnvalue = pixelFormatName(PIXELFORMAT_YUV422P);	break;
X 			}
X 			break;
X@@ -1774,7 +1778,7 @@
X {
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			switch(standard)
X@@ -1916,7 +1920,7 @@
X 	returnvalue = "None";
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			switch(standard)
X@@ -1986,7 +1990,7 @@
X {
X 	switch(m_driver)
X 	{
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 		case VIDEODEV_DRIVER_V4L2:
X 			break;
END-of-patch-kopete__libkopete__avdevice__videodevice.cpp
echo x - patch-kopete__libkopete__avdevice__videodevice.h
sed 's/^X//' >patch-kopete__libkopete__avdevice__videodevice.h << 'END-of-patch-kopete__libkopete__avdevice__videodevice.h'
X--- kopete/libkopete/avdevice/videodevice.h.orig	2007-11-09 17:22:29.000000000 -0700
X+++ kopete/libkopete/avdevice/videodevice.h	2007-11-09 17:34:16.000000000 -0700
X@@ -33,9 +33,11 @@
X #include <unistd.h>
X #include <signal.h>
X 
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X 
X+#if defined(__linux__)
X #include <asm/types.h>
X+#endif
X #undef __STRICT_ANSI__
X #ifndef __u64 //required by videodev.h
X #define __u64 unsigned long long
X@@ -50,8 +52,10 @@
X #define pgoff_t unsigned long
X #endif
X 
X+#if defined(__linux__)
X #include <linux/fs.h>
X #include <linux/kernel.h>
X+#endif
X #include <linux/videodev.h>
X #define VIDEO_MODE_PAL_Nc  3
X #define VIDEO_MODE_PAL_M   4
X@@ -79,7 +83,7 @@
X typedef enum
X {
X 	VIDEODEV_DRIVER_NONE
X-#if defined( __linux__) && defined(ENABLE_AV)
X+#if (defined( __linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X         ,
X 	VIDEODEV_DRIVER_V4L
X #ifdef HAVE_V4L2
X@@ -255,7 +259,7 @@
X 	int descriptor;
X 
X //protected:
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X #ifdef HAVE_V4L2
X 	struct v4l2_capability V4L2_capabilities;
X 	struct v4l2_cropcap cropcap;
END-of-patch-kopete__libkopete__avdevice__videodevice.h
echo x - patch-kopete__libkopete__avdevice__videodevicepool.cpp
sed 's/^X//' >patch-kopete__libkopete__avdevice__videodevicepool.cpp << 'END-of-patch-kopete__libkopete__avdevice__videodevicepool.cpp'
X--- kopete/libkopete/avdevice/videodevicepool.cpp.orig	2007-11-09 21:12:49.000000000 -0700
X+++ kopete/libkopete/avdevice/videodevicepool.cpp	2007-11-09 21:13:54.000000000 -0700
X@@ -650,7 +650,7 @@
X     /// @todo implement me
X 
X 	kdDebug() <<  k_funcinfo << "called" << endl;
X-#if defined(__linux__) && defined(ENABLE_AV)
X+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
X 	QDir videodevice_dir;
X 	const QString videodevice_dir_path=QString::fromLocal8Bit("/dev/v4l/");
X 	const QString videodevice_dir_filter=QString::fromLocal8Bit("video*");
END-of-patch-kopete__libkopete__avdevice__videodevicepool.cpp
exit


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->kde 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Nov 10 22:35:03 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117960 

From: Tino Engel <goaengel@gmx.net>
To: bug-followup@FreeBSD.org, durian@boogie.com
Cc:  
Subject: Re: ports/117960: Patches to enable webcam support in net-im/kopete
Date: Tue, 6 Jan 2009 21:00:22 +0100

 --MP_/Zx+xcji9o.BJoUV.WUx8yiT
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Dear port maintainer,
 
 I have used the patches (they were outdated) provided in PR ports/117960
 to create port compliant patches for the current kopete port
 (kdenetwork-kopete-0.12.8).
 
 I have verified that the port compiles and installs clean with the 3
 additional patch files in the files-directory.
 
 kopete now recognizes a webcam with pwcbsd driver correctly.
 (pwcbsd-1.4.1_1)
 
 The webcam (in my case a Logitech Quickcam 4000 Pro) shows up in kopete
 configuration dialog.
 In addition I have veryfied the stream makes it through the internet,
 and you can have a bidirectional webcam chat with another msn client.
 
 Please note that I had to forward the needed ports on my router to make
 it work. Those were:
 TCP: 1863,6891-6900,6901
 UDP: 1863,5190,6901
 
 I have attached the three patches.
 
 In addition I have attached a patch for the change to the Makefile
 the original PR also suggested. It is adding the build dependencies
 BUILD_DEPENDS=${LOCALBASE}/include/linux/videodev.h:${PORTSDIR}/multimedia/v4l_compat
 
 KNOWN PROBLEM: The configuration section for the webcam does store all
 options permanently except the whiteness. This results in a quite dark
 picture when the value goes back to zero.
 This is a minor issue, because the setting can be changed once the
 webcam is on (during a conversation) and is stored as long as the
 webcam is on.
 
 Please contact me if there are any open questions concerning this topic.
 
 Sincerely yours, Tino Engel
 
 
 --MP_/Zx+xcji9o.BJoUV.WUx8yiT
 Content-Type: text/x-c++src;
  name=patch-kopete_libkopete_avdevice-videodevice.cpp
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename=patch-kopete_libkopete_avdevice-videodevice.cpp
 
 --- 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;
 
 --MP_/Zx+xcji9o.BJoUV.WUx8yiT
 Content-Type: text/x-chdr;
  name=patch-kopete_libkopete_avdevice-videodevice.h
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename=patch-kopete_libkopete_avdevice-videodevice.h
 
 --- 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;
 
 --MP_/Zx+xcji9o.BJoUV.WUx8yiT
 Content-Type: text/x-c++src;
  name=patch-kopete_libkopete_avdevice-videodevicepool.cpp
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename=patch-kopete_libkopete_avdevice-videodevicepool.cpp
 
 --- 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*");
 
 --MP_/Zx+xcji9o.BJoUV.WUx8yiT
 Content-Type: text/x-patch; name=Makefile.diff
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=Makefile.diff
 
 --- Makefile	2009-01-06 20:50:35.000000000 +0100
 +++ Makefile	2009-01-06 20:47:43.000000000 +0100
 @@ -17,6 +17,7 @@
  MAINTAINER=	kde@FreeBSD.org
  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]*
 
 --MP_/Zx+xcji9o.BJoUV.WUx8yiT--
State-Changed-From-To: open->closed 
State-Changed-By: makc 
State-Changed-When: Sat Jan 10 13:57:47 UTC 2009 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117960 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/117960: commit references a PR
Date: Sat, 10 Jan 2009 13:52:37 +0000 (UTC)

 makc        2009-01-10 13:52:22 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-im/kopete        Makefile 
   Added files:
     net-im/kopete/files  
                          extrapatch-kopete_libkopete_avdevice-videodevice.cpp 
                          extrapatch-kopete_libkopete_avdevice-videodevice.h 
                          extrapatch-kopete_libkopete_avdevice-videodevicepool.cpp 
   Log:
   Enable optional webcamera support
   
   PR:             ports/117960
   Submitted by:   Mike Durian <durian at boogie.com>, Tino Engel <goaengel at gmx.net>
   Approved by:    miwi (mentor)
   
   Revision  Changes    Path
   1.13      +11 -1     ports/net-im/kopete/Makefile
   1.1       +246 -0    ports/net-im/kopete/files/extrapatch-kopete_libkopete_avdevice-videodevice.cpp (new)
   1.1       +48 -0     ports/net-im/kopete/files/extrapatch-kopete_libkopete_avdevice-videodevice.h (new)
   1.1       +12 -0     ports/net-im/kopete/files/extrapatch-kopete_libkopete_avdevice-videodevicepool.cpp (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
