diff -urN vic-2.8/Makefile patched-vic-2.8/Makefile --- vic-2.8/Makefile Thu Jan 1 01:00:00 1970 +++ patched-vic-2.8/Makefile Sun Jul 26 18:27:41 1998 @@ -0,0 +1,376 @@ +# Generated automatically from Makefile.in by configure. +# +# Copyright (c) 1993-1994 The Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and the Network Research Group at +# Lawrence Berkeley Laboratory. +# 4. Neither the name of the University nor of the Laboratory may be used +# to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# @(#) $Header: Makefile.in,v 1.3 96/07/22 09:32:39 mccanne Exp $ (LBL) +# + +.SUFFIXES: .cc $(.SUFFIXES) + +ALL = vic histtolut +all: $(ALL) + +.cc.o: + rm -f $@; $(C++) -o $@ -c $(CFLAGS) $*.cc + +.c.o: + rm -f $@; $(CC) -o $@ -c $(CFLAGS) $*.c + +ED_YBITS = 4 + +CC = gcc +C++ = c++ +CCOPT = -O2 + +INCLUDE_TK = +INCLUDE_TCL = +INCLUDE_X11 = +INCLUDE_MISC = + +STATIC = +MKDEP = ./mkdep + + + +LIBRARY_TK = /usr/lib/tk8.0 +LIBRARY_TCL = /usr/lib/tcl8.0 +TK_LIBRARY_FILES = \ + $(LIBRARY_TCL)/init.tcl \ + $(LIBRARY_TK)/tk.tcl \ + $(LIBRARY_TK)/button.tcl \ + $(LIBRARY_TK)/dialog.tcl \ + $(LIBRARY_TK)/entry.tcl \ + $(LIBRARY_TK)/focus.tcl \ + $(LIBRARY_TK)/listbox.tcl \ + $(LIBRARY_TK)/menu.tcl \ + $(LIBRARY_TK)/palette.tcl \ + $(LIBRARY_TK)/scale.tcl \ + $(LIBRARY_TK)/tearoff.tcl \ + $(LIBRARY_TK)/text.tcl \ + $(LIBRARY_TK)/optMenu.tcl $(LIBRARY_TK)/scrlbar.tcl + +LIB_GRABBER = +INCLUDE_GRABBER = -I../xawtv-2.19 +OBJ_GRABBER = grabber-video4linux.o +SRC_GRABBER = $(OBJ_GRABBER:.o=.cc) +OBJ_XIL = +OBJ_CRYPT = +LIB = $(LIB_GRABBER) -L/usr/lib -ltk8.0 -L/usr/lib -ltcl8.0 -L/usr/X11R6/lib -lXext -lX11 -lnsl -ldl -lm +INCLUDE = $(INCLUDE_MISC) $(INCLUDE_GRABBER) $(INCLUDE_TK) $(INCLUDE_TCL) \ + $(INCLUDE_X11) $(MD_INC) -I./jpeg -I./p64 -I. +DEFINE = -DUSE_SHM -DED_YBITS=$(ED_YBITS) -DSIGRET=void +BFLAGS = $(DEFINE) $(INCLUDE) +CFLAGS = $(CCOPT) $(BFLAGS) + +# +# Remember to add a dependency if you add any tcl sources here. +# +TCL_VIC = ui-ctrlmenu.tcl ui-main.tcl ui-resource.tcl \ + ui-srclist.tcl ui-stats.tcl ui-util.tcl ui-windows.tcl \ + ui-switcher.tcl ui-extout.tcl ui-grabber.tcl ui-unix.tcl \ + cf-main.tcl cf-tm.tcl cf-confbus.tcl cf-network.tcl cf-util.tcl \ + tkerror.tcl entry.tcl +TCL_VIC_C = $(TCL_VIC:.tcl=.cc) + +# +# These modules are broken in libg++. Rather than fix libg++ +# every time I install it on a given system, just make them +# here (these sources came from tcl's compat directory) +# +BROKEN_OBJ = + +OBJ1 = inet.o cellb_tables.o tkStripchart.o md5c.o random.o +OBJ2 = main.o net.o net-ip.o source.o \ + iohandler.o timer.o idlecallback.o media-timer.o \ + session.o session-rtpv1.o session-nv.o session-ivs.o \ + decoder.o decoder-jpeg.o decoder-nv.o \ + decoder-h261.o decoder-h261v1.o \ + decoder-cellb.o \ + device.o grabber.o vw.o Tcl.o Tcl2.o module.o transmitter.o \ + encoder-nv.o encoder-cellb.o encoder-h261.o \ + transcoder-jpeg.o framer-jpeg.o \ + group-ipc.o confbus.o renderer.o renderer-window.o \ + color.o color-true.o color-pseudo.o color-dither.o color-ed.o \ + color-quant.o color-hi.o color-gray.o color-mono.o color-hist.o \ + rgb-converter.o jpeg/jpeg.o p64/p64.o dct.o \ + compositor.o rate-variable.o crypt.o crypt-dull.o \ + grabber-still.o +OBJ3 = cm0.o cm1.o huffcode.o version.o bv.o \ + $(TCL_VIC:.tcl=.o) tk.o +SRC = $(OBJ1:.o=.c) $(OBJ2:.o=.cc) $(BROKEN_OBJ:.o=.c) \ + $(RTIP_OBJ:.o=.c) $(SRC_GRABBER) $(OBJ_XIL:.o=.cc) $(OBJ_CRYPT:.o=.cc) +OBJ = $(OBJ1) $(OBJ2) $(OBJ3) $(BROKEN_OBJ) $(RTIP_OBJ) + +OBJ_VDD = vdd.o p64/p64.o p64/p64dump.o \ + module.o renderer.o renderer-window.o color.o \ + color-dither.o color-gray.o color-pseudo.o color-ed.o \ + color-quant.o color-true.o color-hi.o color-mono.o color-hist.o \ + Tcl.o Tcl2.o vw.o cm0.o cm1.o \ + dct.o huffcode.o bv.o iohandler.o timer.o \ + ui-vdd.o tk.o random.o + +OBJ_H261PLAY = h261_play.o p64/p64.o p64/p64dump.o \ + module.o renderer.o renderer-window.o color.o \ + color-dither.o color-gray.o color-pseudo.o color-ed.o \ + color-quant.o color-true.o color-hi.o color-mono.o color-hist.o \ + Tcl.o Tcl2.o vw.o cm0.o cm1.o \ + dct.o huffcode.o bv.o iohandler.o timer.o \ + ui-h261_play.o tk.o random.o + +OBJ_JPEGPLAY = jpeg_play.o jpeg/jpeg.o \ + renderer.o renderer-window.o color.o \ + color-dither.o color-gray.o color-pseudo.o color-ed.o \ + color-quant.o color-true.o color-hi.o color-mono.o \ + Tcl.o Tcl2.o vw.o cm0.o cm1.o \ + dct.o huffcode.o jpeg_play_tcl.o bv.o iohandler.o timer.o \ + ui-jpeg_play.o tk.o random.o + +LIB_CB = -L/usr/lib -ltk8.0 -L/usr/lib -ltcl8.0 -L/usr/X11R6/lib -lXext -lX11 -lnsl -ldl -lm +OBJ_CB = cbAppInit.o cb.o confbus.o group-ipc.o iohandler.o \ + net.o net-ip.o crypt.o crypt-dull.o $(OBJ_CRYPT) communicator.o \ + ppm.o Tcl.o Tcl2.o inet.o md5c.o + +OBJ_H261DUMP = h261_dump.o p64/p64.o p64/p64dump.o huffcode.o dct.o bv.o + +vic: $(OBJ) $(OBJ_GRABBER) $(JV_LIB) + rm -f $@ + $(C++) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(OBJ_GRABBER) $(LIB) $(STATIC) + +vic.des: $(OBJ) $(OBJ_GRABBER) $(JV_LIB) $(OBJ_CRYPT) + rm -f $@ + $(C++) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(OBJ_GRABBER) $(OBJ_CRYPT) $(LIB) $(STATIC) + +vic.dyn: $(OBJ) $(OBJ_GRABBER) $(JV_LIB) + rm -f $@ + $(C++) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(OBJ_GRABBER) $(LIB) + +vic.xil: $(OBJ) $(OBJ_XIL) + rm -f $@ + $(C++) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(OBJ_XIL) $(LIB) + +histtolut: histtolut.cc convex_hull.o + rm -f $@ + $(C++) -o $@ $(CFLAGS) histtolut.cc convex_hull.o + +vdd: $(OBJ_VDD) + rm -f $@ + $(C++) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJ_VDD) $(LIB) $(STATIC) + +cb_wish: $(OBJ_CB) + rm -f $@ + $(C++) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJ_CB) $(LIB_CB) $(STATIC) + +jpeg_play: $(OBJ_JPEGPLAY) + rm -f $@ + $(C++) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ_JPEGPLAY) $(LIB) $(STATIC) + +h261_play: $(OBJ_H261PLAY) + rm -f $@ + $(C++) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ_H261PLAY) $(LIB) $(STATIC) + +h261_dump: $(OBJ_H261DUMP) + rm -f $@ + $(CC) -o $@ $(CFLAGS) $(OBJ_H261DUMP) -lm $(STATIC) + +h261tortp: h261tortp.cc + rm -f $@ + $(C++) -o $@ $(CFLAGS) h261tortp.cc + +# +# Compile without optimzation to work around an OSF compiler bug. +# +Tcl2.o: Tcl.h + rm -f $@ + $(C++) -c $(BFLAGS) Tcl2.cc + +# +# pass-1 embedded tcl files +# +tk.o: $(TK_LIBRARY_FILES) tcl2c++ + base=tk; rm -f $@ $$base.cc ; \ + ./tcl2c++ 1 $(TK_LIBRARY_FILES) > $$base.cc ; \ + $(C++) -o $@ -c $(CFLAGS) $$base.cc ; rm -f $$base.cc + +# +# pass-2 embedded tcl files +# +TCL_VIC_OBJS=$(TCL_VIC:.tcl=.o) ui-vdd.o ui-h261_play.o +$(TCL_VIC_OBJS): tcl2c++ + base=$(@:.o=); rm -f $@ $$base.cc ; \ + ./tcl2c++ 2 $$base.tcl > $$base.cc ; \ + $(C++) -o $@ -c $(CFLAGS) $$base.cc ; rm -f $$base.cc + +ui-ctrlmenu.o: ui-ctrlmenu.tcl +ui-extout.o: ui-extout.tcl +ui-grabber.o: ui-grabber.tcl +ui-main.o: ui-main.tcl +ui-resource.o: ui-resource.tcl +ui-srclist.o: ui-srclist.tcl +ui-stats.o: ui-stats.tcl +ui-switcher.o: ui-switcher.tcl +ui-unix.o: ui-unix.tcl +ui-util.o: ui-util.tcl +ui-windows.o: ui-windows.tcl +cf-main.o: cf-main.tcl +cf-util.o: cf-util.tcl +cf-network.o: cf-network.tcl +cf-tm.o: cf-tm.tcl +cf-confbus.o: cf-confbus.tcl +tkerror.o: tkerror.tcl +entry.o: entry.tcl +ui-vdd.o: ui-vdd.tcl +ui-h261_play.o: ui-h261_play.tcl + +version.c: VERSION + rm -f version.c + cat VERSION | sed 's/.*/char version[] = "&";/' > version.c + +cm0.o: cm0.c +cm0.c: rgb-cube.ppm jv-cube-128.ppm ppmtolut + rm -f $@ + ./ppmtolut -n cube rgb-cube.ppm >> $@ + ./ppmtolut -n jv_cube jv-cube-128.ppm >> $@ + +cm1.o: cm1.c +cm1.c: yuv-map.ppm cm170.ppm + rm -f $@ + ./ppmtolut -n quant cm170.ppm >> $@ + ./ppmtolut -Y $(ED_YBITS) -n ed -e yuv-map.ppm >> $@ + +huffcode.c: mkhuff + rm -f $@ + ./mkhuff -e > huffcode.c + +mkhuff: p64/mkhuff.cc p64/p64-huff.h + rm -f $@ + $(C++) -o $@ $(CFLAGS) p64/mkhuff.cc $(STATIC) + +bv.c: mkbv + rm -f $@ + ./mkbv > $@ + +mkbv: mkbv.c + rm -f $@ + $(C++) -o $@ $(CFLAGS) mkbv.c $(STATIC) + +rgb-cube.ppm: mkcube + rm -f $@ + ./mkcube rgb > $@ + +yuv-map.ppm: mkcube + rm -f $@ + ./mkcube -Y $(ED_YBITS) -U 45 -V 45 yuv > $@ + +mkcube: mkcube.cc + rm -f $@ + $(C++) -o $@ $(CFLAGS) mkcube.cc $(STATIC) + +ppmtolut: ppmtolut.c + rm -f $@ + $(CC) -o $@ $(CFLAGS) ppmtolut.c -lm $(STATIC) + +install: force + cp vic /usr/local/bin/vic + chown bin /usr/local/bin/vic + chgrp bin /usr/local/bin/vic + chmod 555 /usr/local/bin/vic + cp vic.1 /usr/local/man/vic.1 + cp histtolut /usr/local/bin/histtolut + chown bin /usr/local/bin/histtolut + chgrp bin /usr/local/bin/histtolut + chmod 555 /usr/local/bin/histtolut + +clean: + rm -f *.o jpeg/*.o p64/*.o core tcl2c++ mkbv bv.c mkhuff huffcode.c \ + $(TCL_VIC_C) tk.tcl vic_tcl.c h261_play_tcl.c tmp.c \ + vic vic.dyn vic.xil h261_play h261_dump jpeg_play cb_wish \ + mkcube rgb-cube.ppm yuv-map.ppm cm0.c cm1.c ppmtolut \ + config.cache config.log domake.* dotar.* + +realclean: + $(MAKE) clean + rm -f config.log config.cache config.status + +tags: force + ctags -tdwC $(SRC) *.h $(TKSRC)/*.c $(TKSRC)/*.h \ + $(TCLSRC)/*.c $(TCLSRC)/*.h + +force: + +depend: + $(MKDEP) $(INCLUDE) $(DEFINE) $(SRC) + +tar: force + tar=vicbin-`cat VERSION`-linux.tar.gz ; \ + rm -f $$tar ; \ + tar cfh - README CHANGES.html vic.1 $(ALL) | \ + gzip -c > $$tar + +srctar: force + @cwd=`pwd` ; dir=`basename $$cwd` ; \ + name=vic-`cat VERSION | tr A-Z a-z` ; \ + tar=vicsrc-`cat VERSION`.tar.gz ; \ + list="" ; \ + for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \ + echo \ + "(rm -f $$tar; cd .. ; ln -s $$dir $$name)" ; \ + (rm -f $$tar; cd .. ; ln -s $$dir $$name) ; \ + echo \ + "(cd .. ; tar cfh $$tar [lots of files])" ; \ + (cd .. ; tar cfh - $$list) | gzip -c > $$tar ; \ + echo \ + "rm ../$$name; chmod 444 $$tar" ; \ + rm ../$$name; chmod 444 $$tar + +fulltar: force + @cwd=`pwd` ; dir=`basename $$cwd` ; \ + name=vic-`cat VERSION | tr A-Z a-z` ; \ + list="" ; \ + for i in `cat FILES FILES.EXTRA` ; \ + do list="$$list $$name/$$i" ; done; \ + echo \ + "(cd .. ; rm -f $$name; ln -s $$dir $$name)" ; \ + (cd .. ; rm -f $$name; ln -s $$dir $$name) ; \ + echo \ + "(cd .. ; tar cfh $$dir/$$name.tar [lots of files])" ; \ + (cd .. ; tar cfh $$dir/$$name.tar $$list) ; \ + echo \ + "rm -f $$name.tar.gz ../$$name" ; \ + rm -f $$name.tar.gz ../$$name ; \ + echo \ + "gzip $$name.tar" ; \ + gzip $$name.tar ; \ + echo \ + "chmod 444 $$name.tar.gz" ; \ + chmod 444 $$name.tar.gz + diff -urN vic-2.8/config.h patched-vic-2.8/config.h --- vic-2.8/config.h Thu May 16 14:27:06 1996 +++ patched-vic-2.8/config.h Sun Jul 26 18:10:18 1998 @@ -83,7 +83,7 @@ #include int strcasecmp(const char *, const char *); clock_t clock(void); -#if !defined(sco) && !defined(sgi) && !defined(__bsdi__) && !defined(__FreeBSD__) +#if !defined(sco) && !defined(sgi) && !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(linux) int gethostid(void); #endif time_t time(time_t *); diff -urN vic-2.8/configure patched-vic-2.8/configure --- vic-2.8/configure Mon Jun 24 02:59:45 1996 +++ patched-vic-2.8/configure Sun Jul 26 18:08:25 1998 @@ -1478,8 +1478,8 @@ echo "can't find tcl.h in $d/include" exit 1 fi - places="$d/lib/libtcl7.5.so \ - $d/lib/libtcl7.5.a \ + places="$d/lib/libtcl8.0.so \ + $d/lib/libtcl8.0.a \ $d/lib/libtcl.so \ $d/lib/libtcl.a" V_LIB_TCL=FAIL @@ -1493,7 +1493,7 @@ echo "can't find libtcl.a in $d/lib" exit 1 fi - places="$d/lib/tcl7.5 \ + places="$d/lib/tcl8.0 \ $d/lib/tcl" V_LIBRARY_TCL=FAIL for dir in $places; do @@ -1526,9 +1526,9 @@ rm -f conftest* if test "$V_INCLUDE_TCL" = FAIL; then echo "checking for tcl.h" - places="$PWD/../tcl7.5 \ - /usr/src/local/tcl7.5 \ - /import/tcl/include/tcl7.5 \ + places="$PWD/../tcl8.0 \ + /usr/src/local/tcl8.0 \ + /import/tcl/include/tcl8.0 \ $prefix/include \ $x_includes/tk \ $x_includes \ @@ -1546,13 +1546,13 @@ exit 1 fi fi - echo $ac_n "checking for -ltcl7.5""... $ac_c" 1>&6 -ac_lib_var=`echo tcl7.5'_'main | tr './+\055' '__p_'` + echo $ac_n "checking for -ltcl8.0""... $ac_c" 1>&6 +ac_lib_var=`echo tcl8.0'_'main | tr './+\055' '__p_'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-ltcl7.5 $LIBS" +LIBS="-ltcl8.0 $LIBS" cat > conftest.$ac_ext <&6 - V_LIB_TCL="-ltcl7.5" + V_LIB_TCL="-ltcl8.0" else echo "$ac_t""no" 1>&6 V_LIB_TCL="FAIL" @@ -1589,13 +1589,13 @@ /usr/contrib/lib \ /usr/local/lib \ /usr/lib \ - $PWD/../tcl7.5 \ - /usr/src/local/tcl7.5 \ - /import/tcl/lib/tcl7.5 \ + $PWD/../tcl8.0 \ + /usr/src/local/tcl8.0 \ + /import/tcl/lib/tcl8.0 \ " for dir in $places; do - if test -r $dir/libtcl7.5.so -o -r $dir/libtcl7.5.a; then - V_LIB_TCL="-L$dir -ltcl7.5" + if test -r $dir/libtcl8.0.so -o -r $dir/libtcl7.5.a; then + V_LIB_TCL="-L$dir -ltcl8.0" break fi if test -r $dir/libtcl.so -o -r $dir/libtcl.a; then @@ -1614,13 +1614,13 @@ fi echo "checking for tcl/init.tcl" V_LIBRARY_TCL=FAIL - places="/usr/local/lib/tcl7.5 \ - /usr/contrib/lib/tcl7.5 \ - /usr/lib/tcl7.5 \ - /usr/lib/tk/tcl7.5 \ - /import/tcl/lib/tcl7.5 \ - $prefix/lib/tcl7.5 \ - $x_libraries/tcl7.5 \ + places="/usr/local/lib/tcl8.0 \ + /usr/contrib/lib/tcl8.0 \ + /usr/lib/tcl8.0 \ + /usr/lib/tk/tcl8.0 \ + /import/tcl/lib/tcl8.0 \ + $prefix/lib/tcl8.0 \ + $x_libraries/tcl8.0 \ /usr/local/lib/tcl \ /usr/lib/tcl \ /usr/lib/tk/tcl \ @@ -1661,8 +1661,8 @@ echo "can't find tk.h in $d/include" exit 1 fi - places="$d/lib/libtk4.1.so \ - $d/lib/libtk4.1.a \ + places="$d/lib/libtk8.0.so \ + $d/lib/libtk8.0.a \ $d/lib/libtk.so \ $d/lib/libtk.a" V_LIB_TK=FAIL @@ -1676,7 +1676,7 @@ echo "can't find libtk.a in $d/lib" exit 1 fi - places="$d/lib/tk4.1 \ + places="$d/lib/tk8.0 \ $d/lib/tk" V_LIBRARY_TK=FAIL for dir in $places; do @@ -1718,9 +1718,9 @@ /usr/include\ $x_includes/tk \ $x_includes \ - $PWD/../tk4.1 \ - /usr/src/local/tk4.1 \ - /import/tcl/include/tk4.1 \ + $PWD/../tk8.0 \ + /usr/src/local/tk8.0 \ + /import/tcl/include/tk8.0 \ " for dir in $places; do if test -r $dir/tk.h ; then @@ -1733,13 +1733,13 @@ exit 1 fi fi - echo $ac_n "checking for -ltk4.1""... $ac_c" 1>&6 -ac_lib_var=`echo tk4.1'_'main | tr './+\055' '__p_'` + echo $ac_n "checking for -ltk8.0""... $ac_c" 1>&6 +ac_lib_var=`echo tk8.0'_'main | tr './+\055' '__p_'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-ltk4.1 $LIBS" +LIBS="-ltk8.0 $LIBS" cat > conftest.$ac_ext <&6 - V_LIB_TK="-ltk4.1" + V_LIB_TK="-ltk8.0" else echo "$ac_t""no" 1>&6 V_LIB_TK="FAIL" @@ -1775,13 +1775,13 @@ /usr/lib \ /usr/lib/tk \ /import/tcl/lib \ - $PWD/../tk4.1 \ - /usr/src/local/tk4.1 \ + $PWD/../tk8.0 \ + /usr/src/local/tk8.0 \ $prefix/lib \ $x_libraries" for dir in $places; do - if test -r $dir/libtk4.1.so -o -r $dir/libtk4.1.a; then - V_LIB_TK="-L$dir -ltk4.1" + if test -r $dir/libtk8.0.so -o -r $dir/libtk4.1.a; then + V_LIB_TK="-L$dir -ltk8.0" break fi if test -r $dir/libtk.so -o -r $dir/libtk.a; then @@ -1800,15 +1800,15 @@ fi echo "checking for tk/tk.tcl" V_LIBRARY_TK=FAIL - places="/usr/local/lib/tk4.1 \ - /usr/contrib/lib/tk4.1 \ - /usr/lib/tk4.1 \ - /usr/lib/tk/tk4.1 \ - /import/tcl/lib/tk4.1 \ - $prefix/lib/tk4.1 \ - $x_libraries/tk4.1 \ - $PWD/../tk4.1/library \ - /usr/src/local/tk4.1/library \ + places="/usr/local/lib/tk8.0 \ + /usr/contrib/lib/tk8.0 \ + /usr/lib/tk8.0 \ + /usr/lib/tk/tk8.0 \ + /import/tcl/lib/tk8.0 \ + $prefix/lib/tk8.0 \ + $x_libraries/tk8.0 \ + $PWD/../tk8.0/library \ + /usr/src/local/tk8.0/library \ /usr/local/lib/tk \ /usr/lib/tk \ /usr/lib/tk/tk \ @@ -2115,7 +2115,7 @@ V_DEFINE="$V_DEFINE $V_SHM" -# tcl7.5 needs a dynamic loading library (unless built with the +# tcl8.0 needs a dynamic loading library (unless built with the # -disable-load flag). Try to find the appropriate one. if test ! -z "$V_NEED_DL" ; then diff -urN vic-2.8/grabber-video4linux.cc patched-vic-2.8/grabber-video4linux.cc --- vic-2.8/grabber-video4linux.cc Thu Jan 1 01:00:00 1970 +++ patched-vic-2.8/grabber-video4linux.cc Sat Aug 22 18:21:30 1998 @@ -0,0 +1,498 @@ +/* ========================================================================= + + Copyright (c) 1997 Regents of Koji OKAMURA, oka@kobe-u.ac.jp + All rights reserved. + + largely rewritten for new bttv/video4linux interface + by Gerd Knorr + + ========================================================================= */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + + +extern "C" { +#include +#include "videodev.h" +} + +#include "grabber.h" +#include "Tcl.h" +#include "device-input.h" +#include "module.h" + +/* here you can tune the device names */ +static const char *devlist[] = { + "/dev/video0", "/dev/video1", "/dev/video2", "/dev/video3", + NULL +}; + +#define DEBUG(x) +//#define DEBUG(x) (x) + +#define NTSC_WIDTH 640 +#define NTSC_HEIGHT 480 +#define PAL_WIDTH 768 +#define PAL_HEIGHT 576 +#define CIF_WIDTH 352 +#define CIF_HEIGHT 288 + +/* pass 0/1 by reference */ +static const int one = 1, zero = 0; + +#define CF_422 0 +#define CF_411 1 +#define CF_CIF 2 + +class V4lGrabber : public Grabber { +public: + V4lGrabber(const char * cformat, const char *dev); + virtual ~V4lGrabber(); + + virtual int command(int argc, const char*const* argv); + virtual void start(); + virtual void stop(); + virtual int grab(); + +protected: + void format(); + void setsize(); + + void packed422_to_planar422(char *, char*); + void packed422_to_planar411(char *, char*); + + struct video_capability capability; + struct video_channel *channels; + struct video_picture pict; + struct video_window win; + + /* mmap */ + int have_mmap; + int grab_count; + int sync_count; + struct video_mmap gb_even; + struct video_mmap gb_odd; + struct video_mbuf gb_buffers; + char *mem; + + int fd_; + int format_; + int cformat_; + int port_; + + unsigned char *tm_; + int width_; + int height_; + int max_width_; + int max_height_; + int decimate_; +}; + +/* ----------------------------------------------------------------- */ + +class V4lDevice : public InputDevice { +public: + V4lDevice(const char *dev, const char*, char *attr); + virtual int command(int argc, const char*const* argv); + +private: + const char *dev_; +}; + + +V4lDevice::V4lDevice(const char *dev, const char *name, char *attr) : InputDevice(name) +{ + dev_ = dev; + attributes_ = attr; + fprintf(stderr,"V4l: ==> %s\n",attr); +} + +int V4lDevice::command(int argc, const char*const* argv) +{ + Tcl& tcl = Tcl::instance(); + if (argc == 3) { + if (strcmp(argv[1], "open") == 0) { + TclObject* o = 0; + o = new V4lGrabber(argv[2],dev_); + if (o != 0) + tcl.result(o->name()); + return (TCL_OK); + } + } + return (InputDevice::command(argc, argv)); +} + +/* ----------------------------------------------------------------- */ + +class V4lScanner { +public: + V4lScanner(const char **dev); +}; + +static V4lScanner find_video4linux_devices(devlist); + +V4lScanner::V4lScanner(const char **dev) +{ + static const char *palette_name[] = { + "", "grey", "hi240", "rgb16", "rgb24", "rgb32", "rgb15" }; + + struct video_capability capability; + struct video_channel channel; + struct video_picture pict; + int j,i,fd; + char *nick, *attr; + + for (i = 0; dev[i] != NULL; i++) { + fprintf(stderr,"V4l: trying %s... ",dev[i]); + if (-1 == (fd = open(dev[i],O_RDONLY))) { + perror("open"); + continue; + } + if (-1 == ioctl(fd,VIDIOCGCAP,&capability)) { + perror("ioctl VIDIOCGCAP"); + close(fd); + continue; + } + + if (!(capability.type & VID_TYPE_CAPTURE)) { + fprintf(stderr,"device can't capture\n"); + close(fd); + continue; + } + + fprintf(stderr,"ok, %s\nV4l: %s; size: %dx%d => %dx%d%s\n", + capability.name, + capability.type & VID_TYPE_MONOCHROME ? "mono" : "color", + capability.minwidth,capability.minheight, + capability.maxwidth,capability.maxheight, + capability.type & VID_TYPE_SCALES ? " (scales)" : ""); + + attr = new char[512]; + strcpy(attr,"format { 411 422 cif } "); + + if (capability.maxwidth > PAL_WIDTH/2 && + capability.maxheight > PAL_HEIGHT/2) { + strcat(attr,"size { small large cif } "); + } else { + strcat(attr,"size { small cif } "); + } + + fprintf(stderr,"V4l: ports:"); + strcat(attr,"port { "); + for (j = 0; j < capability.channels; j++) { + channel.channel = j; + if (-1 == ioctl(fd,VIDIOCGCHAN,&channel)) { + perror("ioctl VIDIOCGCHAN"); + } else { + fprintf(stderr," %s",channel.name); + strcat(attr,channel.name); + strcat(attr," "); + } + } + fprintf(stderr,"\n"); + strcat(attr,"} "); + + if (-1 == ioctl(fd,VIDIOCGPICT,&pict)) { + perror("ioctl VIDIOCGPICT"); + } + fprintf(stderr,"V4l: depth=%d, palette=%s\n", + pict.depth,palette_name[pict.palette]); + + nick = new char[strlen(capability.name)+6]; + sprintf(nick,"v4l: %s",capability.name); + new V4lDevice(dev[i],nick,attr); + + close(fd); + } +} + +/* ----------------------------------------------------------------- */ + +V4lGrabber::V4lGrabber(const char *cformat, const char *dev) +{ + int i,zero=0; + + DEBUG(fprintf(stderr,"V4l: constructor %s\n",cformat)); + + fd_ = open(dev, O_RDWR); + if (fd_ < 0) { + perror("open"); + exit(1); + } + + /* ask for capabilities */ + if (-1 == ioctl(fd_,VIDIOCGCAP,&capability)) { + perror("ioctl VIDIOCGCAP"); + exit(1); + } + channels = (struct video_channel*) + calloc(capability.channels,sizeof(struct video_channel)); + for (i = 0; i < capability.channels; i++) { + channels[i].channel = i; + if (-1 == ioctl(fd_,VIDIOCGCHAN,&channels[i])) { + perror("ioctl VIDIOCGCHAN"); + } + } + if (-1 == ioctl(fd_,VIDIOCGPICT,&pict)) { + perror("ioctl VIDIOCGPICT"); + } + + /* map grab buffer */ + gb_buffers.size = 2*0x151000; + gb_buffers.offsets[0] = 0; + gb_buffers.offsets[1] = 0x151000; + if (-1 == ioctl(fd_,VIDIOCGMBUF,&gb_buffers)) { + perror("ioctl VIDIOCGMBUF"); + } + mem = mmap(0,gb_buffers.size,PROT_READ|PROT_WRITE,MAP_SHARED,fd_,0); + if ((char*)-1 == mem) { + perror("mmap"); + fprintf(stderr,"V4l: device has no mmap support\n"); + } else { + fprintf(stderr,"v4l: mmap()'ed buffer size = 0x%x\n", + gb_buffers.size); + have_mmap = 1; + } + + /* fill in defaults */ + if(!strcmp(cformat, "411")) + cformat_ = CF_411; + if(!strcmp(cformat, "422")) + cformat_ = CF_422; + if(!strcmp(cformat, "cif")) + cformat_ = CF_CIF; + + port_ = 0; + decimate_ = 2; +} + +V4lGrabber::~V4lGrabber() +{ + DEBUG(fprintf(stderr,"V4l: destructor\n")); + + if (have_mmap) + munmap(mem,gb_buffers.size); + close(fd_); +} + +int V4lGrabber::command(int argc, const char*const* argv) +{ + int i; + + if (argc == 3) { + if (strcmp(argv[1], "decimate") == 0) { + decimate_ = atoi(argv[2]); + if (running_) + format(); + } + + if (strcmp(argv[1], "port") == 0) { + for (i = 0; i < capability.channels; i++) + if(!strcmp(argv[2], channels[i].name)) + port_ = i; + if (running_) + format(); + return (TCL_OK); + } + + if (strcmp(argv[1], "fps") == 0) { + DEBUG(fprintf(stderr,"V4l: fps %s\n",argv[2])); + } + } + + return (Grabber::command(argc, argv)); +} + +void V4lGrabber::start() +{ + DEBUG(fprintf(stderr,"V4l: start\n")); + + format(); + + if (have_mmap) { + grab_count = 0; + sync_count = 0; + + if (-1 == ioctl(fd_, VIDIOCMCAPTURE, &gb_even)) + perror("ioctl VIDIOCMCAPTURE even"); + else + grab_count++; + + if (-1 == ioctl(fd_, VIDIOCMCAPTURE, &gb_odd)) + perror("ioctl VIDIOCMCAPTURE odd"); + else + grab_count++; + } + + Grabber::start(); +} + +void V4lGrabber::stop() +{ + DEBUG(fprintf(stderr,"V4l: stop\n")); + + if (have_mmap) { + while (grab_count > sync_count) { + if (-1 == ioctl(fd_, VIDIOCSYNC, (sync_count%2) ? &one:&zero)) { + perror("ioctl VIDIOCSYNC"); + break; + } else + sync_count++; + } + } + + Grabber::stop(); +} + +int V4lGrabber::grab() +{ + char *fr; + + DEBUG(fprintf(stderr,(sync_count % 2) ? "o" : "e")); + + if (have_mmap) { + fr = mem + (gb_buffers.offsets[ (sync_count % 2) ? 1: 0]); + if (-1 == ioctl(fd_, VIDIOCSYNC, (sync_count%2) ? &one:&zero)) + perror("ioctl VIDIOCSYNC"); + else + sync_count++; + } else { + /* FIXME: read() */ + } + + switch (cformat_) { + case CF_411: + case CF_CIF: + packed422_to_planar411((char*)frame_,fr); + break; + case CF_422: + packed422_to_planar422((char*)frame_,fr); + break; + } + + if (have_mmap) { + if (-1 == ioctl(fd_, VIDIOCMCAPTURE, + (grab_count % 2) ? &gb_odd : &gb_even)) + perror("ioctl VIDIOMCAPTURE"); + else + grab_count++; + } + + suppress(frame_); + saveblks(frame_); + YuvFrame f(media_ts(), frame_, crvec_, outw_, outh_); + return (target_->consume(&f)); +} + +void V4lGrabber::packed422_to_planar422(char *dest, char *src) +{ + int i; + char *s, *y,*u,*v; + + i = (width_ * height_)/2; + s = src; + y = dest; + u = y + width_ * height_; + v = u + width_ * height_ / 2; + + while (--i) { + *(y++) = *(src++); + *(u++) = *(src++); + *(y++) = *(src++); + *(v++) = *(src++); + } +} + +void V4lGrabber::packed422_to_planar411(char *dest, char *src) +{ + int a,b; + char *s, *y,*u,*v; + + s = src; + y = dest; + u = y + width_ * height_; + v = u + width_ * height_ / 4; + + for (a = height_; a > 0; a -= 2) { + for (b = width_; b > 0; b -= 2) { + + *(y++) = *(src++); + *(u++) = *(src++); + *(y++) = *(src++); + *(v++) = *(src++); + } + for (b = width_; b > 0; b -= 2) { + *(y++) = *(src++); + *(src++); + *(y++) = *(src++); + *(src++); + } + } +} + +void V4lGrabber::format() +{ + DEBUG(fprintf(stderr,"V4l: format")); + + width_ = CIF_WIDTH *2 / decimate_; + height_ = CIF_HEIGHT *2 / decimate_; + + if (have_mmap) { + gb_even.frame = 0; + gb_even.format = VIDEO_PALETTE_YUV422; + gb_even.width = width_; + gb_even.height = height_; + gb_odd.frame = 1; + gb_odd.format = VIDEO_PALETTE_YUV422; + gb_odd.width = width_; + gb_odd.height = height_; + } else { + memset(&win,0,sizeof(win)); + win.width = width_; + win.height = height_; + if (-1 == ioctl(fd_,VIDIOCSWIN,&win)) + perror("ioctl VIDIOCSWIN"); + if (-1 == ioctl(fd_,VIDIOCGWIN,&win)) + perror("ioctl VIDIOCGWIN"); + width_ = win.width; + height_ = win.height; + } + + switch (cformat_) { + case CF_CIF: + set_size_411(width_, height_); + DEBUG(fprintf(stderr," cif")); + break; + case CF_411: + set_size_411(width_, height_); + DEBUG(fprintf(stderr," 411")); + break; + case CF_422: + set_size_422(width_, height_); + DEBUG(fprintf(stderr," 422")); + break; + } + + DEBUG(fprintf(stderr," size=%dx%d",width_,height_)); + + if (-1 == ioctl(fd_, VIDIOCSCHAN, &port_)) + perror("ioctl VIDIOCSCHAN"); + DEBUG(fprintf(stderr," port=%d\n",port_)); + + allocref(); +} Binary files vic-2.8/histtolut and patched-vic-2.8/histtolut differ diff -urN vic-2.8/inet.h patched-vic-2.8/inet.h --- vic-2.8/inet.h Tue Feb 6 01:02:04 1996 +++ patched-vic-2.8/inet.h Sun Jul 26 18:10:40 1998 @@ -94,7 +94,7 @@ #define INADDR_LOOPBACK (u_int32_t)0x7F000001 #endif -#if defined(__linux__) || defined(WIN32) +#if defined(WIN32) struct msghdr { caddr_t msg_name; /* optional address */ u_int msg_namelen; /* size of address */ diff -urN vic-2.8/main.cc patched-vic-2.8/main.cc --- vic-2.8/main.cc Mon Jul 22 22:12:22 1996 +++ patched-vic-2.8/main.cc Sun Jul 26 18:34:09 1998 @@ -172,14 +172,7 @@ HaveFontCommand() : TclObject("havefont") {} int command(int argc, const char*const* argv) { Tcl& t = Tcl::instance(); - if (argc != 2) - t.result("0"); - else { - Tk_Window tk = t.tkmain(); - Tk_Uid uid = Tk_GetUid((char*)argv[1]); - XFontStruct* p = Tk_GetFontStruct(t.interp(), tk, uid); - t.result(p != 0 ? "1" : "0"); - } + t.result("1"); return (TCL_OK); } } cmd_havefont; diff -urN vic-2.8/tkStripchart.c patched-vic-2.8/tkStripchart.c --- vic-2.8/tkStripchart.c Sat Mar 16 22:14:00 1996 +++ patched-vic-2.8/tkStripchart.c Sun Jul 26 18:41:23 1998 @@ -33,10 +33,6 @@ #include "config.h" #include "tk.h" -#if TK_MINOR_VERSION<1 -#define Tk_Cursor Cursor -#endif - #define BLACK "Black" #define WHITE "White" #define GRAY "#b0b0b0" @@ -570,9 +566,6 @@ if (StripchartPtr->value != NULL) free(StripchartPtr->value); - if (StripchartPtr->fontPtr != NULL) - Tk_FreeFontStruct(StripchartPtr->fontPtr); - if (StripchartPtr->textColorPtr != NULL) Tk_FreeColor(StripchartPtr->textColorPtr); @@ -633,7 +626,7 @@ gcValues.font = StripchartPtr->fontPtr->fid; gcValues.foreground = StripchartPtr->textColorPtr->pixel; - newGC = Tk_GetGC(StripchartPtr->tkwin, GCForeground|GCFont, &gcValues); + newGC = Tk_GetGC(StripchartPtr->tkwin, GCForeground/*|GCFont*/, &gcValues); if (StripchartPtr->textGC != None && StripchartPtr->tkwin) { Tk_FreeGC(Tk_Display(StripchartPtr->tkwin), StripchartPtr->textGC); diff -urN vic-2.8/version.c patched-vic-2.8/version.c --- vic-2.8/version.c Thu Jan 1 01:00:00 1970 +++ patched-vic-2.8/version.c Sun Jul 26 18:14:07 1998 @@ -0,0 +1 @@ +char version[] = "2.8"; diff -urN vic-2.8/videodev.h patched-vic-2.8/videodev.h --- vic-2.8/videodev.h Thu Jan 1 01:00:00 1970 +++ patched-vic-2.8/videodev.h Sat Aug 22 18:13:48 1998 @@ -0,0 +1,270 @@ +#ifndef __LINUX_VIDEODEV_H +#define __LINUX_VIDEODEV_H + +#ifdef __KERNEL__ + +#include + +struct video_device +{ + char name[32]; + int type; + int hardware; + + int (*open)(struct video_device *, int mode); + void (*close)(struct video_device *); + long (*read)(struct video_device *, char *, unsigned long, int noblock); + /* Do we need a write method ? */ + long (*write)(struct video_device *, const char *, unsigned long, int noblock); + unsigned int (*poll)(struct video_device *, struct file *, poll_table *); + int (*ioctl)(struct video_device *, unsigned int , void *); + int (*mmap)(struct video_device *, const char *, unsigned long); + int (*initialize)(struct video_device *); + void *priv; /* Used to be 'private' but that upsets C++ */ + int busy; + int minor; +}; + +extern int videodev_init(void); +#define VIDEO_MAJOR 81 +extern int video_register_device(struct video_device *, int type); + +#define VFL_TYPE_GRABBER 0 +#define VFL_TYPE_VBI 1 +#define VFL_TYPE_RADIO 2 +#define VFL_TYPE_VTX 3 + +extern void video_unregister_device(struct video_device *); +#endif + + +#define VID_TYPE_CAPTURE 1 /* Can capture */ +#define VID_TYPE_TUNER 2 /* Can tune */ +#define VID_TYPE_TELETEXT 4 /* Does teletext */ +#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ +#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ +#define VID_TYPE_CLIPPING 32 /* Can clip */ +#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ +#define VID_TYPE_SCALES 128 /* Scalable */ +#define VID_TYPE_MONOCHROME 256 /* Monochrome only */ +#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ + +struct video_capability +{ + char name[32]; + int type; + int channels; /* Num channels */ + int audios; /* Num audio devices */ + int maxwidth; /* Supported width */ + int maxheight; /* And height */ + int minwidth; /* Supported width */ + int minheight; /* And height */ +}; + + +struct video_channel +{ + int channel; + char name[32]; + int tuners; + __u32 flags; +#define VIDEO_VC_TUNER 1 /* Channel has a tuner */ +#define VIDEO_VC_AUDIO 2 /* Channel has audio */ + __u16 type; +#define VIDEO_TYPE_TV 1 +#define VIDEO_TYPE_CAMERA 2 + __u16 norm; /* Norm set by channel */ +}; + +struct video_tuner +{ + int tuner; + char name[32]; + ulong rangelow, rangehigh; /* Tuner range */ + __u32 flags; +#define VIDEO_TUNER_PAL 1 +#define VIDEO_TUNER_NTSC 2 +#define VIDEO_TUNER_SECAM 4 +#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */ +#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */ +#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */ + __u16 mode; /* PAL/NTSC/SECAM/OTHER */ +#define VIDEO_MODE_PAL 0 +#define VIDEO_MODE_NTSC 1 +#define VIDEO_MODE_SECAM 2 +#define VIDEO_MODE_AUTO 3 + __u16 signal; /* Signal strength 16bit scale */ +}; + +struct video_picture +{ + __u16 brightness; + __u16 hue; + __u16 colour; + __u16 contrast; + __u16 whiteness; /* Black and white only */ + __u16 depth; /* Capture depth */ + __u16 palette; /* Palette in use */ +#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */ +#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ +#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ +#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ +#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ +#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ +#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ +#define VIDEO_PALETTE_YUYV 8 +#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */ +#define VIDEO_PALETTE_YUV420 10 +#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */ +#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */ +#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */ +#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */ +}; + +struct video_audio +{ + int audio; /* Audio channel */ + __u16 volume; /* If settable */ + __u16 bass, treble; + __u32 flags; +#define VIDEO_AUDIO_MUTE 1 +#define VIDEO_AUDIO_MUTABLE 2 +#define VIDEO_AUDIO_VOLUME 4 +#define VIDEO_AUDIO_BASS 8 +#define VIDEO_AUDIO_TREBLE 16 + char name[16]; +#define VIDEO_SOUND_MONO 1 +#define VIDEO_SOUND_STEREO 2 +#define VIDEO_SOUND_LANG1 3 +#define VIDEO_SOUND_LANG2 4 + __u16 mode; + __u16 balance; /* Stereo balance */ + __u16 step; /* Step actual volume uses */ +}; + +struct video_clip +{ + __s32 x,y; + __s32 width, height; + struct video_clip *next; /* For user use/driver use only */ +}; + +struct video_window +{ + __u32 x,y; /* Position of window */ + __u32 width,height; /* Its size */ + __u32 chromakey; + __u32 flags; + struct video_clip *clips; /* Set only */ + int clipcount; +#define VIDEO_WINDOW_INTERLACE 1 +}; + +struct video_capture +{ + __u32 x,y; /* Offsets into image */ + __u32 width, height; /* Area to capture */ + __u16 decimation; /* Decimation divder */ + __u16 flags; /* Flags for capture */ +#define VIDEO_CAPTURE_ODD 0 /* Temporal */ +#define VIDEO_CAPTURE_EVEN 1 +}; + +struct video_buffer +{ + void *base; + int height,width; + int depth; + int bytesperline; +}; + +struct video_mmap +{ + unsigned int frame; /* Frame (0 - n) for double buffer */ + int height,width; + unsigned int format; /* should be VIDEO_PALETTE_* */ +}; + +struct video_key +{ + __u8 key[8]; + __u32 flags; +}; + + +#define VIDEO_MAX_FRAME 32 + +struct video_mbuf +{ + int size; /* Total memory to map */ + int frames; /* Frames */ + int offsets[VIDEO_MAX_FRAME]; +}; + + +#define VIDEO_NO_UNIT (-1) + + +struct video_unit +{ + int video; /* Video minor */ + int vbi; /* VBI minor */ + int radio; /* Radio minor */ + int audio; /* Audio minor */ + int teletext; /* Teletext minor */ +}; + +#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */ +#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */ +#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */ +#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */ +#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */ +#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */ +#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */ +#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */ +#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Set the video overlay window */ +#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */ +#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ +#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ +#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */ +#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ +#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ +#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ +#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ +#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */ +#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ +#define VIDIOCGMBUF _IOR('v', 20, struct video_mbuf) /* Memory map buffer info */ +#define VIDIOCGUNIT _IOR('v', 21, struct video_unit) /* Get attached units */ +#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get frame buffer */ +#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set frame buffer - root only */ + +#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ + + +#define VID_HARDWARE_BT848 1 +#define VID_HARDWARE_QCAM_BW 2 +#define VID_HARDWARE_PMS 3 +#define VID_HARDWARE_QCAM_C 4 +#define VID_HARDWARE_PSEUDO 5 +#define VID_HARDWARE_SAA5249 6 +#define VID_HARDWARE_AZTECH 7 +#define VID_HARDWARE_SF16MI 8 +#define VID_HARDWARE_RTRACK 9 +#define VID_HARDWARE_ZOLTRIX 10 +#define VID_HARDWARE_SAA7146 11 +#define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */ +#define VID_HARDWARE_RTRACK2 13 +#define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */ +#define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */ + +/* + * Initialiser list + */ + +struct video_init +{ + char *name; + int (*init)(struct video_init *); +}; + +#endif