aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2007-02-13 01:26:57 +0800
committerluigi <luigi@FreeBSD.org>2007-02-13 01:26:57 +0800
commit2042bf043c38a3f075e2dc72508681b4181cb9cf (patch)
treee810b57996184d8591eba0573e1606b3d1cd3aba /multimedia
parent4a6b5d7f994a478eb9094246be2370ca07647f94 (diff)
downloadfreebsd-ports-gnome-2042bf043c38a3f075e2dc72508681b4181cb9cf.tar.gz
freebsd-ports-gnome-2042bf043c38a3f075e2dc72508681b4181cb9cf.tar.zst
freebsd-ports-gnome-2042bf043c38a3f075e2dc72508681b4181cb9cf.zip
Add support for video4linux devices by:
- adding a build dependency on v4l_compat; - fixing the paths to locate videodev.h in configure.in, and disabling the (incorrect) check for V4L2; - correct the paths in grabber-video4linux.cpp, and also add support for the read() method in addition to mmap. On the mailing list there was a suggestion to remove the hardwired path in favour of a variable ( %%LOCALBASE%% or so) based one. But this configure.in is full of hardwired paths, so fixing one doesn't help at all, and the full fix would take more time and knowledge that i have.
Diffstat (limited to 'multimedia')
-rw-r--r--multimedia/vic/Makefile2
-rw-r--r--multimedia/vic/files/patch-Makefile.in25
-rw-r--r--multimedia/vic/files/patch-configure.in26
-rw-r--r--multimedia/vic/files/patch-video-grabber-video4linux.cpp60
4 files changed, 97 insertions, 16 deletions
diff --git a/multimedia/vic/Makefile b/multimedia/vic/Makefile
index 89d3cf2b20f6..92a1a4825342 100644
--- a/multimedia/vic/Makefile
+++ b/multimedia/vic/Makefile
@@ -14,6 +14,8 @@ DISTNAME= ${PORTNAME}-2.8ucl1.1.6
MAINTAINER= mi@aldan.algebra.com
COMMENT= MBONE video tool
+BUILD_DEPENDS+= v4l_compat>=1.0.20060801:${PORTSDIR}/multimedia/v4l_compat
+
LIB_DEPENDS= tk84:${PORTSDIR}/x11-toolkits/tk84 \
uclmmbase:${PORTSDIR}/devel/uclmmbase
diff --git a/multimedia/vic/files/patch-Makefile.in b/multimedia/vic/files/patch-Makefile.in
index 96d268d9b47b..a1dd00423658 100644
--- a/multimedia/vic/files/patch-Makefile.in
+++ b/multimedia/vic/files/patch-Makefile.in
@@ -1,13 +1,16 @@
---- Makefile.in Wed Apr 30 07:50:17 2003
-+++ Makefile.in Tue Mar 22 13:18:58 2005
-@@ -59,5 +59,5 @@
+--- Makefile.in.orig Wed Apr 30 13:50:17 2003
++++ Makefile.in Fri Feb 9 16:08:03 2007
+@@ -58,7 +58,7 @@
+ INCLUDE_TK = @V_INCLUDE_TK@
INCLUDE_TCL = @V_INCLUDE_TCL@
INCLUDE_X11 = @V_INCLUDE_X11@
-INCLUDE_MISC = @V_INCLUDE@ -I. -Icodec/tmndec -Icodec/tmn-x -Icodec/h263 -Irtp -Irender -Inet -Ivideo -Icodec -I../common/src
-+INCLUDE_MISC = @V_INCLUDE@ -I. -Icodec/tmndec -Icodec/tmn-x -Icodec/h263 -Irtp -Irender -Inet -Ivideo -Icodec -I${LOCALBASE}/include/uclmmbase
++INCLUDE_MISC = @V_INCLUDE@ -I. -Icodec/tmndec -Icodec/tmn-x -Icodec/h263 -Irtp -Irender -Inet -Ivideo -Icodec -I${LOCALBASE}/include/uclmmbase -I${LOCALBASE}/include
STATIC = @V_STATIC@
-@@ -90,10 +90,10 @@
+ MKDEP = ./mkdep
+@@ -89,12 +89,12 @@
+ OBJ_XIL = @V_OBJ_XIL@
OBJ_CRYPT = @V_OBJ_CRYPT@
LIB = $(LIB_GRABBER) @V_LIB_TK@ @V_LIB_TCL@ @V_LIB_X11@ @V_LIB@ \
- codec/tmndec/libh263.a codec/tmn-x/libh263coder.a ../common/src/libuclmmbase.a -lm
@@ -20,14 +23,18 @@
+CFLAGS += $(BFLAGS)
#
-@@ -123,5 +123,5 @@
+ # Remember to add a dependency if you add any tcl sources here.
+@@ -122,7 +122,7 @@
+ codec/h263/idctenc.o codec/h263/sac.o
# .c objects
-OBJ1 = net/inet.o net/inet6.o codec/cellb_tables.o tkStripchart.o md5c.o random.o \
+OBJ1 = net/inet.o net/inet6.o codec/cellb_tables.o tkStripchart.o \
$(H263_OBJS)
# session-rtpv1.o session-nv.o session-ivs.o # Not supported anymore
-@@ -330,13 +330,7 @@
+ # .cpp objects
+@@ -329,15 +329,9 @@
+ $(CC) -o $@ $(CFLAGS) render/ppmtolut/ppmtolut.c -lm $(STATIC)
install: force
- cp vic @prefix@/bin/vic
@@ -44,7 +51,9 @@
+ ${BSD_INSTALL_PROGRAM} histtolut @prefix@/bin/histtolut
clean:
-@@ -411,6 +405,6 @@
+ rm -f *.o codec/jpeg/*.o codec/p64/*.o codec/h263/*.o \
+@@ -410,7 +404,7 @@
+
codec/tmn-x/libh263coder.a:
- (cd codec/tmn-x; $(MAKE) CC=$(CC) CCOPT="$(CCOPT)" )
diff --git a/multimedia/vic/files/patch-configure.in b/multimedia/vic/files/patch-configure.in
index 4d687b5fd931..aac7387cf554 100644
--- a/multimedia/vic/files/patch-configure.in
+++ b/multimedia/vic/files/patch-configure.in
@@ -1,19 +1,29 @@
--- configure.in.orig Thu Jul 10 16:55:43 2003
-+++ configure.in Sat Jan 27 01:57:23 2007
-@@ -76,12 +76,6 @@
- V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-video4linux.o"
- fi
++++ configure.in Mon Feb 12 17:58:29 2007
+@@ -69,18 +69,11 @@
+ if test -r /usr/include/machine/ioctl_meteor.h ; then
+ V_OBJ_GRABBER="video/grabber-meteor.o $V_OBJ_GRABBER"
fi
+-if test -r /usr/include/linux/videodev.h ; then
+- if grep V4L2 /usr/include/linux/videodev.h >/dev/null 2>&1 ; then
+- V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
+- else
+- V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-video4linux.o"
+- fi
+-fi
-#if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; then
-if test -r /usr/local/lib/libspigot.a ; then
- V_OBJ_GRABBER="video/grabber-spigot.o $V_OBJ_GRABBER"
- V_LIB_GRABBER="$V_LIB_GRABBER -lspigot"
-- V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
--fi
++if test -r /usr/local/include/linux/videodev.h ; then
+ V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
++ V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-video4linux.o"
++ # no V4L2 support yet.
++ # V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
+ fi
if test "$qcamdir" != "" ; then
V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
- V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$qcamdir"
-@@ -254,6 +248,7 @@
+@@ -254,6 +247,7 @@
else
V_DEFINE="$V_DEFINE -DFreeBSD"
fi
diff --git a/multimedia/vic/files/patch-video-grabber-video4linux.cpp b/multimedia/vic/files/patch-video-grabber-video4linux.cpp
new file mode 100644
index 000000000000..8aa3f98be10e
--- /dev/null
+++ b/multimedia/vic/files/patch-video-grabber-video4linux.cpp
@@ -0,0 +1,60 @@
+diff -ubwr video/grabber-video4linux.cpp ../../test/vic-2.8ucl1.1.6/video/grabber-video4linux.cpp
+--- video/grabber-video4linux.cpp Fri Sep 12 19:36:19 2003
++++ ../../test/vic-2.8ucl1.1.6/video/grabber-video4linux.cpp Fri Feb 9 16:15:12 2007
+@@ -36,7 +36,7 @@
+
+
+ extern "C" {
+-#include <asm/types.h>
++//#include <asm/types.h>
+ #include <linux/videodev.h>
+ }
+
+@@ -312,9 +314,20 @@
+ }
+
+ if( !( have_422P || have_422 || have_420P)) {
+- debug_msg("No suituable palette found\n");
++ debug_msg("No suituable palette found, try normal\n");
++ /* this needs to cleaned up heavily */
++ have_420P = 1; /* assume no mmap and try 420 is default */
++ struct video_picture vp;
++ if(ioctl(fd_,VIDIOCGPICT,&vp) == -1) {
++ debug_msg("Failed to get current picture info");
+ exit(1);
+ }
++ vp.palette = VIDEO_PALETTE_YUV420P;
++ if(ioctl(fd_,VIDIOCSPICT,&vp) == -1) {
++ debug_msg("Failed to set current picture info");
++ exit(1);
++ }
++ }
+
+ /* Release device */
+ close(fd_);
+@@ -551,10 +564,15 @@
+ Grabber::stop();
+ }
+
++/*
++ * quick hack - support only a single device of this kind,
++ * with a static max-sized buffer for reads.
++ */
++static char buf1[1024*768*3/2];
++
+ int V4lGrabber::grab()
+ {
+ char *fr=NULL;
+-
+ debug_msg((sync_count % 2) ? "o" : "e");
+
+ if (have_mmap) {
+@@ -566,6 +584,8 @@
+ else
+ sync_count++;
+ } else {
++ read(fd_, buf1, (size_t)height_*width_*3/2);
++ fr = buf1;
+ /* FIXME: read() */
+ }
+