Update to vic 2.8ucl-1.1.3

PR:		ports/27239
Submitted by:	Takeshi MUTOH <mutoh@info.nara-k.ac.jp>
This commit is contained in:
Bill Fenner 2001-08-01 22:01:23 +00:00
parent dab2a981df
commit 8f1f1812fb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=45715
60 changed files with 298 additions and 6830 deletions

View file

@ -6,17 +6,26 @@
#
PORTNAME= vic
PORTVERSION= 2.8
CATEGORIES= mbone tk82
MASTER_SITES= ftp://ftp.ee.lbl.gov/conferencing/vic/
DISTFILES= vicsrc-2.8.tar.gz
PORTVERSION= 2.8.1.1.3
CATEGORIES= mbone tk83
MASTER_SITES= http://www-mice.cs.ucl.ac.uk/multimedia/software/vic/2.8ucl-1.1.3/
DISTNAME= ${PORTNAME}-2.8ucl-1.1.3
MAINTAINER= fenner@FreeBSD.org
LIB_DEPENDS= tk82.1:${PORTSDIR}/x11-toolkits/tk82
LIB_DEPENDS= tk83.1:${PORTSDIR}/x11-toolkits/tk83
BUILD_DEPENDS= ${LOCALBASE}/lib/libuclmmbase.a:${PORTSDIR}/devel/uclmmbase
WRKSRC= ${WRKDIR}/vic-2.8ucl-1.1.3/vic
USE_AUTOCONF= yes
USE_X_PREFIX= yes
CONFIGURE_ARGS= -x-libraries=${PREFIX}/lib \
-x-includes=${PREFIX}/include \
-without-ucltcl \
-with-tcl=${LOCALBASE} \
-without-ucltk \
-with-tk=${LOCALBASE}
MAN1= vic.1
post-install:

View file

@ -1 +1 @@
MD5 (vicsrc-2.8.tar.gz) = 1f9ae3fbf8e9e47e6539c0621964542d
MD5 (vic-2.8ucl-1.1.3.tar.gz) = 55e792aa8f370fc15a197bb1b910a704

View file

@ -0,0 +1,20 @@
--- Makefile.in.orig Thu Feb 17 21:59:08 2000
+++ Makefile.in Tue May 8 09:06:28 2001
@@ -85,7 +85,7 @@
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/libuclmmbase.a -lm
+ codec/tmndec/libh263.a codec/tmn-x/libh263coder.a /usr/local/lib/libuclmmbase.a -lm
INCLUDE = $(INCLUDE_MISC) $(INCLUDE_GRABBER) $(INCLUDE_TK) $(INCLUDE_TCL) \
$(INCLUDE_X11) $(MD_INC) -Icodec/jpeg -Icodec/p64 -I.
DEFINE = @V_DEFINE@ -DED_YBITS=$(ED_YBITS) -DSIGRET=@V_SIGRET@ -DNLAYER=8
@@ -329,7 +329,7 @@
chown bin @prefix@/bin/vic
chgrp bin @prefix@/bin/vic
chmod 555 @prefix@/bin/vic
- cp vic.1 @prefix@/man/vic.1
+ cp vic.1 @prefix@/man/man1/vic.1
cp histtolut @prefix@/bin/histtolut
chown bin @prefix@/bin/histtolut
chgrp bin @prefix@/bin/histtolut

View file

@ -0,0 +1,10 @@
--- Tcl.cpp.org Mon May 7 15:55:17 2001
+++ Tcl.cpp Mon May 7 15:55:34 2001
@@ -66,6 +66,7 @@
{
instance_.tcl_ = tcl;
instance_.application_ = application;
+ Tcl_Init(tcl);
}
void Tcl::evalc(const char* s)

View file

@ -1,236 +0,0 @@
--- configure.in.orig Fri Jun 21 01:36:47 1996
+++ configure.in Mon Oct 12 23:20:51 1998
@@ -34,7 +34,7 @@
V_LIB_GRABBER=""
V_INCLUDE_GRABBER=""
-V_OBJ_GRABBER=""
+V_OBJ_GRABBER="grabber-x11.cc"
V_LIB_XIL=""
V_OBJ_XIL=""
@@ -69,7 +69,7 @@
if test -r /usr/include/machine/ioctl_meteor.h ; then
V_OBJ_GRABBER="$V_OBJ_GRABBER grabber-meteor.o"
fi
-if test -r /usr/local/lib/libspigot.a ; then
+if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; then
V_OBJ_GRABBER="$V_OBJ_GRABBER grabber-spigot.o"
V_LIB_GRABBER="$V_LIB_GRABBER -lspigot"
V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
@@ -87,9 +87,6 @@
V_OBJ_GRABBER="$V_OBJ_GRABBER grabber-qcam.o"
V_DEFINE="$V_DEFINE -DQCAMDEV"
fi
-if test -r /usr/include/linux/scc.h -o -r /usr/include/machine/scc.h ; then
- V_OBJ_GRABBER="$V_OBJ_GRABBER grabber-scc.o"
-fi
vpix_dir=/usr/src/local/vfc-1.0
vpix_lib=$vpix_dir/vfc_lib
if test -d /import/VideoPix ; then
@@ -227,6 +224,9 @@
*-*-netbsd*)
V_TARCMD="tar -h -c -f"
V_LIB="$V_LIB -L/usr/local/lib"
+ ;;
+*-*-freebsd*)
+ V_STATIC=""
;;
*-*-hpux*)
V_CCOPT="-O"
--- configure.in.tk.orig Thu May 16 01:06:05 1996
+++ configure.in.tk Tue Sep 9 11:01:36 1997
@@ -12,8 +12,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.2.so \
+ $d/lib/libtcl8.2.a \
$d/lib/libtcl.so \
$d/lib/libtcl.a"
V_LIB_TCL=FAIL
@@ -27,7 +27,7 @@
echo "can't find libtcl.a in $d/lib"
exit 1
fi
- places="$d/lib/tcl7.5 \
+ places="$d/lib/tcl8.2 \
$d/lib/tcl"
V_LIBRARY_TCL=FAIL
for dir in $places; do
@@ -44,13 +44,14 @@
AC_TEST_CPP([#include <tcl.h>], V_INCLUDE_TCL="", V_INCLUDE_TCL=FAIL)
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.2 \
+ /usr/src/local/tcl8.2 \
+ /import/tcl/include/tcl8.2 \
$prefix/include \
$x_includes/tk \
$x_includes \
/usr/local/include \
+ /usr/local/include/tcl8.2 \
/usr/contrib/include \
/usr/include"
for dir in $places; do
@@ -64,7 +65,7 @@
exit 1
fi
fi
- AC_CHECK_LIB(tcl7.5, main, V_LIB_TCL="-ltcl7.5", V_LIB_TCL="FAIL")
+ AC_CHECK_LIB(tcl8.2, main, V_LIB_TCL="-ltcl8.2", V_LIB_TCL="FAIL")
if test "$V_LIB_TCL" = FAIL; then
echo "checking for libtcl.a"
places="\
@@ -73,13 +74,13 @@
/usr/contrib/lib \
/usr/local/lib \
/usr/lib \
- $PWD/../tcl7.5 \
- /usr/src/local/tcl7.5 \
- /import/tcl/lib/tcl7.5 \
+ $PWD/../tcl8.2 \
+ /usr/src/local/tcl8.2 \
+ /import/tcl/lib/tcl8.2 \
"
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/libtcl82.so -o -r $dir/libtcl82.a; then
+ V_LIB_TCL="-L$dir -ltcl82"
break
fi
if test -r $dir/libtcl.so -o -r $dir/libtcl.a; then
@@ -98,13 +99,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.2 \
+ /usr/contrib/lib/tcl8.2 \
+ /usr/lib/tcl8.2 \
+ /usr/lib/tk/tcl8.2 \
+ /import/tcl/lib/tcl8.2 \
+ $prefix/lib/tcl8.2 \
+ $x_libraries/tcl8.2 \
/usr/local/lib/tcl \
/usr/lib/tcl \
/usr/lib/tk/tcl \
@@ -138,8 +139,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.2.so \
+ $d/lib/libtk8.2.a \
$d/lib/libtk.so \
$d/lib/libtk.a"
V_LIB_TK=FAIL
@@ -153,7 +154,7 @@
echo "can't find libtk.a in $d/lib"
exit 1
fi
- places="$d/lib/tk4.1 \
+ places="$d/lib/tk8.2 \
$d/lib/tk"
V_LIBRARY_TK=FAIL
for dir in $places; do
@@ -170,18 +171,19 @@
AC_TEST_CPP([#include <tk.h>], V_INCLUDE_TK="", V_INCLUDE_TK=FAIL)
if test "$V_INCLUDE_TK" = FAIL; then
echo "checking for tk.h"
- V_INCLUDE_TK=""
+ V_INCLUDE_TK="FAIL"
places="\
$prefix/include \
/usr/local/include \
+ /usr/local/include/tk8.2 \
/usr/contrib/include \
/usr/include/tcl \
/usr/include\
$x_includes/tk \
$x_includes \
- $PWD/../tk4.1 \
- /usr/src/local/tk4.1 \
- /import/tcl/include/tk4.1 \
+ $PWD/../tk8.2 \
+ /usr/src/local/tk8.2 \
+ /import/tcl/include/tk8.2 \
"
for dir in $places; do
if test -r $dir/tk.h ; then
@@ -194,7 +196,7 @@
exit 1
fi
fi
- AC_CHECK_LIB(tk4.1, main, V_LIB_TK="-ltk4.1", V_LIB_TK="FAIL")
+ AC_CHECK_LIB(tk8.2, main, V_LIB_TK="-ltk8.2", V_LIB_TK="FAIL")
if test "$V_LIB_TK" = FAIL; then
echo "checking for libtk.a"
places="/usr/local/lib \
@@ -202,13 +204,13 @@
/usr/lib \
/usr/lib/tk \
/import/tcl/lib \
- $PWD/../tk4.1 \
- /usr/src/local/tk4.1 \
+ $PWD/../tk8.2 \
+ /usr/src/local/tk8.2 \
$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/libtk82.so -o -r $dir/libtk82.a; then
+ V_LIB_TK="-L$dir -ltk82"
break
fi
if test -r $dir/libtk.so -o -r $dir/libtk.a; then
@@ -227,15 +229,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.2 \
+ /usr/contrib/lib/tk8.2 \
+ /usr/lib/tk8.2 \
+ /usr/lib/tk/tk8.2 \
+ /import/tcl/lib/tk8.2 \
+ $prefix/lib/tk8.2 \
+ $x_libraries/tk8.2 \
+ $PWD/../tk8.2/library \
+ /usr/src/local/tk8.2/library \
/usr/local/lib/tk \
/usr/lib/tk \
/usr/lib/tk/tk \
--- Makefile.in.orig Mon Jul 22 09:32:53 1996
+++ Makefile.in Tue Sep 9 11:01:36 1997
@@ -303,7 +303,7 @@
chown bin @prefix@/bin/vic
chgrp bin @prefix@/bin/vic
chmod 555 @prefix@/bin/vic
- cp vic.1 @prefix@/man/vic.1
+ cp vic.1 @prefix@/man/man1/vic.1
cp histtolut @prefix@/bin/histtolut
chown bin @prefix@/bin/histtolut
chgrp bin @prefix@/bin/histtolut

View file

@ -1,30 +0,0 @@
*** grabber-spigot.cc.orig Fri Nov 1 16:11:59 1996
--- grabber-spigot.cc Fri Nov 1 16:17:36 1996
***************
*** 202,212 ****
hstart_ = 1;
hstop_ = blkw_ - 1;
int voff = (outh_ - inh_) / 2;
- hwrap_ = outw_ - inw_ ;
int hoff = hwrap_ / 2;
loff_ = outw_ * voff + hoff;
coff_ = (outw_ >> 1) * (voff >> 1) + (hoff >> 1);
hskip_ = 0;
break;
case f_411:
--- 202,215 ----
hstart_ = 1;
hstop_ = blkw_ - 1;
+ {
int voff = (outh_ - inh_) / 2;
int hoff = hwrap_ / 2;
+
+ hwrap_ = outw_ - inw_ ;
loff_ = outw_ * voff + hoff;
coff_ = (outw_ >> 1) * (voff >> 1) + (hoff >> 1);
+ }
hskip_ = 0;
break;
case f_411:

View file

@ -1,14 +0,0 @@
--- grabber-qcam.cc.orig Sat Nov 2 23:22:46 1996
+++ grabber-qcam.cc Sat Nov 2 23:23:34 1996
@@ -84,6 +84,11 @@
#define CIF_HEIGHT 288
/*XXX*/
+#ifndef QC_MAX_CONTRAST
+#define QC_MAX_CONTRAST 255
+#endif
+
+/*XXX*/
#define VOLATILE volatile
class QcamGrabber : public Grabber {

View file

@ -1,21 +0,0 @@
--- main.cc.orig Mon Jul 22 13:12:22 1996
+++ main.cc Tue Sep 9 10:25:36 1997
@@ -177,7 +177,7 @@
else {
Tk_Window tk = t.tkmain();
Tk_Uid uid = Tk_GetUid((char*)argv[1]);
- XFontStruct* p = Tk_GetFontStruct(t.interp(), tk, uid);
+ Tk_Font p = Tk_GetFont(t.interp(), tk, uid);
t.result(p != 0 ? "1" : "0");
}
return (TCL_OK);
@@ -425,6 +425,9 @@
#endif
signal(SIGINT, ciao);
signal(SIGTERM, ciao);
+#ifdef __FreeBSD__
+ signal(SIGSYS, (sig_t)noXShm);
+#endif
#ifdef WIN32
TkSetPlatformInit(TkPlatformInit);

View file

@ -1,136 +0,0 @@
--- tkStripchart.c.orig Tue Sep 9 11:00:42 1997
+++ tkStripchart.c Tue Sep 9 10:52:30 1997
@@ -148,7 +148,7 @@
int scrollrequired;
int guarantee_draw;
int grow_up;
- XFontStruct *fontPtr; /* Information about text font, or NULL. */
+ Tk_Font tkfont; /* Information about text font, or NULL. */
XColor *textColorPtr; /* Color for drawing text. */
GC textGC; /* GC for drawing text. */
XColor *tickColorPtr; /* Color for drawing ticks. */
@@ -257,7 +257,7 @@
{TK_CONFIG_SYNONYM, "-fg", "stripcolor", 0,
0, 0, 0},
{TK_CONFIG_FONT, "-font", "font", "Font",
- DEF_STRIPCHART_FONT, Tk_Offset(Stripchart, fontPtr),
+ DEF_STRIPCHART_FONT, Tk_Offset(Stripchart, tkfont),
0},
{TK_CONFIG_BOOLEAN, "-guaranteedrawing", "guaranteedrawing",
"Guaranteedrawing", DEF_GUARANTEE_DRAW,
@@ -570,8 +570,8 @@
if (StripchartPtr->value != NULL)
free(StripchartPtr->value);
- if (StripchartPtr->fontPtr != NULL)
- Tk_FreeFontStruct(StripchartPtr->fontPtr);
+ if (StripchartPtr->tkfont != NULL)
+ Tk_FreeFont(StripchartPtr->tkfont);
if (StripchartPtr->textColorPtr != NULL)
Tk_FreeColor(StripchartPtr->textColorPtr);
@@ -631,7 +631,7 @@
Tk_SetBackgroundFromBorder(StripchartPtr->tkwin, StripchartPtr->border);
- gcValues.font = StripchartPtr->fontPtr->fid;
+ gcValues.font = Tk_FontId(StripchartPtr->tkfont);
gcValues.foreground = StripchartPtr->textColorPtr->pixel;
newGC = Tk_GetGC(StripchartPtr->tkwin, GCForeground|GCFont, &gcValues);
if (StripchartPtr->textGC != None && StripchartPtr->tkwin) {
@@ -692,8 +692,11 @@
{
int tt = hasatitle(StripchartPtr);
int bd = StripchartPtr->borderWidth;
- int lineHeight = StripchartPtr->fontPtr->ascent +
- StripchartPtr->fontPtr->descent;
+ Tk_FontMetrics fm;
+ int lineHeight;
+
+ Tk_GetFontMetrics(StripchartPtr->tkfont, &fm);
+ lineHeight = fm.ascent + fm.descent;
Tk_GeometryRequest(StripchartPtr->tkwin,
2 * (bd + PADDING) + StripchartPtr->num_strips *
@@ -726,11 +729,13 @@
/*
* Variable declarations used in the title drawing routines
*/
- XFontStruct *fp = StripchartPtr->fontPtr;
- XCharStruct bbox;
- int x, dummy;
- int lineHeight = StripchartPtr->fontPtr->ascent +
- StripchartPtr->fontPtr->descent;
+ Tk_Font tkf = StripchartPtr->tkfont;
+ int x;
+ Tk_FontMetrics fm;
+ int lineHeight;
+
+ Tk_GetFontMetrics(tkf, &fm);
+ lineHeight = fm.ascent + fm.descent;
StripchartPtr->displaybits &= ~REDRAW_PENDING;
if ((StripchartPtr->tkwin == NULL) || !Tk_IsMapped(tkwin))
@@ -747,18 +752,17 @@
* space. Otherwise left justified and clipped on the right.
*/
if (tt && StripchartPtr->displaybits & DISPLAY_TITLE) {
- XTextExtents(fp, StripchartPtr->title,
- strlen(StripchartPtr->title),
- &dummy, &dummy, &dummy, &bbox);
- if (bbox.lbearing + bbox.rbearing < Tk_Width(tkwin) - 2 * bd)
- x = (Tk_Width(tkwin) - bbox.lbearing - bbox.rbearing)/2;
+ int width = Tk_TextWidth(tkf, StripchartPtr->title,
+ strlen(StripchartPtr->title));
+ if (width < Tk_Width(tkwin) - 2 * bd)
+ x = (Tk_Width(tkwin) - width)/2;
else
x = bd + PADDING;
XClearArea(Tk_Display(tkwin), Tk_WindowId(tkwin), bd, bd,
Tk_Width(tkwin) - 2 * bd, lineHeight + PADDING, False);
XDrawString(Tk_Display(tkwin), Tk_WindowId(tkwin),
- StripchartPtr->textGC, x, fp->max_bounds.ascent + bd,
+ StripchartPtr->textGC, x, fm.ascent + bd, /*XXX no max_bounds */
StripchartPtr->title, strlen(StripchartPtr->title));
}
/*
@@ -1057,7 +1061,8 @@
DrawStripi(Stripchart* SPtr, int i)
{
Tk_Window tkwin = SPtr->tkwin;
- int lineHeight = SPtr->fontPtr->ascent + SPtr->fontPtr->descent;
+ Tk_FontMetrics fm;
+ int lineHeight;
int x = SPtr->borderWidth + PADDING + (i - 1) * SPtr->strip_width;
int y = SPtr->borderWidth + PADDING +
hasatitle(SPtr) * (lineHeight + PADDING);
@@ -1066,6 +1071,9 @@
double maxv = SPtr->max_value;
double minv = SPtr->min_value;
+ Tk_GetFontMetrics(SPtr->tkfont, &fm);
+ lineHeight = fm.ascent + fm.descent;
+
if (i < 1 || i > SPtr->num_strips)
return;
@@ -1136,7 +1144,8 @@
ScrollStrips(Stripchart* SPtr)
{
Tk_Window tkwin = SPtr->tkwin;
- int lineHeight = SPtr->fontPtr->ascent + SPtr->fontPtr->descent;
+ Tk_FontMetrics fm;
+ int lineHeight;
int src_x = SPtr->borderWidth + PADDING + SPtr->strip_width;
int src_y = SPtr->borderWidth + PADDING +
hasatitle(SPtr) * (lineHeight + PADDING);
@@ -1144,6 +1153,8 @@
int dest_y = src_y;
int w = (SPtr->num_strips - 1) * SPtr->strip_width;
int h = SPtr->max_height;
+
+ Tk_GetFontMetrics(SPtr->tkfont, &fm);
XCopyArea(Tk_Display(tkwin), Tk_WindowId(tkwin), Tk_WindowId(tkwin),
Tk_GetGC(tkwin, 0, NULL), src_x, src_y, w, h, dest_x, dest_y);

View file

@ -1,757 +0,0 @@
--- grabber-meteor.cc.orig Fri Jun 26 11:25:55 1998
+++ grabber-meteor.cc Fri Jun 26 11:18:53 1998
@@ -43,7 +43,6 @@
*
*/
-/*#define FRAME_CNTS /* print frame counts and fps when device stops -- debug */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -51,16 +50,16 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
-#ifdef FRAME_CNTS
-#include <sys/time.h>
-#endif
#include "grabber.h"
+#include "crdef.h"
#include "Tcl.h"
#include "device-input.h"
#include "module.h"
+#include "bsd-endian.h"
#include <machine/ioctl_meteor.h>
+#include <machine/ioctl_bt848.h>
/*XXX*/
#define NTSC_WIDTH 320
@@ -72,62 +71,78 @@
class MeteorGrabber : public Grabber {
- public:
- MeteorGrabber(const char* name, const char* format);
+ public:
+ MeteorGrabber(const char* name);
virtual ~MeteorGrabber();
+ virtual int command(int argc, const char*const* argv);
+ virtual void fps(int);
virtual void start();
virtual void stop();
- virtual void fps(int);
- protected:
- virtual int command(int argc, const char*const* argv);
- virtual int capture();
virtual int grab();
+ protected:
void format();
- void setsize();
+ virtual void setsize() = 0;
+ void suppress(const u_char* in, int istride);
+ virtual void saveblks(const u_char* in, int istride) = 0;
+ void set_size_meteor(int w, int h);
int video_format_; /* video input format: NTSC or PAL */
int dev_; /* device fd */
int port_; /* video input port */
- int coder_format_; /* 411, 422, or cif */
u_int basewidth_; /* Height of frame to be captured */
u_int baseheight_; /* Width of frame to be captured */
u_int decimate_; /* division of base sizes */
volatile u_int* pyuv_; /* pointer to yuv data */
-#ifdef FRAME_CNTS
- struct meteor_counts cnts_; /* pointer to counters */
- double start_time_;
-#endif
+ int tuner_ ; /* tuner device... */
};
-static const int f_411 = 0; /* coder_format_s */
-static const int f_422 = 1;
-static const int f_cif = 2;
+class Meteor422Grabber : public MeteorGrabber {
+ public:
+ Meteor422Grabber(const char* name);
+ protected:
+ void setsize();
+ void saveblk(const u_char* in, u_char* yp, u_char* up, u_char* vp,
+ int stride, int istride);
+ void saveblks(const u_char* in, int istride);
+};
+
+class MeteorCIFGrabber : public MeteorGrabber {
+ public:
+ MeteorCIFGrabber(const char* name);
+ protected:
+ void setsize();
+ void saveblk(const u_char* in, u_char* yp, u_char* up, u_char* vp,
+ int stride, int istride);
+ void saveblks(const u_char* in, int istride);
+};
class MeteorDevice : public InputDevice {
- public:
+ public:
MeteorDevice(const char* nickname, const char* devname, int free);
virtual int command(int argc, const char*const* argv);
- protected:
+ protected:
const char* name_;
};
class MeteorScanner {
- public:
+ public:
MeteorScanner(const int n);
};
+
static MeteorScanner find_meteor_devices(4);
MeteorScanner::MeteorScanner(const int n)
{
- char* devname_template = "/dev/meteor%d";
- char* nickname_template = "Matrox Meteor %d";
+ static char *d[] = { "/dev/bktr%d", "/dev/meteor%d", NULL };
+ char *nickname_template = "meteor-%d";
for(int i = 0; i < n; i++) {
- char *devname = new char[strlen(devname_template) + 3];
+ for (int j = 0 ; d[j] != NULL ; j++) {
+ char *devname = new char[strlen(d[j]) + 3];
char *nickname = new char[strlen(nickname_template) + 3];
+ sprintf(devname, d[j], i);
sprintf(nickname, nickname_template, i + 1);
- sprintf(devname, devname_template, i);
if(access(devname, R_OK) == 0) {
int fd = open(devname, O_RDONLY);
if(fd < 0) {
@@ -140,8 +155,9 @@
delete nickname;
delete devname;
}
+ }
+ }
}
-}
MeteorDevice::MeteorDevice(const char* nickname, const char *devname, int free):
InputDevice(nickname), name_(devname)
@@ -149,6 +165,7 @@
if(free)
attributes_ = "\
format {422 411} \
+type {pal ntsc secam auto} \
size {large normal small cif} \
port {RCA Port-1 Port-2 Port-3 S-Video RGB}";
else
@@ -160,7 +177,10 @@
Tcl& tcl = Tcl::instance();
if ((argc == 3) && (strcmp(argv[1], "open") == 0)) {
TclObject* o = 0;
- o = new MeteorGrabber(name_, argv[2]);
+ if (strcmp(argv[2], "422") == 0)
+ o = new Meteor422Grabber(name_);
+ else if (strcmp(argv[2], "cif") == 0)
+ o = new MeteorCIFGrabber(name_);
if (o != 0)
tcl.result(o->name());
return (TCL_OK);
@@ -168,19 +188,15 @@
return (InputDevice::command(argc, argv));
}
-MeteorGrabber::MeteorGrabber(const char* name, const char* format)
+MeteorGrabber::MeteorGrabber(const char* name)
{
- coder_format_ = -1;
- if(!strcmp(format, "411")) coder_format_ = f_411;
- if(!strcmp(format, "422")) coder_format_ = f_422;
- if(!strcmp(format, "cif")) coder_format_ = f_cif;
- if(coder_format_ == -1) {
- fprintf(stderr,
- "vic: MeteorGrabber: unsupported format: %s\n",
- format);
- abort();
- }
-
+ int devnum;
+ if (sscanf(name, "/dev/bktr%d", &devnum) == 1) {
+ char *tunerdev = new char[strlen(name) + 3];
+ sprintf(tunerdev, "/dev/tuner%d", devnum);
+ tuner_ = open(tunerdev, O_RDONLY);
+ } else
+ tuner_ = -1;
dev_ = open(name, O_RDONLY);
if (dev_ == -1) {
status_ = -1;
@@ -203,52 +219,33 @@
if (dev_ != -1) {
close(dev_);
}
+ if (tuner_ != -1)
+ close(tuner_);
}
-void MeteorGrabber::setsize()
+void MeteorGrabber::set_size_meteor(int w, int h)
{
struct meteor_geomet geom;
- geom.rows = (baseheight_ / decimate_) &~0xf; /* 0xf, ugh! */
- geom.columns = (basewidth_ / decimate_) &~0xf;
+ geom.rows = h &~0xf; /* 0xf, ugh! */
+ geom.columns = w &~0xf;
geom.frames = 1;
- geom.oformat = METEOR_GEO_UNSIGNED;
- geom.oformat |= METEOR_GEO_YUV_422;
+ geom.oformat = METEOR_GEO_UNSIGNED | METEOR_GEO_YUV_PACKED;
/*
* If we can get by with only reading even fields, then by all
* means do so.
*/
unsigned short status;
- ioctl(dev_, METEORSTATUS, &status);
- if(status & METEOR_STATUS_HCLK) { /* do we have a source? */
- /* No source, assume ntsc*/
+ // ioctl(dev_, METEORSTATUS, &status);
+ if ( video_format_ == METEOR_FMT_NTSC ) {
if(geom.rows <= NTSC_HEIGHT && geom.columns <= NTSC_WIDTH)
geom.oformat |= METEOR_GEO_EVEN_ONLY;
} else {
- if(status & METEOR_STATUS_FIDT) { /* is it pal or ntsc? */
- /* 60 hz */
- if(geom.rows<=NTSC_HEIGHT && geom.columns<=NTSC_WIDTH)
- geom.oformat |= METEOR_GEO_EVEN_ONLY;
- } else { /* 50 hz */
if(geom.rows<=PAL_HEIGHT && geom.columns<=PAL_WIDTH)
geom.oformat |= METEOR_GEO_EVEN_ONLY;
}
- }
-
if(ioctl(dev_, METEORSETGEO, &geom) < 0)
perror("vic: METERSETGEO: ");
-
- switch(coder_format_) {
- case f_422:
- set_size_422(geom.columns, geom.rows);
- break;
- case f_cif:
- case f_411:
- set_size_411(geom.columns, geom.rows);
- break;
- }
-
- allocref(); /* allocate reference frame */
}
void MeteorGrabber::format()
@@ -285,11 +282,6 @@
baseheight_ = PAL_HEIGHT * 2;
basewidth_ = PAL_WIDTH * 2;
}
-
- if(coder_format_ == f_cif) {
- baseheight_ = CIF_HEIGHT * 2;
- basewidth_ = CIF_WIDTH * 2;
- }
setsize();
}
@@ -299,15 +291,6 @@
format();
int cmd = METEOR_CAP_SINGLE;
ioctl(dev_, METEORCAPTUR, (char*)&cmd);
-#ifdef FRAME_CNTS
- cnts_.fifo_errors = 0;
- cnts_.dma_errors = 0;
- cnts_.frames_captured = 0;
- cnts_.even_fields_captured = 0;
- cnts_.odd_fields_captured = 0;
- ioctl(dev_, METEORSCOUNT, &cnts_);
- start_time_ = gettimeofday();
-#endif
cmd = METEOR_CAP_CONTINOUS;
ioctl(dev_, METEORCAPTUR, (char*)&cmd);
@@ -319,19 +302,6 @@
int cmd = METEOR_CAP_STOP_CONT;
ioctl(dev_, METEORCAPTUR, (char*)&cmd);
-#ifdef FRAME_CNTS
- double endtime = gettimeofday() ;
- ioctl(dev_, METEORGCOUNT, &cnts_);
- int diff = (int)((endtime-start_time_) * 1e-6 + 0.5);
- printf("frames = %d, even fields = %d, odd fields = %d,\n\
-fifo errors = %d, dma errors = %d, seconds = %d",
- cnts_.frames_captured, cnts_.even_fields_captured,
- cnts_.odd_fields_captured, cnts_.fifo_errors, cnts_.dma_errors,
- diff);
- if(diff)
- printf(",fps = %d", cnts_.frames_captured/diff);
- printf("\n");
-#endif
Grabber::stop();
}
@@ -345,15 +315,15 @@
int MeteorGrabber::command(int argc, const char*const* argv)
{
+ Tcl& tcl = Tcl::instance();
if (argc == 3) {
if (strcmp(argv[1], "decimate") == 0) {
int dec = atoi(argv[2]);
- Tcl& tcl = Tcl::instance();
if (dec <= 0) {
tcl.resultf("%s: divide by zero", argv[0]);
return (TCL_ERROR);
}
- if (dec != decimate_) {
+ if ((u_int)dec != decimate_) {
decimate_ = dec;
if(running_) {
stop();
@@ -362,7 +332,8 @@
}
}
return (TCL_OK);
- } else if (strcmp(argv[1], "port") == 0) {
+ }
+ if (strcmp(argv[1], "port") == 0) {
int p = port_;
if(!strcmp(argv[2], "RCA")) p = METEOR_INPUT_DEV0;
if(!strcmp(argv[2], "Port-1")) p = METEOR_INPUT_DEV1;
@@ -377,7 +348,30 @@
ioctl(dev_, METEORSINPUT, &port_);
}
return (TCL_OK);
- } else if (strcmp(argv[1], "format") == 0 ||
+ }
+ if (strcmp(argv[1], "freeze") == 0) {
+ int cmd = METEOR_CAP_CONTINOUS ;
+ if ( atoi(argv[2]) != 0 )
+ cmd = METEOR_CAP_STOP_CONT;
+ ioctl(dev_, METEORCAPTUR, (char*)&cmd);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "chan") == 0) {
+ int p = port_;
+ int c = atoi(argv[2]);
+ if (c > 0 && c < 199)
+ p = METEOR_INPUT_DEV1 ;
+ else
+ p = METEOR_INPUT_DEV0 ;
+ if (p != port_) {
+ port_ = p;
+ ioctl(dev_, METEORSINPUT, &port_);
+ }
+ if (p == METEOR_INPUT_DEV1)
+ ioctl(tuner_, TVTUNER_SETCHNL, &c);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "format") == 0 ||
strcmp(argv[1], "type") == 0) {
if (strcmp(argv[2], "auto") == 0)
video_format_ = METEOR_FMT_AUTOMODE;
@@ -390,14 +384,35 @@
if (running_)
format();
return (TCL_OK);
- } else if (strcmp(argv[1], "contrast") == 0) {
- contrast(atof(argv[2]));
- return (TCL_OK);
+ }
+ if (strcmp(argv[1], "brightness") == 0) {
+ u_char val = atoi(argv[2]);
+ ioctl(dev_, METEORSBRIG, &val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "contrast") == 0) {
+ u_char val = atoi(argv[2]);
+ ioctl(dev_, METEORSCONT, &val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "hue") == 0) {
+ char val = atoi(argv[2]);
+ ioctl(dev_, METEORSHUE, &val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "saturation") == 0) {
+ u_char val = atoi(argv[2]);
+ ioctl(dev_, METEORSCSAT, &val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "uvgain") == 0) {
+ u_char val = atoi(argv[2]);
+ ioctl(dev_, METEORSCHCV, &val);
+ return (TCL_OK);
}
} else if (argc == 2) {
if (strcmp(argv[1], "format") == 0 ||
strcmp(argv[1], "type") == 0) {
- Tcl& tcl = Tcl::instance();
switch (video_format_) {
case METEOR_FMT_AUTOMODE:
@@ -423,54 +438,316 @@
return (TCL_OK);
}
+ if (strcmp(argv[1], "brightness") == 0) {
+ u_char val;
+ ioctl(dev_, METEORGBRIG, &val);
+ tcl.resultf("%d", (unsigned int)val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "contrast") == 0) {
+ u_char val;
+ ioctl(dev_, METEORGCONT, &val);
+ tcl.resultf("%d", (int)val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "hue") == 0) {
+ char val;
+ ioctl(dev_, METEORGHUE, &val);
+ tcl.resultf("%d", (int)val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "saturation") == 0) {
+ u_char val;
+ ioctl(dev_, METEORGCSAT, &val);
+ tcl.resultf("%d", (int)val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "uvgain") == 0) {
+ u_char val;
+ ioctl(dev_, METEORGCHCV, &val);
+ tcl.resultf("%d", (int)val);
+ return (TCL_OK);
+ }
}
return (Grabber::command(argc, argv));
}
-int MeteorGrabber::capture()
-{
- if(pyuv_ == 0) return 0;
-
- volatile u_int* py = pyuv_;
- volatile u_int* pu = (u_int *)((u_int)py + (u_int)framesize_);
- volatile u_int* pv = (u_int *)((u_int)pu + (framesize_ >> 1));
- u_int* lum = (u_int *)frame_;
- u_int* uoff = (u_int *)((u_int)lum + (u_int)framesize_);
- int f422 = coder_format_ == f_422;
- u_int* voff = (u_int *)((u_int)uoff +
- (u_int)(framesize_>>(f422?1:2)));
- int numc = ((basewidth_/decimate_) &~0xf) >> 3;
-
- for (int row = 0; row < (((baseheight_/decimate_)&~0xf) >> 1); row++) {
- for(int col = 0; col < numc; col++) {
- *lum++ = *py++;
- *lum++ = *py++;
- *uoff++ = *pu++;
- *voff++ = *pv++;
- }
- for(col = 0; col < numc; col++) {
- *lum++ = *py++;
- *lum++ = *py++;
- if(f422) { /* only copy odd in 4:2:2 format */
- *uoff++ = *pu++;
- *voff++ = *pv++;
-
- }
- }
- if(!f422) { /* skip odd if 4:1:1 or cif format */
- pu += numc;
- pv += numc;
- }
- }
- return 1;
+#define U 0
+#define Y0 1
+#define V 2
+#define Y1 3
+
+/*
+ * define these for REPLENISH macro used below
+ */
+#define DIFF4(in, frm, v) \
+ v += (in)[Y0] - (frm)[0]; \
+ v += (in)[Y1] - (frm)[1]; \
+ v += (in)[Y0+4] - (frm)[2]; \
+ v += (in)[Y1+4] - (frm)[3];
+
+#define DIFFLINE(in, frm, left, center, right) \
+ DIFF4(in + 0*8, frm + 0*4, left); \
+ DIFF4(in + 1*8, frm + 1*4, center); \
+ DIFF4(in + 2*8, frm + 2*4, center); \
+ DIFF4(in + 3*8, frm + 3*4, right); \
+ if (right < 0) \
+ right = -right; \
+ if (left < 0) \
+ left = -left; \
+ if (center < 0) \
+ center = -center;
+
+void MeteorGrabber::suppress(const u_char* devbuf, int is)
+{
+ const u_char* start = frame_ + 16 * vstart_ * outw_ + 16 * hstart_;
+ REPLENISH(devbuf, start, is, 2,
+ hstart_, hstop_, vstart_, vstop_);
}
int MeteorGrabber::grab()
{
- if (capture() == 0)
- return (0);
- suppress(frame_);
- saveblks(frame_);
- YuvFrame f(media_ts(), frame_, crvec_, outw_, outh_);
+ if (pyuv_ == 0)
+ return 0;
+
+ int istride = inw_ * 2;
+ suppress((u_char*)pyuv_, istride);
+ saveblks((u_char*)pyuv_, istride);
+ u_int32_t ts = media_ts();
+ YuvFrame f(ts, frame_, crvec_, outw_, outh_);
return (target_->consume(&f));
+}
+
+Meteor422Grabber::Meteor422Grabber(const char* name)
+ : MeteorGrabber(name)
+{
+}
+
+MeteorCIFGrabber::MeteorCIFGrabber(const char* name)
+ : MeteorGrabber(name)
+{
+}
+
+void Meteor422Grabber::setsize()
+{
+ int w = basewidth_ / decimate_;
+ int h = baseheight_ / decimate_;
+ set_size_meteor(w, h);
+ set_size_422(w, h);
+}
+
+inline void
+Meteor422Grabber::saveblk(const u_char* in,
+ u_char* yp, u_char* up, u_char* vp, int stride, int istride)
+{
+ for (int i = 16; --i >= 0; ) {
+ /*
+ * Each iteration of this loop grabs 16 Ys & 8 U/Vs.
+ */
+ register u_int y0, y1, u, v;
+
+ u = in[U + 0*4] << SHIFT(24) |
+ in[U + 1*4] << SHIFT(16) |
+ in[U + 2*4] << SHIFT(8) |
+ in[U + 3*4] << SHIFT(0);
+ v = in[V + 0*4] << SHIFT(24) |
+ in[V + 1*4] << SHIFT(16) |
+ in[V + 2*4] << SHIFT(8) |
+ in[V + 3*4] << SHIFT(0);
+ y0 = in[Y0 + 0*4] << SHIFT(24) |
+ in[Y1 + 0*4] << SHIFT(16) |
+ in[Y0 + 1*4] << SHIFT(8) |
+ in[Y1 + 1*4] << SHIFT(0);
+ y1 = in[Y0 + 2*4] << SHIFT(24) |
+ in[Y1 + 2*4] << SHIFT(16) |
+ in[Y0 + 3*4] << SHIFT(8) |
+ in[Y1 + 3*4] << SHIFT(0);
+
+ ((u_int*)yp)[0] = y0;
+ ((u_int*)yp)[1] = y1;
+ ((u_int*)up)[0] = u;
+ ((u_int*)vp)[0] = v;
+
+ u = in[U + 4*4] << SHIFT(24) |
+ in[U + 5*4] << SHIFT(16) |
+ in[U + 6*4] << SHIFT(8) |
+ in[U + 7*4] << SHIFT(0);
+ v = in[V + 4*4] << SHIFT(24) |
+ in[V + 5*4] << SHIFT(16) |
+ in[V + 6*4] << SHIFT(8) |
+ in[V + 7*4] << SHIFT(0);
+ y0 = in[Y0 + 4*4] << SHIFT(24) |
+ in[Y1 + 4*4] << SHIFT(16) |
+ in[Y0 + 5*4] << SHIFT(8) |
+ in[Y1 + 5*4] << SHIFT(0);
+ y1 = in[Y0 + 6*4] << SHIFT(24) |
+ in[Y1 + 6*4] << SHIFT(16) |
+ in[Y0 + 7*4] << SHIFT(8) |
+ in[Y1 + 7*4] << SHIFT(0);
+
+ ((u_int*)yp)[2] = y0;
+ ((u_int*)yp)[3] = y1;
+ ((u_int*)up)[1] = u;
+ ((u_int*)vp)[1] = v;
+
+ in += istride;
+ yp += stride;
+ up += stride >> 1;
+ vp += stride >> 1;
+ }
+}
+
+void Meteor422Grabber::saveblks(const u_char* devbuf, int is)
+{
+ u_char* crv = crvec_;
+ int off = framesize_;
+ u_char* lum = frame_;
+ u_char* chm = lum + off;
+ off >>= 1;
+ int stride = 15 * outw_;
+ int istride = is * 15;
+ for (int y = 0; y < blkh_; ++y) {
+ for (int x = 0; x < blkw_; ++x) {
+ int s = *crv++;
+ if ((s & CR_SEND) != 0)
+ saveblk(devbuf, lum, chm, chm + off, outw_, is);
+
+ devbuf += 32;
+ lum += 16;
+ chm += 8;
+ }
+ lum += stride;
+ chm += stride >> 1;
+ devbuf += istride;
+ }
+}
+
+void MeteorCIFGrabber::setsize()
+{
+ int w = basewidth_ / decimate_;
+ int h = baseheight_ / decimate_;
+ set_size_meteor(w, h);
+ set_size_cif(w, h);
+}
+
+inline void
+MeteorCIFGrabber::saveblk(const u_char* in,
+ u_char* yp, u_char* up, u_char* vp, int stride, int istride)
+{
+ for (int i = 8; --i >= 0; ) {
+ /*
+ * Each iteration of this loop grabs 32 Ys & 16 U/Vs.
+ */
+ register u_int y0, y1, u, v;
+
+ u = in[U + 0*4] << SHIFT(24) |
+ in[U + 1*4] << SHIFT(16) |
+ in[U + 2*4] << SHIFT(8) |
+ in[U + 3*4] << SHIFT(0);
+ v = in[V + 0*4] << SHIFT(24) |
+ in[V + 1*4] << SHIFT(16) |
+ in[V + 2*4] << SHIFT(8) |
+ in[V + 3*4] << SHIFT(0);
+ y0 = in[Y0 + 0*4] << SHIFT(24) |
+ in[Y1 + 0*4] << SHIFT(16) |
+ in[Y0 + 1*4] << SHIFT(8) |
+ in[Y1 + 1*4] << SHIFT(0);
+ y1 = in[Y0 + 2*4] << SHIFT(24) |
+ in[Y1 + 2*4] << SHIFT(16) |
+ in[Y0 + 3*4] << SHIFT(8) |
+ in[Y1 + 3*4] << SHIFT(0);
+
+ ((u_int*)yp)[0] = y0;
+ ((u_int*)yp)[1] = y1;
+ ((u_int*)up)[0] = u;
+ ((u_int*)vp)[0] = v;
+
+ u = in[U + 4*4] << SHIFT(24) |
+ in[U + 5*4] << SHIFT(16) |
+ in[U + 6*4] << SHIFT(8) |
+ in[U + 7*4] << SHIFT(0);
+ v = in[V + 4*4] << SHIFT(24) |
+ in[V + 5*4] << SHIFT(16) |
+ in[V + 6*4] << SHIFT(8) |
+ in[V + 7*4] << SHIFT(0);
+ y0 = in[Y0 + 4*4] << SHIFT(24) |
+ in[Y1 + 4*4] << SHIFT(16) |
+ in[Y0 + 5*4] << SHIFT(8) |
+ in[Y1 + 5*4] << SHIFT(0);
+ y1 = in[Y0 + 6*4] << SHIFT(24) |
+ in[Y1 + 6*4] << SHIFT(16) |
+ in[Y0 + 7*4] << SHIFT(8) |
+ in[Y1 + 7*4] << SHIFT(0);
+
+ ((u_int*)yp)[2] = y0;
+ ((u_int*)yp)[3] = y1;
+ ((u_int*)up)[1] = u;
+ ((u_int*)vp)[1] = v;
+
+ in += istride;
+ yp += stride;
+ up += stride >> 1;
+ vp += stride >> 1;
+
+ /* do the 2nd (y only instead of yuv) line */
+
+ y0 = in[Y0 + 0*4] << SHIFT(24) |
+ in[Y1 + 0*4] << SHIFT(16) |
+ in[Y0 + 1*4] << SHIFT(8) |
+ in[Y1 + 1*4] << SHIFT(0);
+ y1 = in[Y0 + 2*4] << SHIFT(24) |
+ in[Y1 + 2*4] << SHIFT(16) |
+ in[Y0 + 3*4] << SHIFT(8) |
+ in[Y1 + 3*4] << SHIFT(0);
+
+ ((u_int*)yp)[0] = y0;
+ ((u_int*)yp)[1] = y1;
+
+ y0 = in[Y0 + 4*4] << SHIFT(24) |
+ in[Y1 + 4*4] << SHIFT(16) |
+ in[Y0 + 5*4] << SHIFT(8) |
+ in[Y1 + 5*4] << SHIFT(0);
+ y1 = in[Y0 + 6*4] << SHIFT(24) |
+ in[Y1 + 6*4] << SHIFT(16) |
+ in[Y0 + 7*4] << SHIFT(8) |
+ in[Y1 + 7*4] << SHIFT(0);
+
+ ((u_int*)yp)[2] = y0;
+ ((u_int*)yp)[3] = y1;
+
+ in += istride;
+ yp += stride;
+ }
+}
+
+void MeteorCIFGrabber::saveblks(const u_char* in, int is)
+{
+ u_char* crv = crvec_;
+ int off = framesize_;
+ u_char* lum = frame_;
+ u_char* chm = lum + off;
+ off >>= 2;
+
+ crv += vstart_ * blkw_ + hstart_;
+ lum += vstart_ * outw_ * 16 + hstart_ * 16;
+ chm += vstart_ * (outw_ >> 1) * 8 + hstart_ * 8;
+
+ int skip = hstart_ + (blkw_ - hstop_);
+
+ for (int y = vstart_; y < vstop_; ++y) {
+ const u_char* nin = in;
+ for (int x = hstart_; x < hstop_; ++x) {
+ int s = *crv++;
+ if ((s & CR_SEND) != 0)
+ saveblk(in, lum, chm, chm + off, outw_, is);
+
+ in += 32;
+ lum += 16;
+ chm += 8;
+ }
+ crv += skip;
+ lum += 15 * outw_ + skip * 16;
+ chm += 7 * (outw_ >> 1) + skip * 8;
+ in = nin + 16 * is;
+ }
}

View file

@ -1,113 +0,0 @@
--- vw.cc.orig Mon Jul 22 13:12:31 1996
+++ vw.cc Tue Dec 17 16:35:57 1996
@@ -248,8 +248,6 @@
/*
* Wrap segment in an ximage
*/
- image_ = XCreateImage(dpy_, Tk_Visual(tk), Tk_Depth(tk), ZPixmap,
- 0, (char*)0, width_, height_, 8, 0);
image_->obdata = (char*)&shminfo_;
image_->data = shminfo_.shmaddr;
}
--- Tcl.h.orig Sat Mar 16 13:14:34 1996
+++ Tcl.h Tue Dec 17 14:39:45 1996
@@ -53,7 +53,8 @@
inline int dark() const { return (tcl_ == 0); }
inline Tcl_Interp* interp() const { return (tcl_); }
inline char* result() const { return (tcl_->result); }
- inline void result(const char* p) { tcl_->result = (char*)p; }
+ inline void result(const char* p, Tcl_FreeProc* freeProc = TCL_STATIC)
+ { Tcl_SetResult(tcl_, (char *)p, freeProc); }
void resultf(const char* fmt, ...);
inline void CreateCommand(const char* cmd, Tcl_CmdProc* cproc,
ClientData cd = 0,
--- source.cc.orig Thu Apr 4 07:05:45 1996
+++ source.cc Tue Dec 17 14:38:44 1996
@@ -251,8 +251,7 @@
return (TCL_OK);
}
if (strcmp(argv[1], "addr") == 0) {
- strcpy(wrk, InetNtoa(addr_));
- tcl.result(wrk);
+ tcl.result(InetNtoa(addr_), TCL_DYNAMIC);
return (TCL_OK);
}
if (strcmp(argv[1], "srcid") == 0) {
--- Tcl.cc.orig Tue Apr 2 20:53:27 1996
+++ Tcl.cc Tue Dec 17 15:45:30 1996
@@ -65,6 +65,7 @@
{
instance_.tcl_ = tcl;
instance_.application_ = application;
+ Tcl_Init(tcl);
}
void Tcl::evalc(const char* s)
@@ -162,6 +163,8 @@
Tcl& tcl = Tcl::instance();
if (!tcl.dark())
tcl.DeleteCommand(name_);
+ if (name_ != 0)
+ delete name_;
TclObject** p;
for (p = &all_; *p != this; p = &(*p)->next_)
;
@@ -197,8 +200,9 @@
void TclObject::setproc(const char* s)
{
Tcl& tcl = Tcl::instance();
- if (name_ != 0 && !tcl.dark()) {
- tcl.DeleteCommand(name_);
+ if (name_ != 0) {
+ if (!tcl.dark())
+ tcl.DeleteCommand(name_);
delete name_;
}
int n = strlen(s);
--- decoder.cc.orig Wed Jun 26 17:28:40 1996
+++ decoder.cc Tue Dec 17 15:55:42 1996
@@ -74,6 +74,8 @@
Decoder::~Decoder()
{
+ if (rvts_)
+ delete rvts_;
}
int Decoder::command(int argc, const char*const* argv)
--- encoder-h261.cc.orig Mon Jul 22 13:12:53 1996
+++ encoder-h261.cc Tue Dec 17 16:01:47 1996
@@ -118,6 +118,7 @@
void setq(int q);
protected:
H261Encoder(int ft);
+ ~H261Encoder();
int encode(const VideoFrame*, const u_int8_t *crvec);
int command(int argc, const char*const* argv);
void encode_blk(const short* blk, const char* lm);
@@ -211,6 +212,16 @@
}
}
+H261Encoder::~H261Encoder()
+{
+ for (int q = 0; q < 32; ++q) {
+ if (llm_[q] != 0)
+ delete llm_[q];
+ if (clm_[q] != 0)
+ delete clm_[q];
+ }
+}
+
H261PixelEncoder::H261PixelEncoder() : H261Encoder(FT_YUV_CIF)
{
quant_required_ = 0;
@@ -631,7 +642,7 @@
if (q < 8) {
register int cmin = 0, cmax = 0;
register short* bp = lblk;
- register i, j;
+ register int i, j;
// Y U and V blocks
for (i = 6; --i >= 0; ) {

View file

@ -1,117 +0,0 @@
--- net.cc.orig 1997/10/07 19:07:01
+++ net.cc 1998/01/26 22:21:41
@@ -163,46 +163,48 @@
{
int cc = ::send(fd, (char*)buf, len, 0);
if (cc < 0) {
- switch (errno) {
+ /*
+ * Due to a bug in kern/uipc_socket.c, on several
+ * systems, datagram sockets incorrectly persist
+ * in an error state on receipt of any ICMP
+ * error. This causes unicast connection
+ * rendezvous problems, and worse, multicast
+ * transmission problems because several systems
+ * incorrectly send port unreachables for
+ * multicast destinations. Our work around
+ * is to call getsockopt(..., SO_ERROR, ...)
+ * which resets so->so_error.
+ *
+ * This bug originated at CSRG in Berkeley
+ * and was present in the BSD Reno networking
+ * code release. It has since been fixed
+ * in OSF-3.x. It is know to remain
+ * in 4.4BSD and AIX-4.1.3.
+ *
+ * A fix is to change the following lines from
+ * kern/uipc_socket.c:
+ *
+ * if (so_serror)
+ * snderr(so->so_error);
+ *
+ * to:
+ *
+ * if (so->so_error) {
+ * error = so->so_error;
+ * so->so_error = 0;
+ * splx(s);
+ * goto release;
+ * }
+ *
+ */
+ int err, errlen = sizeof(err), savederrno;
+
+ savederrno = errno;
+ getsockopt(fd, SOL_SOCKET, SO_ERROR, &err,
+ &errlen);
+ switch (savederrno) {
case ECONNREFUSED:
/* no one listening at some site - ignore */
-#if defined(__osf__) || defined(_AIX)
- /*
- * Due to a bug in kern/uipc_socket.c, on several
- * systems, datagram sockets incorrectly persist
- * in an error state on receipt of an ICMP
- * port-unreachable. This causes unicast connection
- * rendezvous problems, and worse, multicast
- * transmission problems because several systems
- * incorrectly send port unreachables for
- * multicast destinations. Our work around
- * is to simply close and reopen the socket
- * (by calling reset() below).
- *
- * This bug originated at CSRG in Berkeley
- * and was present in the BSD Reno networking
- * code release. It has since been fixed
- * in 4.4BSD and OSF-3.x. It is know to remain
- * in AIX-4.1.3.
- *
- * A fix is to change the following lines from
- * kern/uipc_socket.c:
- *
- * if (so_serror)
- * snderr(so->so_error);
- *
- * to:
- *
- * if (so->so_error) {
- * error = so->so_error;
- * so->so_error = 0;
- * splx(s);
- * goto release;
- * }
- *
- */
- reset();
-#endif
break;
case ENETUNREACH:
@@ -217,7 +219,7 @@
* icmp unreachable, so we should be able to
* send now.
*/
- (void)::send(ssock_, (char*)buf, len, 0);
+ (void)::send(fd, (char*)buf, len, 0);
break;
default:
@@ -264,12 +266,14 @@
}
int cc = ::sendmsg(ssock_, (msghdr*)&mh, 0);
if (cc < 0) {
- switch (errno) {
+ int err, errlen = sizeof(err), savederrno;
+
+ savederrno = errno;
+ getsockopt(ssock_, SOL_SOCKET, SO_ERROR, &err,
+ &errlen);
+ switch (savederrno) {
case ECONNREFUSED:
/* no one listening at some site - ignore */
-#if defined(__osf__) || defined(_AIX)
- reset();
-#endif
break;
case ENETUNREACH:

View file

@ -1,421 +0,0 @@
diff -ubwr ./grabber.cc /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/grabber.cc
--- grabber.cc Tue Feb 6 00:02:00 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/grabber.cc Fri Apr 10 15:36:42 1998
@@ -69,6 +69,7 @@
hstart_(0), hstop_(0),
framebase_(0), frame_(0),
inw_(0), inh_(0), outw_(0), outh_(0),
+ threshold_(48),
target_(0), tx_(0)
{
bps(128);
@@ -122,6 +123,10 @@
}
return (TCL_OK);
}
+ if (strcmp(argv[1], "threshold") == 0) {
+ threshold_ = 8*atoi(argv[2]);
+ return (TCL_OK);
+ }
if (strcmp(argv[1], "fps") == 0) {
/*XXX assume value in range */
fps(atoi(argv[2]));
diff -ubwr ./grabber.h /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/grabber.h
--- grabber.h Tue Feb 6 00:02:00 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/grabber.h Fri Apr 10 15:37:28 1998
@@ -87,6 +87,7 @@
int vstop_;
int hstart_;
int hstop_;
+ int threshold_ ; // when a block is changed ? (was constant 48)
u_int framesize_;
u_char* framebase_;
@@ -160,19 +161,19 @@
rb -= _rs << 3; \
\
int center = 0; \
- if (left >= 48 && x > 0) { \
+ if (left >= threshold_ && x > 0) { \
crv[-1] = CR_MOTION|CR_SEND; \
center = 1; \
} \
- if (right >= 48 && x < w - 1) { \
+ if (right >= threshold_ && x < w - 1) { \
crv[1] = CR_MOTION|CR_SEND; \
center = 1; \
} \
- if (bottom >= 48 && y < blkh_ - 1) { \
+ if (bottom >= threshold_ && y < blkh_ - 1) { \
crv[w] = CR_MOTION|CR_SEND; \
center = 1; \
} \
- if (top >= 48 && y > 0) { \
+ if (top >= threshold_ && y > 0) { \
crv[-w] = CR_MOTION|CR_SEND; \
center = 1; \
} \
diff -ubwr ./ui-ctrlmenu.tcl /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-ctrlmenu.tcl
--- ui-ctrlmenu.tcl Thu Jun 27 01:27:48 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-ctrlmenu.tcl Fri Apr 10 16:39:04 1998
@@ -390,11 +394,15 @@
-relief raised -command transmit \
-anchor w -variable transmitButtonState -font $f \
-state disabled -highlightthickness 0
+ checkbutton $w.freeze -text "Freeze" \
+ -relief raised -command "grabber freeze \$freeze" \
+ -anchor w -variable freeze -font $f \
+ -highlightthickness 0
button $w.release -text "Release" \
-relief raised -command release_device \
-font $f -highlightthickness 0
- pack $w.send $w.release -fill both
+ pack $w.send $w.release $w.freeze -fill both
}
proc doNothing { args } {
@@ -434,8 +442,9 @@
frame $w.bps
scale $w.bps.scale -orient horizontal -font $f \
- -showvalue 0 -from 10 -to [option get . maxbw Vic] \
+ -showvalue 0 -from 1 -to [option get . maxbw Vic] \
-command "set_bps $w.bps.value" -width 12 \
+ -sliderlength 20 \
-relief groove
label $w.bps.value -font $f -width 8 -anchor w
@@ -443,6 +452,7 @@
scale $w.fps.scale -font $f -orient horizontal \
-showvalue 0 -from 1 -to 30 \
-command "set_fps $w.fps.value" -width 12 \
+ -sliderlength 20 \
-relief groove
label $w.fps.value -font $f -width 8 -anchor w
@@ -564,7 +574,7 @@
proc select_device device {
global transmitButton sizeButtons portButton formatButtons \
videoFormat defaultFormat lastDevice defaultPort inputPort \
- transmitButtonState
+ transmitButtonState typeButton
#
# Remember settings of various controls for previous device
@@ -607,6 +617,11 @@
} else {
$portButton configure -state disabled
}
+ if [device_supports $device type *] {
+ $typeButton configure -state normal
+ } else {
+ $typeButton configure -state disabled
+ }
insert_grabber_panel [$device nickname]
@@ -774,7 +789,8 @@
build.encoder_options $w.options
build.device $w.device
build.port $w.port
- pack $w.device $w.port $w.options -fill x
+ build.type $w.type
+ pack $w.device $w.port $w.type $w.options -fill x
}
proc build.encoder_options w {
@@ -1172,6 +1188,9 @@
global inputPort inputType portButton typeButton
if { [$portButton cget -state] == "normal" } {
$grabber port $inputPort
+ }
+ if { [$typeButton cget -state] == "normal" } {
+ $grabber type $inputType
}
setFillRate
update
diff -ubwr ./ui-grabber.tcl /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-grabber.tcl
--- ui-grabber.tcl Fri Jun 21 04:39:35 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-grabber.tcl Fri Apr 10 13:54:42 1998
@@ -39,65 +39,93 @@
# called foo-1, foo-2, etc. and you'll only need build.foo
#
+proc build.meteor w {
+#
+# The meteor has the same controls as the slicvideo, so just call that
+# routine to build the controls.
+
+ build.slicvideo $w
+}
+
+proc build.bktr w {
+ build.slicvideo $w
+}
+
proc build.slicvideo w {
set f [smallfont]
+# set f "-*-helvetica-medium-r-normal--*-100-75-75-*-*-*-*"
label $w.title -text "Grabber"
frame $w.f -relief sunken -borderwidth 2
frame $w.f.h -relief flat
- label $w.f.h.label -font $f -anchor e -text "Hue"
-
- scale $w.f.h.scale -orient horizontal -width 12 -length 20 \
- -relief groove -showvalue 0 -from -128 -to 127 \
- -command "grabber set HUE"
- pack $w.f.h.label $w.f.h.scale -side left -fill x -expand 1
-
- frame $w.f.ll -relief flat
-
- label $w.f.ll.label -font $f -text "Luma" -anchor s
-
- label $w.f.ll.clabel -font $f -text "Contrast" -anchor s
-
- label $w.f.ll.blabel -font $f -text "Brightness" -anchor s
- pack $w.f.ll.clabel $w.f.ll.label $w.f.ll.blabel \
+ frame $w.f.h.c
+ label $w.f.h.c.l1 -font $f -anchor e -text "Chan:"
+ mk.entry $w.f.h.c do_chan "20"
+ $w.f.h.c.entry configure -relief sunken -width 5
+ bind $w.f.h.c.entry <Return> "grabber chan \[$w.f.h.c.entry get\]"
+ pack $w.f.h.c.l1 $w.f.h.c.entry -side top
+
+ global ths
+ scale $w.f.h.ths \
+-orient horizontal -width 12 -length 60 -relief groove -sliderlength 6 \
+ -showvalue 0 -from 1 -to 10 \
+ -command "grabber threshold" -label Thre
+ $w.f.h.ths set 6
+ # the actual scale is multiplied by 8
+ scale $w.f.h.scale \
+-orient horizontal -width 12 -length 100 -relief groove \
+ -showvalue 0 -from -128 -to 127 \
+ -command "grabber hue" -label Hue
+ pack $w.f.h.c \
+ $w.f.h.ths \
+ $w.f.h.scale \
-side left -fill x -expand 1
+# frame $w.f.ll -relief flat
+# label $w.f.ll.label -font $f -text "Luma" -anchor s
+# label $w.f.ll.clabel -font $f -text "Contrast" -anchor s
+# label $w.f.ll.blabel -font $f -text "Brightness" -anchor s
+# pack $w.f.ll.clabel $w.f.ll.label $w.f.ll.blabel \
+# -side left -fill x -expand 1
+
frame $w.f.l -relief flat
- scale $w.f.l.cscale -orient horizontal -width 12 -relief groove \
+ scale $w.f.l.cscale \
+-orient horizontal -width 12 -length 100 -relief groove \
-showvalue 0 -from 0 -to 127 \
- -command "grabber set LUMA_CONTRAST"
+ -label "Contrast" \
+ -command "grabber contrast"
- scale $w.f.l.bscale -orient horizontal -width 12 -relief groove \
+ scale $w.f.l.bscale \
+-orient horizontal -width 12 -length 100 -relief groove \
-showvalue 0 -from 0 -to 255 \
- -command "grabber set LUMA_BRIGHTNESS"
+ -command "grabber brightness" -label "Brightness"
pack $w.f.l.cscale $w.f.l.bscale -side left -fill x -expand 1
- frame $w.f.cl -relief flat
-
- label $w.f.cl.label -font $f -text "Chroma" -anchor n
-
- label $w.f.cl.glabel -font $f -text "Gain" -anchor n
-
- label $w.f.cl.slabel -font $f -text "Saturation" -anchor n
- pack $w.f.cl.glabel $w.f.cl.label $w.f.cl.slabel \
- -side left -fill x -expand 1
+# frame $w.f.cl -relief flat
+# label $w.f.cl.label -font $f -text "Chroma" -anchor n
+# label $w.f.cl.glabel -font $f -text "Gain" -anchor n
+# label $w.f.cl.slabel -font $f -text "Saturation" -anchor n
+# pack $w.f.cl.glabel $w.f.cl.label $w.f.cl.slabel \
+# -side left -fill x -expand 1
frame $w.f.c -relief flat
- scale $w.f.c.gscale -orient horizontal -width 12 -relief groove \
+ scale $w.f.c.gscale \
+-orient horizontal -width 12 -length 100 -relief groove \
-showvalue 0 -from 0 -to 255 \
- -command "grabber set CHROMA_GAIN"
+ -command "grabber uvgain" -label "Chr. Gain"
- scale $w.f.c.sscale -orient horizontal -width 12 -relief groove \
+ scale $w.f.c.sscale \
+-orient horizontal -width 12 -length 100 -relief groove \
-showvalue 0 -from 0 -to 127 \
- -command "grabber set CHROMA_SATURATION"
+ -command "grabber saturation" -label "Saturation"
pack $w.f.c.gscale $w.f.c.sscale -side left -fill x -expand 1
- pack $w.f.h $w.f.ll $w.f.l $w.f.c $w.f.cl \
- -fill x -expand 1 -padx 1m
+ # pack $w.f.h $w.f.ll $w.f.l $w.f.c $w.f.cl
+ pack $w.f.h $w.f.l $w.f.c -fill x -expand 1 -padx 1m
pack $w.title $w.f -fill x -expand 1
@@ -109,6 +137,10 @@
$w.f.c.sscale set 64
}
+#
+# STILL image-grabber (?)
+#
+
proc build.still w {
set f [smallfont]
@@ -131,6 +163,10 @@
$lastDevice file $s
}
+#
+# quickcam grabber
+#
+
proc build.qcam {w} {
global qcamwindow
@@ -190,3 +226,118 @@
set qcamwindow(setwbal) "$w.f.s.s.wbal.scale set"
set qcamwindow(setbpp) "set qcambpp"
}
+
+#
+# X11 Grabber controls
+#
+proc x11grabUpdatePos {x y w h} {
+
+ global x11grabcontrols
+ set w $x11grabcontrols
+
+ if {[string compare $x [$w.x11grab.row1.pos.x.e get]] != 0} {
+ $w.x11grab.row1.pos.x.e delete 0 end
+ $w.x11grab.row1.pos.x.e insert 0 $x
+ }
+ if {[string compare $y [$w.x11grab.row1.pos.y.e get]] != 0} {
+ $w.x11grab.row1.pos.y.e delete 0 end
+ $w.x11grab.row1.pos.y.e insert 0 $y
+ }
+ if {[string compare $w [$w.x11grab.row1.pos.w.e get]] != 0} {
+ $w.x11grab.row1.pos.w.e delete 0 end
+ $w.x11grab.row1.pos.w.e insert 0 $w
+ }
+ if {[string compare $h [$w.x11grab.row1.pos.h.e get]] != 0} {
+ $w.x11grab.row1.pos.h.e delete 0 end
+ $w.x11grab.row1.pos.h.e insert 0 $h
+ }
+}
+
+proc x11cmd.update.geo w {
+ grabber fixed [$w.row.x get] [$w.row.y get]
+}
+
+proc x11cmd.fixed {} {
+ global x11Source x11grabcontrols
+ set w $x11grabcontrols
+ $w.label configure -text "$x11Source"
+ if [winfo exists $w.row] {
+ destroy $w.row
+ }
+ frame $w.row
+ pack append $w.row \
+ [label $w.row.xl -text "X:" -width 2 -anchor e] {left filly} \
+ [entry $w.row.x -relief flat -width 4] {left filly} \
+ [label $w.row.yl -text "Y:" -width 2 -anchor e] {left filly} \
+ [entry $w.row.y -relief flat -width 4] {left filly}
+ bind $w.row.x <Return> "x11cmd.update.geo $w"
+ bind $w.row.y <Return> "x11cmd.update.geo $w"
+
+ pack $w.row -after $w.label
+}
+
+proc x11cmd.pointer {} {
+ global x11Source x11grabcontrols
+ set w $x11grabcontrols
+ $w.label configure -text "$x11Source"
+ if [winfo exists $w.row] {
+ destroy $w.row
+ }
+ frame $w.row
+ pack append $w.row \
+ [button $w.row.s -text "Follow pointer" ] { left filly }
+ pack $w.row -after $w.label
+}
+
+proc x11cmd.window {} {
+ global x11Source x11grabcontrols
+ puts "x11cmd -- x11Source $x11Source"
+ set w $x11grabcontrols
+ $w.label configure -text "$x11Source"
+ if [winfo exists $w.row] {
+ destroy $w.row
+ }
+ frame $w.row
+ pack append $w.row \
+ [button $w.row.s -text "Select window" ] { left filly }
+ pack $w.row -after $w.label
+}
+
+proc build.x11 w {
+ global x11grabcontrols x11Source
+ set f [smallfont]
+
+ label $w.title -text "X11 Grabber controls"
+ frame $w.x11grab -relief sunken -borderwidth 2
+ set x11grabcontrols $w.x11grab
+ set x11Source "Fixed"
+ set w1 $w.x11grab
+
+
+ # luigi
+ set m $w1.menu
+ set m1 $m.m1
+ menubutton $w1.menu -menu $m1 -text "Source:" \
+ -relief raised -width 7 -font $f
+ label $w1.label -width 6 -font $f
+ frame $w1.row
+ menu $m1
+ $m1 add radiobutton -label Fixed \
+ -state active \
+ -command "x11cmd.fixed" -font $f -variable x11Source
+# $m1 add radiobutton -label Pointer \
+# -command "x11cmd.pointer" -font $f -variable x11Source
+# $m1 add radiobutton -label Window \
+# -command "x11cmd.window" -font $f -variable x11Source
+
+ pack append $w1 \
+ $w1.menu {left} \
+ $w1.label {left} \
+ $w1.row {left}
+
+ pack $w $w.title $w1 -fill x -expand 1
+
+ x11cmd.fixed
+}
+
+### end of file ###
diff -ubwr ./ui-resource.tcl /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-resource.tcl
--- ui-resource.tcl Wed Apr 3 02:33:56 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-resource.tcl Fri Apr 10 21:11:56 1998
@@ -140,7 +140,7 @@
option add Vic.useHardwareDecode false startupFile
option add Vic.infoHighlightColor LightYellow2 startupFile
option add Vic.useJPEGforH261 false startupFile
- option add Vic.stillGrabber false startupFile
+ option add Vic.stillGrabber true startupFile ; # XXX was false
option add Vic.siteDropTime "300" startupFile
#

File diff suppressed because it is too large Load diff

View file

@ -1,20 +0,0 @@
--- iohandler.cc.orig Sun Nov 28 19:12:12 1999
+++ iohandler.cc Sun Nov 28 19:12:50 1999
@@ -132,7 +132,7 @@
}
#else
- Tk_CreateFileHandler((ClientData)fd, mask, callback, (ClientData)this);
+ Tk_CreateFileHandler(fd, mask, callback, (ClientData)this);
#endif
}
@@ -151,7 +151,7 @@
}
#else
if (fd_ >= 0) {
- Tk_DeleteFileHandler((ClientData)fd_);
+ Tk_DeleteFileHandler(fd_);
fd_ = -1;
}
#endif

View file

@ -1,11 +0,0 @@
--- transcoder-jpeg.cc.orig Sun Nov 28 19:15:40 1999
+++ transcoder-jpeg.cc Sun Nov 28 19:15:57 1999
@@ -138,7 +138,7 @@
rval = target_->consume(df);
// update CR vec
- register blkno;
+ register int blkno;
int s;
for (blkno = 0; blkno < crvlen_; blkno++) {
s = CR_STATE(crvec_[blkno]);

View file

@ -1,11 +0,0 @@
--- color-true.cc.orig Sun Nov 28 19:17:03 1999
+++ color-true.cc Sun Nov 28 19:17:23 1999
@@ -180,7 +180,7 @@
protected:
TrueColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = TrueMethod(WindowRenderer::dither_null); }
+ virtual void disable() { method_ = TrueMethod(&WindowRenderer::dither_null); }
TrueMethod method_;
void map_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-dither.cc.orig Sun Nov 28 19:18:04 1999
+++ color-dither.cc Sun Nov 28 19:18:21 1999
@@ -177,7 +177,7 @@
protected:
DitherColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = PseudoWindowRenderer::dither_null; }
+ virtual void disable() { method_ = &PseudoWindowRenderer::dither_null; }
DitherMethod method_;
void dither_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-ed.cc.orig Sun Nov 28 19:18:55 1999
+++ color-ed.cc Sun Nov 28 19:19:12 1999
@@ -180,7 +180,7 @@
protected:
EDColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = PseudoWindowRenderer::dither_null; }
+ virtual void disable() { method_ = &PseudoWindowRenderer::dither_null; }
EDMethod method_;
void dither_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-quant.cc.orig Sun Nov 28 19:19:44 1999
+++ color-quant.cc Sun Nov 28 19:20:01 1999
@@ -92,7 +92,7 @@
protected:
QuantColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = PseudoWindowRenderer::dither_null; }
+ virtual void disable() { method_ = &PseudoWindowRenderer::dither_null; }
QuantMethod method_;
void map_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-hi.cc.orig Sun Nov 28 19:20:41 1999
+++ color-hi.cc Sun Nov 28 19:21:03 1999
@@ -164,7 +164,7 @@
protected:
HiColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = HiMethod(WindowRenderer::dither_null); }
+ virtual void disable() { method_ = HiMethod(&WindowRenderer::dither_null); }
HiMethod method_;
void map_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-gray.cc.orig Sun Nov 28 19:21:35 1999
+++ color-gray.cc Sun Nov 28 19:21:47 1999
@@ -82,7 +82,7 @@
}
protected:
virtual void update();
- virtual void disable() { method_ = PseudoWindowRenderer::dither_null; }
+ virtual void disable() { method_ = &PseudoWindowRenderer::dither_null; }
GrayMethod method_;
};

View file

@ -1,20 +0,0 @@
--- color-mono.cc.orig Sun Nov 28 19:22:19 1999
+++ color-mono.cc Sun Nov 28 19:22:51 1999
@@ -200,7 +200,7 @@
~MonoColorModel();
virtual int alloc_grays();
virtual int command(int argc, const char*const* argv);
- inline white(void) { return (white_); }
+ inline int white(void) { return (white_); }
private:
int white_;
};
@@ -250,7 +250,7 @@
protected:
MonoColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = WindowDitherer::dither_null; }
+ virtual void disable() { method_ = &WindowDitherer::dither_null; }
MonoMethod method_;
void dither(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,20 +0,0 @@
--- jpeg/jpeg.cc.orig Sun Nov 28 19:23:29 1999
+++ jpeg/jpeg.cc Sun Nov 28 19:23:52 1999
@@ -139,7 +139,7 @@
dct_unbias_ = 1;
short *sp = (short *)frm_;
- for (register i = 0; i < n / (BMB * 64) ; i++) {
+ for (register int i = 0; i < n / (BMB * 64) ; i++) {
*sp = DCT_GRAY;
sp += 64;
*sp = DCT_GRAY;
@@ -173,7 +173,7 @@
dct_unbias_ = 1;
short *sp = (short*)frm_;
- for (register i = 0; i < n / (BMB * 64) ; i++) {
+ for (register int i = 0; i < n / (BMB * 64) ; i++) {
*sp = DCT_GRAY;
sp += 64;
*sp = DCT_GRAY;

View file

@ -1,11 +0,0 @@
--- p64/mkhuff.cc.orig Sun Nov 28 19:24:42 1999
+++ p64/mkhuff.cc Sun Nov 28 19:25:49 1999
@@ -45,6 +45,8 @@
extern "C" {
int getopt(int, char * const *, const char *);
}
+#else
+#include <unistd.h>
#endif
#define HUFFSTRINGS
#include "p64-huff.h"

View file

@ -1,11 +0,0 @@
--- Makefile.in.orig Thu Jan 27 18:52:29 2000
+++ Makefile.in Thu Jan 27 18:53:00 2000
@@ -40,7 +40,7 @@
all: $(ALL)
.cc.o:
- rm -f $@; $(C++) -o $@ -c $(CFLAGS) $*.cc
+ rm -f $@; $(C++) -pedantic -o $@ -c $(CFLAGS) $*.cc
.c.o:
rm -f $@; $(CC) -o $@ -c $(CFLAGS) $*.c

View file

@ -0,0 +1,12 @@
--- configure.in.org Mon May 7 15:30:01 2001
+++ configure.in Mon May 7 15:31:32 2001
@@ -72,8 +72,7 @@
if test -r /usr/include/linux/videodev.h ; then
V_OBJ_GRABBER="video/grabber-video4linux.o $V_OBJ_GRABBER"
fi
-#if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; then
-if test -r /usr/local/lib/libspigot.a ; then
+if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; 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"

View file

@ -0,0 +1,56 @@
--- configure.in.tk.org Tue May 8 08:42:54 2001
+++ configure.in.tk Tue May 8 08:56:43 2001
@@ -32,13 +32,13 @@
echo "'$d' is not a directory"
exit 1
fi
- V_INCLUDE_TCL=-I$d/include
- if test ! -r $d/include/tcl.h ; then
+ V_INCLUDE_TCL=-I$d/include/tcl8.3/
+ if test ! -r $d/include/tcl8.3/tcl.h ; then
echo "can't find tcl.h in $d/include"
exit 1
fi
- places="$d/lib/libtcl8.0.so \
- $d/lib/libtcl8.0.a \
+ places="$d/lib/libtcl83.so \
+ $d/lib/libtcl83.a \
$d/lib/libtcl.so \
$d/lib/libtcl.a"
V_LIB_TCL=FAIL
@@ -52,7 +52,7 @@
echo "can't find libtcl.a in $d/lib"
exit 1
fi
- places="$d/lib/tcl-8.0 \
+ places="$d/lib/tcl8.3 \
$d/lib/tcl8.0 \
$d/lib/tcl"
V_LIBRARY_TCL=FAIL
@@ -190,13 +190,13 @@
echo "'$d' is not a directory"
exit 1
fi
- V_INCLUDE_TK=-I$d/include
- if test ! -r $d/include/tk.h ; then
+ V_INCLUDE_TK=-I$d/include/tk8.3
+ if test ! -r $d/include/tk8.3/tk.h ; then
echo "can't find tk.h in $d/include"
exit 1
fi
- places="$d/lib/libtk8.0.so \
- $d/lib/libtk8.0.a \
+ places="$d/lib/libtk83.so \
+ $d/lib/libtk83.a \
$d/lib/libtk.so \
$d/lib/libtk.a"
V_LIB_TK=FAIL
@@ -210,7 +210,7 @@
echo "can't find libtk.a in $d/lib"
exit 1
fi
- places="$d/lib/tk8.0 \
+ places="$d/lib/tk8.3 \
$d/lib/tk"
V_LIBRARY_TK=FAIL
for dir in $places; do

View file

@ -0,0 +1,25 @@
--- tcl/ui-ctrlmenu.tcl.org Thu May 10 08:44:51 2001
+++ tcl/ui-ctrlmenu.tcl Thu May 10 08:48:19 2001
@@ -408,16 +408,16 @@
-relief raised -command transmit \
-anchor w -variable transmitButtonState -font $f \
-state disabled -highlightthickness 0
-# checkbutton $w.freeze -text "Freeze" \
-# -relief raised -command "grabber freeze \$freeze" \
-# -anchor w -variable freeze -font $f \
-# -highlightthickness 0
+ checkbutton $w.freeze -text "Freeze" \
+ -relief raised -command "grabber freeze \$freeze" \
+ -anchor w -variable freeze -font $f \
+ -highlightthickness 0
button $w.release -text "Release" \
-relief raised -command release_device \
-font $f -highlightthickness 0
-# pack $w.send $w.release $w.freeze -fill both
- pack $w.send $w.release -fill both
+ pack $w.send $w.release $w.freeze -fill both
+# pack $w.send $w.release -fill both
}
proc doNothing { args } {

View file

@ -0,0 +1,11 @@
--- tcl/ui-resource.tcl.org Mon May 7 16:17:03 2001
+++ tcl/ui-resource.tcl Mon May 7 16:17:29 2001
@@ -153,7 +153,7 @@
option add Vic.infoHighlightColor LightYellow2 startupFile
option add Vic.useJPEGforH261 false startupFile
option add Vic.useHardwareComp false startupFile
- option add Vic.stillGrabber false startupFile
+ option add Vic.stillGrabber true startupFile ; # XXX was false
option add Vic.siteDropTime "300" startupFile
option add Vic.quality "0" startupFile

View file

@ -6,17 +6,26 @@
#
PORTNAME= vic
PORTVERSION= 2.8
CATEGORIES= mbone tk82
MASTER_SITES= ftp://ftp.ee.lbl.gov/conferencing/vic/
DISTFILES= vicsrc-2.8.tar.gz
PORTVERSION= 2.8.1.1.3
CATEGORIES= mbone tk83
MASTER_SITES= http://www-mice.cs.ucl.ac.uk/multimedia/software/vic/2.8ucl-1.1.3/
DISTNAME= ${PORTNAME}-2.8ucl-1.1.3
MAINTAINER= fenner@FreeBSD.org
LIB_DEPENDS= tk82.1:${PORTSDIR}/x11-toolkits/tk82
LIB_DEPENDS= tk83.1:${PORTSDIR}/x11-toolkits/tk83
BUILD_DEPENDS= ${LOCALBASE}/lib/libuclmmbase.a:${PORTSDIR}/devel/uclmmbase
WRKSRC= ${WRKDIR}/vic-2.8ucl-1.1.3/vic
USE_AUTOCONF= yes
USE_X_PREFIX= yes
CONFIGURE_ARGS= -x-libraries=${PREFIX}/lib \
-x-includes=${PREFIX}/include \
-without-ucltcl \
-with-tcl=${LOCALBASE} \
-without-ucltk \
-with-tk=${LOCALBASE}
MAN1= vic.1
post-install:

View file

@ -1 +1 @@
MD5 (vicsrc-2.8.tar.gz) = 1f9ae3fbf8e9e47e6539c0621964542d
MD5 (vic-2.8ucl-1.1.3.tar.gz) = 55e792aa8f370fc15a197bb1b910a704

View file

@ -0,0 +1,20 @@
--- Makefile.in.orig Thu Feb 17 21:59:08 2000
+++ Makefile.in Tue May 8 09:06:28 2001
@@ -85,7 +85,7 @@
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/libuclmmbase.a -lm
+ codec/tmndec/libh263.a codec/tmn-x/libh263coder.a /usr/local/lib/libuclmmbase.a -lm
INCLUDE = $(INCLUDE_MISC) $(INCLUDE_GRABBER) $(INCLUDE_TK) $(INCLUDE_TCL) \
$(INCLUDE_X11) $(MD_INC) -Icodec/jpeg -Icodec/p64 -I.
DEFINE = @V_DEFINE@ -DED_YBITS=$(ED_YBITS) -DSIGRET=@V_SIGRET@ -DNLAYER=8
@@ -329,7 +329,7 @@
chown bin @prefix@/bin/vic
chgrp bin @prefix@/bin/vic
chmod 555 @prefix@/bin/vic
- cp vic.1 @prefix@/man/vic.1
+ cp vic.1 @prefix@/man/man1/vic.1
cp histtolut @prefix@/bin/histtolut
chown bin @prefix@/bin/histtolut
chgrp bin @prefix@/bin/histtolut

View file

@ -0,0 +1,10 @@
--- Tcl.cpp.org Mon May 7 15:55:17 2001
+++ Tcl.cpp Mon May 7 15:55:34 2001
@@ -66,6 +66,7 @@
{
instance_.tcl_ = tcl;
instance_.application_ = application;
+ Tcl_Init(tcl);
}
void Tcl::evalc(const char* s)

View file

@ -1,236 +0,0 @@
--- configure.in.orig Fri Jun 21 01:36:47 1996
+++ configure.in Mon Oct 12 23:20:51 1998
@@ -34,7 +34,7 @@
V_LIB_GRABBER=""
V_INCLUDE_GRABBER=""
-V_OBJ_GRABBER=""
+V_OBJ_GRABBER="grabber-x11.cc"
V_LIB_XIL=""
V_OBJ_XIL=""
@@ -69,7 +69,7 @@
if test -r /usr/include/machine/ioctl_meteor.h ; then
V_OBJ_GRABBER="$V_OBJ_GRABBER grabber-meteor.o"
fi
-if test -r /usr/local/lib/libspigot.a ; then
+if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; then
V_OBJ_GRABBER="$V_OBJ_GRABBER grabber-spigot.o"
V_LIB_GRABBER="$V_LIB_GRABBER -lspigot"
V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
@@ -87,9 +87,6 @@
V_OBJ_GRABBER="$V_OBJ_GRABBER grabber-qcam.o"
V_DEFINE="$V_DEFINE -DQCAMDEV"
fi
-if test -r /usr/include/linux/scc.h -o -r /usr/include/machine/scc.h ; then
- V_OBJ_GRABBER="$V_OBJ_GRABBER grabber-scc.o"
-fi
vpix_dir=/usr/src/local/vfc-1.0
vpix_lib=$vpix_dir/vfc_lib
if test -d /import/VideoPix ; then
@@ -227,6 +224,9 @@
*-*-netbsd*)
V_TARCMD="tar -h -c -f"
V_LIB="$V_LIB -L/usr/local/lib"
+ ;;
+*-*-freebsd*)
+ V_STATIC=""
;;
*-*-hpux*)
V_CCOPT="-O"
--- configure.in.tk.orig Thu May 16 01:06:05 1996
+++ configure.in.tk Tue Sep 9 11:01:36 1997
@@ -12,8 +12,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.2.so \
+ $d/lib/libtcl8.2.a \
$d/lib/libtcl.so \
$d/lib/libtcl.a"
V_LIB_TCL=FAIL
@@ -27,7 +27,7 @@
echo "can't find libtcl.a in $d/lib"
exit 1
fi
- places="$d/lib/tcl7.5 \
+ places="$d/lib/tcl8.2 \
$d/lib/tcl"
V_LIBRARY_TCL=FAIL
for dir in $places; do
@@ -44,13 +44,14 @@
AC_TEST_CPP([#include <tcl.h>], V_INCLUDE_TCL="", V_INCLUDE_TCL=FAIL)
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.2 \
+ /usr/src/local/tcl8.2 \
+ /import/tcl/include/tcl8.2 \
$prefix/include \
$x_includes/tk \
$x_includes \
/usr/local/include \
+ /usr/local/include/tcl8.2 \
/usr/contrib/include \
/usr/include"
for dir in $places; do
@@ -64,7 +65,7 @@
exit 1
fi
fi
- AC_CHECK_LIB(tcl7.5, main, V_LIB_TCL="-ltcl7.5", V_LIB_TCL="FAIL")
+ AC_CHECK_LIB(tcl8.2, main, V_LIB_TCL="-ltcl8.2", V_LIB_TCL="FAIL")
if test "$V_LIB_TCL" = FAIL; then
echo "checking for libtcl.a"
places="\
@@ -73,13 +74,13 @@
/usr/contrib/lib \
/usr/local/lib \
/usr/lib \
- $PWD/../tcl7.5 \
- /usr/src/local/tcl7.5 \
- /import/tcl/lib/tcl7.5 \
+ $PWD/../tcl8.2 \
+ /usr/src/local/tcl8.2 \
+ /import/tcl/lib/tcl8.2 \
"
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/libtcl82.so -o -r $dir/libtcl82.a; then
+ V_LIB_TCL="-L$dir -ltcl82"
break
fi
if test -r $dir/libtcl.so -o -r $dir/libtcl.a; then
@@ -98,13 +99,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.2 \
+ /usr/contrib/lib/tcl8.2 \
+ /usr/lib/tcl8.2 \
+ /usr/lib/tk/tcl8.2 \
+ /import/tcl/lib/tcl8.2 \
+ $prefix/lib/tcl8.2 \
+ $x_libraries/tcl8.2 \
/usr/local/lib/tcl \
/usr/lib/tcl \
/usr/lib/tk/tcl \
@@ -138,8 +139,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.2.so \
+ $d/lib/libtk8.2.a \
$d/lib/libtk.so \
$d/lib/libtk.a"
V_LIB_TK=FAIL
@@ -153,7 +154,7 @@
echo "can't find libtk.a in $d/lib"
exit 1
fi
- places="$d/lib/tk4.1 \
+ places="$d/lib/tk8.2 \
$d/lib/tk"
V_LIBRARY_TK=FAIL
for dir in $places; do
@@ -170,18 +171,19 @@
AC_TEST_CPP([#include <tk.h>], V_INCLUDE_TK="", V_INCLUDE_TK=FAIL)
if test "$V_INCLUDE_TK" = FAIL; then
echo "checking for tk.h"
- V_INCLUDE_TK=""
+ V_INCLUDE_TK="FAIL"
places="\
$prefix/include \
/usr/local/include \
+ /usr/local/include/tk8.2 \
/usr/contrib/include \
/usr/include/tcl \
/usr/include\
$x_includes/tk \
$x_includes \
- $PWD/../tk4.1 \
- /usr/src/local/tk4.1 \
- /import/tcl/include/tk4.1 \
+ $PWD/../tk8.2 \
+ /usr/src/local/tk8.2 \
+ /import/tcl/include/tk8.2 \
"
for dir in $places; do
if test -r $dir/tk.h ; then
@@ -194,7 +196,7 @@
exit 1
fi
fi
- AC_CHECK_LIB(tk4.1, main, V_LIB_TK="-ltk4.1", V_LIB_TK="FAIL")
+ AC_CHECK_LIB(tk8.2, main, V_LIB_TK="-ltk8.2", V_LIB_TK="FAIL")
if test "$V_LIB_TK" = FAIL; then
echo "checking for libtk.a"
places="/usr/local/lib \
@@ -202,13 +204,13 @@
/usr/lib \
/usr/lib/tk \
/import/tcl/lib \
- $PWD/../tk4.1 \
- /usr/src/local/tk4.1 \
+ $PWD/../tk8.2 \
+ /usr/src/local/tk8.2 \
$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/libtk82.so -o -r $dir/libtk82.a; then
+ V_LIB_TK="-L$dir -ltk82"
break
fi
if test -r $dir/libtk.so -o -r $dir/libtk.a; then
@@ -227,15 +229,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.2 \
+ /usr/contrib/lib/tk8.2 \
+ /usr/lib/tk8.2 \
+ /usr/lib/tk/tk8.2 \
+ /import/tcl/lib/tk8.2 \
+ $prefix/lib/tk8.2 \
+ $x_libraries/tk8.2 \
+ $PWD/../tk8.2/library \
+ /usr/src/local/tk8.2/library \
/usr/local/lib/tk \
/usr/lib/tk \
/usr/lib/tk/tk \
--- Makefile.in.orig Mon Jul 22 09:32:53 1996
+++ Makefile.in Tue Sep 9 11:01:36 1997
@@ -303,7 +303,7 @@
chown bin @prefix@/bin/vic
chgrp bin @prefix@/bin/vic
chmod 555 @prefix@/bin/vic
- cp vic.1 @prefix@/man/vic.1
+ cp vic.1 @prefix@/man/man1/vic.1
cp histtolut @prefix@/bin/histtolut
chown bin @prefix@/bin/histtolut
chgrp bin @prefix@/bin/histtolut

View file

@ -1,30 +0,0 @@
*** grabber-spigot.cc.orig Fri Nov 1 16:11:59 1996
--- grabber-spigot.cc Fri Nov 1 16:17:36 1996
***************
*** 202,212 ****
hstart_ = 1;
hstop_ = blkw_ - 1;
int voff = (outh_ - inh_) / 2;
- hwrap_ = outw_ - inw_ ;
int hoff = hwrap_ / 2;
loff_ = outw_ * voff + hoff;
coff_ = (outw_ >> 1) * (voff >> 1) + (hoff >> 1);
hskip_ = 0;
break;
case f_411:
--- 202,215 ----
hstart_ = 1;
hstop_ = blkw_ - 1;
+ {
int voff = (outh_ - inh_) / 2;
int hoff = hwrap_ / 2;
+
+ hwrap_ = outw_ - inw_ ;
loff_ = outw_ * voff + hoff;
coff_ = (outw_ >> 1) * (voff >> 1) + (hoff >> 1);
+ }
hskip_ = 0;
break;
case f_411:

View file

@ -1,14 +0,0 @@
--- grabber-qcam.cc.orig Sat Nov 2 23:22:46 1996
+++ grabber-qcam.cc Sat Nov 2 23:23:34 1996
@@ -84,6 +84,11 @@
#define CIF_HEIGHT 288
/*XXX*/
+#ifndef QC_MAX_CONTRAST
+#define QC_MAX_CONTRAST 255
+#endif
+
+/*XXX*/
#define VOLATILE volatile
class QcamGrabber : public Grabber {

View file

@ -1,21 +0,0 @@
--- main.cc.orig Mon Jul 22 13:12:22 1996
+++ main.cc Tue Sep 9 10:25:36 1997
@@ -177,7 +177,7 @@
else {
Tk_Window tk = t.tkmain();
Tk_Uid uid = Tk_GetUid((char*)argv[1]);
- XFontStruct* p = Tk_GetFontStruct(t.interp(), tk, uid);
+ Tk_Font p = Tk_GetFont(t.interp(), tk, uid);
t.result(p != 0 ? "1" : "0");
}
return (TCL_OK);
@@ -425,6 +425,9 @@
#endif
signal(SIGINT, ciao);
signal(SIGTERM, ciao);
+#ifdef __FreeBSD__
+ signal(SIGSYS, (sig_t)noXShm);
+#endif
#ifdef WIN32
TkSetPlatformInit(TkPlatformInit);

View file

@ -1,136 +0,0 @@
--- tkStripchart.c.orig Tue Sep 9 11:00:42 1997
+++ tkStripchart.c Tue Sep 9 10:52:30 1997
@@ -148,7 +148,7 @@
int scrollrequired;
int guarantee_draw;
int grow_up;
- XFontStruct *fontPtr; /* Information about text font, or NULL. */
+ Tk_Font tkfont; /* Information about text font, or NULL. */
XColor *textColorPtr; /* Color for drawing text. */
GC textGC; /* GC for drawing text. */
XColor *tickColorPtr; /* Color for drawing ticks. */
@@ -257,7 +257,7 @@
{TK_CONFIG_SYNONYM, "-fg", "stripcolor", 0,
0, 0, 0},
{TK_CONFIG_FONT, "-font", "font", "Font",
- DEF_STRIPCHART_FONT, Tk_Offset(Stripchart, fontPtr),
+ DEF_STRIPCHART_FONT, Tk_Offset(Stripchart, tkfont),
0},
{TK_CONFIG_BOOLEAN, "-guaranteedrawing", "guaranteedrawing",
"Guaranteedrawing", DEF_GUARANTEE_DRAW,
@@ -570,8 +570,8 @@
if (StripchartPtr->value != NULL)
free(StripchartPtr->value);
- if (StripchartPtr->fontPtr != NULL)
- Tk_FreeFontStruct(StripchartPtr->fontPtr);
+ if (StripchartPtr->tkfont != NULL)
+ Tk_FreeFont(StripchartPtr->tkfont);
if (StripchartPtr->textColorPtr != NULL)
Tk_FreeColor(StripchartPtr->textColorPtr);
@@ -631,7 +631,7 @@
Tk_SetBackgroundFromBorder(StripchartPtr->tkwin, StripchartPtr->border);
- gcValues.font = StripchartPtr->fontPtr->fid;
+ gcValues.font = Tk_FontId(StripchartPtr->tkfont);
gcValues.foreground = StripchartPtr->textColorPtr->pixel;
newGC = Tk_GetGC(StripchartPtr->tkwin, GCForeground|GCFont, &gcValues);
if (StripchartPtr->textGC != None && StripchartPtr->tkwin) {
@@ -692,8 +692,11 @@
{
int tt = hasatitle(StripchartPtr);
int bd = StripchartPtr->borderWidth;
- int lineHeight = StripchartPtr->fontPtr->ascent +
- StripchartPtr->fontPtr->descent;
+ Tk_FontMetrics fm;
+ int lineHeight;
+
+ Tk_GetFontMetrics(StripchartPtr->tkfont, &fm);
+ lineHeight = fm.ascent + fm.descent;
Tk_GeometryRequest(StripchartPtr->tkwin,
2 * (bd + PADDING) + StripchartPtr->num_strips *
@@ -726,11 +729,13 @@
/*
* Variable declarations used in the title drawing routines
*/
- XFontStruct *fp = StripchartPtr->fontPtr;
- XCharStruct bbox;
- int x, dummy;
- int lineHeight = StripchartPtr->fontPtr->ascent +
- StripchartPtr->fontPtr->descent;
+ Tk_Font tkf = StripchartPtr->tkfont;
+ int x;
+ Tk_FontMetrics fm;
+ int lineHeight;
+
+ Tk_GetFontMetrics(tkf, &fm);
+ lineHeight = fm.ascent + fm.descent;
StripchartPtr->displaybits &= ~REDRAW_PENDING;
if ((StripchartPtr->tkwin == NULL) || !Tk_IsMapped(tkwin))
@@ -747,18 +752,17 @@
* space. Otherwise left justified and clipped on the right.
*/
if (tt && StripchartPtr->displaybits & DISPLAY_TITLE) {
- XTextExtents(fp, StripchartPtr->title,
- strlen(StripchartPtr->title),
- &dummy, &dummy, &dummy, &bbox);
- if (bbox.lbearing + bbox.rbearing < Tk_Width(tkwin) - 2 * bd)
- x = (Tk_Width(tkwin) - bbox.lbearing - bbox.rbearing)/2;
+ int width = Tk_TextWidth(tkf, StripchartPtr->title,
+ strlen(StripchartPtr->title));
+ if (width < Tk_Width(tkwin) - 2 * bd)
+ x = (Tk_Width(tkwin) - width)/2;
else
x = bd + PADDING;
XClearArea(Tk_Display(tkwin), Tk_WindowId(tkwin), bd, bd,
Tk_Width(tkwin) - 2 * bd, lineHeight + PADDING, False);
XDrawString(Tk_Display(tkwin), Tk_WindowId(tkwin),
- StripchartPtr->textGC, x, fp->max_bounds.ascent + bd,
+ StripchartPtr->textGC, x, fm.ascent + bd, /*XXX no max_bounds */
StripchartPtr->title, strlen(StripchartPtr->title));
}
/*
@@ -1057,7 +1061,8 @@
DrawStripi(Stripchart* SPtr, int i)
{
Tk_Window tkwin = SPtr->tkwin;
- int lineHeight = SPtr->fontPtr->ascent + SPtr->fontPtr->descent;
+ Tk_FontMetrics fm;
+ int lineHeight;
int x = SPtr->borderWidth + PADDING + (i - 1) * SPtr->strip_width;
int y = SPtr->borderWidth + PADDING +
hasatitle(SPtr) * (lineHeight + PADDING);
@@ -1066,6 +1071,9 @@
double maxv = SPtr->max_value;
double minv = SPtr->min_value;
+ Tk_GetFontMetrics(SPtr->tkfont, &fm);
+ lineHeight = fm.ascent + fm.descent;
+
if (i < 1 || i > SPtr->num_strips)
return;
@@ -1136,7 +1144,8 @@
ScrollStrips(Stripchart* SPtr)
{
Tk_Window tkwin = SPtr->tkwin;
- int lineHeight = SPtr->fontPtr->ascent + SPtr->fontPtr->descent;
+ Tk_FontMetrics fm;
+ int lineHeight;
int src_x = SPtr->borderWidth + PADDING + SPtr->strip_width;
int src_y = SPtr->borderWidth + PADDING +
hasatitle(SPtr) * (lineHeight + PADDING);
@@ -1144,6 +1153,8 @@
int dest_y = src_y;
int w = (SPtr->num_strips - 1) * SPtr->strip_width;
int h = SPtr->max_height;
+
+ Tk_GetFontMetrics(SPtr->tkfont, &fm);
XCopyArea(Tk_Display(tkwin), Tk_WindowId(tkwin), Tk_WindowId(tkwin),
Tk_GetGC(tkwin, 0, NULL), src_x, src_y, w, h, dest_x, dest_y);

View file

@ -1,757 +0,0 @@
--- grabber-meteor.cc.orig Fri Jun 26 11:25:55 1998
+++ grabber-meteor.cc Fri Jun 26 11:18:53 1998
@@ -43,7 +43,6 @@
*
*/
-/*#define FRAME_CNTS /* print frame counts and fps when device stops -- debug */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -51,16 +50,16 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
-#ifdef FRAME_CNTS
-#include <sys/time.h>
-#endif
#include "grabber.h"
+#include "crdef.h"
#include "Tcl.h"
#include "device-input.h"
#include "module.h"
+#include "bsd-endian.h"
#include <machine/ioctl_meteor.h>
+#include <machine/ioctl_bt848.h>
/*XXX*/
#define NTSC_WIDTH 320
@@ -72,62 +71,78 @@
class MeteorGrabber : public Grabber {
- public:
- MeteorGrabber(const char* name, const char* format);
+ public:
+ MeteorGrabber(const char* name);
virtual ~MeteorGrabber();
+ virtual int command(int argc, const char*const* argv);
+ virtual void fps(int);
virtual void start();
virtual void stop();
- virtual void fps(int);
- protected:
- virtual int command(int argc, const char*const* argv);
- virtual int capture();
virtual int grab();
+ protected:
void format();
- void setsize();
+ virtual void setsize() = 0;
+ void suppress(const u_char* in, int istride);
+ virtual void saveblks(const u_char* in, int istride) = 0;
+ void set_size_meteor(int w, int h);
int video_format_; /* video input format: NTSC or PAL */
int dev_; /* device fd */
int port_; /* video input port */
- int coder_format_; /* 411, 422, or cif */
u_int basewidth_; /* Height of frame to be captured */
u_int baseheight_; /* Width of frame to be captured */
u_int decimate_; /* division of base sizes */
volatile u_int* pyuv_; /* pointer to yuv data */
-#ifdef FRAME_CNTS
- struct meteor_counts cnts_; /* pointer to counters */
- double start_time_;
-#endif
+ int tuner_ ; /* tuner device... */
};
-static const int f_411 = 0; /* coder_format_s */
-static const int f_422 = 1;
-static const int f_cif = 2;
+class Meteor422Grabber : public MeteorGrabber {
+ public:
+ Meteor422Grabber(const char* name);
+ protected:
+ void setsize();
+ void saveblk(const u_char* in, u_char* yp, u_char* up, u_char* vp,
+ int stride, int istride);
+ void saveblks(const u_char* in, int istride);
+};
+
+class MeteorCIFGrabber : public MeteorGrabber {
+ public:
+ MeteorCIFGrabber(const char* name);
+ protected:
+ void setsize();
+ void saveblk(const u_char* in, u_char* yp, u_char* up, u_char* vp,
+ int stride, int istride);
+ void saveblks(const u_char* in, int istride);
+};
class MeteorDevice : public InputDevice {
- public:
+ public:
MeteorDevice(const char* nickname, const char* devname, int free);
virtual int command(int argc, const char*const* argv);
- protected:
+ protected:
const char* name_;
};
class MeteorScanner {
- public:
+ public:
MeteorScanner(const int n);
};
+
static MeteorScanner find_meteor_devices(4);
MeteorScanner::MeteorScanner(const int n)
{
- char* devname_template = "/dev/meteor%d";
- char* nickname_template = "Matrox Meteor %d";
+ static char *d[] = { "/dev/bktr%d", "/dev/meteor%d", NULL };
+ char *nickname_template = "meteor-%d";
for(int i = 0; i < n; i++) {
- char *devname = new char[strlen(devname_template) + 3];
+ for (int j = 0 ; d[j] != NULL ; j++) {
+ char *devname = new char[strlen(d[j]) + 3];
char *nickname = new char[strlen(nickname_template) + 3];
+ sprintf(devname, d[j], i);
sprintf(nickname, nickname_template, i + 1);
- sprintf(devname, devname_template, i);
if(access(devname, R_OK) == 0) {
int fd = open(devname, O_RDONLY);
if(fd < 0) {
@@ -140,8 +155,9 @@
delete nickname;
delete devname;
}
+ }
+ }
}
-}
MeteorDevice::MeteorDevice(const char* nickname, const char *devname, int free):
InputDevice(nickname), name_(devname)
@@ -149,6 +165,7 @@
if(free)
attributes_ = "\
format {422 411} \
+type {pal ntsc secam auto} \
size {large normal small cif} \
port {RCA Port-1 Port-2 Port-3 S-Video RGB}";
else
@@ -160,7 +177,10 @@
Tcl& tcl = Tcl::instance();
if ((argc == 3) && (strcmp(argv[1], "open") == 0)) {
TclObject* o = 0;
- o = new MeteorGrabber(name_, argv[2]);
+ if (strcmp(argv[2], "422") == 0)
+ o = new Meteor422Grabber(name_);
+ else if (strcmp(argv[2], "cif") == 0)
+ o = new MeteorCIFGrabber(name_);
if (o != 0)
tcl.result(o->name());
return (TCL_OK);
@@ -168,19 +188,15 @@
return (InputDevice::command(argc, argv));
}
-MeteorGrabber::MeteorGrabber(const char* name, const char* format)
+MeteorGrabber::MeteorGrabber(const char* name)
{
- coder_format_ = -1;
- if(!strcmp(format, "411")) coder_format_ = f_411;
- if(!strcmp(format, "422")) coder_format_ = f_422;
- if(!strcmp(format, "cif")) coder_format_ = f_cif;
- if(coder_format_ == -1) {
- fprintf(stderr,
- "vic: MeteorGrabber: unsupported format: %s\n",
- format);
- abort();
- }
-
+ int devnum;
+ if (sscanf(name, "/dev/bktr%d", &devnum) == 1) {
+ char *tunerdev = new char[strlen(name) + 3];
+ sprintf(tunerdev, "/dev/tuner%d", devnum);
+ tuner_ = open(tunerdev, O_RDONLY);
+ } else
+ tuner_ = -1;
dev_ = open(name, O_RDONLY);
if (dev_ == -1) {
status_ = -1;
@@ -203,52 +219,33 @@
if (dev_ != -1) {
close(dev_);
}
+ if (tuner_ != -1)
+ close(tuner_);
}
-void MeteorGrabber::setsize()
+void MeteorGrabber::set_size_meteor(int w, int h)
{
struct meteor_geomet geom;
- geom.rows = (baseheight_ / decimate_) &~0xf; /* 0xf, ugh! */
- geom.columns = (basewidth_ / decimate_) &~0xf;
+ geom.rows = h &~0xf; /* 0xf, ugh! */
+ geom.columns = w &~0xf;
geom.frames = 1;
- geom.oformat = METEOR_GEO_UNSIGNED;
- geom.oformat |= METEOR_GEO_YUV_422;
+ geom.oformat = METEOR_GEO_UNSIGNED | METEOR_GEO_YUV_PACKED;
/*
* If we can get by with only reading even fields, then by all
* means do so.
*/
unsigned short status;
- ioctl(dev_, METEORSTATUS, &status);
- if(status & METEOR_STATUS_HCLK) { /* do we have a source? */
- /* No source, assume ntsc*/
+ // ioctl(dev_, METEORSTATUS, &status);
+ if ( video_format_ == METEOR_FMT_NTSC ) {
if(geom.rows <= NTSC_HEIGHT && geom.columns <= NTSC_WIDTH)
geom.oformat |= METEOR_GEO_EVEN_ONLY;
} else {
- if(status & METEOR_STATUS_FIDT) { /* is it pal or ntsc? */
- /* 60 hz */
- if(geom.rows<=NTSC_HEIGHT && geom.columns<=NTSC_WIDTH)
- geom.oformat |= METEOR_GEO_EVEN_ONLY;
- } else { /* 50 hz */
if(geom.rows<=PAL_HEIGHT && geom.columns<=PAL_WIDTH)
geom.oformat |= METEOR_GEO_EVEN_ONLY;
}
- }
-
if(ioctl(dev_, METEORSETGEO, &geom) < 0)
perror("vic: METERSETGEO: ");
-
- switch(coder_format_) {
- case f_422:
- set_size_422(geom.columns, geom.rows);
- break;
- case f_cif:
- case f_411:
- set_size_411(geom.columns, geom.rows);
- break;
- }
-
- allocref(); /* allocate reference frame */
}
void MeteorGrabber::format()
@@ -285,11 +282,6 @@
baseheight_ = PAL_HEIGHT * 2;
basewidth_ = PAL_WIDTH * 2;
}
-
- if(coder_format_ == f_cif) {
- baseheight_ = CIF_HEIGHT * 2;
- basewidth_ = CIF_WIDTH * 2;
- }
setsize();
}
@@ -299,15 +291,6 @@
format();
int cmd = METEOR_CAP_SINGLE;
ioctl(dev_, METEORCAPTUR, (char*)&cmd);
-#ifdef FRAME_CNTS
- cnts_.fifo_errors = 0;
- cnts_.dma_errors = 0;
- cnts_.frames_captured = 0;
- cnts_.even_fields_captured = 0;
- cnts_.odd_fields_captured = 0;
- ioctl(dev_, METEORSCOUNT, &cnts_);
- start_time_ = gettimeofday();
-#endif
cmd = METEOR_CAP_CONTINOUS;
ioctl(dev_, METEORCAPTUR, (char*)&cmd);
@@ -319,19 +302,6 @@
int cmd = METEOR_CAP_STOP_CONT;
ioctl(dev_, METEORCAPTUR, (char*)&cmd);
-#ifdef FRAME_CNTS
- double endtime = gettimeofday() ;
- ioctl(dev_, METEORGCOUNT, &cnts_);
- int diff = (int)((endtime-start_time_) * 1e-6 + 0.5);
- printf("frames = %d, even fields = %d, odd fields = %d,\n\
-fifo errors = %d, dma errors = %d, seconds = %d",
- cnts_.frames_captured, cnts_.even_fields_captured,
- cnts_.odd_fields_captured, cnts_.fifo_errors, cnts_.dma_errors,
- diff);
- if(diff)
- printf(",fps = %d", cnts_.frames_captured/diff);
- printf("\n");
-#endif
Grabber::stop();
}
@@ -345,15 +315,15 @@
int MeteorGrabber::command(int argc, const char*const* argv)
{
+ Tcl& tcl = Tcl::instance();
if (argc == 3) {
if (strcmp(argv[1], "decimate") == 0) {
int dec = atoi(argv[2]);
- Tcl& tcl = Tcl::instance();
if (dec <= 0) {
tcl.resultf("%s: divide by zero", argv[0]);
return (TCL_ERROR);
}
- if (dec != decimate_) {
+ if ((u_int)dec != decimate_) {
decimate_ = dec;
if(running_) {
stop();
@@ -362,7 +332,8 @@
}
}
return (TCL_OK);
- } else if (strcmp(argv[1], "port") == 0) {
+ }
+ if (strcmp(argv[1], "port") == 0) {
int p = port_;
if(!strcmp(argv[2], "RCA")) p = METEOR_INPUT_DEV0;
if(!strcmp(argv[2], "Port-1")) p = METEOR_INPUT_DEV1;
@@ -377,7 +348,30 @@
ioctl(dev_, METEORSINPUT, &port_);
}
return (TCL_OK);
- } else if (strcmp(argv[1], "format") == 0 ||
+ }
+ if (strcmp(argv[1], "freeze") == 0) {
+ int cmd = METEOR_CAP_CONTINOUS ;
+ if ( atoi(argv[2]) != 0 )
+ cmd = METEOR_CAP_STOP_CONT;
+ ioctl(dev_, METEORCAPTUR, (char*)&cmd);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "chan") == 0) {
+ int p = port_;
+ int c = atoi(argv[2]);
+ if (c > 0 && c < 199)
+ p = METEOR_INPUT_DEV1 ;
+ else
+ p = METEOR_INPUT_DEV0 ;
+ if (p != port_) {
+ port_ = p;
+ ioctl(dev_, METEORSINPUT, &port_);
+ }
+ if (p == METEOR_INPUT_DEV1)
+ ioctl(tuner_, TVTUNER_SETCHNL, &c);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "format") == 0 ||
strcmp(argv[1], "type") == 0) {
if (strcmp(argv[2], "auto") == 0)
video_format_ = METEOR_FMT_AUTOMODE;
@@ -390,14 +384,35 @@
if (running_)
format();
return (TCL_OK);
- } else if (strcmp(argv[1], "contrast") == 0) {
- contrast(atof(argv[2]));
- return (TCL_OK);
+ }
+ if (strcmp(argv[1], "brightness") == 0) {
+ u_char val = atoi(argv[2]);
+ ioctl(dev_, METEORSBRIG, &val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "contrast") == 0) {
+ u_char val = atoi(argv[2]);
+ ioctl(dev_, METEORSCONT, &val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "hue") == 0) {
+ char val = atoi(argv[2]);
+ ioctl(dev_, METEORSHUE, &val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "saturation") == 0) {
+ u_char val = atoi(argv[2]);
+ ioctl(dev_, METEORSCSAT, &val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "uvgain") == 0) {
+ u_char val = atoi(argv[2]);
+ ioctl(dev_, METEORSCHCV, &val);
+ return (TCL_OK);
}
} else if (argc == 2) {
if (strcmp(argv[1], "format") == 0 ||
strcmp(argv[1], "type") == 0) {
- Tcl& tcl = Tcl::instance();
switch (video_format_) {
case METEOR_FMT_AUTOMODE:
@@ -423,54 +438,316 @@
return (TCL_OK);
}
+ if (strcmp(argv[1], "brightness") == 0) {
+ u_char val;
+ ioctl(dev_, METEORGBRIG, &val);
+ tcl.resultf("%d", (unsigned int)val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "contrast") == 0) {
+ u_char val;
+ ioctl(dev_, METEORGCONT, &val);
+ tcl.resultf("%d", (int)val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "hue") == 0) {
+ char val;
+ ioctl(dev_, METEORGHUE, &val);
+ tcl.resultf("%d", (int)val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "saturation") == 0) {
+ u_char val;
+ ioctl(dev_, METEORGCSAT, &val);
+ tcl.resultf("%d", (int)val);
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "uvgain") == 0) {
+ u_char val;
+ ioctl(dev_, METEORGCHCV, &val);
+ tcl.resultf("%d", (int)val);
+ return (TCL_OK);
+ }
}
return (Grabber::command(argc, argv));
}
-int MeteorGrabber::capture()
-{
- if(pyuv_ == 0) return 0;
-
- volatile u_int* py = pyuv_;
- volatile u_int* pu = (u_int *)((u_int)py + (u_int)framesize_);
- volatile u_int* pv = (u_int *)((u_int)pu + (framesize_ >> 1));
- u_int* lum = (u_int *)frame_;
- u_int* uoff = (u_int *)((u_int)lum + (u_int)framesize_);
- int f422 = coder_format_ == f_422;
- u_int* voff = (u_int *)((u_int)uoff +
- (u_int)(framesize_>>(f422?1:2)));
- int numc = ((basewidth_/decimate_) &~0xf) >> 3;
-
- for (int row = 0; row < (((baseheight_/decimate_)&~0xf) >> 1); row++) {
- for(int col = 0; col < numc; col++) {
- *lum++ = *py++;
- *lum++ = *py++;
- *uoff++ = *pu++;
- *voff++ = *pv++;
- }
- for(col = 0; col < numc; col++) {
- *lum++ = *py++;
- *lum++ = *py++;
- if(f422) { /* only copy odd in 4:2:2 format */
- *uoff++ = *pu++;
- *voff++ = *pv++;
-
- }
- }
- if(!f422) { /* skip odd if 4:1:1 or cif format */
- pu += numc;
- pv += numc;
- }
- }
- return 1;
+#define U 0
+#define Y0 1
+#define V 2
+#define Y1 3
+
+/*
+ * define these for REPLENISH macro used below
+ */
+#define DIFF4(in, frm, v) \
+ v += (in)[Y0] - (frm)[0]; \
+ v += (in)[Y1] - (frm)[1]; \
+ v += (in)[Y0+4] - (frm)[2]; \
+ v += (in)[Y1+4] - (frm)[3];
+
+#define DIFFLINE(in, frm, left, center, right) \
+ DIFF4(in + 0*8, frm + 0*4, left); \
+ DIFF4(in + 1*8, frm + 1*4, center); \
+ DIFF4(in + 2*8, frm + 2*4, center); \
+ DIFF4(in + 3*8, frm + 3*4, right); \
+ if (right < 0) \
+ right = -right; \
+ if (left < 0) \
+ left = -left; \
+ if (center < 0) \
+ center = -center;
+
+void MeteorGrabber::suppress(const u_char* devbuf, int is)
+{
+ const u_char* start = frame_ + 16 * vstart_ * outw_ + 16 * hstart_;
+ REPLENISH(devbuf, start, is, 2,
+ hstart_, hstop_, vstart_, vstop_);
}
int MeteorGrabber::grab()
{
- if (capture() == 0)
- return (0);
- suppress(frame_);
- saveblks(frame_);
- YuvFrame f(media_ts(), frame_, crvec_, outw_, outh_);
+ if (pyuv_ == 0)
+ return 0;
+
+ int istride = inw_ * 2;
+ suppress((u_char*)pyuv_, istride);
+ saveblks((u_char*)pyuv_, istride);
+ u_int32_t ts = media_ts();
+ YuvFrame f(ts, frame_, crvec_, outw_, outh_);
return (target_->consume(&f));
+}
+
+Meteor422Grabber::Meteor422Grabber(const char* name)
+ : MeteorGrabber(name)
+{
+}
+
+MeteorCIFGrabber::MeteorCIFGrabber(const char* name)
+ : MeteorGrabber(name)
+{
+}
+
+void Meteor422Grabber::setsize()
+{
+ int w = basewidth_ / decimate_;
+ int h = baseheight_ / decimate_;
+ set_size_meteor(w, h);
+ set_size_422(w, h);
+}
+
+inline void
+Meteor422Grabber::saveblk(const u_char* in,
+ u_char* yp, u_char* up, u_char* vp, int stride, int istride)
+{
+ for (int i = 16; --i >= 0; ) {
+ /*
+ * Each iteration of this loop grabs 16 Ys & 8 U/Vs.
+ */
+ register u_int y0, y1, u, v;
+
+ u = in[U + 0*4] << SHIFT(24) |
+ in[U + 1*4] << SHIFT(16) |
+ in[U + 2*4] << SHIFT(8) |
+ in[U + 3*4] << SHIFT(0);
+ v = in[V + 0*4] << SHIFT(24) |
+ in[V + 1*4] << SHIFT(16) |
+ in[V + 2*4] << SHIFT(8) |
+ in[V + 3*4] << SHIFT(0);
+ y0 = in[Y0 + 0*4] << SHIFT(24) |
+ in[Y1 + 0*4] << SHIFT(16) |
+ in[Y0 + 1*4] << SHIFT(8) |
+ in[Y1 + 1*4] << SHIFT(0);
+ y1 = in[Y0 + 2*4] << SHIFT(24) |
+ in[Y1 + 2*4] << SHIFT(16) |
+ in[Y0 + 3*4] << SHIFT(8) |
+ in[Y1 + 3*4] << SHIFT(0);
+
+ ((u_int*)yp)[0] = y0;
+ ((u_int*)yp)[1] = y1;
+ ((u_int*)up)[0] = u;
+ ((u_int*)vp)[0] = v;
+
+ u = in[U + 4*4] << SHIFT(24) |
+ in[U + 5*4] << SHIFT(16) |
+ in[U + 6*4] << SHIFT(8) |
+ in[U + 7*4] << SHIFT(0);
+ v = in[V + 4*4] << SHIFT(24) |
+ in[V + 5*4] << SHIFT(16) |
+ in[V + 6*4] << SHIFT(8) |
+ in[V + 7*4] << SHIFT(0);
+ y0 = in[Y0 + 4*4] << SHIFT(24) |
+ in[Y1 + 4*4] << SHIFT(16) |
+ in[Y0 + 5*4] << SHIFT(8) |
+ in[Y1 + 5*4] << SHIFT(0);
+ y1 = in[Y0 + 6*4] << SHIFT(24) |
+ in[Y1 + 6*4] << SHIFT(16) |
+ in[Y0 + 7*4] << SHIFT(8) |
+ in[Y1 + 7*4] << SHIFT(0);
+
+ ((u_int*)yp)[2] = y0;
+ ((u_int*)yp)[3] = y1;
+ ((u_int*)up)[1] = u;
+ ((u_int*)vp)[1] = v;
+
+ in += istride;
+ yp += stride;
+ up += stride >> 1;
+ vp += stride >> 1;
+ }
+}
+
+void Meteor422Grabber::saveblks(const u_char* devbuf, int is)
+{
+ u_char* crv = crvec_;
+ int off = framesize_;
+ u_char* lum = frame_;
+ u_char* chm = lum + off;
+ off >>= 1;
+ int stride = 15 * outw_;
+ int istride = is * 15;
+ for (int y = 0; y < blkh_; ++y) {
+ for (int x = 0; x < blkw_; ++x) {
+ int s = *crv++;
+ if ((s & CR_SEND) != 0)
+ saveblk(devbuf, lum, chm, chm + off, outw_, is);
+
+ devbuf += 32;
+ lum += 16;
+ chm += 8;
+ }
+ lum += stride;
+ chm += stride >> 1;
+ devbuf += istride;
+ }
+}
+
+void MeteorCIFGrabber::setsize()
+{
+ int w = basewidth_ / decimate_;
+ int h = baseheight_ / decimate_;
+ set_size_meteor(w, h);
+ set_size_cif(w, h);
+}
+
+inline void
+MeteorCIFGrabber::saveblk(const u_char* in,
+ u_char* yp, u_char* up, u_char* vp, int stride, int istride)
+{
+ for (int i = 8; --i >= 0; ) {
+ /*
+ * Each iteration of this loop grabs 32 Ys & 16 U/Vs.
+ */
+ register u_int y0, y1, u, v;
+
+ u = in[U + 0*4] << SHIFT(24) |
+ in[U + 1*4] << SHIFT(16) |
+ in[U + 2*4] << SHIFT(8) |
+ in[U + 3*4] << SHIFT(0);
+ v = in[V + 0*4] << SHIFT(24) |
+ in[V + 1*4] << SHIFT(16) |
+ in[V + 2*4] << SHIFT(8) |
+ in[V + 3*4] << SHIFT(0);
+ y0 = in[Y0 + 0*4] << SHIFT(24) |
+ in[Y1 + 0*4] << SHIFT(16) |
+ in[Y0 + 1*4] << SHIFT(8) |
+ in[Y1 + 1*4] << SHIFT(0);
+ y1 = in[Y0 + 2*4] << SHIFT(24) |
+ in[Y1 + 2*4] << SHIFT(16) |
+ in[Y0 + 3*4] << SHIFT(8) |
+ in[Y1 + 3*4] << SHIFT(0);
+
+ ((u_int*)yp)[0] = y0;
+ ((u_int*)yp)[1] = y1;
+ ((u_int*)up)[0] = u;
+ ((u_int*)vp)[0] = v;
+
+ u = in[U + 4*4] << SHIFT(24) |
+ in[U + 5*4] << SHIFT(16) |
+ in[U + 6*4] << SHIFT(8) |
+ in[U + 7*4] << SHIFT(0);
+ v = in[V + 4*4] << SHIFT(24) |
+ in[V + 5*4] << SHIFT(16) |
+ in[V + 6*4] << SHIFT(8) |
+ in[V + 7*4] << SHIFT(0);
+ y0 = in[Y0 + 4*4] << SHIFT(24) |
+ in[Y1 + 4*4] << SHIFT(16) |
+ in[Y0 + 5*4] << SHIFT(8) |
+ in[Y1 + 5*4] << SHIFT(0);
+ y1 = in[Y0 + 6*4] << SHIFT(24) |
+ in[Y1 + 6*4] << SHIFT(16) |
+ in[Y0 + 7*4] << SHIFT(8) |
+ in[Y1 + 7*4] << SHIFT(0);
+
+ ((u_int*)yp)[2] = y0;
+ ((u_int*)yp)[3] = y1;
+ ((u_int*)up)[1] = u;
+ ((u_int*)vp)[1] = v;
+
+ in += istride;
+ yp += stride;
+ up += stride >> 1;
+ vp += stride >> 1;
+
+ /* do the 2nd (y only instead of yuv) line */
+
+ y0 = in[Y0 + 0*4] << SHIFT(24) |
+ in[Y1 + 0*4] << SHIFT(16) |
+ in[Y0 + 1*4] << SHIFT(8) |
+ in[Y1 + 1*4] << SHIFT(0);
+ y1 = in[Y0 + 2*4] << SHIFT(24) |
+ in[Y1 + 2*4] << SHIFT(16) |
+ in[Y0 + 3*4] << SHIFT(8) |
+ in[Y1 + 3*4] << SHIFT(0);
+
+ ((u_int*)yp)[0] = y0;
+ ((u_int*)yp)[1] = y1;
+
+ y0 = in[Y0 + 4*4] << SHIFT(24) |
+ in[Y1 + 4*4] << SHIFT(16) |
+ in[Y0 + 5*4] << SHIFT(8) |
+ in[Y1 + 5*4] << SHIFT(0);
+ y1 = in[Y0 + 6*4] << SHIFT(24) |
+ in[Y1 + 6*4] << SHIFT(16) |
+ in[Y0 + 7*4] << SHIFT(8) |
+ in[Y1 + 7*4] << SHIFT(0);
+
+ ((u_int*)yp)[2] = y0;
+ ((u_int*)yp)[3] = y1;
+
+ in += istride;
+ yp += stride;
+ }
+}
+
+void MeteorCIFGrabber::saveblks(const u_char* in, int is)
+{
+ u_char* crv = crvec_;
+ int off = framesize_;
+ u_char* lum = frame_;
+ u_char* chm = lum + off;
+ off >>= 2;
+
+ crv += vstart_ * blkw_ + hstart_;
+ lum += vstart_ * outw_ * 16 + hstart_ * 16;
+ chm += vstart_ * (outw_ >> 1) * 8 + hstart_ * 8;
+
+ int skip = hstart_ + (blkw_ - hstop_);
+
+ for (int y = vstart_; y < vstop_; ++y) {
+ const u_char* nin = in;
+ for (int x = hstart_; x < hstop_; ++x) {
+ int s = *crv++;
+ if ((s & CR_SEND) != 0)
+ saveblk(in, lum, chm, chm + off, outw_, is);
+
+ in += 32;
+ lum += 16;
+ chm += 8;
+ }
+ crv += skip;
+ lum += 15 * outw_ + skip * 16;
+ chm += 7 * (outw_ >> 1) + skip * 8;
+ in = nin + 16 * is;
+ }
}

View file

@ -1,113 +0,0 @@
--- vw.cc.orig Mon Jul 22 13:12:31 1996
+++ vw.cc Tue Dec 17 16:35:57 1996
@@ -248,8 +248,6 @@
/*
* Wrap segment in an ximage
*/
- image_ = XCreateImage(dpy_, Tk_Visual(tk), Tk_Depth(tk), ZPixmap,
- 0, (char*)0, width_, height_, 8, 0);
image_->obdata = (char*)&shminfo_;
image_->data = shminfo_.shmaddr;
}
--- Tcl.h.orig Sat Mar 16 13:14:34 1996
+++ Tcl.h Tue Dec 17 14:39:45 1996
@@ -53,7 +53,8 @@
inline int dark() const { return (tcl_ == 0); }
inline Tcl_Interp* interp() const { return (tcl_); }
inline char* result() const { return (tcl_->result); }
- inline void result(const char* p) { tcl_->result = (char*)p; }
+ inline void result(const char* p, Tcl_FreeProc* freeProc = TCL_STATIC)
+ { Tcl_SetResult(tcl_, (char *)p, freeProc); }
void resultf(const char* fmt, ...);
inline void CreateCommand(const char* cmd, Tcl_CmdProc* cproc,
ClientData cd = 0,
--- source.cc.orig Thu Apr 4 07:05:45 1996
+++ source.cc Tue Dec 17 14:38:44 1996
@@ -251,8 +251,7 @@
return (TCL_OK);
}
if (strcmp(argv[1], "addr") == 0) {
- strcpy(wrk, InetNtoa(addr_));
- tcl.result(wrk);
+ tcl.result(InetNtoa(addr_), TCL_DYNAMIC);
return (TCL_OK);
}
if (strcmp(argv[1], "srcid") == 0) {
--- Tcl.cc.orig Tue Apr 2 20:53:27 1996
+++ Tcl.cc Tue Dec 17 15:45:30 1996
@@ -65,6 +65,7 @@
{
instance_.tcl_ = tcl;
instance_.application_ = application;
+ Tcl_Init(tcl);
}
void Tcl::evalc(const char* s)
@@ -162,6 +163,8 @@
Tcl& tcl = Tcl::instance();
if (!tcl.dark())
tcl.DeleteCommand(name_);
+ if (name_ != 0)
+ delete name_;
TclObject** p;
for (p = &all_; *p != this; p = &(*p)->next_)
;
@@ -197,8 +200,9 @@
void TclObject::setproc(const char* s)
{
Tcl& tcl = Tcl::instance();
- if (name_ != 0 && !tcl.dark()) {
- tcl.DeleteCommand(name_);
+ if (name_ != 0) {
+ if (!tcl.dark())
+ tcl.DeleteCommand(name_);
delete name_;
}
int n = strlen(s);
--- decoder.cc.orig Wed Jun 26 17:28:40 1996
+++ decoder.cc Tue Dec 17 15:55:42 1996
@@ -74,6 +74,8 @@
Decoder::~Decoder()
{
+ if (rvts_)
+ delete rvts_;
}
int Decoder::command(int argc, const char*const* argv)
--- encoder-h261.cc.orig Mon Jul 22 13:12:53 1996
+++ encoder-h261.cc Tue Dec 17 16:01:47 1996
@@ -118,6 +118,7 @@
void setq(int q);
protected:
H261Encoder(int ft);
+ ~H261Encoder();
int encode(const VideoFrame*, const u_int8_t *crvec);
int command(int argc, const char*const* argv);
void encode_blk(const short* blk, const char* lm);
@@ -211,6 +212,16 @@
}
}
+H261Encoder::~H261Encoder()
+{
+ for (int q = 0; q < 32; ++q) {
+ if (llm_[q] != 0)
+ delete llm_[q];
+ if (clm_[q] != 0)
+ delete clm_[q];
+ }
+}
+
H261PixelEncoder::H261PixelEncoder() : H261Encoder(FT_YUV_CIF)
{
quant_required_ = 0;
@@ -631,7 +642,7 @@
if (q < 8) {
register int cmin = 0, cmax = 0;
register short* bp = lblk;
- register i, j;
+ register int i, j;
// Y U and V blocks
for (i = 6; --i >= 0; ) {

View file

@ -1,117 +0,0 @@
--- net.cc.orig 1997/10/07 19:07:01
+++ net.cc 1998/01/26 22:21:41
@@ -163,46 +163,48 @@
{
int cc = ::send(fd, (char*)buf, len, 0);
if (cc < 0) {
- switch (errno) {
+ /*
+ * Due to a bug in kern/uipc_socket.c, on several
+ * systems, datagram sockets incorrectly persist
+ * in an error state on receipt of any ICMP
+ * error. This causes unicast connection
+ * rendezvous problems, and worse, multicast
+ * transmission problems because several systems
+ * incorrectly send port unreachables for
+ * multicast destinations. Our work around
+ * is to call getsockopt(..., SO_ERROR, ...)
+ * which resets so->so_error.
+ *
+ * This bug originated at CSRG in Berkeley
+ * and was present in the BSD Reno networking
+ * code release. It has since been fixed
+ * in OSF-3.x. It is know to remain
+ * in 4.4BSD and AIX-4.1.3.
+ *
+ * A fix is to change the following lines from
+ * kern/uipc_socket.c:
+ *
+ * if (so_serror)
+ * snderr(so->so_error);
+ *
+ * to:
+ *
+ * if (so->so_error) {
+ * error = so->so_error;
+ * so->so_error = 0;
+ * splx(s);
+ * goto release;
+ * }
+ *
+ */
+ int err, errlen = sizeof(err), savederrno;
+
+ savederrno = errno;
+ getsockopt(fd, SOL_SOCKET, SO_ERROR, &err,
+ &errlen);
+ switch (savederrno) {
case ECONNREFUSED:
/* no one listening at some site - ignore */
-#if defined(__osf__) || defined(_AIX)
- /*
- * Due to a bug in kern/uipc_socket.c, on several
- * systems, datagram sockets incorrectly persist
- * in an error state on receipt of an ICMP
- * port-unreachable. This causes unicast connection
- * rendezvous problems, and worse, multicast
- * transmission problems because several systems
- * incorrectly send port unreachables for
- * multicast destinations. Our work around
- * is to simply close and reopen the socket
- * (by calling reset() below).
- *
- * This bug originated at CSRG in Berkeley
- * and was present in the BSD Reno networking
- * code release. It has since been fixed
- * in 4.4BSD and OSF-3.x. It is know to remain
- * in AIX-4.1.3.
- *
- * A fix is to change the following lines from
- * kern/uipc_socket.c:
- *
- * if (so_serror)
- * snderr(so->so_error);
- *
- * to:
- *
- * if (so->so_error) {
- * error = so->so_error;
- * so->so_error = 0;
- * splx(s);
- * goto release;
- * }
- *
- */
- reset();
-#endif
break;
case ENETUNREACH:
@@ -217,7 +219,7 @@
* icmp unreachable, so we should be able to
* send now.
*/
- (void)::send(ssock_, (char*)buf, len, 0);
+ (void)::send(fd, (char*)buf, len, 0);
break;
default:
@@ -264,12 +266,14 @@
}
int cc = ::sendmsg(ssock_, (msghdr*)&mh, 0);
if (cc < 0) {
- switch (errno) {
+ int err, errlen = sizeof(err), savederrno;
+
+ savederrno = errno;
+ getsockopt(ssock_, SOL_SOCKET, SO_ERROR, &err,
+ &errlen);
+ switch (savederrno) {
case ECONNREFUSED:
/* no one listening at some site - ignore */
-#if defined(__osf__) || defined(_AIX)
- reset();
-#endif
break;
case ENETUNREACH:

View file

@ -1,421 +0,0 @@
diff -ubwr ./grabber.cc /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/grabber.cc
--- grabber.cc Tue Feb 6 00:02:00 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/grabber.cc Fri Apr 10 15:36:42 1998
@@ -69,6 +69,7 @@
hstart_(0), hstop_(0),
framebase_(0), frame_(0),
inw_(0), inh_(0), outw_(0), outh_(0),
+ threshold_(48),
target_(0), tx_(0)
{
bps(128);
@@ -122,6 +123,10 @@
}
return (TCL_OK);
}
+ if (strcmp(argv[1], "threshold") == 0) {
+ threshold_ = 8*atoi(argv[2]);
+ return (TCL_OK);
+ }
if (strcmp(argv[1], "fps") == 0) {
/*XXX assume value in range */
fps(atoi(argv[2]));
diff -ubwr ./grabber.h /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/grabber.h
--- grabber.h Tue Feb 6 00:02:00 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/grabber.h Fri Apr 10 15:37:28 1998
@@ -87,6 +87,7 @@
int vstop_;
int hstart_;
int hstop_;
+ int threshold_ ; // when a block is changed ? (was constant 48)
u_int framesize_;
u_char* framebase_;
@@ -160,19 +161,19 @@
rb -= _rs << 3; \
\
int center = 0; \
- if (left >= 48 && x > 0) { \
+ if (left >= threshold_ && x > 0) { \
crv[-1] = CR_MOTION|CR_SEND; \
center = 1; \
} \
- if (right >= 48 && x < w - 1) { \
+ if (right >= threshold_ && x < w - 1) { \
crv[1] = CR_MOTION|CR_SEND; \
center = 1; \
} \
- if (bottom >= 48 && y < blkh_ - 1) { \
+ if (bottom >= threshold_ && y < blkh_ - 1) { \
crv[w] = CR_MOTION|CR_SEND; \
center = 1; \
} \
- if (top >= 48 && y > 0) { \
+ if (top >= threshold_ && y > 0) { \
crv[-w] = CR_MOTION|CR_SEND; \
center = 1; \
} \
diff -ubwr ./ui-ctrlmenu.tcl /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-ctrlmenu.tcl
--- ui-ctrlmenu.tcl Thu Jun 27 01:27:48 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-ctrlmenu.tcl Fri Apr 10 16:39:04 1998
@@ -390,11 +394,15 @@
-relief raised -command transmit \
-anchor w -variable transmitButtonState -font $f \
-state disabled -highlightthickness 0
+ checkbutton $w.freeze -text "Freeze" \
+ -relief raised -command "grabber freeze \$freeze" \
+ -anchor w -variable freeze -font $f \
+ -highlightthickness 0
button $w.release -text "Release" \
-relief raised -command release_device \
-font $f -highlightthickness 0
- pack $w.send $w.release -fill both
+ pack $w.send $w.release $w.freeze -fill both
}
proc doNothing { args } {
@@ -434,8 +442,9 @@
frame $w.bps
scale $w.bps.scale -orient horizontal -font $f \
- -showvalue 0 -from 10 -to [option get . maxbw Vic] \
+ -showvalue 0 -from 1 -to [option get . maxbw Vic] \
-command "set_bps $w.bps.value" -width 12 \
+ -sliderlength 20 \
-relief groove
label $w.bps.value -font $f -width 8 -anchor w
@@ -443,6 +452,7 @@
scale $w.fps.scale -font $f -orient horizontal \
-showvalue 0 -from 1 -to 30 \
-command "set_fps $w.fps.value" -width 12 \
+ -sliderlength 20 \
-relief groove
label $w.fps.value -font $f -width 8 -anchor w
@@ -564,7 +574,7 @@
proc select_device device {
global transmitButton sizeButtons portButton formatButtons \
videoFormat defaultFormat lastDevice defaultPort inputPort \
- transmitButtonState
+ transmitButtonState typeButton
#
# Remember settings of various controls for previous device
@@ -607,6 +617,11 @@
} else {
$portButton configure -state disabled
}
+ if [device_supports $device type *] {
+ $typeButton configure -state normal
+ } else {
+ $typeButton configure -state disabled
+ }
insert_grabber_panel [$device nickname]
@@ -774,7 +789,8 @@
build.encoder_options $w.options
build.device $w.device
build.port $w.port
- pack $w.device $w.port $w.options -fill x
+ build.type $w.type
+ pack $w.device $w.port $w.type $w.options -fill x
}
proc build.encoder_options w {
@@ -1172,6 +1188,9 @@
global inputPort inputType portButton typeButton
if { [$portButton cget -state] == "normal" } {
$grabber port $inputPort
+ }
+ if { [$typeButton cget -state] == "normal" } {
+ $grabber type $inputType
}
setFillRate
update
diff -ubwr ./ui-grabber.tcl /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-grabber.tcl
--- ui-grabber.tcl Fri Jun 21 04:39:35 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-grabber.tcl Fri Apr 10 13:54:42 1998
@@ -39,65 +39,93 @@
# called foo-1, foo-2, etc. and you'll only need build.foo
#
+proc build.meteor w {
+#
+# The meteor has the same controls as the slicvideo, so just call that
+# routine to build the controls.
+
+ build.slicvideo $w
+}
+
+proc build.bktr w {
+ build.slicvideo $w
+}
+
proc build.slicvideo w {
set f [smallfont]
+# set f "-*-helvetica-medium-r-normal--*-100-75-75-*-*-*-*"
label $w.title -text "Grabber"
frame $w.f -relief sunken -borderwidth 2
frame $w.f.h -relief flat
- label $w.f.h.label -font $f -anchor e -text "Hue"
-
- scale $w.f.h.scale -orient horizontal -width 12 -length 20 \
- -relief groove -showvalue 0 -from -128 -to 127 \
- -command "grabber set HUE"
- pack $w.f.h.label $w.f.h.scale -side left -fill x -expand 1
-
- frame $w.f.ll -relief flat
-
- label $w.f.ll.label -font $f -text "Luma" -anchor s
-
- label $w.f.ll.clabel -font $f -text "Contrast" -anchor s
-
- label $w.f.ll.blabel -font $f -text "Brightness" -anchor s
- pack $w.f.ll.clabel $w.f.ll.label $w.f.ll.blabel \
+ frame $w.f.h.c
+ label $w.f.h.c.l1 -font $f -anchor e -text "Chan:"
+ mk.entry $w.f.h.c do_chan "20"
+ $w.f.h.c.entry configure -relief sunken -width 5
+ bind $w.f.h.c.entry <Return> "grabber chan \[$w.f.h.c.entry get\]"
+ pack $w.f.h.c.l1 $w.f.h.c.entry -side top
+
+ global ths
+ scale $w.f.h.ths \
+-orient horizontal -width 12 -length 60 -relief groove -sliderlength 6 \
+ -showvalue 0 -from 1 -to 10 \
+ -command "grabber threshold" -label Thre
+ $w.f.h.ths set 6
+ # the actual scale is multiplied by 8
+ scale $w.f.h.scale \
+-orient horizontal -width 12 -length 100 -relief groove \
+ -showvalue 0 -from -128 -to 127 \
+ -command "grabber hue" -label Hue
+ pack $w.f.h.c \
+ $w.f.h.ths \
+ $w.f.h.scale \
-side left -fill x -expand 1
+# frame $w.f.ll -relief flat
+# label $w.f.ll.label -font $f -text "Luma" -anchor s
+# label $w.f.ll.clabel -font $f -text "Contrast" -anchor s
+# label $w.f.ll.blabel -font $f -text "Brightness" -anchor s
+# pack $w.f.ll.clabel $w.f.ll.label $w.f.ll.blabel \
+# -side left -fill x -expand 1
+
frame $w.f.l -relief flat
- scale $w.f.l.cscale -orient horizontal -width 12 -relief groove \
+ scale $w.f.l.cscale \
+-orient horizontal -width 12 -length 100 -relief groove \
-showvalue 0 -from 0 -to 127 \
- -command "grabber set LUMA_CONTRAST"
+ -label "Contrast" \
+ -command "grabber contrast"
- scale $w.f.l.bscale -orient horizontal -width 12 -relief groove \
+ scale $w.f.l.bscale \
+-orient horizontal -width 12 -length 100 -relief groove \
-showvalue 0 -from 0 -to 255 \
- -command "grabber set LUMA_BRIGHTNESS"
+ -command "grabber brightness" -label "Brightness"
pack $w.f.l.cscale $w.f.l.bscale -side left -fill x -expand 1
- frame $w.f.cl -relief flat
-
- label $w.f.cl.label -font $f -text "Chroma" -anchor n
-
- label $w.f.cl.glabel -font $f -text "Gain" -anchor n
-
- label $w.f.cl.slabel -font $f -text "Saturation" -anchor n
- pack $w.f.cl.glabel $w.f.cl.label $w.f.cl.slabel \
- -side left -fill x -expand 1
+# frame $w.f.cl -relief flat
+# label $w.f.cl.label -font $f -text "Chroma" -anchor n
+# label $w.f.cl.glabel -font $f -text "Gain" -anchor n
+# label $w.f.cl.slabel -font $f -text "Saturation" -anchor n
+# pack $w.f.cl.glabel $w.f.cl.label $w.f.cl.slabel \
+# -side left -fill x -expand 1
frame $w.f.c -relief flat
- scale $w.f.c.gscale -orient horizontal -width 12 -relief groove \
+ scale $w.f.c.gscale \
+-orient horizontal -width 12 -length 100 -relief groove \
-showvalue 0 -from 0 -to 255 \
- -command "grabber set CHROMA_GAIN"
+ -command "grabber uvgain" -label "Chr. Gain"
- scale $w.f.c.sscale -orient horizontal -width 12 -relief groove \
+ scale $w.f.c.sscale \
+-orient horizontal -width 12 -length 100 -relief groove \
-showvalue 0 -from 0 -to 127 \
- -command "grabber set CHROMA_SATURATION"
+ -command "grabber saturation" -label "Saturation"
pack $w.f.c.gscale $w.f.c.sscale -side left -fill x -expand 1
- pack $w.f.h $w.f.ll $w.f.l $w.f.c $w.f.cl \
- -fill x -expand 1 -padx 1m
+ # pack $w.f.h $w.f.ll $w.f.l $w.f.c $w.f.cl
+ pack $w.f.h $w.f.l $w.f.c -fill x -expand 1 -padx 1m
pack $w.title $w.f -fill x -expand 1
@@ -109,6 +137,10 @@
$w.f.c.sscale set 64
}
+#
+# STILL image-grabber (?)
+#
+
proc build.still w {
set f [smallfont]
@@ -131,6 +163,10 @@
$lastDevice file $s
}
+#
+# quickcam grabber
+#
+
proc build.qcam {w} {
global qcamwindow
@@ -190,3 +226,118 @@
set qcamwindow(setwbal) "$w.f.s.s.wbal.scale set"
set qcamwindow(setbpp) "set qcambpp"
}
+
+#
+# X11 Grabber controls
+#
+proc x11grabUpdatePos {x y w h} {
+
+ global x11grabcontrols
+ set w $x11grabcontrols
+
+ if {[string compare $x [$w.x11grab.row1.pos.x.e get]] != 0} {
+ $w.x11grab.row1.pos.x.e delete 0 end
+ $w.x11grab.row1.pos.x.e insert 0 $x
+ }
+ if {[string compare $y [$w.x11grab.row1.pos.y.e get]] != 0} {
+ $w.x11grab.row1.pos.y.e delete 0 end
+ $w.x11grab.row1.pos.y.e insert 0 $y
+ }
+ if {[string compare $w [$w.x11grab.row1.pos.w.e get]] != 0} {
+ $w.x11grab.row1.pos.w.e delete 0 end
+ $w.x11grab.row1.pos.w.e insert 0 $w
+ }
+ if {[string compare $h [$w.x11grab.row1.pos.h.e get]] != 0} {
+ $w.x11grab.row1.pos.h.e delete 0 end
+ $w.x11grab.row1.pos.h.e insert 0 $h
+ }
+}
+
+proc x11cmd.update.geo w {
+ grabber fixed [$w.row.x get] [$w.row.y get]
+}
+
+proc x11cmd.fixed {} {
+ global x11Source x11grabcontrols
+ set w $x11grabcontrols
+ $w.label configure -text "$x11Source"
+ if [winfo exists $w.row] {
+ destroy $w.row
+ }
+ frame $w.row
+ pack append $w.row \
+ [label $w.row.xl -text "X:" -width 2 -anchor e] {left filly} \
+ [entry $w.row.x -relief flat -width 4] {left filly} \
+ [label $w.row.yl -text "Y:" -width 2 -anchor e] {left filly} \
+ [entry $w.row.y -relief flat -width 4] {left filly}
+ bind $w.row.x <Return> "x11cmd.update.geo $w"
+ bind $w.row.y <Return> "x11cmd.update.geo $w"
+
+ pack $w.row -after $w.label
+}
+
+proc x11cmd.pointer {} {
+ global x11Source x11grabcontrols
+ set w $x11grabcontrols
+ $w.label configure -text "$x11Source"
+ if [winfo exists $w.row] {
+ destroy $w.row
+ }
+ frame $w.row
+ pack append $w.row \
+ [button $w.row.s -text "Follow pointer" ] { left filly }
+ pack $w.row -after $w.label
+}
+
+proc x11cmd.window {} {
+ global x11Source x11grabcontrols
+ puts "x11cmd -- x11Source $x11Source"
+ set w $x11grabcontrols
+ $w.label configure -text "$x11Source"
+ if [winfo exists $w.row] {
+ destroy $w.row
+ }
+ frame $w.row
+ pack append $w.row \
+ [button $w.row.s -text "Select window" ] { left filly }
+ pack $w.row -after $w.label
+}
+
+proc build.x11 w {
+ global x11grabcontrols x11Source
+ set f [smallfont]
+
+ label $w.title -text "X11 Grabber controls"
+ frame $w.x11grab -relief sunken -borderwidth 2
+ set x11grabcontrols $w.x11grab
+ set x11Source "Fixed"
+ set w1 $w.x11grab
+
+
+ # luigi
+ set m $w1.menu
+ set m1 $m.m1
+ menubutton $w1.menu -menu $m1 -text "Source:" \
+ -relief raised -width 7 -font $f
+ label $w1.label -width 6 -font $f
+ frame $w1.row
+ menu $m1
+ $m1 add radiobutton -label Fixed \
+ -state active \
+ -command "x11cmd.fixed" -font $f -variable x11Source
+# $m1 add radiobutton -label Pointer \
+# -command "x11cmd.pointer" -font $f -variable x11Source
+# $m1 add radiobutton -label Window \
+# -command "x11cmd.window" -font $f -variable x11Source
+
+ pack append $w1 \
+ $w1.menu {left} \
+ $w1.label {left} \
+ $w1.row {left}
+
+ pack $w $w.title $w1 -fill x -expand 1
+
+ x11cmd.fixed
+}
+
+### end of file ###
diff -ubwr ./ui-resource.tcl /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-resource.tcl
--- ui-resource.tcl Wed Apr 3 02:33:56 1996
+++ /home/old_wd0f/ports/mbone/vic/work.luigi/vic-2.8-luigi/ui-resource.tcl Fri Apr 10 21:11:56 1998
@@ -140,7 +140,7 @@
option add Vic.useHardwareDecode false startupFile
option add Vic.infoHighlightColor LightYellow2 startupFile
option add Vic.useJPEGforH261 false startupFile
- option add Vic.stillGrabber false startupFile
+ option add Vic.stillGrabber true startupFile ; # XXX was false
option add Vic.siteDropTime "300" startupFile
#

File diff suppressed because it is too large Load diff

View file

@ -1,20 +0,0 @@
--- iohandler.cc.orig Sun Nov 28 19:12:12 1999
+++ iohandler.cc Sun Nov 28 19:12:50 1999
@@ -132,7 +132,7 @@
}
#else
- Tk_CreateFileHandler((ClientData)fd, mask, callback, (ClientData)this);
+ Tk_CreateFileHandler(fd, mask, callback, (ClientData)this);
#endif
}
@@ -151,7 +151,7 @@
}
#else
if (fd_ >= 0) {
- Tk_DeleteFileHandler((ClientData)fd_);
+ Tk_DeleteFileHandler(fd_);
fd_ = -1;
}
#endif

View file

@ -1,11 +0,0 @@
--- transcoder-jpeg.cc.orig Sun Nov 28 19:15:40 1999
+++ transcoder-jpeg.cc Sun Nov 28 19:15:57 1999
@@ -138,7 +138,7 @@
rval = target_->consume(df);
// update CR vec
- register blkno;
+ register int blkno;
int s;
for (blkno = 0; blkno < crvlen_; blkno++) {
s = CR_STATE(crvec_[blkno]);

View file

@ -1,11 +0,0 @@
--- color-true.cc.orig Sun Nov 28 19:17:03 1999
+++ color-true.cc Sun Nov 28 19:17:23 1999
@@ -180,7 +180,7 @@
protected:
TrueColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = TrueMethod(WindowRenderer::dither_null); }
+ virtual void disable() { method_ = TrueMethod(&WindowRenderer::dither_null); }
TrueMethod method_;
void map_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-dither.cc.orig Sun Nov 28 19:18:04 1999
+++ color-dither.cc Sun Nov 28 19:18:21 1999
@@ -177,7 +177,7 @@
protected:
DitherColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = PseudoWindowRenderer::dither_null; }
+ virtual void disable() { method_ = &PseudoWindowRenderer::dither_null; }
DitherMethod method_;
void dither_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-ed.cc.orig Sun Nov 28 19:18:55 1999
+++ color-ed.cc Sun Nov 28 19:19:12 1999
@@ -180,7 +180,7 @@
protected:
EDColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = PseudoWindowRenderer::dither_null; }
+ virtual void disable() { method_ = &PseudoWindowRenderer::dither_null; }
EDMethod method_;
void dither_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-quant.cc.orig Sun Nov 28 19:19:44 1999
+++ color-quant.cc Sun Nov 28 19:20:01 1999
@@ -92,7 +92,7 @@
protected:
QuantColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = PseudoWindowRenderer::dither_null; }
+ virtual void disable() { method_ = &PseudoWindowRenderer::dither_null; }
QuantMethod method_;
void map_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-hi.cc.orig Sun Nov 28 19:20:41 1999
+++ color-hi.cc Sun Nov 28 19:21:03 1999
@@ -164,7 +164,7 @@
protected:
HiColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = HiMethod(WindowRenderer::dither_null); }
+ virtual void disable() { method_ = HiMethod(&WindowRenderer::dither_null); }
HiMethod method_;
void map_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,11 +0,0 @@
--- color-gray.cc.orig Sun Nov 28 19:21:35 1999
+++ color-gray.cc Sun Nov 28 19:21:47 1999
@@ -82,7 +82,7 @@
}
protected:
virtual void update();
- virtual void disable() { method_ = PseudoWindowRenderer::dither_null; }
+ virtual void disable() { method_ = &PseudoWindowRenderer::dither_null; }
GrayMethod method_;
};

View file

@ -1,20 +0,0 @@
--- color-mono.cc.orig Sun Nov 28 19:22:19 1999
+++ color-mono.cc Sun Nov 28 19:22:51 1999
@@ -200,7 +200,7 @@
~MonoColorModel();
virtual int alloc_grays();
virtual int command(int argc, const char*const* argv);
- inline white(void) { return (white_); }
+ inline int white(void) { return (white_); }
private:
int white_;
};
@@ -250,7 +250,7 @@
protected:
MonoColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = WindowDitherer::dither_null; }
+ virtual void disable() { method_ = &WindowDitherer::dither_null; }
MonoMethod method_;
void dither(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;

View file

@ -1,20 +0,0 @@
--- jpeg/jpeg.cc.orig Sun Nov 28 19:23:29 1999
+++ jpeg/jpeg.cc Sun Nov 28 19:23:52 1999
@@ -139,7 +139,7 @@
dct_unbias_ = 1;
short *sp = (short *)frm_;
- for (register i = 0; i < n / (BMB * 64) ; i++) {
+ for (register int i = 0; i < n / (BMB * 64) ; i++) {
*sp = DCT_GRAY;
sp += 64;
*sp = DCT_GRAY;
@@ -173,7 +173,7 @@
dct_unbias_ = 1;
short *sp = (short*)frm_;
- for (register i = 0; i < n / (BMB * 64) ; i++) {
+ for (register int i = 0; i < n / (BMB * 64) ; i++) {
*sp = DCT_GRAY;
sp += 64;
*sp = DCT_GRAY;

View file

@ -1,11 +0,0 @@
--- p64/mkhuff.cc.orig Sun Nov 28 19:24:42 1999
+++ p64/mkhuff.cc Sun Nov 28 19:25:49 1999
@@ -45,6 +45,8 @@
extern "C" {
int getopt(int, char * const *, const char *);
}
+#else
+#include <unistd.h>
#endif
#define HUFFSTRINGS
#include "p64-huff.h"

View file

@ -1,11 +0,0 @@
--- Makefile.in.orig Thu Jan 27 18:52:29 2000
+++ Makefile.in Thu Jan 27 18:53:00 2000
@@ -40,7 +40,7 @@
all: $(ALL)
.cc.o:
- rm -f $@; $(C++) -o $@ -c $(CFLAGS) $*.cc
+ rm -f $@; $(C++) -pedantic -o $@ -c $(CFLAGS) $*.cc
.c.o:
rm -f $@; $(CC) -o $@ -c $(CFLAGS) $*.c

View file

@ -0,0 +1,12 @@
--- configure.in.org Mon May 7 15:30:01 2001
+++ configure.in Mon May 7 15:31:32 2001
@@ -72,8 +72,7 @@
if test -r /usr/include/linux/videodev.h ; then
V_OBJ_GRABBER="video/grabber-video4linux.o $V_OBJ_GRABBER"
fi
-#if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; then
-if test -r /usr/local/lib/libspigot.a ; then
+if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; 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"

View file

@ -0,0 +1,56 @@
--- configure.in.tk.org Tue May 8 08:42:54 2001
+++ configure.in.tk Tue May 8 08:56:43 2001
@@ -32,13 +32,13 @@
echo "'$d' is not a directory"
exit 1
fi
- V_INCLUDE_TCL=-I$d/include
- if test ! -r $d/include/tcl.h ; then
+ V_INCLUDE_TCL=-I$d/include/tcl8.3/
+ if test ! -r $d/include/tcl8.3/tcl.h ; then
echo "can't find tcl.h in $d/include"
exit 1
fi
- places="$d/lib/libtcl8.0.so \
- $d/lib/libtcl8.0.a \
+ places="$d/lib/libtcl83.so \
+ $d/lib/libtcl83.a \
$d/lib/libtcl.so \
$d/lib/libtcl.a"
V_LIB_TCL=FAIL
@@ -52,7 +52,7 @@
echo "can't find libtcl.a in $d/lib"
exit 1
fi
- places="$d/lib/tcl-8.0 \
+ places="$d/lib/tcl8.3 \
$d/lib/tcl8.0 \
$d/lib/tcl"
V_LIBRARY_TCL=FAIL
@@ -190,13 +190,13 @@
echo "'$d' is not a directory"
exit 1
fi
- V_INCLUDE_TK=-I$d/include
- if test ! -r $d/include/tk.h ; then
+ V_INCLUDE_TK=-I$d/include/tk8.3
+ if test ! -r $d/include/tk8.3/tk.h ; then
echo "can't find tk.h in $d/include"
exit 1
fi
- places="$d/lib/libtk8.0.so \
- $d/lib/libtk8.0.a \
+ places="$d/lib/libtk83.so \
+ $d/lib/libtk83.a \
$d/lib/libtk.so \
$d/lib/libtk.a"
V_LIB_TK=FAIL
@@ -210,7 +210,7 @@
echo "can't find libtk.a in $d/lib"
exit 1
fi
- places="$d/lib/tk8.0 \
+ places="$d/lib/tk8.3 \
$d/lib/tk"
V_LIBRARY_TK=FAIL
for dir in $places; do

View file

@ -0,0 +1,25 @@
--- tcl/ui-ctrlmenu.tcl.org Thu May 10 08:44:51 2001
+++ tcl/ui-ctrlmenu.tcl Thu May 10 08:48:19 2001
@@ -408,16 +408,16 @@
-relief raised -command transmit \
-anchor w -variable transmitButtonState -font $f \
-state disabled -highlightthickness 0
-# checkbutton $w.freeze -text "Freeze" \
-# -relief raised -command "grabber freeze \$freeze" \
-# -anchor w -variable freeze -font $f \
-# -highlightthickness 0
+ checkbutton $w.freeze -text "Freeze" \
+ -relief raised -command "grabber freeze \$freeze" \
+ -anchor w -variable freeze -font $f \
+ -highlightthickness 0
button $w.release -text "Release" \
-relief raised -command release_device \
-font $f -highlightthickness 0
-# pack $w.send $w.release $w.freeze -fill both
- pack $w.send $w.release -fill both
+ pack $w.send $w.release $w.freeze -fill both
+# pack $w.send $w.release -fill both
}
proc doNothing { args } {

View file

@ -0,0 +1,11 @@
--- tcl/ui-resource.tcl.org Mon May 7 16:17:03 2001
+++ tcl/ui-resource.tcl Mon May 7 16:17:29 2001
@@ -153,7 +153,7 @@
option add Vic.infoHighlightColor LightYellow2 startupFile
option add Vic.useJPEGforH261 false startupFile
option add Vic.useHardwareComp false startupFile
- option add Vic.stillGrabber false startupFile
+ option add Vic.stillGrabber true startupFile ; # XXX was false
option add Vic.siteDropTime "300" startupFile
option add Vic.quality "0" startupFile