aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-04-01 11:24:37 +0200
committerGerd Hoffmann <kraxel@redhat.com>2010-04-01 11:24:37 +0200
commit0a3b75898a27d0e526d2310832c8b409c9d5c5f0 (patch)
tree512368cbafec7bce5e2ea5fc1a0f1ed5bc62ae83
parentab5d04be814f12985f0590495aef5113ffb43799 (diff)
v3.66
-rw-r--r--Changes285
-rw-r--r--KNOWN_PROBLEMS56
-rw-r--r--Make.config.in41
-rw-r--r--Makefile12
-rw-r--r--Makefile.clean12
-rw-r--r--Makefile.in61
-rw-r--r--Miro_gpio.txt8
-rw-r--r--README112
-rw-r--r--README.bttv271
-rw-r--r--README.de24
-rw-r--r--README.network51
-rw-r--r--README.recording59
-rw-r--r--README.translate21
-rw-r--r--README.xfree447
-rw-r--r--Sound-FAQ5
-rw-r--r--TODO5
-rw-r--r--Trouble-Shooting164
-rw-r--r--acconfig.h6
-rw-r--r--build-test32
-rw-r--r--capture-test4
-rw-r--r--cc/Makefile25
-rw-r--r--cc/Makefile.in25
-rw-r--r--cc/ntsc-cc.c (renamed from contrib/cc/cc.c)222
-rw-r--r--cc/ntsc-cc.man31
-rw-r--r--config.h.in17
-rwxr-xr-xconfigure451
-rw-r--r--configure.in98
-rw-r--r--contrib/cc/Makefile8
-rw-r--r--debian/changelog152
-rw-r--r--debian/control28
-rw-r--r--debian/copyright2
-rw-r--r--debian/rules13
-rw-r--r--debian/scantv.files2
-rw-r--r--debian/streamer.files1
-rw-r--r--debian/ttv.files2
-rw-r--r--debian/ttv.menu2
-rw-r--r--debian/v4l-conf.files2
-rw-r--r--debian/xawtv-plugins.files1
-rw-r--r--debian/xawtv-tools.files4
-rw-r--r--debian/xawtv.conffiles1
-rw-r--r--debian/xawtv.config18
-rw-r--r--debian/xawtv.files11
-rw-r--r--debian/xawtv.postinst21
-rw-r--r--debian/xawtv.template.Master44
-rw-r--r--debian/xawtv.template.de71
-rw-r--r--debian/xawtv.template.es68
-rw-r--r--debian/xawtv.templates115
-rw-r--r--font/Makefile.in63
-rw-r--r--font/bigfont.pl26
-rw-r--r--font/fonts.dir4
-rw-r--r--font/led-iso8859-1.bdf (renamed from font/led-latin1.bdf)1034
-rw-r--r--font/led-iso8859-2.bdf (renamed from font/led-latin2.bdf)0
-rw-r--r--font/led-koi8-r.bdf (renamed from font/led-koi8.bdf)0
-rw-r--r--http/Makefile.in29
-rw-r--r--http/alevtd.man14
-rw-r--r--http/bottom.html.in2
-rw-r--r--http/devices.c93
-rw-r--r--http/devices.h14
-rw-r--r--http/main.c64
-rw-r--r--http/page.c61
-rw-r--r--http/response.c1
-rw-r--r--libng/Makefile.in10
-rw-r--r--libng/OVERVIEW135
-rw-r--r--libng/README14
-rw-r--r--libng/clipping.c134
-rw-r--r--libng/color_lut.c22
-rw-r--r--libng/color_packed.c2
-rw-r--r--libng/color_yuv2rgb.c175
-rw-r--r--libng/devices.c93
-rw-r--r--libng/devices.h14
-rw-r--r--libng/grab-bsd.c99
-rw-r--r--libng/grab-ng.c110
-rw-r--r--libng/grab-ng.h74
-rw-r--r--libng/grab-v4l.c139
-rw-r--r--libng/grab-v4l2.c195
-rw-r--r--libng/mjpeg.c14
-rw-r--r--libng/plugins/Makefile.in29
-rw-r--r--libng/plugins/invert.c135
-rw-r--r--libng/plugins/nop.c69
-rw-r--r--libng/videodev2.h143
-rw-r--r--libng/writeavi.c9
-rw-r--r--libng/writefile.c80
-rw-r--r--libng/writeqt.c60
-rw-r--r--libvbi/Makefile.in5
-rw-r--r--libvbi/README6
-rw-r--r--libvbi/cache.c4
-rw-r--r--libvbi/cache.h2
-rw-r--r--libvbi/exp-gfx.c160
-rw-r--r--libvbi/exp-html.c6
-rw-r--r--libvbi/exp-txt.c2
-rw-r--r--libvbi/export.c2
-rw-r--r--libvbi/os.h6
-rw-r--r--libvbi/vbi.c284
-rw-r--r--libvbi/vbi.h14
-rw-r--r--man/Makefile.in19
-rw-r--r--man/fbtv.1 (renamed from man/fbtv.man)12
-rw-r--r--man/motv.1235
-rw-r--r--man/rootv.1 (renamed from man/rootv.man)0
-rw-r--r--man/scantv.1 (renamed from man/scantv.man)26
-rw-r--r--man/streamer.144
-rw-r--r--man/subtitles.120
-rw-r--r--man/ttv.141
-rw-r--r--man/v4l-conf.8 (renamed from man/v4l-conf.man)0
-rw-r--r--man/v4lctl.1 (renamed from man/v4lctl.man)0
-rw-r--r--man/xawtv-remote.1 (renamed from man/xawtv-remote.man)40
-rw-r--r--man/xawtv.1237
-rw-r--r--man/xawtv.man334
-rw-r--r--man/xawtvrc.5241
-rw-r--r--radio/Makefile.in24
-rw-r--r--radio/radio-old.c244
-rw-r--r--radio/radio.c348
-rw-r--r--radio/radio.man45
-rw-r--r--src/Makefile.in204
-rw-r--r--src/MoTV-de261
-rw-r--r--src/MoTV-default266
-rw-r--r--src/MoTV-fixed311
-rw-r--r--src/MoTV-it267
-rw-r--r--src/MoTV.ad55
-rw-r--r--src/MoTV.de.ad572
-rw-r--r--src/MoTV.it.ad578
-rw-r--r--src/RegEdit.c1795
-rw-r--r--src/RegEdit.h65
-rw-r--r--src/RegEditI.h368
-rw-r--r--src/Xawtv.ad149
-rw-r--r--src/aa.c352
-rw-r--r--src/capture.c548
-rw-r--r--src/capture.h33
-rw-r--r--src/channel.c139
-rw-r--r--src/channel.h24
-rw-r--r--src/commands.c467
-rw-r--r--src/commands.h27
-rw-r--r--src/complete.c26
-rw-r--r--src/conf.c23
-rw-r--r--src/conf.h3
-rw-r--r--src/fallback.pl26
-rw-r--r--src/fbtools.c191
-rw-r--r--src/fbtools.h5
-rw-r--r--src/fbtv.c371
-rw-r--r--src/frequencies.c273
-rw-r--r--src/frequencies.h2
-rw-r--r--src/fs.c501
-rw-r--r--src/fs.h68
-rw-r--r--src/grab.c179
-rw-r--r--src/grab.h18
-rw-r--r--src/icons.c57
-rw-r--r--src/icons.h1
-rw-r--r--src/joystick.c80
-rw-r--r--src/joystick.h2
-rw-r--r--src/lirc.c3
-rw-r--r--src/main.c1548
-rw-r--r--src/man.c122
-rw-r--r--src/man.h4
-rw-r--r--src/matrox.c6
-rw-r--r--src/midictrl.c311
-rw-r--r--src/midictrl.h23
-rw-r--r--src/motif.c3005
-rw-r--r--src/parseconfig.c10
-rw-r--r--src/scantv.c56
-rw-r--r--src/sound.c313
-rw-r--r--src/sound.h12
-rw-r--r--src/streamer.c176
-rw-r--r--src/subtitles90
-rw-r--r--src/toolbox.c4
-rw-r--r--src/v4l-conf.c169
-rw-r--r--src/v4lctl.c41
-rw-r--r--src/vbi-debug.c113
-rw-r--r--src/webcam.c2
-rw-r--r--src/wmhooks.c13
-rw-r--r--src/x11.c470
-rw-r--r--src/x11.h17
-rw-r--r--src/xawtv-remote.c6
-rw-r--r--src/xt.c1337
-rw-r--r--src/xt.h84
-rw-r--r--src/xv.c356
-rw-r--r--src/xv.h18
-rw-r--r--src/xvideo.c81
-rw-r--r--tools/Makefile.in31
-rw-r--r--tools/dump-mixers.c2
-rw-r--r--tools/dump-mixers.man11
-rw-r--r--tools/propwatch.c12
-rw-r--r--tools/record.c326
-rw-r--r--tools/record.man38
-rw-r--r--tools/showriff.c79
-rw-r--r--tools/showriff.man4
-rw-r--r--webcam/Makefile.in18
-rw-r--r--webcam/ftp.c15
-rw-r--r--webcam/ftp.h2
-rw-r--r--webcam/parseconfig.c10
-rw-r--r--webcam/webcam.c176
-rw-r--r--webcam/webcam.man17
-rw-r--r--xawtv.spec7
-rw-r--r--xawtv.spec.in7
-rw-r--r--xpm/exit.xpm22
-rw-r--r--xpm/movie.xpm22
-rw-r--r--xpm/mute.xpm22
-rw-r--r--xpm/next.xpm22
-rw-r--r--xpm/prev.xpm22
-rw-r--r--xpm/snap.xpm22
-rw-r--r--xpm/tv.xpm44
199 files changed, 20303 insertions, 5597 deletions
diff --git a/Changes b/Changes
index 997dce3..9f298fe 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,289 @@
+3.65 => 3.66
+============
+
+ * various scantv fixes.
+ * added "show" command for v4lctl, updated man-page.
+ * LFS bug in showriff fixed, now it finally displays large
+ files correctly.
+ * Added experimental image filtering plugin interface, for
+ now only works for the x11 screen in "grabdisplay" mode.
+ * Made it build with both alsa 0.5.x and 0.9.x.
+ * Made it build without X11 installed.
+
+
+3.64 => 3.65
+============
+
+ * fixed FreeBSD build problems.
+ * control *tv via joystick (based on patches from "W. Michael Petullo"
+ <mike@flyn.org>).
+ * fixed fbtv cursor keys to work as documented (and like they work in
+ xawtv).
+ * splitted reading and parsing of the config file to fix some minor
+ initialization order issues.
+ * more alevtd fixes/patches (Alessandro Fausto).
+ * added window clipping fixups (range checks, drop empty clips,
+ try merge clip windows).
+ * removed chromakey color flash on channel switches
+ * added -c option for scantv.
+ * full devfs support for fbtv.
+
+
+3.63 => 3.64
+============
+
+ * fixed build problems without alsa installed.
+ * alevtd: subpage link list tweaks.
+ * alevtd: clear cache on SIGUSR1.
+ * fixed a segfault in fbtv.
+
+
+3.62 => 3.63
+============
+
+ * tried to reduce the channel switch delay a bit.
+ * motv: italian translations (Mij <mij@fastwebnet.it>).
+ * wrote README.translate
+ * wrote some code to control xawtv/motv/fbtv via alsa midi.
+ * moved lirc code to xt.c, added lirc support to motv.
+ * "fbtv -M" + v4l2 fixed.
+ * ttv: ignore aspect ratio.
+ * ttv: segfault-at-exit fixed.
+ * added subpage link list to alevtd pages
+ (Alessandro Fausto <fareale@libero.it>).
+ * updated libvbi to alevt 1.6.0 code.
+
+
+3.61 => 3.62
+============
+
+ * fixed italy frequency table (Gianluca <gialluca@tiscalinet.it>).
+ * oss changes to improve audio/video sync with some sound cards.
+ * Fancy DnD icon for motv.
+ * preferences dialog for motv.
+ * fixed segfault when typing '00' on the keypad.
+ * fixed VIDIOCSWIN error handling.
+ * major changes for the radio app: Added reasonable command line
+ parsing, can be easily used non-interactively now. Added station
+ scanner (Gunther Mayer <Gunther.Mayer@t-online.de>).
+ * added frequency table for argentina
+ ("KciNicK M. M." <kcinick@ciudad.com.ar>).
+ * MIT-SHM support is no longer a compile time option.
+ * Fixed MIT-SHM bug in xv.c
+ * v4l2 format assignments fixed (fixes swapped red+blue for yuv)
+
+
+3.60 => 3.61
+============
+
+ * keypad-partial fix.
+ * record utility documentation update.
+ * movie recording: display audio/video times relative to real time.
+ * added some examples to "streamer -h" output.
+ * minor fix for v4lctl.
+ * reactivated "xawtv-remote webcam"
+ * fixed "xawtv-remove movie driver ..." for motv.
+ * Some minor DnD fixes.
+ * audio mode fixes
+ * added keypad support for motv.
+ * temporarely suspend grabdisplay for attribute changes.
+ * mjpeg-quality config option is gone, jpeg-quality is used
+ everythere now.
+
+
+3.59 => 3.60
+============
+
+ * Added proper cleanup code for DnD. This breaks DnD with KDE apps
+ because they _first_ signal the transfer is finished, _then_ try to
+ read the tmp file which might be already deleted at that point ...
+ * separated primary selection (aka clipboard) and DnD selection data.
+ * fixed segfault with DnD + not capturing devices (i.e. Xvideo).
+
+
+3.58 => 3.59
+============
+
+ * keypad-partial fixes.
+ * added a few more buttons to motv's toolbar.
+ * fixed v4l-conf compile problem with v4l2-patched kernels.
+ * added console mode for record (Gergely Tamas <dice@mfa.kfki.hu>),
+ also added a switch to set the sample rate and fixed some minor
+ problems.
+ * Added support for selections (clipboard & dnd) to motv.
+ * Fixed missing "setinput next"
+
+
+3.57 => 3.58
+============
+
+ * Makefile / build process updates. make depend is done automagically
+ now if needed. Parallel builds (make -j) work better. Enabled a few
+ more warnings.
+ * new keypad-partial config option (Pawel Sakowski <pawel@sakowski.eu.org>).
+ * made oss mixer work again for fbtv.
+ * merged some stuff from Kawamata/Hitoshi <kwmt@din.or.jp>'s patches.
+ * finally multithreaded compression for those of you with SMP boxen.
+ * text/plain support for alevtd (Adam Sampson <azz@gnu.org>).
+ * Documentation updates.
+
+
+3.56 => 3.57
+============
+
+ * changed oss mixer control internals
+ * made 4:3 aspect ratio the default.
+ * more Motif GUI fixes.
+
+
+3.55 => 3.56
+============
+
+ * chromakey tyops fixed.
+ * updated / reorganized the manual pages.
+ * wrote a manual page for motv.
+ * lots of motv improvements.
+ * streamer also accepts hh:mm:ss for -t now (W. Michael Petullo).
+ * added color space conversion functions for yuv 420 planar
+ (Sunjin Yang <lethean@realtime.ssu.ac.kr>).
+
+
+3.54 => 3.55
+============
+
+ * some fbtv fixes.
+
+
+3.53 => 3.54
+============
+
+ * NOTE: starting with 3.53 "make depend" is REQUIRED to build
+ xawtv.
+ * more motif code / fixes.
+ * moved devices.c to libng, added init function for switching to
+ devfs namespace.
+ * made xawtv/motv more quiet by default, prefixed some messages
+ with "if (debug)".
+ * copyed new fb font rendering from fbi for fbtv.
+ * Made grabdisplay in fbtv work again.
+ * Added german application defaults for motv.
+ * fixed default dsp device.
+ * added v4l2 support to v4l-conf.
+
+
+3.52 => 3.53
+============
+
+ * various build fixes (aa.c / build without Xvideo / FreeBSD).
+ * s|/dev/video|/dev/video0|, also moved stuff to a single file.
+ * ttv fixes, made ttv use the conversion functions.
+
+
+3.51 => 3.52
+============
+
+ * Added ttv -- a aalib based tv viewer.
+ * wrote some docs for libng.
+ * optimized the tracking code for the window clipping.
+ * more motif code / fixes.
+ * added support for planar yuv (grabdisplay via Xvideo).
+ * bytesex fixes for showriff.
+
+
+3.50 => 3.51
+============
+
+ * Major documentation update
+ * Some more motif tweaks. Build it with --enable-motif if you have
+ openmotif installed and want to have a look, comments about the
+ new GUI are welcome. motv is the exectutable (anyone has a idea for
+ a better name ?).
+ * disabled packed pixel yuv for FreeBSD (broken).
+ * added -hwscan option.
+
+
+3.49 => 3.50
+============
+
+ * lot of new motif stuff
+ * added a workaround for a bttv bug.
+ * minor fix in subtitles script.
+
+
+3.48 => 3.49
+============
+
+ * added archive function to the webcam utility.
+ * config file tags are case insensitive now.
+ * changed webcam to use libng conversions (i.e. it can deal
+ with yuv-only devices now).
+ * raw yuv data support for quicktime (with help from
+ W. Michael Petullo <mike@flyn.org>)
+ * more new motif stuff.
+
+
+3.47 => 3.48
+============
+
+ * added config file entries for record settings.
+ * fixed some minor FreeBSD build problems on.
+ * Managed it to get the locate stuff right for the motif
+ version.
+ * fixed a rate control bug.
+ * fixed a bug in vtx display code.
+ * frequency table for south africa (Hendrik Visage <hvisage@envisage.co.za>)
+
+
+3.46 => 3.47
+============
+
+ * fixed more makefile flaws (which broke rpm -ta).
+ * fixed a bug in color space conversion
+ (FUKUCHI Kentarou <fukuchi@is.titech.ac.jp>)
+ * reactivated chromakeying code. Untested.
+ * Bumped the timeout for VIDIOCSYNC from one to three
+ seconds. Seems some USB-Devices need more time
+ for the first frame.
+ * dropped Xaw3d support altogether.
+ * added back in some 3D effects using the new features of the
+ XFree86 4 Athena widgets.
+
+
+3.45 => 3.46
+============
+
+ * fixed Makefile bug (which caused fonts not being included in the
+ tarball).
+
+
+3.44 => 3.45
+============
+
+ * Xaw3d disabled by default -- it crashes xawtv with i18n turned on.
+
+
+3.43 => 3.44
+============
+
+ * fixed minor bug in grab-v4l.c
+ * rewrote much of the conversion/compression code, made it reentrant.
+ * moved the conversion/compression code to a thread.
+ * rewrote the grabdisplay code.
+ * The -xvideo and -device switches implicitly turn on/off the Xvideo
+ extention.
+ * The vtx command (see xawtv-remote man-page) can parse ANSI color
+ sequences too.
+ * new shell script to display subtitles.
+ * update for cc (Adam <adam@cfar.umd.edu>). Moved the utility
+ out of the contrib, renamed it to ntsc-cc (to avoid name clashes
+ with the C compiler) and included it into the Makefile tree, so
+ it gets compiled and installed by default. Wrote a short man
+ page for it.
+ * some progress on the motif version.
+ * fixed a bug in webcam (Kelsey Hudson <khudson@rohan.sdsu.edu>).
+
+
3.42 => 3.43
============
diff --git a/KNOWN_PROBLEMS b/KNOWN_PROBLEMS
deleted file mode 100644
index dec5386..0000000
--- a/KNOWN_PROBLEMS
+++ /dev/null
@@ -1,56 +0,0 @@
-
-bttv + ATI Rage128 + DRI seem not to play nicely together (hard freeze).
-Don't know why. Happens with the ATI only, other gfx cards work fine.
-Suspect it's either a hardware problem or a bug somewhere in DRI (either
-kernel or xfree86). The only workaround I know of is to turn off DRI.
-
---
-
-For some people xawtv failes with
- Error: Couldn't find per display information
-
-This is probably some library compatibility problem. I've never seen
-this myself. According to a report I've received upgrading Xfree86 to
-4.0 fixed this. Probaby xawtv does'nt work with 3.3.x libraries if it
-was compiled against the 4.0.x versions.
-
-Compiling xawtv without DGA support seems to fix this too.
-
---
-
-libXaw3d is buggy. It bombs when xawtv wants to use a visual with a
-different color depth than the default visual. Looks like this:
-
-bogomips kraxel ~# xawtv
-This is xawtv-3.08, running on Linux/i686 (2.2.13)
-visual: id=0x22 class=3 (PseudoColor), depth=8
-visual: id=0x23 class=1 (GrayScale), depth=8
-visual: id=0x24 class=4 (TrueColor), depth=24
-switching visual (0x24)
-[ ... more messages ... ]
-X Error of failed request: BadValue (integer parameter out of range for operation)
- Major opcode of failed request: 91 (X_QueryColors)
- Value in failed request: 0xd3d3d3
- Serial number of failed request: 63
- Current serial number in output stream: 63
-
-workaround: ./configure --disable-xaw3d
-
---
-
-Some people report xawtv segfaults with glibc 2.1
-(got success reports too). I don't know what the
-reason for this problem is. From the stack traces
-I've seen so far, I suspect it is a glibc bug or
-some incompatibility between glibc and the X11 libs.
-
-I've got one report that upgrading the X11 libs from
-3.3.2 to 3.3.3 fixed the problem.
-
-
-HTH,
-
- Gerd
-
---
-Gerd Knorr <kraxel@goldbach.in-berlin.de>
diff --git a/Make.config.in b/Make.config.in
new file mode 100644
index 0000000..9ab7fdd
--- /dev/null
+++ b/Make.config.in
@@ -0,0 +1,41 @@
+
+# paths
+DESTDIR=
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=$(DESTDIR)@bindir@
+mandir=$(DESTDIR)@mandir@
+libdir=$(DESTDIR)@libdir@/xawtv
+resdir=$(DESTDIR)@resdir@
+fontdir=$(DESTDIR)/usr/X11R6/lib/X11/fonts/misc
+config=@x11conf@/xawtvrc
+
+# programs
+CC=@CC@
+DEPEND=@DEPEND@
+INSTALL=@INSTALL@
+INSTALL_PROGRAM=@INSTALL_PROGRAM@
+INSTALL_DATA=@INSTALL_DATA@
+INSTALL_DIR=mkdir -p
+SUID_ROOT=-m4755 -o root
+
+# misc
+OS:=$(shell uname -s | tr "A-Z" "a-z")
+VERSION=@VERSION@
+
+# for CFLAGS
+WARN_FLAGS=-Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
+LFS_FLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+X11_FLAGS=@X_CFLAGS@ -I/usr/X11R6/include/X11/fonts
+LIB_FLAGS=-I$(srcdir)/../libng -I$(srcdir)/../libvbi -L../libvbi -L../libng
+
+# libraries
+ATHENA_LIBS=@X_LIBS@ @LIBS@ @ATHENA@
+MOTIF_LIBS=@X_LIBS@ @LIBS@ -lXm -lXmu -lXt \
+ @X_PRE_LIBS@ -lXp -lXpm -lXext -lX11 @X_EXTRA_LIBS@
+GFX_LIBS=@GFXLIBS@ @LIBPTHREAD@
+CURSES_LIBS=@LIBCURSES@
+LIRC_LIBS=@LIRC@
+OSS_LIBS=@LIBOSS@
+ALSA_LIBS=@LIBALSA@
+AA_LIBS=$(shell aalib-config --libs)
diff --git a/Makefile b/Makefile
index f7f27dc..7a5f147 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,3 @@
-default:
- ./configure && $(MAKE) dep && $(MAKE)
-
-
-#########################################################
-# just for me, some maintaining jobs. Don't use them
-
-checkit diff release port tarball:
- ./configure && $(MAKE) $@
+all checkit diff release port tarball snapshot auto:
+ ./configure
+ $(MAKE) $@
diff --git a/Makefile.clean b/Makefile.clean
index f7f27dc..7a5f147 100644
--- a/Makefile.clean
+++ b/Makefile.clean
@@ -1,9 +1,3 @@
-default:
- ./configure && $(MAKE) dep && $(MAKE)
-
-
-#########################################################
-# just for me, some maintaining jobs. Don't use them
-
-checkit diff release port tarball:
- ./configure && $(MAKE) $@
+all checkit diff release port tarball snapshot auto:
+ ./configure
+ $(MAKE) $@
diff --git a/Makefile.in b/Makefile.in
index 563a5fc..e5fb47e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,13 +1,40 @@
-SUBDIRS=libvbi libng src man radio font tools webcam http #i2c vtx
+#########################################################
+# build stuff
+
+SUBDIRS=src http webcam libvbi libng libng/plugins radio tools cc man @SUBS@
+
+all build: $(SUBDIRS)
+.PHONY: $(SUBDIRS)
+
+
+src: libvbi libng .havedeps
+ (cd $@; $(MAKE) build)
+
+http: libvbi .havedeps
+ (cd $@; $(MAKE) build)
+
+webcam: libng .havedeps
+ (cd $@; $(MAKE) build)
-all build dep depend install clean distclean realclean::
+libvbi libng libng/plugins radio font tools cc man: .havedeps
+ (cd $@; $(MAKE) build)
+
+
+.havedeps dep depend:
set -ex; for dir in $(SUBDIRS); do \
- (cd $$dir; $(MAKE) $@); \
+ (cd $$dir; $(MAKE) depend) \
+ done
+ touch .havedeps
+
+install clean distclean realclean::
+ set -ex; for dir in $(SUBDIRS); do \
+ (cd $$dir; $(MAKE) $@) \
done
distclean realclean::
- -rm -f *~ debian/*~ config.cache config.h config.log config.status Makefile
+ -rm -f *~ debian/*~ xpm/*~ Makefile Make.config .havedeps
+ -rm -f config.cache config.h config.log config.status
cp Makefile.clean Makefile
@@ -16,24 +43,12 @@ distclean realclean::
VERSION=@XAWTV_VERSION@
-realclean::
- find . -name snap0*.ppm -print | xargs -i rm -f
- find . -name snap0*.jpeg -print | xargs -i rm -f
- find . -name .nfs* -print | xargs -i rm -f
- set -e; for dir in i2c; do make -C $$dir distclean; done
-
-diff:
- last=`ls -t $(HOME)/strusel/linux/xawtv/xawtv_*.tar.gz | head -1`;\
- tardiff $$last . | gzip > ../xawtv_$(VERSION).diff.gz
-
checkit: distclean
dpkg-buildpackage -tc -us -uc -rfakeroot
# rpm -ta ../xawtv_*.tar.gz
lintian ../xawtv_*.changes
-#release: realclean diff
-release: distclean diff
-# make -C font bdf
+release: distclean
dpkg-buildpackage -tc -rfakeroot
port:
@@ -43,9 +58,21 @@ tarball: distclean
(cd ..; tar cvzf xawtv_$(VERSION).tar.gz \
xawtv-$(VERSION))
+snapshot: distclean
+ (cd ..; tar cvzf xawtv-snap-`date +%Y-%m-%d`.tar.gz \
+ xawtv-$(VERSION))
+
auto:
rm -f config.cache
autoconf
autoheader
./configure
+ make distclean
+ make
+
+realclean::
+ find . -name snap0*.ppm -print | xargs -i rm -f
+ find . -name snap0*.jpeg -print | xargs -i rm -f
+ find . -name .nfs* -print | xargs -i rm -f
+ set -e; for dir in i2c; do make -C $$dir distclean; done
diff --git a/Miro_gpio.txt b/Miro_gpio.txt
deleted file mode 100644
index 7d0030c..0000000
--- a/Miro_gpio.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-
-MIRO pro: GPIO registers, Win95
-
-GPOE: 0000 0011 0000 0000 0000 1111 [03000F]
--------------------------------------------------
-GPDATA: 1110 0100 0000 0111 1101 0010 [E407D2] (direct output)
-GPDATA: 1110 0110 0000 0111 1101 0001 [E607D1] (using MSP chip)
-
diff --git a/README b/README
index 9b573e9..1d23db2 100644
--- a/README
+++ b/README
@@ -1,25 +1,38 @@
-IMPORTANT: Don't send me mails with images attached unless I ask you
-to do so. Mails with images attached will go to /dev/null unseen.
+Documentation overview
+======================
+
+README [this file] gives a overview over the package.
+ Build instructions, short overview over every
+ program, some maybe useful URL's.
+
+man pages For most programs a manual page is available.
+
+README.xfree4 Some notes about XFree86 4.x and the Xvideo
+ extention.
+
+README.recording If you want record videos, have a look at this
+ file. It also has some notes about how to process /
+ playback the files recorded by xawtv/streamer.
+
+README.network How to stream video/audio over the net. Pointers to
+ other software for the most part.
+README.lirc Some hints how make lirc work with xawtv.
-small is beautiful
-==================
+README.bttv Some hints to get bttv going, also lists some
+ known problems.
-This is a _simple_ xaw-based TV Program which uses the bttv driver or
-video4linux (included in 2.1.x). Copy Policy is GNU GPL.
+UPDATE_TO_v3.0 Some hints for upgrading from 2.x to 3.x (config
+ file syntax changes, ...)
before sending me email...
==========================
-If you are upgrading from 2.x to 3.x, read the UPDATE_TO_v3.0
-file. There are a few incompatible changes you have to take care
-of.
-
-READ THE F*** MANUAL FIRST (this README file, Trouble-Shooting file,
-KNOWN_PROBLEMS file, xawtv man page, documentation for the driver
-you are using).
+IMPORTANT: Don't send me mails with images attached unless I ask you
+to do so. Mails with images attached will go to /dev/null unseen, you
+will never ever see an answer for these.
If you have problems after upgrading, please check the ChangeLog for
hints first. Looking into the ChangeLog is a good idea in general,
@@ -52,6 +65,7 @@ problem, you can skip it. But if in doubt, better include it...
For patches/changes:
+
* Please add a comment what is changed and and why you changed it.
* Please send unified diffs ("diff -u") against the latest version.
* Please don't reformat my source code.
@@ -63,12 +77,20 @@ For patches/changes:
compile & install
=================
-A simple
+The commands
+ $ ./configure [ options ]
$ make
-should compile xawtv, v4l-conf, maybe kradio and a few other
-utilities. You can install the programs (as root) with:
+should compile xawtv, v4l-conf, fbtv and a few other utilities. You can
+also simply type "make" if you don't want to pass any options to
+configure.
+
+If it failes, check that all required packages are installed. Note that
+the *-devel packages are also required to compile stuff, i.e. you need
+both libjpeg and libjpeg-devel for example.
+
+You can install the programs (as root) with:
# make install
@@ -86,7 +108,9 @@ bttv
----
bttv is'nt bundled with xawtv any more. You can the latest version
-from http://www.strusel007.de/linux/bttv/
+from http://bytesex.org/bttv/. If you are using kernel 2.4.x, it is
+very unlikely that you need a update, the bttv driver in 2.4.x is
+updated in regular intervals.
v4l-conf
@@ -126,11 +150,23 @@ file). If v4l-conf is'nt installed too, you have to run it once
(as root) before starting xawtv.
+motv
+----
+
+That's basically xawtv with better (IMO), motif-based GUI. Feature set
+is very close to xawtv, they share alot of code (basically everything
+but the athena/motif GUI code).
+
+motv uses Motif 2.x features (utm, render tables). This means you
+need openmotif, lesstif does *not* work.
+
+
xawtv-remote
------------
-remote control for xawtv. Takes commands for xawtv as command line
-arguments. Check 'xawtv-remote -h' for details.
+remote control for xawtv. Works with motv too. Takes commands for
+xawtv as command line arguments. Check 'xawtv-remote -h' for details.
+A man-page exists too.
ObSecurity: This uses X Properties, everyone who is allowed to connect
to your X11 Display can control xawtv.
@@ -143,22 +179,28 @@ fbtv
----
TV program for the linux console. Runs on top of a framebuffer
-device, tested with vesafb (2.1.109+) so far. Check out man-page and
-source code for details.
+device. Check out man-page and source code for details.
+
+
+ttv
+---
+
+aa-lib based TV app which renders the TV image on any text terminal.
v4lctl
------
-This tool allows to control a v4l device from the command line. Check
-the man-page for details.
+This tool allows to control a v4l device from the command line.
+Also can capture images. Check the man-page for details.
streamer
--------
-Command line tool for streaming capture (single frames work too).
-Try the '-h' switch for a description.
+Command line tool for streaming capture, including audio. Single
+frames work too. Try the '-h' switch for a description. A (short)
+man page is available too.
radio
@@ -181,17 +223,10 @@ separate tarball now.
videotext / teletext
--------------------
-There is a new videotext application for bttv: alevt. Your friendly
-sunsite mirror has it.
+alevt is _the_ videotext application for bttv. URL below.
-Ralph has written a software decoder for teletext. You can download
-it from his web-page. There is a program called videoteXt which can
-be used to view the teletext pages. A link to this package is on
-Ralphs page too.
-
-In the vtx subdirectory is a simple vtx2ascii converter, build quick&diry
-out of the videoteXt sources. Can output ascii (with and without
-ansi-colors) and html. A perl-cgi is included too.
+A http server for videotext which is based on alevt's vbi decoder engine
+is in the http subdirectory. It's called alevtd.
webcam
@@ -214,16 +249,15 @@ nifty tool to do a channel scan (decodes the station ID from vbi).
resources
=========
-http://www.strusel007.de/linux/xawtv/ - xawtv [me]
-http://user.exit.de/froese/ - alevt [Edgar]
-http://www.metzlerbros.de/bttv.html - bttv [Ralph]
+http://bytesex.org/xawtv/ - xawtv [me]
+http://bytesex.org/bttv/ - bttv [me]
+http://lecker.essen.de/~froese/ - alevt [Edgar]
http://bttv-v4l2.sourceforge.net/ - bttv2 [Justin]
http://roadrunner.swansea.uk.linux.org/v4l.shtml - v4l [Alan]
http://www.thedirks.org/v4l2/ - v4l2 [Bill]
http://www.tk.uni-linz.ac.at/~simon/private/i2c/ - i2c [Simon]
http://www-mice.cs.ucl.ac.uk/multimedia/software/vic/ - vic
-
Have fun!
Gerd
diff --git a/README.bttv b/README.bttv
index a4136c8..cda93af 100644
--- a/README.bttv
+++ b/README.bttv
@@ -2,177 +2,100 @@
Some hints to get the bttv driver up and running
================================================
-[ Note1: this applies to 0.6.x versions, 0.7.x (also kernel 2.4.x)
- users should check out the README included there instead.
- Note2: If you have trouble with 0.6.x, try to upgrade to 0.7.x
- first. The list of supported cards is much longer. ]
-
-You need configured kernel sources to compile the bttv driver. The
-driver uses some Makefile magic to compile the modules with your
-kernel's configuration (wrt. module-versions, SMP, ...). If you
-already have compiled the kernel at least once, you probably don't
-have do worry about this. If not, go to /usr/src/linux and run
-at least "make config". Even better, compile your own kernel, you'll
-never become a real hacker else ;-)
-
-Of cource you have to load the modules as very first thing. There is
-a script called "update" in the bttv/drivers directory. I use this
-one to load a new version while doing driver hacking. You can use it
-too, but check the module arguments before. They work for my setup,
-and probably do *not* for yours. The module arguments are documented
-below. The MAKEDEV.v4l script creates the special files (/dev/video,
-...) for the video4linux.
-
-To autoload the modules, stick something like this into
-/etc/modules.conf:
-
-# TV
-alias char-major-81 videodev
-alias char-major-81-0 bttv
-pre-install bttv modprobe -k msp3400; modprobe -k tuner
-options bttv radio=1
-options tuner type=5
-
-Again: this is for _my_ setup, you probably have to adjust the module
-parameters.
-
-
-See also
-========
-
- * Trouble-Shooting - general tips for xawtv / bttv
- * Sound-FAQ - A description how Sound works on bt8xx-based
- boards and how one can make a new card work.
-
-
-****************************************************************************
-****************************************************************************
-
-insmod options for the bttv modules
-cut+paste from bttv-0.6.4e/driver/MODULES
-=========================================
-
-
-There are quite lot modules out here...
-
-videodev.o
- this is the basic video4linux module, all video
- drivers (incl. bttv) register themself here.
-
-i2c.o
- the generic i2c module. It does much of the i2c bus
- management, all other modules (except videodev.o)
- use this one
-
- insmod args:
- scan=1 scan the bus for i2c devices
- verbose=0 shut up i2c
- i2c_debug=1 for debugging, it sticks the whole
- (software) i2c bus traffic to the
- syslog
-
-bttv.o
- the bt848 (grabber chip) driver
-
- insmod args:
- remap=adr remap Bt848 memory to adr<<20
- vidmem=base frame buffer address>>20 (of graphic card)
- triton1=0/1 for Triton1 compatibility
- Triton1 is automatically recognized
- but this might also help with other chipsets
- pll=0/1/2 pll settings
- 0: don't use PLL
- 1: 28 MHz crystal installed
- 2: 35 MHz crystal installed
- radio=0/1 card supports radio
- card=n card type
- 0: Auto-Detect
- 1: Miro
- 2: Hauppauge (old bt848 boards)
- 3: STB
- 4: Intel
- 5: Diamond
- 6: AVerMedia
- 7: MATRIX Vision MV-Delta
- 8: FlyVideo
- 9: TurboTV
- 10: Hauppauge (new bt878 boards)
- 11: MIRO PCTV pro
- 12: Terratec/Vobis TV-Boostar
- 13: Newer Hauppauge WinCam (bt878)
- 14: MAXI TV Video PCI2
- 15: Terratec TerraTV+
- 16: Aimslab VHX
- 17: PXC200
- 18: AVermedia98
- 19: FlyVideo98 (newer FlyVideo cards)
-
- remap, card, radio and pll accept up to four comma-separted arguments
- (for multiple boards). The CARD and PLL defines from the Makefile
- are used as defaults.
-
-msp3400.o
- The driver for the msp34xx sound processor chips. If you have a
- stereo card, you probably want to insmod this one.
-
- insmod args:
- debug=1/2 print some debug info to the syslog,
- 2 is more verbose.
- simple=1 Use the "short programming" method (newer
- msp34xx versions support this).
- once=1 Don't check the TV-stations Audio mode
- every few seconds, but only once after
- channel switches. This should workaround
- the problems with disappearing sound.
- amsound=1 Audio carrier is AM/NICAM at 6.5 Mhz. This
- should improve things for french people, the
- carrier autoscan seems to work with FM only...
-
-tea6300.o
- The driver for the tea6300 fader chip. If you have a stereo
- card and the msp3400.o doesn't work, you might want to try this
- one. This chip is seen on most STB TV/FM cards (usually from
- Gateway OEM sold surplus on auction sites).
-
- insmod args:
- debug=1 print some debug info to the syslog.
-
-tda8425.o
- The driver for the tda8425 fader chip. This driver used to be
- part of bttv.c, so if your sound used to work but does not
- anymore, try loading this module.
-
- insmod args:
- debug=1 print some debug info to the syslog.
-
-tda9855.o
- The driver for the tda9855 audio chip. Afaik, only the
- Diamond DTV2000 has this chip.
-
- insmod args:
- debug=1 print some debug info to the syslog.
-
-tuner.o
- The tuner driver. You need this unless you want to use only
- with a camera or external tuner ...
-
- insmod args:
- debug=1 print some debug info to the syslog
- type=n type of the tuner chip. n as follows:
- 0: Temic PAL tuner
- 1: Philips PAL_I tuner
- 2: Philips NTSC tuner
- 3: Philips SECAM tuner
- 4: no tuner
- 5: Philips PAL tuner
- 6: Temic NTSC tuner
- 7: Temic PAL tuner
-
-i2c_chardev.o
- provides a character device for i2c bus access. Works for 2.1.x
- only, not compiled by default.
-
-
-To load the tuner+msp3400 modules with kerneld/kmod, you should use
-"modprobe -k tuner; modprobe -k msp3400" in pre-install for bttv.
-
+general hints
+-------------
+
+(1) Make sure if your board is recognized correctly. The bttv driver
+ should print a line like this one (Use the 'dmesg' command to see
+ the kernel messages):
+
+ bttv0: model: BT848(Hauppauge old)
+
+ If your card is'nt autodetected correctly, you have to specify the
+ board type as insmod argument (card=n). You might also have to
+ specify tuner=x and pll=x.
+ Check the driver documentation for details and a list of supported
+ cards. The standard kernel has the bttv documentation in the
+ Documentation/video4linux/bttv directory.
+
+(2) If you are using a vanilla 2.2.x kernel kernel, it is worth trying
+ to upgrade as very first step. Either download and build bttv
+ 0.7.x for your 2.2.x kernel, or upgrade to 2.4.x which includes
+ the 0.7.x driver already.
+ bttv 0.7.x knows alot more cards than the 2.2.x kernel driver, the
+ autodetect is improved much and a number of known problems is
+ fixed.
+
+(3) If you have problems with xawtv, you should open a xterm (or
+ whatever your favorite terminal app is) and start xawtv from
+ there. This way you'll see any error messages xawtv might print on
+ stderr which should help to find the source of the problems.
+
+(4) If something broke after an update, have a look at the changelog.
+ It might be mentioned there.
+
+
+common problems
+---------------
+
+?: I have a black screen in overlay mode
+!: The driver was not initialized correctly, v4l-conf (or the
+ X-Server) has to configure the bttv driver with the current video
+ mode and framebuffer address first. Check if v4l-conf is installed
+ suid root, it needs root priviliges to do this. You can also start
+ v4l-conf from a terminal and check the messages it prints.
+
+?: I have a blue screen.
+!: Good, the overlay is working. A blue screen is what you get if the
+ grabber chip has no input signal. You are probably using the wrong
+ video source, pick another. Also happens sometimes if the tuner
+ type is wrong, check the driver configuration.
+
+?: I have a noisy screen and/or can't tune (some) stations.
+!: Most likely the tuner types is wrong, check the driver configuration.
+ It's no problem to do trial-and-error here.
+
+?: The video is outside the window and spread in thin lines over the
+ screen.
+!: xawtv / v4l-conf did'nt autodetect the color depth for your screen
+ correctly. You can fix that with xawtv's -bpp switch.
+
+?: Only the left part of the window is updated, the right one is updated
+ never / sometimes / only if the window is small.
+!: Your graphics card and/or motherboard can't deal with the data rate
+ going over the PCI bus, leading to canceled PCI transfers. Reduce
+ the color depth, with 16 bpp instead of 32 bpp should work much
+ better.
+
+?: I get no sound.
+!: (a) If your TV-Card is connected to the sound card's line in with a
+ short cable: Make sure the sound driver is loaded, sound cards
+ are usually quiet until initialized by the driver. Also check
+ the mixer settings.
+ (b) Double-check the card type is correct (see above).
+ (c) If there is still no go, have a look at the Sound-FAQ in the
+ bttv documentation.
+
+
+hardware specific problems
+--------------------------
+
+ * bttv + DRI seem not to play nicely together with some cards (ATI
+ Rage128). The linux box just freezes. Don't know why. Suspect
+ it's either a hardware problem or a bug somewhere in DRI (either
+ kernel or xfree86). The only workaround I know of is to turn off
+ DRI.
+
+ * Some motherboard chipsets have PCI bugs, especially with PCI-PCI
+ transfers which are used for video overlay. The bt848/878 chips
+ have some bug compatibility options, which can be enabled to
+ workaround these problems. Have a look at the triton1 and vsfx
+ insmod options. For some known-buggy chipsets these are enabled
+ automagically.
+
+ * Sometimes IRQ sharing causes trouble. It works most of the time,
+ but in combination with some hardware and/or drivers it doesn't work.
+ Especially graphic cards are known to cause trouble due to the lack
+ of a IRQ handler. Try disabling the VGA IRQ in the BIOS. Try moving
+ cards to another PCI slot. Your motherboard manual should tell you
+ which PCI slots share IRQ's.
diff --git a/README.de b/README.de
deleted file mode 100644
index c4bf924..0000000
--- a/README.de
+++ /dev/null
@@ -1,24 +0,0 @@
-
-small is beautiful
-==================
-
-Also das hier ist ein _einfaches_ Xaw-basiertes Fernseh-Programm für
-die vom bttv-Treiber unterstützten bt848-Karten. Inzwischen etwas
-user-freundlicher als die früheren Versionen. Trotzdem sollte man
-sich unbedingt die man-page anschauen, da stehen (unter anderem) die
-Tastatur-shortcuts drin. Und ohne Tastatur kann man nicht mal einen
-Sender einstellen ...
-
-copy policy ist GNU GPL.
-
-
-compilieren, installieren & benutzen
-====================================
-
-Weil ich zu faul bin, alles in zwei Sprachen zu updaten, gibts fortan
-nur noch ein englisches README + englische man-page.
-
-Sorry folks.
-
- Gerd
-
diff --git a/README.network b/README.network
new file mode 100644
index 0000000..6fc2e37
--- /dev/null
+++ b/README.network
@@ -0,0 +1,51 @@
+
+How send audio/video data over the net?
+=======================================
+
+
+Just some pointers where to look. I havn't tried everything myself.
+
+
+still images (webcam)
+---------------------
+
+You can use the xawtv's webcam utility (in the webcam subdirectory) to
+capture single frames and upload them to a (web-)server using ftp.
+
+There are plenty of other tools for that purpose, http://freshmeat.net
+has a list.
+
+
+both audio and video
+--------------------
+
+You can use video conferencing tools, see http://www.openh323.org. That
+should even interoperate with M$ Netmeeting. I've heared there is a
+project named "gnomemeeting" ...
+
+You might want to have a look at videolan (http://www.videolan.org).
+
+Using the mbone tools (i.e. vic for video, vat or rat for audio) works
+too, see http://www-mice.cs.ucl.ac.uk/multimedia/software/
+Drawback is that these two work independent of each other, that's why
+there is no way to make audio and video sync properly.
+
+
+video only
+----------
+
+xawtv works with a remote display. Eats plenty of network bandwith as
+the X11 protocol is not optimized for streaming video. Can be used to
+max-out ATM cards. Don't even think about it with something slower
+than Ethernet.
+
+
+audio only
+----------
+
+Use some network sound daemon, esound for example:
+sox -w -c 2 -r 44100 -t ossdsp /dev/dsp -t raw - | esdcat -r 44100
+
+Check out http://freshmeat.net, IIRC there are some tools to multicast
+audio data.
+
diff --git a/README.recording b/README.recording
index 9acedbe..bb09642 100644
--- a/README.recording
+++ b/README.recording
@@ -1,4 +1,8 @@
+Recording movies
+================
+
+
Audio
=====
@@ -12,7 +16,7 @@ all mixer controls at 0 (i.e. muted) by default.
The inputs where the sound cards record from have a red background
color. With the right mouse botton you'll get a menu where you can
change the settings. FreeBSD has a aumix version with X11 GUI in
-the ports collection which is very nice too.
+the ports collection which is very nice too (aumix-gtk in debian).
Note on stereo: xanim seems not be able to playback stereo sound
correctly.
@@ -21,19 +25,23 @@ correctly.
Video
=====
+Note that video recording does not work if the Xvideo extention is in
+use. For recording stuff with xawtv you might have to start the
+application with the -noxv switch to disable Xvideo.
+
xawtv/streamer handle video recording with multiple threads:
- - one thread records video (and does color space conversion
- / compression, maybe this should be separated)
+ - one thread records video (+ displays video on screen).
+ - one (or more) thread(s) does color space conversion / compression.
- one thread records audio (unless you do video only).
- one thread writes the movie data to the disk.
- one thread calls sync frequently to make the writeouts more
smoothly (more smaller chunks instead of few very big ones).
-There are buffer fifo's between the recording threads and the disk
-writer to avoid recording overruns due to a temporarely busy hard
-disk.
+There are buffer fifo's between the recording threads and the
+compression / disk writer to avoid recording overruns due to a
+temporarely busy hard disk or CPU load peaks.
If you see messages about a full fifo or about v4l(2) waiting for
free buffers it is very likely that your hard disk is too slow,
@@ -53,9 +61,6 @@ automatically.
Known problems (and workarounds)
================================
-streamer/xawtv can't handle floating point frame rates (like 29.97).
-Bad luck for now [to be fixed].
-
The timestamping for the video frames isn't very exact as it does
_not_ come from the v4l(1) driver but is just a gettimeofday() call
after receiving the video frame. API design bug, needs fixing.
@@ -68,20 +73,19 @@ Troubleshooting syncronisation problems
If you are recording a movie with xawtv/stremaer you get a display
like this on stderr:
-real: 3.638s audio: 3.529s video: 3.700s
+real: 3.638s audio: [+-]0.023s video: [+-]0.042s
- "real" is the real time, i.e. simply the number of seconds passed
since you've started recording.
-
- "audio" says how much audio data was recorded: simply the total
- number of bytes divided by the data rate (bytes/second).
-
+ number of bytes divided by the data rate (bytes/second). It is
+ displayer relative to real time.
- "video" is the same for video: total frames divided by the
- frames/second.
+ frames/second (also displayed relative to real time).
-Obviously these numbers should stay close together. If audio and
-video run out of sync, you should be able to see whenever audio or
-video is wrong by comparing the two with the real time.
+Obviously the numbers for audio/video should stay close to zero. If
+audio and video run out of sync you can easily see whenever audio or
+video is wrong by looking at these numbers.
The display says how much media data streamer/xawtv tried to put into
the fifos. Any data which get lost due to fifo overruns will *not* be
@@ -99,11 +103,24 @@ can't capture frames with the frame rate you are asking for. A single
message now and then is harmless.
-Read/Playback stuff
-===================
+MPEG Encoding
+=============
+
+Have a look at the mjpegtools (http://mjpeg.sourceforge.net). xawtv
+can write the yuv4mpeg format accepted by mpeg2enc directly. mp2enc
+accepts xawtv's wav files too. So you can use xawtv/streamer,
+mpeg2enc, mp3enc and mplex to build mpeg movies.
+
+If you don't have enought disk space to store uncompressed yuv video
+you can also record compressed quicktime/avi files and then recode
+stuff using lav2yuv + mpeg2enc in a pipe. The streamer help text
+(streamer -h) has a few examples.
+
+
+Read, Convert, Edit + Playback stuff
+====================================
avi format
-----------
* xanim plays everything without problems.
* QuickTime[tm] (MacOS) plays the uncompressed formats just
@@ -121,7 +138,6 @@ avi format
quicktime format
-----------------
* xmovie + broadcast2000 can read the files without problems
(not exactly surprising as they use the quicktime4linux
@@ -134,7 +150,6 @@ quicktime format
raw data
---------
* ImageMagick can deal with this, you have to specify the image
format + size on the command line like this:
diff --git a/README.translate b/README.translate
new file mode 100644
index 0000000..97e5c92
--- /dev/null
+++ b/README.translate
@@ -0,0 +1,21 @@
+
+translate motv
+==============
+
+The new motif-gui version has i18n support, it is handled by using
+different application default files for the different languages. All
+the strings are in the MoTV-<lang> files. MoTV-default is the english
+version. MoTV-fixed has the other (language-independant) app-default
+settings. The Makefile merges these into MoTV.<lang>.ad files.
+
+To add another language you just need to create a new MoTV-<lang> file
+and add the language to Makefile.in (+ rerun ./configure). "make i18n"
+builds the MoTV.<lang>.ad files. If you set the XUSERFILESEARCHPATH
+environment variable to "./%N.%l.ad:./%N.ad" you can test it without
+installing the app-defaults in /etc/X11.
+
+
+other
+=====
+
+Currently I have no plans to localize xawtv and the command line tools.
diff --git a/README.xfree4 b/README.xfree4
index 3634cdd..a820888 100644
--- a/README.xfree4
+++ b/README.xfree4
@@ -1,15 +1,19 @@
-XFree86 4.0 tips & tricks
+XFree86 4.x tips & tricks
=========================
DGA problems
------------
-Release 4.0 has DGA turned off by default. You'll have turn it on
-in XF86Config, otherwise v4l-conf will not work correctly. It should
-work for most cards this way, althrouth some drivers don't handle DGA
-correctly in 4.0 (that's why it is off...)
+Release 4.0 has DGA turned off by default. This is true for the first
+release only, with current versions this shouldn't be a problem unless
+you have some old config file still in use.
+
+You'll have turn on DGA in XF86Config, otherwise v4l-conf will not
+work correctly (Modules section, extmod options). It should work for
+most cards this way, althrouth some drivers don't handle DGA correctly
+in 4.0 (that's why it is off...)
If DGA doesn't work for you, you have to configure bttv by hand (or
use Xvideo, see below). v4l-conf has the "-a" switch for this.
@@ -43,7 +47,26 @@ without a black border because we are not limited to the maximum size
supported by the bt848 hardware any more.
As this is very new stuff not all drivers support video scaling yet.
-Right now it works with the mga driver (matrox G200+G400) only.
+It basically requires the overlay functions available to the
+applications via xvideo port to be exported using a X-Server internal
+interface too, so other X-Server modules are able to use them.
+
+The mga driver was the first one which supported this (matrox
+G200+G400). XFree86 4.1 adds a few more ones, a quick grep of the
+source tree returns this list: ct, i810, mga, nv, savage, smi,
+trident. For ati you might want to have a look at
+http://www.linuxvideo.org/gatos/.
+
+Detailed Status:
+ * mga: works, I use that myself. On multihead cards the second head
+ is not accelerated, that means hw scaling via Xvideo works on the
+ first head only.
+ * i810: works, according to the drivers author which asked me some
+ questions about it and finally got it going.
+ * tdfx: current CVS version works, next release (4.1.1) will have it.
+ * nvidia: free nv driver not working correctly (4.1). nvidia's
+ binary-only works starting with release 1512.
+ * others: don't know, reports welcome.
You also need a bttv version newer than 0.7.16 (the 2.2.x kernel version
is /way/ to old, kernel 2.4.x is fine). If both bttv driver and xfree86
@@ -67,13 +90,9 @@ start xawtv on the second head if you are *not* using Xvideo. Use
"DISPLAY=:0.1 xawtv" instead. Otherwise v4l-conf will use the wrong
screen to configure the driver.
-With "xinerama" video works on the first physical screen only (the one
-listed first in your ServerLayout section). With Xvideo it will simply
-not work on the other head (will be fixed in one of the next xfree86
-releases I hope), without Xvideo you'll see the video on the wrong
-display.
-
-[ status of the 4.0.2 release ]
+Xvideo + xinerama works just fine starting with XFree86 4.1, older
+versions show video on the first physical screen only (the one listed
+first in your ServerLayout section). Without Xvideo you'll also see
+the video on the first head only.
Gerd
-
diff --git a/Sound-FAQ b/Sound-FAQ
deleted file mode 100644
index efa8c69..0000000
--- a/Sound-FAQ
+++ /dev/null
@@ -1,5 +0,0 @@
-
-bttv and sound mini howto
-=========================
-
-[ gone -- check the bttv documentation -- it's more up-to-date ]
diff --git a/TODO b/TODO
index cc136b5..d951296 100644
--- a/TODO
+++ b/TODO
@@ -11,11 +11,6 @@ general
it should be a station-specific offset to the overall volume. Try to
get this right for every soundcard / high + low volume / ... ).
* mono/stereo config file options.
- * videotext decoder (for station ID, maybe subtitles)
- * switch to another toolkit, Xaw keyboard/menu support sucks
- gtk? Motif?
- * config file args for avi-params?
- * i18n/locale
* hotkeys/remote commands for mono/stereo/...
* two (more?) channel lists: "all" & "frequently used".
diff --git a/Trouble-Shooting b/Trouble-Shooting
deleted file mode 100644
index 754caf0..0000000
--- a/Trouble-Shooting
+++ /dev/null
@@ -1,164 +0,0 @@
-
-Here are a few hints if you have trouble to make bttv & xawtv work:
-
-
-general
-=======
-
-* I STRONGLY recommend to build the driver as module, if you are using
- the driver version included in the linux kernel. All the insmod
- options only available if you build the driver as module. You'll
- need them to configure the driver if autodetection does'nt work.
-
-* Just in case you don't know: With the "dmesg" command you can
- display the (last 4k of) kernel/module messages.
-
-* Check if your board is recognized correctly. The bttv driver
- should print a line like this one:
-
- bttv0: model: BT848(Hauppauge old)
-
- If your card is'nt recognized correctly, you have to specify
- the board type as insmod argument (card=x, see bttv/driver/MODULES
- for a list).
-
-* If your board is'nt listed there, you can check if it is compatible
- with another one which is already in the list (trial-and-error for
- all valid card numbers...).
-
-* The insmod options for the modules are documented in the
- MODULES file. Use the "verbose=" and "debug=" args to make
- the modules more verbose.
-
-
-* Check the PROBLEMS file in Ralph's bttv Documentation
-
-* There are a few known incompatibilities, see below.
-
-* Try a newer version of the X-Server (if available).
-
-* If you upgrade xawtv and something does'nt work any more, please
- check the Changes file before sending bug reports...
-
-* Seems the XF86VidMode extention is rarely used and not very well
- tested with some X-Servers. If you have strange effects while
- switching fullscreen on and/or off, try to disable the VidMode
- usage with the "-novm" switch. If xawtv hangs on startup (while
- asking the Server for available resolutions), using "-novm" should
- help too.
-
-
-video
-=====
-
-* Make sure capture is turned on (xtvscreen starts up with capture off)
-
-* Black screen, no picture at all: Bad, probably the video frame buffer
- address is wrong.
- Setting the address is done by the v4l-conf module based on the
- information from the DGA-Extention of the X-Server. If your
- X-Server doesn't support DGA, you'll have to configure the driver
- manually with the "v4l-conf -a address".
-
-* Black screen after some time of normal operation: try to reload the
- bttv module.
-
-* Blue Screen: That's what you get if there is no input signal
- (Composite1 and no input source connected, sometimes happens with
- the wrong tuner type too). The Blue Screen already comes from
- the Grabber card, so the interaction between Grabber and Graphics
- board already works fine.
-
-* grabber board seems not to sync correctly: try to change the PLL
- settings. You can load bttv with the insmod argument pll=[0,1,2].
- See bttv/driver/MODULES for details.
-
-* noisy, sort-of-white screen: There is no TV Station tuned in.
- Possible reasons:
- - There is really no station present on that channel...
- - tuner module not loaded
- - Wrong tuner type. You can set the tuner type with the "type="
- insmod argument of the tuner module, see the MODULES file for
- details.
- - Wrong channel map (the channel-to-freqency mapping is
- different in different countries)
- - some trouble with the i2c bus, i/o error messages in the syslog.
- If this is a Hauppauge board, check the kernel messages to see
- if it was correctly identified as Hauppauge. If not, try
- "insmod bttv card=2"
-
-* Trouble with TrueColor mode (image spread across the screen): It's
- impossible to find what color depth the X-Server uses internally,
- you might have to use the -b switch to tell if it runs 24 or 32 bpp.
- Both xawtv and v4l-conf have this switch.
-
-* Picture is fine, but it some pixels off the window (matrox board,
- eh?). This is a design bug in the DGA extention. A workaround
- is the -shift=xxx option. Play with different values for xxx
- until it fits, 1024 is a good start.
-
-
-sound
-=====
-
-* With old Hauppauge boards (bt848-based) it might be needed to load
- the bttv module with "card=2". Try this if your board is'nt
- correctly autodetected as Hauppauge.
-
-* it might be nessesary to initialize the sound card with a
- "insmod sound" to get sound at all. Double-check the mixer
- settings.
-
-* For radio support (WinTV/Radio) you have to do "insmod radio=1"
-
-
-if it still does'nt work... -- hardware problems/conflicts
-============================================================
-
-* As far I know, the bttv driver can't do IRQ sharing, make sure it
- has its own interrupt. Try to play with the BIOS settings, or swap
- PCI boards if nothing else works...
-
-* There are reports that the tuner works only if the *graphic board*
- has its own IRQ. Don't ask me why...
-
-* Sometimes there are memory conflicts beetween bttv and some other
- card. With the remap insmod option of the bttv module you can move
- the memory of the bt848 chip to some other place.
-
-* If you have to boot Win95 first to make the grabber board work, you
- might want to save /proc/pci before and after running Win95 and look
- for changes to track the problem down.
-
-* /proc/pci, /proc/interrupts and /proc/ioports are your friends...
-
-
-Known problems / incompatibilities
-==================================
-
-[Alan on linux-kernel]
-
-o Some SiS boards it doesnt work on. I don't know if it works on
- the new SiS socket 7 stuff (5598 etc) but I'd like to know
-
-o S3 video cards it flickers when windows are scrolling etc. Windows
- & Linux. You cant DMA video to an S3 while it is using the onboard
- accelerator
-
-o Lot of noise with 3c59x ethernet. Caused by the latency for the
- 3c59x having to be really high to avoid a silicon bug.
-
-[Ralph, see also his PROBLEMS file]
-
-o Some S3 cards (mostly Trio 64) don't work with XFree (but with
- AccelX).
-
-
-
-More hints/suggestions/corrections/updates are welcome,
-
- Gerd
-
-
---
-Gerd Knorr <kraxel@goldbach.in-berlin.de>
diff --git a/acconfig.h b/acconfig.h
index 619a967..0ebb61f 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,9 +1,9 @@
-/* MIT shared memory extention */
-#undef HAVE_MITSHM
-
/* lirc lib */
#undef HAVE_LIBLIRC_CLIENT
+/* alsa */
+#undef HAVE_ALSA
+
/* quicktime lib */
#undef HAVE_LIBQUICKTIME
diff --git a/build-test b/build-test
index 19efba7..df41902 100644
--- a/build-test
+++ b/build-test
@@ -15,8 +15,14 @@ make distclean
autoconf || exit 1
autoheader || exit 1
+set -x
+
# normal
-./configure && make || exit 1
+./configure && make -j2 || exit 1
+make distclean
+
+# parallel builds
+./configure && make -j || exit 1
make distclean
# no lirc
@@ -31,9 +37,25 @@ make distclean
./configure --disable-xvideo && make || exit 1
make distclean
+# no aalib
+./configure --disable-aa && make || exit 1
+make distclean
+
+# no motif
+./configure --disable-motif && make || exit 1
+make distclean
+
+# no alsa
+./configure --disable-alsa && make || exit 1
+make distclean
+
+# no X11
+./configure --without-x && make || exit 1
+make distclean
+
# library link order
-#./configure && make CC="gcc -static" || exit 1
-#make distclean
+./configure && make CC="gcc -static" || exit 1
+make distclean
# 2.2.x kernel headers
kernel=`echo /usr/src/kernel/2.2.17`
@@ -41,10 +63,12 @@ kernel=`echo /usr/src/kernel/2.2.17`
make distclean
# 2.4.x kernel headers
-kernel=`echo /usr/src/kernel/2.4.[0-9]`
+kernel=`echo /usr/src/kernel/2.4.1[0-9]`
./configure && make CC="gcc -I$kernel/include" || exit 1
make distclean
+set +x
+
##########################################################################
# done
diff --git a/capture-test b/capture-test
index 9133269..531b15b 100644
--- a/capture-test
+++ b/capture-test
@@ -5,8 +5,8 @@
STREAMER=src/streamer
PLAYBACK="xanim +f +Sr +Ze -Zr -Av"
LEN=600
-DEST=/media/test
-#DEST=/usr/data/test
+#DEST=/media/test
+DEST=/tmp/media
################################################################
# init
diff --git a/cc/Makefile b/cc/Makefile
new file mode 100644
index 0000000..95dc5b6
--- /dev/null
+++ b/cc/Makefile
@@ -0,0 +1,25 @@
+# Generated automatically from Makefile.in by configure.
+
+srcdir=.
+
+include ../Make.config
+
+CFLAGS=-g -g -O2 $(WARN_FLAGS) $(X11_FLAGS) -I..
+LDLIBS=$(ATHENA_LIBS)
+
+all build: ntsc-cc
+
+ntsc-cc: ntsc-cc.o
+ $(CC) $(CFLAGS) -o $@ ntsc-cc.o $(LDLIBS)
+
+install: all
+ $(INSTALL_DIR) $(bindir)
+ $(INSTALL_DIR) $(mandir)
+ $(INSTALL_PROGRAM) -s ntsc-cc $(bindir)
+ $(INSTALL_DATA) $(srcdir)/ntsc-cc.man $(mandir)/man1/ntsc-cc.1
+
+clean distclean realclean:
+ -rm -f ntsc-cc ntsc-cc.o *~
+
+depend dep:
+
diff --git a/cc/Makefile.in b/cc/Makefile.in
new file mode 100644
index 0000000..e4bb62b
--- /dev/null
+++ b/cc/Makefile.in
@@ -0,0 +1,25 @@
+
+srcdir=@srcdir@
+VPATH=$(srcdir)
+
+include ../Make.config
+
+CFLAGS=-g @CFLAGS@ $(WARN_FLAGS) $(X11_FLAGS) -I..
+LDLIBS=$(ATHENA_LIBS)
+
+all build: ntsc-cc
+
+ntsc-cc: ntsc-cc.o
+ $(CC) $(CFLAGS) -o $@ ntsc-cc.o $(LDLIBS)
+
+install: all
+ $(INSTALL_DIR) $(bindir)
+ $(INSTALL_DIR) $(mandir)
+ $(INSTALL_PROGRAM) -s ntsc-cc $(bindir)
+ $(INSTALL_DATA) $(srcdir)/ntsc-cc.man $(mandir)/man1/ntsc-cc.1
+
+clean distclean realclean:
+ -rm -f ntsc-cc ntsc-cc.o *~
+
+depend dep:
+
diff --git a/contrib/cc/cc.c b/cc/ntsc-cc.c
index 80c9ec0..78b6cc9 100644
--- a/contrib/cc/cc.c
+++ b/cc/ntsc-cc.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -29,25 +31,22 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/time.h>
-#include <getopt.h>
-
-
-
-
-//#define XWIN 1 // visual debugging
+#ifdef HAVE_GETOPT_H
+# include <getopt.h>
+#endif
-#ifdef XWIN
- #include <X11/X.h>
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
- #include <X11/Xproto.h>
- Display *dpy;
- Window Win,Root;
- char dpyname[256] = "";
- GC WinGC;
- GC WinGC0;
- GC WinGC1;
- int x;
+#ifndef X_DISPLAY_MISSING
+# include <X11/X.h>
+# include <X11/Xlib.h>
+# include <X11/Xutil.h>
+# include <X11/Xproto.h>
+Display *dpy;
+Window Win,Root;
+char dpyname[256] = "";
+GC WinGC;
+GC WinGC0;
+GC WinGC1;
+int x;
#endif
@@ -72,17 +71,19 @@ char *keyword[32];
//args (this should probably be put into a structure later)
char useraw=0;
+char semirawdata=0;
char usexds=0;
char usecc=0;
char plain=0;
char usesen=0;
+char debugwin=0;
char rawline=-1;
int sen;
int inval;
-int parityok(int n) /* check parity for 2 bytes packed in n */
+static int parityok(int n) /* check parity for 2 bytes packed in n */
{
int mask=0;
int j, k;
@@ -101,7 +102,7 @@ int parityok(int n) /* check parity for 2 bytes packed in n */
return mask;
}
-int decodebit(unsigned char *data, int threshold)
+static int decodebit(unsigned char *data, int threshold)
{
int i, sum = 0;
for (i = 0; i < 23; i++)
@@ -109,7 +110,7 @@ int decodebit(unsigned char *data, int threshold)
return (sum > threshold*23);
}
-int decode(unsigned char *vbiline)
+static int decode(unsigned char *vbiline)
{
int max[7], min[7], val[7], i, clk, tmp, sample, packedbits = 0;
@@ -139,13 +140,15 @@ int decode(unsigned char *vbiline)
if (clk != 7 || vbiline[max[3]] - vbiline[min[5]] < 45) /* failure to locate clock lead-in */
return -1;
-#ifdef XWIN
- for (clk=0;clk<7;clk++)
- {
- XDrawLine(dpy,Win,WinGC,min[clk]/2,0,min[clk]/2,128);
- XDrawLine(dpy,Win,WinGC1,max[clk]/2,0,max[clk]/2,128);
- }
- XFlush(dpy);
+#ifndef X_DISPLAY_MISSING
+ if (debugwin) {
+ for (clk=0;clk<7;clk++)
+ {
+ XDrawLine(dpy,Win,WinGC,min[clk]/2,0,min[clk]/2,128);
+ XDrawLine(dpy,Win,WinGC1,max[clk]/2,0,max[clk]/2,128);
+ }
+ XFlush(dpy);
+ }
#endif
@@ -155,10 +158,12 @@ int decode(unsigned char *vbiline)
for(i=min[6];vbiline[i]<sample;i++);
-#ifdef XWIN
- for (clk=i;clk<i+57*18;clk+=57)
- XDrawLine(dpy,Win,WinGC,clk/2,0,clk/2,128);
- XFlush(dpy);
+#ifndef X_DISPLAY_MISSING
+ if (debugwin) {
+ for (clk=i;clk<i+57*18;clk+=57)
+ XDrawLine(dpy,Win,WinGC,clk/2,0,clk/2,128);
+ XFlush(dpy);
+ }
#endif
@@ -169,7 +174,7 @@ int decode(unsigned char *vbiline)
return packedbits&parityok(packedbits);
} /* decode */
-int XDSdecode(int data)
+static int XDSdecode(int data)
{
int b1, b2, length;
@@ -282,7 +287,7 @@ int XDSdecode(int data)
return 0;
}
-int webtv_check(char * buf,int len)
+static int webtv_check(char * buf,int len)
{
unsigned long sum;
unsigned long nwords;
@@ -336,7 +341,7 @@ int webtv_check(char * buf,int len)
return 0;
}
-int CCdecode(int data)
+static int CCdecode(int data)
{
int b1, b2, row, len, x,y;
if (data == -1) //invalid data. flush buffers to be safe.
@@ -455,17 +460,58 @@ int CCdecode(int data)
lastcode=data;
return 0;
}
-int RAW(int data)
+
+static int RAW(int data)
{
int b1, b2;
if (data == -1)
return -1;
+
+ // this is just null data with two parity bits
+ // 100000010000000 = 0x8080
+ if (data == 0x8080)
+ return -1;
+
b1 = data & 0x7f;
b2 = (data>>8) & 0x7f;
+
+ if (!semirawdata) {
+ fprintf(stderr,"%c%c",b1,b2);
+ return 0;
+ }
+
+ // semi-raw data output begins here...
+
+ // a control code.
+ if ( ( b1 >= 0x10 ) && ( b1 <= 0x1F ) ) {
+ if ( ( b2 >= 0x20 ) && ( b2 <= 0x7F ) )
+ fprintf(stderr,"[%02X-%02X]",b1,b2);
+ return 0;
+ }
+
+ // next two rules:
+ // supposed to be one printable char
+ // and the other char to be discarded
+ if ( ( b1 >= 0x0 ) && ( b1 <= 0xF ) ) {
+ fprintf(stderr,"(%02x)%c",b1,b2);
+ //fprintf(stderr,"%c",b2);
+ //fprintf(stderr,"%c%c",0,b2);
+ return 0;
+ }
+ if ( ( b2 >= 0x0 ) && ( b2 <= 0xF ) ) {
+ fprintf(stderr,"%c{%02x}",b1,b2);
+ //fprintf(stderr,"%c",b1);
+ //fprintf(stderr,"%c%c",b1,1);
+ return 0;
+ }
+
+ // just classic two chars to print.
fprintf(stderr,"%c%c",b1,b2);
+
return 0;
}
-int sentence(int data)
+
+static int sentence(int data)
{
int b1, b2;
if (data == -1)
@@ -508,8 +554,9 @@ int sentence(int data)
}
return 0;
}
-#ifdef XWIN
-unsigned long getColor(char *colorName, float dim)
+
+#ifndef X_DISPLAY_MISSING
+static unsigned long getColor(char *colorName, float dim)
{
XColor Color;
XWindowAttributes Attributes;
@@ -527,42 +574,37 @@ unsigned long getColor(char *colorName, float dim)
return Color.pixel;
}
#endif
+
int main(int argc,char **argv)
{
char *vbifile = "/dev/vbi";
unsigned char buf[65536];
- char arg;
+ int arg;
int args=0;
int vbifd;
fd_set rfds;
int x;
- #ifdef XWIN
- dpy=XOpenDisplay(dpyname);
- Root=DefaultRootWindow(dpy);
- Win = XCreateSimpleWindow(dpy, Root, 10, 10, 1024, 128,0,0,0);
- WinGC = XCreateGC(dpy, Win, 0, NULL);
- WinGC0 = XCreateGC(dpy, Win, 0, NULL);
- WinGC1 = XCreateGC(dpy, Win, 0, NULL);
- XSetForeground(dpy, WinGC, getColor("blue",1));
- XSetForeground(dpy, WinGC0, getColor("green",1));
- XSetForeground(dpy, WinGC1, getColor("red",1));
- #endif
-
for (;;) //commandline parsing
{
- if (-1 == (arg = getopt(argc, argv, "h?xspckd:r:")))
+ if (-1 == (arg = getopt(argc, argv, "?hxsckpwRr:d:")))
break;
switch (arg)
{
case '?':
case 'h':
printf("CCDecoder 0.9.1 (mbm@linux.com)\n"
- "\tx\tdecode XDS info\n"
- "\tc\tdecode Closed Caption (includes webtv)\n"
- "\tp (plain) \tdo not display underline and italic\n"
- "\tr arg\traw dump of arg\n");
+ "\tx \t decode XDS info\n"
+ "\ts \t decode by sentences \n"
+ "\tc \t decode Closed Caption (includes webtv)\n"
+ "\tk word \t keywords to break line at [broken???]\n"
+ "\tp \t plain output. do not display underline and italic\n"
+ "\tw \t open debugging window (used with -r option)\n"
+ "\tR \t semi-raw data (used with -r option)\n"
+ "\tr #\t raw dump of data (use 11 or 27 as line number)\n"
+ "\td dev \t file to open (default: /dev/vbi)\n"
+ );
exit(0);
case 'x':
usexds=1; args++;
@@ -574,19 +616,23 @@ int main(int argc,char **argv)
usecc=1; args++;
break;
case 'k':
+ //args++;
keyword[keywords++]=optarg;
break;
case 'p':
plain=1; args++;
break;
+ case 'w':
+ debugwin=1;
+ break;
+ case 'R':
+ semirawdata=1;
+ break;
case 'r':
useraw=1; args++;
rawline=atoi(optarg);
- #if XWIN
- XMapWindow(dpy, Win);
- #endif
break;
- case 'd':
+ case 'd':
vbifile = optarg;
break;
}
@@ -601,6 +647,25 @@ int main(int argc,char **argv)
exit(0);
for (x=0;x<keywords;x++)
printf("Keyword(%d): %s\n",x,keyword[x]);
+
+
+#ifndef X_DISPLAY_MISSING
+ if (debugwin) {
+ dpy=XOpenDisplay(dpyname);
+ Root=DefaultRootWindow(dpy);
+ Win = XCreateSimpleWindow(dpy, Root, 10, 10, 1024, 128,0,0,0);
+ WinGC = XCreateGC(dpy, Win, 0, NULL);
+ WinGC0 = XCreateGC(dpy, Win, 0, NULL);
+ WinGC1 = XCreateGC(dpy, Win, 0, NULL);
+ XSetForeground(dpy, WinGC, getColor("blue",1));
+ XSetForeground(dpy, WinGC0, getColor("green",1));
+ XSetForeground(dpy, WinGC1, getColor("red",1));
+
+ if (useraw)
+ XMapWindow(dpy, Win);
+ }
+#endif
+
//mainloop
while(1){
@@ -612,18 +677,23 @@ int main(int argc,char **argv)
printf("read error\n");
if (useraw)
{
- #ifdef XWIN
- XClearArea(dpy,Win,0,0,1024,128,0);
- XDrawLine(dpy,Win,WinGC1,0,128-85/2,1024,128-85/2);
- for (x=0;x<1024;x++)
- if (buf[2048 * rawline+x*2]/2<128 && buf[2048 * rawline+x*2+2]/2 < 128)
- XDrawLine(dpy,Win,WinGC0,x,128-buf[2048 * rawline+x*2]/2,x+1,128-buf[2048 * rawline+x*2+2]/2);
- #endif
- RAW(decode(&buf[2048 * rawline]));
- #ifdef XWIN
- XFlush(dpy);
- usleep(100);
- #endif
+#ifndef X_DISPLAY_MISSING
+ if (debugwin) {
+ XClearArea(dpy,Win,0,0,1024,128,0);
+ XDrawLine(dpy,Win,WinGC1,0,128-85/2,1024,128-85/2);
+ for (x=0;x<1024;x++)
+ if (buf[2048 * rawline+x*2]/2<128 && buf[2048 * rawline+x*2+2]/2 < 128)
+ XDrawLine(dpy,Win,WinGC0,x,128-buf[2048 * rawline+x*2]/2,
+ x+1,128-buf[2048 * rawline+x*2+2]/2);
+ }
+#endif
+ RAW(decode(&buf[2048 * rawline]));
+#ifndef X_DISPLAY_MISSING
+ if (debugwin) {
+ XFlush(dpy);
+ usleep(100);
+ }
+#endif
}
if (usexds)
XDSdecode(decode(&buf[2048 * 27]));
@@ -631,10 +701,12 @@ int main(int argc,char **argv)
CCdecode(decode(&buf[2048 * 11]));
if (usesen)
sentence(decode(&buf[2048 * 11]));
- #ifdef XWIN
+#ifndef X_DISPLAY_MISSING
+ if (debugwin) {
XFlush(dpy);
usleep(100);
- #endif
+ }
+#endif
}
}
return 0;
diff --git a/cc/ntsc-cc.man b/cc/ntsc-cc.man
new file mode 100644
index 0000000..5c60b63
--- /dev/null
+++ b/cc/ntsc-cc.man
@@ -0,0 +1,31 @@
+.TH ntsc-cc 1
+.SH NAME
+ntsc-cc - closed caption decoder
+.SH SYNOPSIS
+.B ntsc-cc [ options ]
+.SH DESCRIPTION
+.B ntsc-cc
+reads vbi data from /dev/vbi and decodes the enclosed cc data.
+Start it with '-h' to get a list of cmd line options.
+.SH SEE ALSO
+alevt(1)
+.SH AUTHORS
+timecop@japan.co.jp
+.br
+Mike Baker <mbm@linux.com>
+.br
+Adam <adam@cfar.umd.edu>
+.SH COPYRIGHT
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+.P
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+.P
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/config.h.in b/config.h.in
index f7a8eec..f045469 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,14 +1,14 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
+/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
-/* MIT shared memory extention */
-#undef HAVE_MITSHM
-
/* lirc lib */
#undef HAVE_LIBLIRC_CLIENT
+/* alsa */
+#undef HAVE_ALSA
+
/* quicktime lib */
#undef HAVE_LIBQUICKTIME
@@ -18,6 +18,9 @@
/* ipv6 struct sockaddr_storage */
#undef HAVE_SOCKADDR_STORAGE
+/* Define if you have the fseeko function. */
+#undef HAVE_FSEEKO
+
/* Define if you have the ftello function. */
#undef HAVE_FTELLO
@@ -30,12 +33,18 @@
/* Define if you have the getpt function. */
#undef HAVE_GETPT
+/* Define if you have the <alsa/asoundlib.h> header file. */
+#undef HAVE_ALSA_ASOUNDLIB_H
+
/* Define if you have the <endian.h> header file. */
#undef HAVE_ENDIAN_H
/* Define if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
+/* Define if you have the <linux/joystick.h> header file. */
+#undef HAVE_LINUX_JOYSTICK_H
+
/* Define if you have the <soundcard.h> header file. */
#undef HAVE_SOUNDCARD_H
diff --git a/configure b/configure
index 798aaf1..7a0718b 100755
--- a/configure
+++ b/configure
@@ -12,8 +12,6 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
- --enable-xaw3d use Xaw3D"
-ac_help="$ac_help
--enable-xfree-ext use XFree extentions (DGA,VidMode,DPMS)"
ac_help="$ac_help
--enable-xvideo use the Xvideo extention"
@@ -24,6 +22,10 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-motif enable experimental motif support"
ac_help="$ac_help
+ --enable-aa enable aalib support"
+ac_help="$ac_help
+ --enable-alsa enable alsa support"
+ac_help="$ac_help
--with-x use the X Window System"
# Initialize some variables set by options.
@@ -539,12 +541,6 @@ fi
-# Check whether --enable-xaw3d or --disable-xaw3d was given.
-if test "${enable_xaw3d+set}" = set; then
- enableval="$enable_xaw3d"
- :
-fi
-
# Check whether --enable-xfree-ext or --disable-xfree-ext was given.
if test "${enable_xfree_ext+set}" = set; then
enableval="$enable_xfree_ext"
@@ -575,13 +571,25 @@ if test "${enable_motif+set}" = set; then
:
fi
+# Check whether --enable-aa or --disable-aa was given.
+if test "${enable_aa+set}" = set; then
+ enableval="$enable_aa"
+ :
+fi
+
+# Check whether --enable-alsa or --disable-alsa was given.
+if test "${enable_alsa+set}" = set; then
+ enableval="$enable_alsa"
+ :
+fi
+
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:585: checking for $ac_word" >&5
+echo "configure:593: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -611,7 +619,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:615: checking for $ac_word" >&5
+echo "configure:623: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -662,7 +670,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:666: checking for $ac_word" >&5
+echo "configure:674: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -694,7 +702,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:698: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:706: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -705,12 +713,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 709 "configure"
+#line 717 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -736,12 +744,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:740: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:748: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:745: checking whether we are using GNU C" >&5
+echo "configure:753: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -750,7 +758,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -769,7 +777,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:773: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:781: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -801,7 +809,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:805: checking how to run the C preprocessor" >&5
+echo "configure:813: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -816,13 +824,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 820 "configure"
+#line 828 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -833,13 +841,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 837 "configure"
+#line 845 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -850,13 +858,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 854 "configure"
+#line 862 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -912,7 +920,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:916: checking for a BSD compatible install" >&5
+echo "configure:924: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -969,7 +977,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:973: checking for $ac_word" >&5
+echo "configure:981: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DEPEND'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1004,11 +1012,13 @@ test -n "$DEPEND" || DEPEND="true"
NG_GRAB=""
VBIFLAGS=""
PROGS=""
+INST=""
RADIO=""
case "`uname -s`" in
Linux)
NG_GRAB="grab-v4l.o grab-v4l2.o"
PROGS="v4l-conf fbtv"
+ INST="install-v4l-conf install-fbtv"
RADIO="radio"
;;
OpenBSD | FreeBSD)
@@ -1020,7 +1030,7 @@ case "`uname -s`" in
;;
*)
echo $ac_n "checking if xawtv will build on `uname -s`""... $ac_c" 1>&6
-echo "configure:1024: checking if xawtv will build on `uname -s`" >&5
+echo "configure:1034: checking if xawtv will build on `uname -s`" >&5
echo "$ac_t""maybe" 1>&6
;;
esac
@@ -1031,15 +1041,16 @@ esac
-for ac_func in ftello getpt getnameinfo getopt_long
+
+for ac_func in ftello fseeko getpt getnameinfo getopt_long
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1038: checking for $ac_func" >&5
+echo "configure:1049: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1043 "configure"
+#line 1054 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1062,7 +1073,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1087,7 +1098,7 @@ fi
done
cat > conftest.$ac_ext <<EOF
-#line 1091 "configure"
+#line 1102 "configure"
#include "confdefs.h"
#include <sys/socket.h>
EOF
@@ -1101,21 +1112,21 @@ EOF
fi
rm -f conftest*
-for ac_hdr in endian.h soundcard.h sys/soundcard.h getopt.h
+for ac_hdr in endian.h getopt.h soundcard.h sys/soundcard.h alsa/asoundlib.h linux/joystick.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1109: checking for $ac_hdr" >&5
+echo "configure:1120: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1114 "configure"
+#line 1125 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1143,7 +1154,7 @@ done
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:1147: checking for pthread_create in -lpthread" >&5
+echo "configure:1158: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1151,7 +1162,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1155 "configure"
+#line 1166 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1162,7 +1173,7 @@ int main() {
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:1166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1184,7 +1195,7 @@ fi
if test "$LIBPTHREAD" = ""; then
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:1188: checking for pthread_create in -lc_r" >&5
+echo "configure:1199: checking for pthread_create in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1192,7 +1203,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1196 "configure"
+#line 1207 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1203,7 +1214,7 @@ int main() {
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:1207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1225,7 +1236,7 @@ fi
fi
echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6
-echo "configure:1229: checking for main in -lossaudio" >&5
+echo "configure:1240: checking for main in -lossaudio" >&5
ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1233,14 +1244,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lossaudio $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1237 "configure"
+#line 1248 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:1244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1255,13 +1266,13 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- LIBSOUND="-lossaudio"
+ LIBOSS="-lossaudio"
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:1265: checking for initscr in -lncurses" >&5
+echo "configure:1276: checking for initscr in -lncurses" >&5
ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1269,7 +1280,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1273 "configure"
+#line 1284 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1280,7 +1291,7 @@ int main() {
initscr()
; return 0; }
EOF
-if { (eval echo configure:1284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1302,7 +1313,7 @@ fi
if test "$LIBCURSES" = ""; then
echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:1306: checking for initscr in -lcurses" >&5
+echo "configure:1317: checking for initscr in -lcurses" >&5
ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1310,7 +1321,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1314 "configure"
+#line 1325 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1321,7 +1332,7 @@ int main() {
initscr()
; return 0; }
EOF
-if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1344,6 +1355,8 @@ fi
fi
if test "$LIBCURSES" = ""; then
echo "Oops: (n)curses library not found. You need this one, please install."
+ echo "Note: to compile stuff just the library packages are not enougth,"
+ echo " you need also the *-devel packages."
exit 1
fi
@@ -1357,7 +1370,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:1361: checking for X" >&5
+echo "configure:1374: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -1419,12 +1432,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 1423 "configure"
+#line 1436 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1493,14 +1506,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1497 "configure"
+#line 1510 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:1504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -1606,17 +1619,17 @@ else
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:1610: checking whether -R must be followed by a space" >&5
+echo "configure:1623: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 1613 "configure"
+#line 1626 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_nospace=yes
else
@@ -1632,14 +1645,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 1636 "configure"
+#line 1649 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_space=yes
else
@@ -1671,7 +1684,7 @@ rm -f conftest*
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:1675: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:1688: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1679,7 +1692,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1683 "configure"
+#line 1696 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1690,7 +1703,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:1694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1712,7 +1725,7 @@ fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:1716: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:1729: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1720,7 +1733,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1724 "configure"
+#line 1737 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1731,7 +1744,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1760,12 +1773,12 @@ fi
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1764: checking for gethostbyname" >&5
+echo "configure:1777: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1769 "configure"
+#line 1782 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -1788,7 +1801,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:1792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -1809,7 +1822,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1813: checking for gethostbyname in -lnsl" >&5
+echo "configure:1826: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1817,7 +1830,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1821 "configure"
+#line 1834 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1828,7 +1841,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:1832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1858,12 +1871,12 @@ fi
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:1862: checking for connect" >&5
+echo "configure:1875: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1867 "configure"
+#line 1880 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -1886,7 +1899,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:1890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@@ -1907,7 +1920,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:1911: checking for connect in -lsocket" >&5
+echo "configure:1924: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1915,7 +1928,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1919 "configure"
+#line 1932 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1926,7 +1939,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:1930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1950,12 +1963,12 @@ fi
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:1954: checking for remove" >&5
+echo "configure:1967: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1959 "configure"
+#line 1972 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@@ -1978,7 +1991,7 @@ remove();
; return 0; }
EOF
-if { (eval echo configure:1982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
@@ -1999,7 +2012,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:2003: checking for remove in -lposix" >&5
+echo "configure:2016: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2007,7 +2020,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2011 "configure"
+#line 2024 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2018,7 +2031,7 @@ int main() {
remove()
; return 0; }
EOF
-if { (eval echo configure:2022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2042,12 +2055,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:2046: checking for shmat" >&5
+echo "configure:2059: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2051 "configure"
+#line 2064 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@@ -2070,7 +2083,7 @@ shmat();
; return 0; }
EOF
-if { (eval echo configure:2074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
@@ -2091,7 +2104,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:2095: checking for shmat in -lipc" >&5
+echo "configure:2108: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2099,7 +2112,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2103 "configure"
+#line 2116 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2110,7 +2123,7 @@ int main() {
shmat()
; return 0; }
EOF
-if { (eval echo configure:2114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2143,7 +2156,7 @@ fi
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:2147: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:2160: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2151,7 +2164,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2155 "configure"
+#line 2168 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2162,7 +2175,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2186,8 +2199,17 @@ fi
fi
-if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
- { echo "configure: error: can not find X11" 1>&2; exit 1; }
+if test "$no_x" != "yes"; then
+ PROGS="$PROGS xawtv xawtv-remote xvideo rootv"
+ ATHENA="-lXaw -lXmu -lXt $X_PRE_LIBS -lXpm -lXext -lX11 $X_EXTRA_LIBS"
+ FSLIB="-lFS"
+ SUBS="font"
+ TOOLS="propwatch"
+else
+ ATHENA=""
+ FSLIB=""
+ SUBS=""
+ TOOLS=""
fi
@@ -2195,28 +2217,34 @@ fi
-if test "$enable_xaw3d" != "no"; then
- echo $ac_n "checking for Xaw3dComputeTopShadowRGB in -lXaw3d""... $ac_c" 1>&6
-echo "configure:2201: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5
-ac_lib_var=`echo Xaw3d'_'Xaw3dComputeTopShadowRGB | sed 'y%./+-%__p_%'`
+
+
+
+
+
+
+GFXLIBS="";
+echo $ac_n "checking for jpeg_start_compress in -ljpeg""... $ac_c" 1>&6
+echo "configure:2229: checking for jpeg_start_compress in -ljpeg" >&5
+ac_lib_var=`echo jpeg'_'jpeg_start_compress | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lXaw3d $X_LIBS $X_PRE_LIBS -lXext -lXmu -lXt -lX11 $LIBS"
+LIBS="-ljpeg $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2209 "configure"
+#line 2237 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char Xaw3dComputeTopShadowRGB();
+char jpeg_start_compress();
int main() {
-Xaw3dComputeTopShadowRGB()
+jpeg_start_compress()
; return 0; }
EOF
-if { (eval echo configure:2220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2231,41 +2259,42 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- XAWLIB=Xaw3d
+ GFXLIBS="-ljpeg"; JPEG="found"
else
echo "$ac_t""no" 1>&6
-XAWLIB=Xaw
fi
-else
- echo "*** Xaw3D disabled"
- XAWLIB=Xaw
+if test "$JPEG" != "found"; then
+ echo "Oops: jpeg library not found. You need this one, please install."
+ echo "Note: to compile stuff just the library packages are not enougth,"
+ echo " you need also the *-devel packages."
+ exit 1
fi
-
-GFXLIBS="";
-echo $ac_n "checking for jpeg_start_compress in -ljpeg""... $ac_c" 1>&6
-echo "configure:2250: checking for jpeg_start_compress in -ljpeg" >&5
-ac_lib_var=`echo jpeg'_'jpeg_start_compress | sed 'y%./+-%__p_%'`
+LIBALSA=""
+if test "$enable_alsa" != "no"; then
+ echo $ac_n "checking for snd_seq_open in -lasound""... $ac_c" 1>&6
+echo "configure:2279: checking for snd_seq_open in -lasound" >&5
+ac_lib_var=`echo asound'_'snd_seq_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-ljpeg $LIBS"
+LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2258 "configure"
+#line 2287 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char jpeg_start_compress();
+char snd_seq_open();
int main() {
-jpeg_start_compress()
+snd_seq_open()
; return 0; }
EOF
-if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2280,21 +2309,23 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- GFXLIBS="-ljpeg"; JPEG="found"
+ cat >> confdefs.h <<\EOF
+#define HAVE_ALSA 1
+EOF
+ PROGS="$PROGS mididump"; LIBALSA="-lasound"
else
echo "$ac_t""no" 1>&6
fi
-if test "$JPEG" != "found"; then
- echo "Oops: jpeg library not found. You need this one, please install."
- exit 1
+else
+ echo "*** alsa disabled"
fi
LIRC=""
if test "$enable_lirc" != "no"; then
echo $ac_n "checking for lirc_init in -llirc_client""... $ac_c" 1>&6
-echo "configure:2298: checking for lirc_init in -llirc_client" >&5
+echo "configure:2329: checking for lirc_init in -llirc_client" >&5
ac_lib_var=`echo lirc_client'_'lirc_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2302,7 +2333,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-llirc_client $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2306 "configure"
+#line 2337 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2313,7 +2344,7 @@ int main() {
lirc_init()
; return 0; }
EOF
-if { (eval echo configure:2317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2340,9 +2371,54 @@ else
echo "*** lirc disabled"
fi
+if test "$enable_aa" != "no"; then
+ echo $ac_n "checking for aa_autoinit in -laa""... $ac_c" 1>&6
+echo "configure:2377: checking for aa_autoinit in -laa" >&5
+ac_lib_var=`echo aa'_'aa_autoinit | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-laa $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2385 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char aa_autoinit();
+
+int main() {
+aa_autoinit()
+; return 0; }
+EOF
+if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ PROGS="$PROGS ttv"; INST="$INST install-ttv"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ echo "*** aalib support disabled"
+fi
+
if test "$enable_quicktime" != "no"; then
echo $ac_n "checking for png_read_info in -lpng""... $ac_c" 1>&6
-echo "configure:2346: checking for png_read_info in -lpng" >&5
+echo "configure:2422: checking for png_read_info in -lpng" >&5
ac_lib_var=`echo png'_'png_read_info | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2350,7 +2426,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpng $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2354 "configure"
+#line 2430 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2361,7 +2437,7 @@ int main() {
png_read_info()
; return 0; }
EOF
-if { (eval echo configure:2365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2376,14 +2452,14 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- GFXLIBS="-lpng $GFXLIBS"; PNG="found"
+ GFXLIBS="-lpng -lz -lm $GFXLIBS"; PNG="found"
else
echo "$ac_t""no" 1>&6
fi
if test "$PNG" = "found"; then
echo $ac_n "checking for quicktime_open in -lquicktime""... $ac_c" 1>&6
-echo "configure:2387: checking for quicktime_open in -lquicktime" >&5
+echo "configure:2463: checking for quicktime_open in -lquicktime" >&5
ac_lib_var=`echo quicktime'_'quicktime_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2391,7 +2467,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lquicktime -ldl -lglib -ljpeg -lpng $LIBPTHREAD $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2395 "configure"
+#line 2471 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2402,7 +2478,7 @@ int main() {
quicktime_open()
; return 0; }
EOF
-if { (eval echo configure:2406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2434,7 +2510,7 @@ fi
if test "$enable_xfree_ext" != "no"; then
echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6
-echo "configure:2438: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
+echo "configure:2514: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2442,7 +2518,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXxf86dga $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2446 "configure"
+#line 2522 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2453,7 +2529,7 @@ int main() {
XF86DGAQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2481,7 +2557,7 @@ else
fi
echo $ac_n "checking for XF86VidModeQueryExtension in -lXxf86vm""... $ac_c" 1>&6
-echo "configure:2485: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5
+echo "configure:2561: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5
ac_lib_var=`echo Xxf86vm'_'XF86VidModeQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2489,7 +2565,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXxf86vm $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2493 "configure"
+#line 2569 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2500,7 +2576,7 @@ int main() {
XF86VidModeQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2528,7 +2604,7 @@ else
fi
echo $ac_n "checking for DPMSQueryExtension in -lXdpms""... $ac_c" 1>&6
-echo "configure:2532: checking for DPMSQueryExtension in -lXdpms" >&5
+echo "configure:2608: checking for DPMSQueryExtension in -lXdpms" >&5
ac_lib_var=`echo Xdpms'_'DPMSQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2536,7 +2612,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXdpms $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2540 "configure"
+#line 2616 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2547,7 +2623,7 @@ int main() {
DPMSQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2576,7 +2652,7 @@ fi
if test "$ac_cv_lib_Xdpms_DPMSQueryExtension" = "no"; then
echo $ac_n "checking for DPMSQueryExtension in -lXext""... $ac_c" 1>&6
-echo "configure:2580: checking for DPMSQueryExtension in -lXext" >&5
+echo "configure:2656: checking for DPMSQueryExtension in -lXext" >&5
ac_lib_var=`echo Xext'_'DPMSQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2584,7 +2660,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXext $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2588 "configure"
+#line 2664 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2595,7 +2671,7 @@ int main() {
DPMSQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2620,7 +2696,7 @@ fi
fi
echo $ac_n "checking for XineramaQueryExtension in -lXinerama""... $ac_c" 1>&6
-echo "configure:2624: checking for XineramaQueryExtension in -lXinerama" >&5
+echo "configure:2700: checking for XineramaQueryExtension in -lXinerama" >&5
ac_lib_var=`echo Xinerama'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2628,7 +2704,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXinerama $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2632 "configure"
+#line 2708 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2639,7 +2715,7 @@ int main() {
XineramaQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2672,7 +2748,7 @@ fi
if test "$enable_xvideo" != "no"; then
echo $ac_n "checking for XvQueryExtension in -lXv""... $ac_c" 1>&6
-echo "configure:2676: checking for XvQueryExtension in -lXv" >&5
+echo "configure:2752: checking for XvQueryExtension in -lXv" >&5
ac_lib_var=`echo Xv'_'XvQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2680,7 +2756,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXv $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2684 "configure"
+#line 2760 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2691,7 +2767,7 @@ int main() {
XvQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2722,33 +2798,28 @@ else
echo "*** Xvideo extention disabled"
fi
-
-MOTIF=""
-if test "$enable_motif" = "yes"; then
- MOTIF="motv"
-fi
-
-echo $ac_n "checking for XShmAttach in -lXext""... $ac_c" 1>&6
-echo "configure:2733: checking for XShmAttach in -lXext" >&5
-ac_lib_var=`echo Xext'_'XShmAttach | sed 'y%./+-%__p_%'`
+if test "$enable_motif" != "no"; then
+ echo $ac_n "checking for XmStringGenerate in -lXm""... $ac_c" 1>&6
+echo "configure:2804: checking for XmStringGenerate in -lXm" >&5
+ac_lib_var=`echo Xm'_'XmStringGenerate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lXext $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
+LIBS="-lXm $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2741 "configure"
+#line 2812 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char XShmAttach();
+char XmStringGenerate();
int main() {
-XShmAttach()
+XmStringGenerate()
; return 0; }
EOF
-if { (eval echo configure:2752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2763,20 +2834,20 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_MITSHM 1
-EOF
-
+ PROGS="$PROGS motv"; INST="$INST install-motv"
else
echo "$ac_t""no" 1>&6
fi
+else
+ echo "*** motif support disabled"
+fi
-XAWTV_VERSION="`(cd $srcdir; pwd) | sed -e 's/.*-//'`"
+VERSION="`(cd $srcdir; pwd) | sed -e 's/.*-//'`"
echo $ac_n "checking for X11 config directory""... $ac_c" 1>&6
-echo "configure:2780: checking for X11 config directory" >&5
+echo "configure:2851: checking for X11 config directory" >&5
x11conf=/usr/X11R6/lib/X11
if test -d /etc/X11; then
x11conf=/etc/X11
@@ -2785,12 +2856,12 @@ echo "$ac_t""$x11conf" 1>&6
echo $ac_n "checking for X11 app-defaults directory""... $ac_c" 1>&6
-echo "configure:2789: checking for X11 app-defaults directory" >&5
-resdir=/usr/X11R6/lib/X11/app-defaults
+echo "configure:2860: checking for X11 app-defaults directory" >&5
+resdir=/usr/X11R6/lib/X11
if test -d /etc/X11/app-defaults; then
- resdir=/etc/X11/app-defaults
+ resdir=/etc/X11
fi
-echo "$ac_t""$resdir" 1>&6
+echo "$ac_t""$resdir/app-defaults" 1>&6
@@ -2895,9 +2966,10 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile src/Makefile tools/Makefile radio/Makefile
+trap 'rm -fr `echo "Make.config Makefile src/Makefile tools/Makefile radio/Makefile
man/Makefile i2c/Makefile font/Makefile webcam/Makefile
- http/Makefile libvbi/Makefile libng/Makefile xawtv.spec config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+ http/Makefile libvbi/Makefile libng/Makefile libng/plugins/Makefile
+ cc/Makefile xawtv.spec config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -2938,20 +3010,25 @@ s%@DEPEND@%$DEPEND%g
s%@NG_GRAB@%$NG_GRAB%g
s%@VBIFLAGS@%$VBIFLAGS%g
s%@PROGS@%$PROGS%g
+s%@INST@%$INST%g
s%@RADIO@%$RADIO%g
s%@LIBPTHREAD@%$LIBPTHREAD%g
-s%@LIBSOUND@%$LIBSOUND%g
+s%@LIBOSS@%$LIBOSS%g
s%@LIBCURSES@%$LIBCURSES%g
s%@X_CFLAGS@%$X_CFLAGS%g
s%@X_PRE_LIBS@%$X_PRE_LIBS%g
s%@X_LIBS@%$X_LIBS%g
s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
+s%@x_includes@%$x_includes%g
s%@x_libraries@%$x_libraries%g
-s%@XAWLIB@%$XAWLIB%g
+s%@ATHENA@%$ATHENA%g
+s%@FSLIB@%$FSLIB%g
+s%@SUBS@%$SUBS%g
+s%@TOOLS@%$TOOLS%g
s%@GFXLIBS@%$GFXLIBS%g
+s%@LIBALSA@%$LIBALSA%g
s%@LIRC@%$LIRC%g
-s%@MOTIF@%$MOTIF%g
-s%@XAWTV_VERSION@%$XAWTV_VERSION%g
+s%@VERSION@%$VERSION%g
s%@x11conf@%$x11conf%g
s%@resdir@%$resdir%g
@@ -2995,9 +3072,10 @@ EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile tools/Makefile radio/Makefile
+CONFIG_FILES=\${CONFIG_FILES-"Make.config Makefile src/Makefile tools/Makefile radio/Makefile
man/Makefile i2c/Makefile font/Makefile webcam/Makefile
- http/Makefile libvbi/Makefile libng/Makefile xawtv.spec"}
+ http/Makefile libvbi/Makefile libng/Makefile libng/plugins/Makefile
+ cc/Makefile xawtv.spec"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -3175,3 +3253,4 @@ chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/configure.in b/configure.in
index e8ba919..809c3eb 100644
--- a/configure.in
+++ b/configure.in
@@ -8,8 +8,6 @@ AC_CONFIG_HEADER(config.h)
dnl ---------------------------------------------------------------------
dnl Options
-AC_ARG_ENABLE(xaw3d,
- [ --enable-xaw3d use Xaw3D])
AC_ARG_ENABLE(xfree-ext,
[ --enable-xfree-ext use XFree extentions (DGA,VidMode,DPMS)])
AC_ARG_ENABLE(xvideo,
@@ -20,6 +18,10 @@ AC_ARG_ENABLE(quicktime,
[ --enable-quicktime quicktime support])
AC_ARG_ENABLE(motif,
[ --enable-motif enable experimental motif support])
+AC_ARG_ENABLE(aa,
+ [ --enable-aa enable aalib support])
+AC_ARG_ENABLE(alsa,
+ [ --enable-alsa enable alsa support])
dnl ---------------------------------------------------------------------
@@ -37,11 +39,13 @@ dnl do some OS specific stuff here
NG_GRAB=""
VBIFLAGS=""
PROGS=""
+INST=""
RADIO=""
case "`uname -s`" in
Linux)
NG_GRAB="grab-v4l.o grab-v4l2.o"
PROGS="v4l-conf fbtv"
+ INST="install-v4l-conf install-fbtv"
RADIO="radio"
;;
OpenBSD | FreeBSD)
@@ -59,31 +63,34 @@ esac
AC_SUBST(NG_GRAB)
AC_SUBST(VBIFLAGS)
AC_SUBST(PROGS)
+AC_SUBST(INST)
AC_SUBST(RADIO)
dnl ---------------------------------------------------------------------
dnl Checks for functions
-AC_CHECK_FUNCS(ftello getpt getnameinfo getopt_long)
+AC_CHECK_FUNCS(ftello fseeko getpt getnameinfo getopt_long)
AC_EGREP_HEADER(sockaddr_storage,sys/socket.h,AC_DEFINE(HAVE_SOCKADDR_STORAGE))
-AC_CHECK_HEADERS(endian.h soundcard.h sys/soundcard.h getopt.h)
+AC_CHECK_HEADERS(endian.h getopt.h soundcard.h sys/soundcard.h alsa/asoundlib.h linux/joystick.h)
AC_CHECK_LIB(pthread,pthread_create,LIBPTHREAD="-lpthread")
if test "$LIBPTHREAD" = ""; then
AC_CHECK_LIB(c_r,pthread_create,LIBPTHREAD="-lc_r")
fi
-AC_CHECK_LIB(ossaudio,main,LIBSOUND="-lossaudio")
+AC_CHECK_LIB(ossaudio,main,LIBOSS="-lossaudio")
AC_CHECK_LIB(ncurses,initscr,LIBCURSES="-lncurses")
if test "$LIBCURSES" = ""; then
AC_CHECK_LIB(curses,initscr,LIBCURSES="-lcurses")
fi
if test "$LIBCURSES" = ""; then
echo "Oops: (n)curses library not found. You need this one, please install."
+ echo "Note: to compile stuff just the library packages are not enougth,"
+ echo " you need also the *-devel packages."
exit 1
fi
AC_SUBST(LIBPTHREAD)
-AC_SUBST(LIBSOUND)
+AC_SUBST(LIBOSS)
AC_SUBST(LIBCURSES)
@@ -91,33 +98,48 @@ dnl ---------------------------------------------------------------------
dnl X11 checks
AC_PATH_XTRA
-if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
- AC_MSG_ERROR(can not find X11)
+if test "$no_x" != "yes"; then
+ PROGS="$PROGS xawtv xawtv-remote xvideo rootv"
+ ATHENA="-lXaw -lXmu -lXt $X_PRE_LIBS -lXpm -lXext -lX11 $X_EXTRA_LIBS"
+ FSLIB="-lFS"
+ SUBS="font"
+ TOOLS="propwatch"
+else
+ ATHENA=""
+ FSLIB=""
+ SUBS=""
+ TOOLS=""
fi
AC_SUBST(X_CFLAGS)
AC_SUBST(X_PRE_LIBS)
AC_SUBST(X_EXTRA_LIBS)
AC_SUBST(X_LIBS)
+AC_SUBST(x_includes)
AC_SUBST(x_libraries)
-
-if test "$enable_xaw3d" != "no"; then
- AC_CHECK_LIB(Xaw3d, Xaw3dComputeTopShadowRGB,
- XAWLIB=Xaw3d, XAWLIB=Xaw,
- $X_LIBS $X_PRE_LIBS -lXext -lXmu -lXt -lX11)
-else
- echo "*** Xaw3D disabled"
- XAWLIB=Xaw
-fi
-AC_SUBST(XAWLIB)
+AC_SUBST(ATHENA)
+AC_SUBST(FSLIB)
+AC_SUBST(SUBS)
+AC_SUBST(TOOLS)
AC_SUBST(GFXLIBS)
GFXLIBS="";
AC_CHECK_LIB(jpeg, jpeg_start_compress, GFXLIBS="-ljpeg"; JPEG="found",,)
if test "$JPEG" != "found"; then
- echo "Oops: jpeg library not found. You need this one, please install."
+ echo "Oops: jpeg library not found. You need this one, please install."
+ echo "Note: to compile stuff just the library packages are not enougth,"
+ echo " you need also the *-devel packages."
exit 1
fi
+AC_SUBST(LIBALSA)
+LIBALSA=""
+if test "$enable_alsa" != "no"; then
+ AC_CHECK_LIB(asound, snd_seq_open,
+ AC_DEFINE(HAVE_ALSA) PROGS="$PROGS mididump"; LIBALSA="-lasound",,)
+else
+ echo "*** alsa disabled"
+fi
+
AC_SUBST(LIRC)
LIRC=""
if test "$enable_lirc" != "no"; then
@@ -127,8 +149,15 @@ else
echo "*** lirc disabled"
fi
+if test "$enable_aa" != "no"; then
+ AC_CHECK_LIB(aa,aa_autoinit,
+ [ PROGS="$PROGS ttv"; INST="$INST install-ttv" ],,)
+else
+ echo "*** aalib support disabled"
+fi
+
if test "$enable_quicktime" != "no"; then
- AC_CHECK_LIB(png, png_read_info, GFXLIBS="-lpng $GFXLIBS"; PNG="found")
+ AC_CHECK_LIB(png, png_read_info, GFXLIBS="-lpng -lz -lm $GFXLIBS"; PNG="found")
if test "$PNG" = "found"; then
AC_CHECK_LIB(quicktime, quicktime_open,
GFXLIBS="-lquicktime -ldl -lglib $GFXLIBS";AC_DEFINE(HAVE_LIBQUICKTIME),,
@@ -164,17 +193,16 @@ else
echo "*** Xvideo extention disabled"
fi
-AC_SUBST(MOTIF)
-MOTIF=""
-if test "$enable_motif" = "yes"; then
- MOTIF="motv"
+if test "$enable_motif" != "no"; then
+ AC_CHECK_LIB(Xm,XmStringGenerate,
+ [ PROGS="$PROGS motv"; INST="$INST install-motv" ],,
+ $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
+else
+ echo "*** motif support disabled"
fi
-AC_CHECK_LIB(Xext, XShmAttach,AC_DEFINE(HAVE_MITSHM),,
- $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS)
-
-XAWTV_VERSION="`(cd $srcdir; pwd) | sed -e 's/.*-//'`"
-AC_SUBST(XAWTV_VERSION)
+VERSION="`(cd $srcdir; pwd) | sed -e 's/.*-//'`"
+AC_SUBST(VERSION)
dnl ---------------------------------------------------------------------
AC_MSG_CHECKING(for X11 config directory)
@@ -186,15 +214,17 @@ AC_MSG_RESULT($x11conf)
AC_SUBST(x11conf)
AC_MSG_CHECKING(for X11 app-defaults directory)
-resdir=/usr/X11R6/lib/X11/app-defaults
+resdir=/usr/X11R6/lib/X11
if test -d /etc/X11/app-defaults; then
- resdir=/etc/X11/app-defaults
+ resdir=/etc/X11
fi
-AC_MSG_RESULT($resdir)
+AC_MSG_RESULT($resdir/app-defaults)
AC_SUBST(resdir)
dnl ---------------------------------------------------------------------
-AC_OUTPUT(Makefile src/Makefile tools/Makefile radio/Makefile
+AC_OUTPUT(Make.config Makefile src/Makefile tools/Makefile radio/Makefile
man/Makefile i2c/Makefile font/Makefile webcam/Makefile
- http/Makefile libvbi/Makefile libng/Makefile xawtv.spec)
+ http/Makefile libvbi/Makefile libng/Makefile libng/plugins/Makefile
+ cc/Makefile xawtv.spec)
+
diff --git a/contrib/cc/Makefile b/contrib/cc/Makefile
deleted file mode 100644
index 24e6c44..0000000
--- a/contrib/cc/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-
-CC=gcc
-CFLAGS=-Wall -g -O2
-
-all: cc
-
-clean:
- -rm -f cc *~
diff --git a/debian/changelog b/debian/changelog
index 697b63e..24782e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,155 @@
+xawtv (3.66) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Wed, 12 Dec 2001 15:51:37 +0100
+
+xawtv (3.65) unstable; urgency=low
+
+ * new release (closes: #119935).
+
+ -- Gerd Knorr <kraxel@debian.org> Tue, 4 Dec 2001 13:13:01 +0100
+
+xawtv (3.64) unstable; urgency=low
+
+ * new release (closes: #113633,#112169).
+ * fixed build dependences (closes: #115111).
+
+ -- Gerd Knorr <kraxel@debian.org> Wed, 10 Oct 2001 12:51:39 +0200
+
+xawtv (3.63) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 8 Oct 2001 15:17:11 +0200
+
+xawtv (3.62) unstable; urgency=low
+
+ * new release (closes: #111105, #111267, #111296).
+
+ -- Gerd Knorr <kraxel@debian.org> Fri, 14 Sep 2001 19:39:38 +0200
+
+xawtv (3.61) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Thu, 23 Aug 2001 21:32:42 +0200
+
+xawtv (3.60) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Tue, 14 Aug 2001 16:39:51 +0200
+
+xawtv (3.59) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 13 Aug 2001 20:12:52 +0200
+
+xawtv (3.58) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Thu, 2 Aug 2001 14:22:14 +0200
+
+xawtv (3.57) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 23 Jul 2001 13:44:03 +0200
+
+xawtv (3.56) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 16 Jul 2001 16:17:18 +0200
+
+xawtv (3.55) unstable; urgency=low
+
+ * new release.
+ * spell fix in control file (s/Replace/Replaces/, closes: #103418).
+
+ -- Gerd Knorr <kraxel@debian.org> Wed, 4 Jul 2001 09:38:14 +0200
+
+xawtv (3.54) unstable; urgency=low
+
+ * new release (closes: #102096).
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 2 Jul 2001 11:36:09 +0200
+
+xawtv (3.53.1) unstable; urgency=low
+
+ * fixed dependences for new scantv package (closes: #101971).
+
+ -- Gerd Knorr <kraxel@debian.org> Sat, 23 Jun 2001 10:42:57 +0200
+
+xawtv (3.53) unstable; urgency=low
+
+ * new release.
+ * splitted scantv into a sepatate package (closes: #101353).
+ * updated ttv description (closes: #101682)
+
+ -- Gerd Knorr <kraxel@debian.org> Wed, 20 Jun 2001 12:18:06 +0200
+
+xawtv (3.52) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 18 Jun 2001 10:20:03 +0200
+
+xawtv (3.51) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 11 Jun 2001 12:58:33 +0200
+
+xawtv (3.50) unstable; urgency=low
+
+ * new release (closes: #99858).
+
+ -- Gerd Knorr <kraxel@debian.org> Wed, 6 Jun 2001 11:28:14 +0200
+
+xawtv (3.49) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Thu, 31 May 2001 11:45:34 +0200
+
+xawtv (3.48) unstable; urgency=low
+
+ * new release (closes: #97772).
+ * updated template file (closes: #92402).
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 21 May 2001 14:19:33 +0200
+
+xawtv (3.47) unstable; urgency=low
+
+ * new release.
+ * tweak postinst (closes: #97187).
+
+ -- Gerd Knorr <kraxel@debian.org> Wed, 16 May 2001 11:04:53 +0200
+
+xawtv (3.46) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 7 May 2001 17:30:03 +0200
+
+xawtv (3.45) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Sun, 6 May 2001 11:02:52 +0200
+
+xawtv (3.44) unstable; urgency=low
+
+ * new release (closes: #87136).
+ * deleted some magic from xawtv config/postinst scripts to avoid
+ dependency on pciutils.
+
+ -- Gerd Knorr <kraxel@debian.org> Sat, 5 May 2001 18:02:34 +0200
+
xawtv (3.43) unstable; urgency=low
* new release.
diff --git a/debian/control b/debian/control
index deaf319..181a1f9 100644
--- a/debian/control
+++ b/debian/control
@@ -1,14 +1,14 @@
Source: xawtv
Section: graphics
Priority: extra
-Build-Depends: libjpeg-dev, libncurses5-dev, xlibs-dev (>= 4.0.1), xaw3dg-dev, liblircclient-dev, debhelper, xutils, libquicktime4linux-dev, xbase-clients
+Build-Depends: libjpeg-dev, libncurses5-dev, xlibs-dev (>= 4.0.1), xaw3dg-dev, liblircclient-dev, debhelper, xutils, libquicktime4linux-dev, xbase-clients, aalib1-dev, libasound1-dev
Maintainer: Gerd Knorr <kraxel@debian.org>
Standards-Version: 3.5.2
Package: xawtv
Section: x11
Architecture: any
-Depends: ${shlibs:Depends}, v4l-conf, xutils, debconf, pciutils
+Depends: ${shlibs:Depends}, v4l-conf, xutils, debconf, scantv
Description: X11 TV application
TV application for X11. Supports video4linux
devices and the Xvideo extension.
@@ -25,6 +25,24 @@ Description: linux console (fbcon) TV application
framebuffer device (vesafb, matroxfb, atyfb, ...)
and a video4linux driver like bttv.
+Package: ttv
+Architecture: any
+Depends: ${shlibs:Depends}
+Suggests: xawtv
+Description: tty TV application
+ TV application for terminals, based on aalib.
+ Uses video4linux devices as video input.
+
+Package: scantv
+Architecture: any
+Depends: ${shlibs:Depends}
+Replaces: xawtv (<< 3.53)
+Description: scan TV channels for stations
+ This utility can scan a channel set for TV stations
+ and write the ones found into a xawtv config file
+ (which is also read by some other utilities like fbtv).
+ It also tries to extract the station names from vbi data.
+
Package: streamer
Architecture: any
Depends: ${shlibs:Depends}
@@ -66,6 +84,12 @@ Description: Miscellaneous tools distributed with xawtv
shoot sound problems.
* showriff - display the structure of RIFF files (avi, wav).
+Package: xawtv-plugins
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: plugins for xawtv and motv
+ a few image processing plugins.
+
Package: webcam
Section: net
Architecture: any
diff --git a/debian/copyright b/debian/copyright
index c7e3fa1..9124f1c 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,4 +1,4 @@
-This is xawtv, written and maintained by Gerd Knorr <kraxel@goldbach.in-berlin.de>
+This is xawtv, written and maintained by Gerd Knorr <kraxel@debian.org>
The original source can always be found at:
ftp://ftp.debian.org/dists/unstable/main/source/
diff --git a/debian/rules b/debian/rules
index d241287..741b86e 100644
--- a/debian/rules
+++ b/debian/rules
@@ -7,7 +7,11 @@ export DH_COMPAT=2
ROOT=$(shell echo `pwd`/debian/tmp)
build:
- test -f config.h || ./configure --prefix=/usr --mandir=/usr/share/man
+ test -f config.h || ./configure \
+ --disable-motif \
+ --prefix=/usr \
+ --mandir=/usr/share/man
+ make depend
$(MAKE) $@
clean::
@@ -15,7 +19,7 @@ clean::
dh_clean
install: build
- $(MAKE) ROOT=$(ROOT) $@
+ $(MAKE) DESTDIR=$(ROOT) $@
dh_movefiles
# fix v4l-conf suid-root lintian warning
@@ -29,8 +33,7 @@ binary-indep: install
binary-arch: install
dh_installdocs README* Changes UPDATE_TO_v3.0 \
- Programming-FAQ Trouble-Shooting Sound-FAQ \
- contrib/dot.lircrc contrib/frequencies*
+ Programming-FAQ contrib/dot.lircrc contrib/frequencies*
dh_installdocs -p xawtv-tools tools/README
dh_installdocs -p webcam webcam/webcam.cgi
# dh_installexamples
@@ -42,8 +45,6 @@ binary-arch: install
# dh_installmanpages
# dh_installinfo
dh_installdebconf -p xawtv
- dh_undocumented -p xawtv-tools record.1 dump-mixers.1
- dh_undocumented -p streamer streamer.1
dh_installchangelogs
# dh_link
# dh_strip
diff --git a/debian/scantv.files b/debian/scantv.files
new file mode 100644
index 0000000..b3981cc
--- /dev/null
+++ b/debian/scantv.files
@@ -0,0 +1,2 @@
+/usr/bin/scantv
+/usr/share/man/man1/scantv.1
diff --git a/debian/streamer.files b/debian/streamer.files
index 7698b4d..4d7f621 100644
--- a/debian/streamer.files
+++ b/debian/streamer.files
@@ -1 +1,2 @@
usr/bin/streamer
+usr/share/man/man1/streamer.1
diff --git a/debian/ttv.files b/debian/ttv.files
new file mode 100644
index 0000000..a0d5837
--- /dev/null
+++ b/debian/ttv.files
@@ -0,0 +1,2 @@
+usr/bin/ttv
+usr/share/man/man1/ttv.1
diff --git a/debian/ttv.menu b/debian/ttv.menu
new file mode 100644
index 0000000..6a61c27
--- /dev/null
+++ b/debian/ttv.menu
@@ -0,0 +1,2 @@
+?package(ttv):needs=text section=Apps/Viewers \
+ title="ttv" command="/usr/bin/ttv"
diff --git a/debian/v4l-conf.files b/debian/v4l-conf.files
index 814c162..48c3bd5 100644
--- a/debian/v4l-conf.files
+++ b/debian/v4l-conf.files
@@ -1,2 +1,2 @@
usr/bin/v4l-conf
-usr/share/man/man1/v4l-conf.1
+usr/share/man/man8/v4l-conf.8
diff --git a/debian/xawtv-plugins.files b/debian/xawtv-plugins.files
new file mode 100644
index 0000000..c9fbe65
--- /dev/null
+++ b/debian/xawtv-plugins.files
@@ -0,0 +1 @@
+/usr/lib/xawtv/*
diff --git a/debian/xawtv-tools.files b/debian/xawtv-tools.files
index 743dad0..ce03cfc 100644
--- a/debian/xawtv-tools.files
+++ b/debian/xawtv-tools.files
@@ -2,5 +2,7 @@ usr/bin/showriff
usr/bin/propwatch
usr/bin/dump-mixers
usr/bin/record
-usr/share/man/man1/propwatch.1
usr/share/man/man1/showriff.1
+usr/share/man/man1/propwatch.1
+usr/share/man/man1/dump-mixers.1
+usr/share/man/man1/record.1
diff --git a/debian/xawtv.conffiles b/debian/xawtv.conffiles
new file mode 100644
index 0000000..94e7b18
--- /dev/null
+++ b/debian/xawtv.conffiles
@@ -0,0 +1 @@
+/etc/X11/app-defaults/Xawtv
diff --git a/debian/xawtv.config b/debian/xawtv.config
index 39eab27..336fdb8 100644
--- a/debian/xawtv.config
+++ b/debian/xawtv.config
@@ -9,19 +9,7 @@ mkdev="true"
mkcfg="true"
tvnorm=""
freqtab=""
-doscan="false"
-
-# look around a bit, see if a channel scan
-# has a chance to work.
-pcidev=`lspci -n 2>/dev/null | cut -d" " -f 4`
-for card in $pcidev; do
- case $card in
- 109e:0350) doscan="true" ;; # bt848
- 109e:0351) doscan="true" ;; # bt849
- 109e:036e) doscan="true" ;; # bt878
- 109e:036f) doscan="true" ;; # bt879
- esac
-done
+doscan=""
# create v4l devices ?
test -c /dev/.devfsd -o -c /dev/video0 && mkdev="false"
@@ -56,10 +44,6 @@ if test "$mkcfg" = "true"; then
db_go
db_get xawtv/freqtab
freqtab="$RET"
-fi
-
-if test "$mkcfg" = "true" -a "$doscan" = "true"; then
- # channel scan?
db_input medium xawtv/channel-scan
db_go
db_get xawtv/channel-scan
diff --git a/debian/xawtv.files b/debian/xawtv.files
index 2c5ef1d..9e81bce 100644
--- a/debian/xawtv.files
+++ b/debian/xawtv.files
@@ -2,13 +2,14 @@
/usr/bin/xawtv-remote
/usr/bin/v4lctl
/usr/bin/rootv
-/usr/bin/scantv
+/usr/bin/ntsc-cc
+/usr/bin/subtitles
/usr/share/man/man1/v4lctl.1
/usr/share/man/man1/xawtv.1
/usr/share/man/man1/rootv.1
-/usr/share/man/man1/scantv.1
/usr/share/man/man1/xawtv-remote.1
-/usr/X11R6/lib/X11/fonts/misc/led-latin1.pcf
-/usr/X11R6/lib/X11/fonts/misc/led-latin2.pcf
-/usr/X11R6/lib/X11/fonts/misc/led-koi8.pcf
+/usr/share/man/man1/ntsc-cc.1
+/usr/share/man/man1/subtitles.1
+/usr/share/man/man5/xawtvrc.5
+/usr/X11R6/lib/X11/fonts/misc/*
/etc/X11/app-defaults/Xawtv
diff --git a/debian/xawtv.postinst b/debian/xawtv.postinst
index b522b68..c84f6e9 100644
--- a/debian/xawtv.postinst
+++ b/debian/xawtv.postinst
@@ -9,19 +9,7 @@ mkdev="true"
mkcfg="true"
tvnorm=""
freqtab=""
-doscan="false"
-
-# look around a bit, see if a channel scan
-# has a chance to work.
-pcidev=`lspci -n 2>/dev/null | cut -d" " -f 4`
-for card in $pcidev; do
- case $card in
- 109e:0350) doscan="true" ;; # bt848
- 109e:0351) doscan="true" ;; # bt849
- 109e:036e) doscan="true" ;; # bt878
- 109e:036f) doscan="true" ;; # bt879
- esac
-done
+doscan=""
# create v4l devices ?
test -c /dev/.devfsd -o -c /dev/video0 && mkdev="false"
@@ -48,10 +36,6 @@ if test "$mkcfg" = "true"; then
tvnorm="$RET"
db_get xawtv/freqtab
freqtab="$RET"
-fi
-
-if test "$mkcfg" = "true" -a "$doscan" = "true"; then
- # channel scan?
db_get xawtv/channel-scan
doscan="$RET"
fi
@@ -73,6 +57,7 @@ fi
# install new X11 fonts
(cd /usr/X11R6/lib/X11/fonts/misc; /usr/X11R6/bin/mkfontdir)
-#xset fp rehash 2>/dev/null || true
+
+#########################################################
#DEBHELPER#
diff --git a/debian/xawtv.template.Master b/debian/xawtv.template.Master
new file mode 100644
index 0000000..914df4c
--- /dev/null
+++ b/debian/xawtv.template.Master
@@ -0,0 +1,44 @@
+Template: xawtv/makedev
+Type: boolean
+Default: true
+Description: Create video4linux (/dev/video*) special files?
+
+Template: xawtv/build-config
+Type: boolean
+Default: false
+Description: Create a default configuration for xawtv?
+ You can create a system-wide configuration file
+ for xawtv with reasonable default values for the
+ country you live in (which TV norm is used for
+ example).
+ .
+ It is not required to have a global configuration
+ file, but it will be more comfortable for your
+ users if they find a working default configuration.
+
+Template: xawtv/tvnorm
+Type: select
+Choices: PAL, SECAM, NTSC
+Description: Which TV norm is used in your country?
+
+Template: xawtv/freqtab
+Type: select
+Choices: us-bcast, us-cable, us-cable-hrc, japan-bcast, japan-cable, europe-west, europe-east, italy, newzealand, australia, ireland, france, china-bcast
+Description: Which frequency table should be used?
+ A frequency table is just a list of TV channel
+ names/numbers and the corresponding broadcast
+ frequencies for these channels. Different regions
+ use different standards here...
+
+Template: xawtv/channel-scan
+Type: boolean
+Default: yes
+Description: scan for TV stations?
+ I can do a scan of all channels and put a list of
+ the TV stations I've found into the config file.
+ .
+ This requires a working bttv driver. If bttv isn't
+ configured correctly I might not find the TV stations.
+ .
+ I'll try to pick up the channel names from videotext.
+ This will work with PAL only.
diff --git a/debian/xawtv.template.de b/debian/xawtv.template.de
new file mode 100644
index 0000000..dbfc75b
--- /dev/null
+++ b/debian/xawtv.template.de
@@ -0,0 +1,71 @@
+Template: xawtv/makedev
+Type: boolean
+Default: true
+Description: Create video4linux (/dev/video*) special files?
+Description-de: Sollen Geräte-Dateien (/dev/video*) für video4linux erstellt werden?
+
+Template: xawtv/build-config
+Type: boolean
+Default: false
+Description: Create a default configuration for xawtv?
+ You can create a system-wide configuration file
+ for xawtv with reasonable default values for the
+ country you live in (which TV norm is used for
+ example).
+ .
+ It is not required to have a global configuration
+ file, but it will be more comfortable for your
+ users if they find a working default configuration.
+Description-de: Soll eine Standard-Konfiguration für xawtv erstellt werden?
+ Sie können für xawtv eine systemweite Konfigurationsdatei
+ erstellen, die vernünftige Voreinstellungen für ihr Land
+ enthält (z.B. welche TV-Norm benutzt wird).
+ .
+ Eine globale Konfigurationsdatei ist nicht unbedingt
+ erforderlich, aber es ist für die Benutzer sicherlich
+ angenehm, gleich eine funktionierende Konfiguration
+ vorzufinden.
+
+Template: xawtv/tvnorm
+Type: select
+Choices: PAL, SECAM, NTSC
+Description: Which TV norm is used in your country?
+Description-de: Welche TV-Norm benutzt man in ihrem Land?
+
+Template: xawtv/freqtab
+Type: select
+Choices: us-bcast, us-cable, us-cable-hrc, japan-bcast, japan-cable, europe-west, europe-east, italy, newzealand, australia, ireland, france, china-bcast
+Description: Which frequency table should be used?
+ A frequency table is just a list of TV channel
+ names/numbers and the corresponding broadcast
+ frequencies for these channels. Different regions
+ use different standards here...
+Description-de: Welche Frequenzen-Tabelle soll benutzt werden?
+ Eine Frequenzen-Tabelle ist einfach nur eine Liste der
+ TV-Kanäle (Namen oder Nummern) mit dazugehörigen
+ Frequenzen. Verschiedene Regionen verwenden unterschiedliche
+ Standards.
+
+Template: xawtv/channel-scan
+Type: boolean
+Default: yes
+Description: scan for TV stations?
+ I can do a scan of all channels and put a list of
+ the TV stations I've found into the config file.
+ .
+ This requires a working bttv driver. If bttv isn't
+ configured correctly I might not find the TV stations.
+ .
+ I'll try to pick up the channel names from videotext.
+ This will work with PAL only.
+Description-de: Soll nach TV-Stationen gesucht werden?
+ Ich kann einen Suche nach Kanälen durchführen und
+ eine Liste der gefundenen TV-Stationen in die
+ Konfigurationsdatei schreiben.
+ .
+ Dafür ist ein funktionierender BTTV-Treiber erforderlich.
+ Wenn BTTV nicht richtig eingerichtet ist, werde ich keine
+ Stationen finden können.
+ .
+ Ich werde versuchen, die Namen der Kanäle aus dem
+ Videotext herauszulesen. Dies funktioniert nur mit PAL.
diff --git a/debian/xawtv.template.es b/debian/xawtv.template.es
new file mode 100644
index 0000000..4f16c87
--- /dev/null
+++ b/debian/xawtv.template.es
@@ -0,0 +1,68 @@
+Template: xawtv/makedev
+Type: boolean
+Default: true
+Description: Create video4linux (/dev/video*) special files?
+Description-es: ¿Crear los ficheros especiales video4linux (/dev/video*)?
+
+Template: xawtv/build-config
+Type: boolean
+Default: false
+Description: Create a default configuration for xawtv?
+ You can create a system-wide configuration file
+ for xawtv with reasonable default values for the
+ country you live in (which TV norm is used for
+ example).
+ .
+ It is not required to have a global configuration
+ file, but it will be more comfortable for your
+ users if they find a working default configuration.
+Description-es: ¿Crear una configuración por defecto para xawtv?
+ Puede crear un fichero de configuración para xawtv general para su
+ sistema con valores razonables para el país en el que vive (el sistema
+ de televisión que se utiliza por ejemplo).
+ .
+ No es obligatorio tener un fichero de configuración global, pero será
+ más cómodo para sus usuarios encontrarse una configuración por defecto
+ que funciona.
+
+Template: xawtv/tvnorm
+Type: select
+Choices: PAL, SECAM, NTSC
+Description: Which TV norm is used in your country?
+Description-es: ¿Qué sistema de televisión se usa en su país?
+
+Template: xawtv/freqtab
+Type: select
+Choices: us-bcast, us-cable, us-cable-hrc, japan-bcast, japan-cable, europe-west, europe-east, italy, newzealand, australia, ireland, france, china-bcast
+Description: Which frequency table should be used?
+ A frequency table is just a list of TV channel
+ names/numbers and the corresponding broadcast
+ frequencies for these channels. Different regions
+ use different standards here...
+Description-es: ¿Que tabla de frecuencias se debería usar?
+ Una tabla de frecuencias es sólo una lista de nombres/números de
+ canales de televisión y sus correspondientes frecuencias de emisión.
+ Diferentes regiones utilizan diferentes estándares para esto...
+
+Template: xawtv/channel-scan
+Type: boolean
+Default: yes
+Description: scan for TV stations?
+ I can do a scan of all channels and put a list of
+ the TV stations I've found into the config file.
+ .
+ This requires a working bttv driver. If bttv isn't
+ configured correctly I might not find the TV stations.
+ .
+ I'll try to pick up the channel names from videotext.
+ This will work with PAL only.
+Description-es: ¿Buscar cadenas de televisión?
+ Puedo realizar una búsqueda de todos los canales y poner una lista de
+ las cadenas de televisión encontradas en el fichero de configuración.
+ .
+ Esto requiere un controlador bttv que funcione. Si bttv no se encuentra
+ configurado correctamente puede que no encuentre las cadenas de
+ televisión.
+ .
+ Trataré de obtener los nombres de los canales del teletexto. Esto sólo
+ funcionará con PAL.
diff --git a/debian/xawtv.templates b/debian/xawtv.templates
index 2a6155f..e6d0e80 100644
--- a/debian/xawtv.templates
+++ b/debian/xawtv.templates
@@ -1,72 +1,89 @@
+Template: xawtv/channel-scan
+Type: boolean
+Default: yes
+Description: scan for TV stations?
+ I can do a scan of all channels and put a list of the TV stations I've
+ found into the config file.
+ .
+ This requires a working bttv driver. If bttv isn't configured correctly I
+ might not find the TV stations.
+ .
+ I'll try to pick up the channel names from videotext. This will work with
+ PAL only.
+Description-de: Soll nach TV-Stationen gesucht werden?
+ Ich kann einen Suche nach Kanälen durchführen und eine Liste der
+ gefundenen TV-Stationen in die Konfigurationsdatei schreiben.
+ .
+ Dafür ist ein funktionierender BTTV-Treiber erforderlich. Wenn BTTV nicht
+ richtig eingerichtet ist, werde ich keine Stationen finden können.
+ .
+ Ich werde versuchen, die Namen der Kanäle aus dem Videotext herauszulesen.
+ Dies funktioniert nur mit PAL.
+Description-es: ¿Buscar cadenas de televisión?
+ Puedo realizar una búsqueda de todos los canales y poner una lista de las
+ cadenas de televisión encontradas en el fichero de configuración.
+ .
+ Esto requiere un controlador bttv que funcione. Si bttv no se encuentra
+ configurado correctamente puede que no encuentre las cadenas de
+ televisión.
+ .
+ Trataré de obtener los nombres de los canales del teletexto. Esto sólo
+ funcionará con PAL.
+
Template: xawtv/makedev
Type: boolean
Default: true
Description: Create video4linux (/dev/video*) special files?
Description-de: Sollen Geräte-Dateien (/dev/video*) für video4linux erstellt werden?
-
-Template: xawtv/build-config
-Type: boolean
-Default: false
-Description: Create a default configuration for xawtv?
- You can create a system-wide configuration file
- for xawtv with reasonable default values for the
- country you live in (which TV norm is used for
- example).
- .
- It is not required to have a global configuration
- file, but it will be more comfortable for your
- users if they find a working default configuration.
-Description-de: Soll eine Standard-Konfiguration für xawtv erstellt werden?
- Sie können für xawtv eine systemweite Konfigurationsdatei
- erstellen, die vernünftige Voreinstellungen für ihr Land
- enthält (z.B. welche TV-Norm benutzt wird).
- .
- Eine globale Konfigurationsdatei ist nicht unbedingt
- erforderlich, aber es ist für die Benutzer sicherlich
- angenehm, gleich eine funktionierende Konfiguration
- vorzufinden.
+Description-es: ¿Crear los ficheros especiales video4linux (/dev/video*)?
Template: xawtv/tvnorm
Type: select
Choices: PAL, SECAM, NTSC
Description: Which TV norm is used in your country?
Description-de: Welche TV-Norm benutzt man in ihrem Land?
+Description-es: ¿Qué sistema de televisión se usa en su país?
Template: xawtv/freqtab
Type: select
Choices: us-bcast, us-cable, us-cable-hrc, japan-bcast, japan-cable, europe-west, europe-east, italy, newzealand, australia, ireland, france, china-bcast
Description: Which frequency table should be used?
- A frequency table is just a list of TV channel
- names/numbers and the corresponding broadcast
- frequencies for these channels. Different regions
+ A frequency table is just a list of TV channel names/numbers and the
+ corresponding broadcast frequencies for these channels. Different regions
use different standards here...
Description-de: Welche Frequenzen-Tabelle soll benutzt werden?
- Eine Frequenzen-Tabelle ist einfach nur eine Liste der
- TV-Kanäle (Namen oder Nummern) mit dazugehörigen
- Frequenzen. Verschiedene Regionen verwenden unterschiedliche
- Standards.
+ Eine Frequenzen-Tabelle ist einfach nur eine Liste der TV-Kanäle (Namen
+ oder Nummern) mit dazugehörigen Frequenzen. Verschiedene Regionen
+ verwenden unterschiedliche Standards.
+Description-es: ¿Que tabla de frecuencias se debería usar?
+ Una tabla de frecuencias es sólo una lista de nombres/números de canales
+ de televisión y sus correspondientes frecuencias de emisión. Diferentes
+ regiones utilizan diferentes estándares para esto...
-Template: xawtv/channel-scan
+Template: xawtv/build-config
Type: boolean
-Default: yes
-Description: scan for TV stations?
- I can do a scan of all channels and put a list of
- the TV stations I've found into the config file.
- .
- This requires a working bttv driver. If bttv isn't
- configured correctly I might not find the TV stations.
+Default: false
+Description: Create a default configuration for xawtv?
+ You can create a system-wide configuration file for xawtv with reasonable
+ default values for the country you live in (which TV norm is used for
+ example).
.
- I'll try to pick up the channel names from videotext.
- This will work with PAL only.
-Description-de: Soll nach TV-Stationen gesucht werden?
- Ich kann einen Suche nach Kanälen durchführen und
- eine Liste der gefundenen TV-Stationen in die
- Konfigurationsdatei schreiben.
+ It is not required to have a global configuration file, but it will be
+ more comfortable for your users if they find a working default
+ configuration.
+Description-de: Soll eine Standard-Konfiguration für xawtv erstellt werden?
+ Sie können für xawtv eine systemweite Konfigurationsdatei erstellen, die
+ vernünftige Voreinstellungen für ihr Land enthält (z.B. welche TV-Norm
+ benutzt wird).
.
- Dafür ist ein funktionierender BTTV-Treiber erforderlich.
- Wenn BTTV nicht richtig eingerichtet ist, werde ich keine
- Stationen finden können.
+ Eine globale Konfigurationsdatei ist nicht unbedingt erforderlich, aber es
+ ist für die Benutzer sicherlich angenehm, gleich eine funktionierende
+ Konfiguration vorzufinden.
+Description-es: ¿Crear una configuración por defecto para xawtv?
+ Puede crear un fichero de configuración para xawtv general para su sistema
+ con valores razonables para el país en el que vive (el sistema de
+ televisión que se utiliza por ejemplo).
.
- Ich werde versuchen, die Namen der Kanäle aus dem
- Videotext herauszulesen. Dies funktioniert nur mit PAL.
-
+ No es obligatorio tener un fichero de configuración global, pero será más
+ cómodo para sus usuarios encontrarse una configuración por defecto que
+ funciona.
diff --git a/font/Makefile.in b/font/Makefile.in
index d32e639..1f630d7 100644
--- a/font/Makefile.in
+++ b/font/Makefile.in
@@ -1,59 +1,48 @@
+
srcdir=@srcdir@
VPATH=$(srcdir)
-ROOT=
-prefix=/usr/X11R6
-FONTDIR=$(ROOT)$(prefix)/lib/X11/fonts/misc
-PCF=led-latin1.pcf led-latin2.pcf led-koi8.pcf
+include ../Make.config
+
+FONTSERVER := unix/:7100
+FONTSPEC := -misc-fixed-medium-r-semicondensed-*-13-120-75-75-c-60
+
+PCF := led-iso8859-1.pcf led-iso8859-2.pcf led-koi8-r.pcf
+BDF := $(PCF:pcf=bdf)
all build: $(PCF)
mkfontdir
install: all
- mkdir -p $(R)$(FONTDIR)
- for file in $(PCF); do \
- install -m 644 $$file $(R)$(FONTDIR); \
+ mkdir -p $(fontdir)
+ for file in $(PCF); do \
+ install -m 644 $$file $(fontdir); \
+ gzip $(fontdir)/$$file; \
done
- if test "$(ROOT)" = ""; then \
- (cd $(FONTDIR); mkfontdir); \
+ if test "$(DESTDIR)" = ""; then \
+ (cd $(fontdir); mkfontdir); \
xset fp rehash || true; \
fi
+
.SUFFIXES: .bdf .pcf
.bdf.pcf:
bdftopcf -o $@ $<
-dep:
-
-clean:
- rm -f $(PCF)
-
-distclean: clean
- rm -f Makefile *~ *.bak
+$(BDF):
+ FONTSERVER=$(FONTSERVER); export FONTSERVER; \
+ charset=`echo $@ | sed -e 's|led-||' -e 's|.bdf||'`; \
+ perl ./bigfont.pl -fn "$(FONTSPEC)-$$charset" > $@
-###########################################################################
-# don't use these, unless you know what you are doing...
-
-SERVER=tcp/goldbach:7100
-
-bdf: led-latin1.bdf led-latin2.bdf led-koi8.bdf
-
-led-latin1.bdf:
- perl ./bigfont.pl -s $(SERVER) -fn \
- "-misc-fixed-medium-r-semicondensed--13-*-iso8859-1" > led-latin1.bdf
-
-led-latin2.bdf:
- perl ./bigfont.pl -s $(SERVER) -fn \
- "-misc-fixed-medium-r-semicondensed--13-*-iso8859-2" > led-latin2.bdf
-
-led-koi8.bdf:
- perl ./bigfont.pl -s $(SERVER) -fn \
- "-misc-fixed-medium-r-semicondensed--13-*-koi8-r" > led-koi8.bdf
+dep depend:
+clean:
+ rm -f *.pcf
-realclean: clean
- rm -f *.bdf fonts.dir
+distclean: clean
+ rm -f Makefile *~ *.bak fonts.dir
-dist: realclean bdf
+realclean: distclean
+ rm -f *.bdf
diff --git a/font/bigfont.pl b/font/bigfont.pl
index bf20f55..64f8f98 100644
--- a/font/bigfont.pl
+++ b/font/bigfont.pl
@@ -1,15 +1,12 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
# defaults
-$fserver = "";
$fname = "fixed";
+$debug = 0;
# parse args
-while ($ARGV[0] =~ /^-(.+)/) {
- if ($1 eq "s") {
- $fserver = "-s $ARGV[1]";
- shift; shift;
- } elsif ($1 eq "fn") {
+while (defined($ARGV[0]) && $ARGV[0] =~ /^-(.+)/) {
+ if ($1 eq "fn") {
$fname = $ARGV[1];
shift; shift;
} else {
@@ -43,16 +40,16 @@ sub printline () {
$start = 4 * length($bits);
$val = hex($bits);
- print STDERR "|";
+ print STDERR "|" if $debug;
for ($i = $start-1; $i >= $start-$width; $i--) {
if ($val & (1 << ($left+$i))) {
- print STDERR "*";
+ print STDERR "*" if $debug;
} else {
- print STDERR " ";
+ print STDERR " " if $debug;
}
}
$big = &bitscale($val,3);
- printf(STDERR "| %s | %0*x |\n",$bits,$start/4*3,$big);
+ printf(STDERR "| %s | %0*x |\n",$bits,$start/4*3,$big) if $debug;
$big |= ($big >> 1);
printf("%0*x\n",$start/4*3,$big);
printf("%0*x\n",$start/4*3,$big);
@@ -68,7 +65,8 @@ sub parsechar () {
local($n) = 0;
local($s) = 3;
- print STDERR "--\n";
+ print STDERR "--\n" if $debug;
+ print STDERR "*" if !$debug;
print "STARTCHAR $name\n";
while (<FONT>) {
last if /ENDCHAR/;
@@ -98,7 +96,7 @@ sub parsechar () {
########################################################################
-open(FONT,"fstobdf $fserver -fn $fname |") || die;
+open(FONT,"fstobdf -fn $fname |") || die;
while (<FONT>) {
if (/STARTCHAR (.*)/) {
@@ -120,4 +118,4 @@ while (<FONT>) {
}
}
-
+print STDERR " done\n" if !$debug;
diff --git a/font/fonts.dir b/font/fonts.dir
deleted file mode 100644
index d1a1f4d..0000000
--- a/font/fonts.dir
+++ /dev/null
@@ -1,4 +0,0 @@
-3
-led-latin1.pcf -xxl-ledfixed-medium-r-semicondensed--39-120-75-75-c-180-iso8859-1
-led-latin2.pcf -xxl-ledfixed-medium-r-semicondensed--39-120-75-75-c-180-iso8859-2
-led-koi8.pcf -xxl-ledfixed-medium-r-semicondensed--39-120-75-75-c-180-koi8-r
diff --git a/font/led-latin1.bdf b/font/led-iso8859-1.bdf
index c90af29..25f27a5 100644
--- a/font/led-latin1.bdf
+++ b/font/led-iso8859-1.bdf
@@ -11,7 +11,7 @@ COMMENT
FONT -Xxl-LedFixed-Medium-R-SemiCondensed--39-120-75-75-C-180-ISO8859-1
SIZE 36 75 75
FONTBOUNDINGBOX 6 13 0 -2
-STARTPROPERTIES 24
+STARTPROPERTIES 25
FONTNAME_REGISTRY ""
FOUNDRY "Led"
FAMILY_NAME "Fixed"
@@ -28,61 +28,56 @@ AVERAGE_WIDTH 180
CHARSET_REGISTRY "ISO8859"
CHARSET_ENCODING "1"
COPYRIGHT "Public domain font. Share and enjoy."
+CAP_HEIGHT 9
+X_HEIGHT 18
FONT "-Xxl-LedFixed-Medium-R-SemiCondensed--39-120-75-75-C-180-ISO8859-1"
WEIGHT 10
-RESOLUTION 107
-X_HEIGHT 33
+RESOLUTION 103
QUAD_WIDTH 18
DEFAULT_CHAR 0
FONT_ASCENT 33
FONT_DESCENT 6
ENDPROPERTIES
-CHARS 224
+CHARS 219
STARTCHAR C000
ENCODING 0
SWIDTH 1440 0
DWIDTH 18 0
-BBX 12 33 3 -3
+BBX 15 27 0 0
BITMAP
-db6000
-db6000
+c30c00
+c30c00
000000
-db6000
-db6000
000000
-db6000
-db6000
000000
-db6000
-db6000
000000
-db6000
-db6000
+c00c00
+c00c00
000000
-db6000
-db6000
000000
-db6000
-db6000
000000
-db6000
-db6000
000000
-db6000
-db6000
+c00c00
+c00c00
+000000
000000
-db6000
-db6000
000000
-db6000
-db6000
+000000
+c00c00
+c00c00
+000000
+000000
+000000
+000000
+c30c00
+c30c00
000000
ENDCHAR
STARTCHAR C001
ENCODING 1
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 15 0 3
+BBX 15 15 0 6
BITMAP
030000
030000
@@ -104,8 +99,11 @@ STARTCHAR C002
ENCODING 2
SWIDTH 1440 0
DWIDTH 18 0
-BBX 18 36 0 -6
+BBX 18 39 0 -6
BITMAP
+c30c00
+c30c00
+000000
186180
186180
000000
@@ -147,7 +145,7 @@ STARTCHAR C003
ENCODING 3
SWIDTH 1440 0
DWIDTH 18 0
-BBX 12 27 0 -6
+BBX 15 27 0 0
BITMAP
c30000
c30000
@@ -164,24 +162,24 @@ c30000
c30000
c30000
000000
-1b6000
-1b6000
+036c00
+036c00
000000
-030000
-030000
+006000
+006000
000000
-030000
-030000
+006000
+006000
000000
-030000
-030000
+006000
+006000
000000
ENDCHAR
STARTCHAR C004
ENCODING 4
SWIDTH 1440 0
DWIDTH 18 0
-BBX 12 27 0 -6
+BBX 15 27 0 0
BITMAP
db0000
db0000
@@ -195,30 +193,30 @@ d80000
c00000
c00000
000000
-db6000
-db6000
+c36c00
+c36c00
000000
-180000
-180000
+030000
+030000
000000
-1b0000
-1b0000
+036000
+036000
000000
-180000
-180000
+030000
+030000
000000
-180000
-180000
+030000
+030000
000000
ENDCHAR
STARTCHAR C005
ENCODING 5
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 27 0 -6
+BBX 15 27 0 0
BITMAP
-1b6000
-1b6000
+1b0000
+1b0000
000000
c00000
c00000
@@ -226,30 +224,30 @@ c00000
c00000
c00000
000000
-1b6000
-1b6000
+1b0000
+1b0000
000000
-1b6000
-1b6000
+036000
+036000
000000
-180c00
-180c00
+030c00
+030c00
000000
-1b6000
-1b6000
+036000
+036000
000000
-186000
-186000
+030c00
+030c00
000000
-180c00
-180c00
+030c00
+030c00
000000
ENDCHAR
STARTCHAR C006
ENCODING 6
SWIDTH 1440 0
DWIDTH 18 0
-BBX 12 27 0 -6
+BBX 15 27 0 0
BITMAP
c00000
c00000
@@ -263,27 +261,27 @@ c00000
db0000
db0000
000000
-1b6000
-1b6000
+036c00
+036c00
000000
-180000
-180000
+030000
+030000
000000
-1b0000
-1b0000
+036000
+036000
000000
-180000
-180000
+030000
+030000
000000
-180000
-180000
+030000
+030000
000000
ENDCHAR
STARTCHAR C007
ENCODING 7
SWIDTH 1440 0
DWIDTH 18 0
-BBX 12 12 0 15
+BBX 12 12 3 15
BITMAP
1b0000
1b0000
@@ -302,7 +300,7 @@ STARTCHAR C010
ENCODING 8
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 21 0 0
+BBX 15 21 0 3
BITMAP
030000
030000
@@ -330,75 +328,75 @@ STARTCHAR C011
ENCODING 9
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 27 0 -6
+BBX 15 27 0 0
BITMAP
-c00c00
-c00c00
+c06000
+c06000
000000
-d80c00
-d80c00
+d86000
+d86000
000000
-c30c00
-c30c00
+c36000
+c36000
000000
-c06c00
-c06c00
+c06000
+c06000
000000
-c00c00
-c00c00
+030000
+030000
000000
-180000
-180000
+030000
+030000
000000
-180000
-180000
+030000
+030000
000000
-180000
-180000
+030000
+030000
000000
-1b6c00
-1b6c00
+036c00
+036c00
000000
ENDCHAR
STARTCHAR C012
ENCODING 10
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 27 0 -6
+BBX 15 27 0 0
BITMAP
-c00c00
-c00c00
-000000
-c00c00
-c00c00
-000000
-186000
-186000
+c30000
+c30000
000000
-030000
-030000
+c30000
+c30000
000000
+c30000
+c30000
000000
+180000
+180000
000000
+180000
+180000
000000
-db6c00
-db6c00
+036c00
+036c00
000000
-030000
-030000
+006000
+006000
000000
-030000
-030000
+006000
+006000
000000
-030000
-030000
+006000
+006000
000000
ENDCHAR
STARTCHAR C013
ENCODING 11
SWIDTH 1440 0
DWIDTH 18 0
-BBX 9 24 0 9
+BBX 9 21 0 12
BITMAP
030000
030000
@@ -418,9 +416,6 @@ BITMAP
030000
030000
000000
-030000
-030000
-000000
db0000
db0000
000000
@@ -429,7 +424,7 @@ STARTCHAR C014
ENCODING 12
SWIDTH 1440 0
DWIDTH 18 0
-BBX 9 18 0 -6
+BBX 9 21 0 -6
BITMAP
db0000
db0000
@@ -449,12 +444,15 @@ db0000
030000
030000
000000
+030000
+030000
+000000
ENDCHAR
STARTCHAR C015
ENCODING 13
SWIDTH 1440 0
DWIDTH 18 0
-BBX 12 18 6 -6
+BBX 12 21 6 -6
BITMAP
db6000
db6000
@@ -474,12 +472,15 @@ c00000
c00000
c00000
000000
+c00000
+c00000
+000000
ENDCHAR
STARTCHAR C016
ENCODING 14
SWIDTH 1440 0
DWIDTH 18 0
-BBX 12 24 6 9
+BBX 12 21 6 12
BITMAP
c00000
c00000
@@ -499,9 +500,6 @@ c00000
c00000
c00000
000000
-c00000
-c00000
-000000
db6000
db6000
000000
@@ -530,9 +528,6 @@ BITMAP
030000
030000
000000
-030000
-030000
-000000
db6d80
db6d80
000000
@@ -551,52 +546,15 @@ db6d80
030000
030000
000000
-ENDCHAR
-STARTCHAR C020
-ENCODING 16
-SWIDTH 1440 0
-DWIDTH 18 0
-BBX 18 3 0 21
-BITMAP
-db6d80
-db6d80
-000000
-ENDCHAR
-STARTCHAR C021
-ENCODING 17
-SWIDTH 1440 0
-DWIDTH 18 0
-BBX 18 3 0 15
-BITMAP
-db6d80
-db6d80
+030000
+030000
000000
ENDCHAR
STARTCHAR C022
ENCODING 18
SWIDTH 1440 0
DWIDTH 18 0
-BBX 18 3 0 9
-BITMAP
-db6d80
-db6d80
-000000
-ENDCHAR
-STARTCHAR C023
-ENCODING 19
-SWIDTH 1440 0
-DWIDTH 18 0
-BBX 18 3 0 3
-BITMAP
-db6d80
-db6d80
-000000
-ENDCHAR
-STARTCHAR C024
-ENCODING 20
-SWIDTH 1440 0
-DWIDTH 18 0
-BBX 18 3 0 -3
+BBX 18 3 0 12
BITMAP
db6d80
db6d80
@@ -626,9 +584,6 @@ c00000
c00000
c00000
000000
-c00000
-c00000
-000000
db6000
db6000
000000
@@ -647,6 +602,9 @@ c00000
c00000
c00000
000000
+c00000
+c00000
+000000
ENDCHAR
STARTCHAR C026
ENCODING 22
@@ -672,9 +630,6 @@ BITMAP
030000
030000
000000
-030000
-030000
-000000
db0000
db0000
000000
@@ -693,12 +648,15 @@ db0000
030000
030000
000000
+030000
+030000
+000000
ENDCHAR
STARTCHAR C027
ENCODING 23
SWIDTH 1440 0
DWIDTH 18 0
-BBX 18 24 0 9
+BBX 18 21 0 12
BITMAP
030000
030000
@@ -718,9 +676,6 @@ BITMAP
030000
030000
000000
-030000
-030000
-000000
db6d80
db6d80
000000
@@ -729,7 +684,7 @@ STARTCHAR C030
ENCODING 24
SWIDTH 1440 0
DWIDTH 18 0
-BBX 18 18 0 -6
+BBX 18 21 0 -6
BITMAP
db6d80
db6d80
@@ -749,6 +704,9 @@ db6d80
030000
030000
000000
+030000
+030000
+000000
ENDCHAR
STARTCHAR C031
ENCODING 25
@@ -800,28 +758,25 @@ STARTCHAR C032
ENCODING 26
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 24 0 0
+BBX 15 21 0 3
BITMAP
-000c00
-000c00
+006c00
+006c00
000000
-006000
-006000
+1b0000
+1b0000
000000
-030000
-030000
+c00000
+c00000
000000
-180000
-180000
+1b0000
+1b0000
+000000
+006c00
+006c00
000000
-030000
-030000
000000
-006000
-006000
000000
-000c00
-000c00
000000
db6c00
db6c00
@@ -831,28 +786,25 @@ STARTCHAR C033
ENCODING 27
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 24 0 0
+BBX 15 21 0 3
BITMAP
-c00000
-c00000
+d80000
+d80000
000000
-180000
-180000
+036000
+036000
000000
-030000
-030000
+000c00
+000c00
000000
-006000
-006000
+036000
+036000
+000000
+d80000
+d80000
000000
-030000
-030000
000000
-180000
-180000
000000
-c00000
-c00000
000000
db6c00
db6c00
@@ -879,8 +831,8 @@ db6c00
186000
186000
000000
-c06000
-c06000
+186000
+186000
000000
ENDCHAR
STARTCHAR C035
@@ -943,10 +895,10 @@ STARTCHAR C037
ENCODING 31
SWIDTH 1440 0
DWIDTH 18 0
-BBX 3 3 6 6
+BBX 6 3 6 12
BITMAP
-c00000
-c00000
+d80000
+d80000
000000
ENDCHAR
STARTCHAR space
@@ -1106,7 +1058,7 @@ STARTCHAR ampersand
ENCODING 38
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 24 0 3
+BBX 15 24 0 0
BITMAP
180000
180000
@@ -1137,13 +1089,13 @@ STARTCHAR apostrophe
ENCODING 39
SWIDTH 1440 0
DWIDTH 18 0
-BBX 9 9 3 18
+BBX 3 9 6 18
BITMAP
-1b0000
-1b0000
+c00000
+c00000
000000
-180000
-180000
+c00000
+c00000
000000
c00000
c00000
@@ -1153,7 +1105,7 @@ STARTCHAR parenleft
ENCODING 40
SWIDTH 1440 0
DWIDTH 18 0
-BBX 9 27 3 0
+BBX 9 33 3 -3
BITMAP
030000
030000
@@ -1173,6 +1125,12 @@ c00000
c00000
c00000
000000
+c00000
+c00000
+000000
+c00000
+c00000
+000000
180000
180000
000000
@@ -1187,7 +1145,7 @@ STARTCHAR parenright
ENCODING 41
SWIDTH 1440 0
DWIDTH 18 0
-BBX 9 27 3 0
+BBX 9 33 3 -3
BITMAP
c00000
c00000
@@ -1207,6 +1165,12 @@ c00000
030000
030000
000000
+030000
+030000
+000000
+030000
+030000
+000000
180000
180000
000000
@@ -2678,11 +2642,11 @@ c30c00
c30c00
c30c00
000000
-d86c00
-d86c00
+c30c00
+c30c00
000000
-c00c00
-c00c00
+186000
+186000
000000
ENDCHAR
STARTCHAR X
@@ -2791,7 +2755,7 @@ STARTCHAR bracketleft
ENCODING 91
SWIDTH 1440 0
DWIDTH 18 0
-BBX 9 27 3 0
+BBX 9 33 3 -3
BITMAP
db0000
db0000
@@ -2817,6 +2781,12 @@ c00000
c00000
c00000
000000
+c00000
+c00000
+000000
+c00000
+c00000
+000000
db0000
db0000
000000
@@ -2859,7 +2829,7 @@ STARTCHAR bracketright
ENCODING 93
SWIDTH 1440 0
DWIDTH 18 0
-BBX 9 27 3 0
+BBX 9 33 3 -3
BITMAP
db0000
db0000
@@ -2885,6 +2855,12 @@ db0000
030000
030000
000000
+030000
+030000
+000000
+030000
+030000
+000000
db0000
db0000
000000
@@ -2919,17 +2895,14 @@ STARTCHAR grave
ENCODING 96
SWIDTH 1440 0
DWIDTH 18 0
-BBX 9 9 6 18
+BBX 6 6 6 24
BITMAP
-d80000
-d80000
+c00000
+c00000
000000
180000
180000
000000
-030000
-030000
-000000
ENDCHAR
STARTCHAR a
ENCODING 97
@@ -2949,11 +2922,11 @@ BITMAP
c00c00
c00c00
000000
-c00c00
-c00c00
+c06c00
+c06c00
000000
-1b6c00
-1b6c00
+1b0c00
+1b0c00
000000
ENDCHAR
STARTCHAR b
@@ -3687,7 +3660,7 @@ STARTCHAR braceleft
ENCODING 123
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 27 0 0
+BBX 15 33 0 -3
BITMAP
006c00
006c00
@@ -3701,6 +3674,9 @@ BITMAP
030000
030000
000000
+030000
+030000
+000000
d80000
d80000
000000
@@ -3713,6 +3689,9 @@ d80000
030000
030000
000000
+030000
+030000
+000000
006c00
006c00
000000
@@ -3755,7 +3734,7 @@ STARTCHAR braceright
ENCODING 125
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 27 0 0
+BBX 15 33 0 -3
BITMAP
d80000
d80000
@@ -3769,6 +3748,9 @@ d80000
030000
030000
000000
+030000
+030000
+000000
006c00
006c00
000000
@@ -3781,6 +3763,9 @@ d80000
030000
030000
000000
+030000
+030000
+000000
d80000
d80000
000000
@@ -3801,13 +3786,6 @@ c06000
c06000
000000
ENDCHAR
-STARTCHAR C177
-ENCODING 127
-SWIDTH 1440 0
-DWIDTH 18 0
-BBX 0 0 0 0
-BITMAP
-ENDCHAR
STARTCHAR nobreakspace
ENCODING 160
SWIDTH 1440 0
@@ -4048,10 +4026,13 @@ STARTCHAR diaeresis
ENCODING 168
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 3 0 24
+BBX 9 6 3 24
BITMAP
-d86c00
-d86c00
+c30000
+c30000
+000000
+c30000
+c30000
000000
ENDCHAR
STARTCHAR copyright
@@ -4161,10 +4142,10 @@ STARTCHAR hyphen
ENCODING 173
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 3 0 12
+BBX 9 3 3 12
BITMAP
-db6c00
-db6c00
+db0000
+db0000
000000
ENDCHAR
STARTCHAR registered
@@ -4319,7 +4300,7 @@ STARTCHAR mu
ENCODING 181
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 21 0 -3
+BBX 15 24 0 -6
BITMAP
c00c00
c00c00
@@ -4342,6 +4323,9 @@ db0c00
c00000
c00000
000000
+c00000
+c00000
+000000
ENDCHAR
STARTCHAR paragraph
ENCODING 182
@@ -4426,25 +4410,28 @@ STARTCHAR masculine
ENCODING 186
SWIDTH 1440 0
DWIDTH 18 0
-BBX 12 18 3 9
+BBX 15 21 0 6
BITMAP
-1b0000
-1b0000
+1b6000
+1b6000
000000
-c06000
-c06000
+c00c00
+c00c00
000000
-c06000
-c06000
+c00c00
+c00c00
000000
-1b0000
-1b0000
+c00c00
+c00c00
000000
+1b6000
+1b6000
000000
000000
000000
-db6000
-db6000
+000000
+db6c00
+db6c00
000000
ENDCHAR
STARTCHAR guillemotright
@@ -4623,12 +4610,12 @@ SWIDTH 1440 0
DWIDTH 18 0
BBX 15 30 0 0
BITMAP
+180000
+180000
+000000
030000
030000
000000
-006000
-006000
-000000
000000
000000
000000
@@ -4919,12 +4906,12 @@ SWIDTH 1440 0
DWIDTH 18 0
BBX 15 30 0 0
BITMAP
+180000
+180000
+000000
030000
030000
000000
-006000
-006000
-000000
000000
000000
000000
@@ -4993,11 +4980,11 @@ SWIDTH 1440 0
DWIDTH 18 0
BBX 15 30 0 0
BITMAP
-1b0000
-1b0000
+036000
+036000
000000
-c06000
-c06000
+180c00
+180c00
000000
000000
000000
@@ -5065,148 +5052,148 @@ STARTCHAR Igrave
ENCODING 204
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 9 30 3 0
BITMAP
-030000
-030000
+c00000
+c00000
000000
-006000
-006000
+180000
+180000
000000
000000
000000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
ENDCHAR
STARTCHAR Iacute
ENCODING 205
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 9 30 3 0
BITMAP
-006000
-006000
-000000
030000
030000
000000
+180000
+180000
000000
000000
000000
-db6c00
-db6c00
000000
-030000
-030000
+db0000
+db0000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-db6c00
-db6c00
+180000
+180000
+000000
+db0000
+db0000
000000
ENDCHAR
STARTCHAR Icircumflex
ENCODING 206
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 12 30 3 0
BITMAP
-036000
-036000
+1b0000
+1b0000
000000
-180c00
-180c00
+c06000
+c06000
000000
000000
000000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
ENDCHAR
STARTCHAR Idiaeresis
ENCODING 207
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 9 30 3 0
BITMAP
-186000
-186000
+c30000
+c30000
000000
-186000
-186000
+c30000
+c30000
000000
000000
000000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
ENDCHAR
STARTCHAR ETH
@@ -5286,12 +5273,12 @@ SWIDTH 1440 0
DWIDTH 18 0
BBX 15 30 0 0
BITMAP
+180000
+180000
+000000
030000
030000
000000
-006000
-006000
-000000
000000
000000
000000
@@ -5533,12 +5520,12 @@ SWIDTH 1440 0
DWIDTH 18 0
BBX 15 30 0 0
BITMAP
+180000
+180000
+000000
030000
030000
000000
-006000
-006000
-000000
000000
000000
000000
@@ -5750,19 +5737,25 @@ STARTCHAR ssharp
ENCODING 223
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 27 0 -3
+BBX 15 27 0 0
BITMAP
-1b6000
-1b6000
+1b0000
+1b0000
000000
-c00c00
-c00c00
+c06000
+c06000
000000
-c00c00
-c00c00
+c06000
+c06000
000000
-db6000
-db6000
+c30000
+c30000
+000000
+c30000
+c30000
+000000
+c06000
+c06000
000000
c00c00
c00c00
@@ -5770,31 +5763,22 @@ c00c00
c00c00
c00c00
000000
-d80c00
-d80c00
-000000
c36000
c36000
000000
-c00000
-c00000
-000000
ENDCHAR
STARTCHAR agrave
ENCODING 224
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
+180000
+180000
+000000
030000
030000
000000
-006000
-006000
-000000
-000000
-000000
-000000
000000
000000
000000
@@ -5821,7 +5805,7 @@ STARTCHAR aacute
ENCODING 225
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
006000
006000
@@ -5832,9 +5816,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -5858,7 +5839,7 @@ STARTCHAR acircumflex
ENCODING 226
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
036000
036000
@@ -5869,9 +5850,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -5895,7 +5873,7 @@ STARTCHAR atilde
ENCODING 227
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
030c00
030c00
@@ -5906,9 +5884,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -5932,7 +5907,7 @@ STARTCHAR adiaeresis
ENCODING 228
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
186000
186000
@@ -5943,9 +5918,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -6062,17 +6034,14 @@ STARTCHAR egrave
ENCODING 232
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
+180000
+180000
+000000
030000
030000
000000
-006000
-006000
-000000
-000000
-000000
-000000
000000
000000
000000
@@ -6099,7 +6068,7 @@ STARTCHAR eacute
ENCODING 233
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
006000
006000
@@ -6110,9 +6079,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -6136,7 +6102,7 @@ STARTCHAR ecircumflex
ENCODING 234
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
036000
036000
@@ -6147,9 +6113,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -6173,7 +6136,7 @@ STARTCHAR ediaeresis
ENCODING 235
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
186000
186000
@@ -6184,9 +6147,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -6210,148 +6170,136 @@ STARTCHAR igrave
ENCODING 236
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 9 27 3 0
BITMAP
-030000
-030000
-000000
-006000
-006000
-000000
-000000
+c00000
+c00000
000000
+180000
+180000
000000
000000
000000
000000
-1b0000
-1b0000
+d80000
+d80000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
ENDCHAR
STARTCHAR iacute
ENCODING 237
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 9 27 3 0
BITMAP
-006000
-006000
-000000
030000
030000
000000
+180000
+180000
000000
000000
000000
000000
+d80000
+d80000
000000
+180000
+180000
000000
-1b0000
-1b0000
-000000
-030000
-030000
-000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
ENDCHAR
STARTCHAR icircumflex
ENCODING 238
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 12 27 3 0
BITMAP
-036000
-036000
-000000
-180c00
-180c00
-000000
-000000
+1b0000
+1b0000
000000
+c06000
+c06000
000000
000000
000000
000000
-1b0000
-1b0000
+d80000
+d80000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
ENDCHAR
STARTCHAR idiaeresis
ENCODING 239
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 9 27 3 0
BITMAP
-186000
-186000
-000000
-186000
-186000
-000000
-000000
+c30000
+c30000
000000
+c30000
+c30000
000000
000000
000000
000000
-1b0000
-1b0000
+d80000
+d80000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-030000
-030000
+180000
+180000
000000
-db6c00
-db6c00
+db0000
+db0000
000000
ENDCHAR
STARTCHAR eth
@@ -6395,7 +6343,7 @@ STARTCHAR ntilde
ENCODING 241
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
030c00
030c00
@@ -6406,9 +6354,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
c36000
c36000
000000
@@ -6432,17 +6377,14 @@ STARTCHAR ograve
ENCODING 242
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
+180000
+180000
+000000
030000
030000
000000
-006000
-006000
-000000
-000000
-000000
-000000
000000
000000
000000
@@ -6469,7 +6411,7 @@ STARTCHAR oacute
ENCODING 243
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
006000
006000
@@ -6480,9 +6422,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -6506,7 +6445,7 @@ STARTCHAR ocircumflex
ENCODING 244
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
036000
036000
@@ -6517,9 +6456,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -6543,7 +6479,7 @@ STARTCHAR otilde
ENCODING 245
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
030c00
030c00
@@ -6554,9 +6490,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -6580,7 +6513,7 @@ STARTCHAR odiaeresis
ENCODING 246
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
186000
186000
@@ -6591,9 +6524,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
1b6000
1b6000
000000
@@ -6676,17 +6606,14 @@ STARTCHAR ugrave
ENCODING 249
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
+180000
+180000
+000000
030000
030000
000000
-006000
-006000
-000000
-000000
-000000
-000000
000000
000000
000000
@@ -6702,18 +6629,18 @@ c00c00
c00c00
c00c00
000000
-c00c00
-c00c00
+c06c00
+c06c00
000000
-1b6c00
-1b6c00
+1b0c00
+1b0c00
000000
ENDCHAR
STARTCHAR uacute
ENCODING 250
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
006000
006000
@@ -6724,9 +6651,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
c00c00
c00c00
000000
@@ -6739,18 +6663,18 @@ c00c00
c00c00
c00c00
000000
-c00c00
-c00c00
+c06c00
+c06c00
000000
-1b6c00
-1b6c00
+1b0c00
+1b0c00
000000
ENDCHAR
STARTCHAR ucircumflex
ENCODING 251
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
036000
036000
@@ -6761,9 +6685,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
c00c00
c00c00
000000
@@ -6776,18 +6697,18 @@ c00c00
c00c00
c00c00
000000
-c00c00
-c00c00
+c06c00
+c06c00
000000
-1b6c00
-1b6c00
+1b0c00
+1b0c00
000000
ENDCHAR
STARTCHAR udiaeresis
ENCODING 252
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 30 0 0
+BBX 15 27 0 0
BITMAP
186000
186000
@@ -6798,9 +6719,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
c00c00
c00c00
000000
@@ -6813,18 +6731,18 @@ c00c00
c00c00
c00c00
000000
-c00c00
-c00c00
+c06c00
+c06c00
000000
-1b6c00
-1b6c00
+1b0c00
+1b0c00
000000
ENDCHAR
STARTCHAR yacute
ENCODING 253
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 36 0 -6
+BBX 15 33 0 -6
BITMAP
006000
006000
@@ -6835,9 +6753,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
c00c00
c00c00
000000
@@ -6904,7 +6819,7 @@ STARTCHAR ydiaeresis
ENCODING 255
SWIDTH 1440 0
DWIDTH 18 0
-BBX 15 36 0 -6
+BBX 15 33 0 -6
BITMAP
186000
186000
@@ -6915,9 +6830,6 @@ BITMAP
000000
000000
000000
-000000
-000000
-000000
c00c00
c00c00
000000
diff --git a/font/led-latin2.bdf b/font/led-iso8859-2.bdf
index 70a2449..70a2449 100644
--- a/font/led-latin2.bdf
+++ b/font/led-iso8859-2.bdf
diff --git a/font/led-koi8.bdf b/font/led-koi8-r.bdf
index 32f859c..32f859c 100644
--- a/font/led-koi8.bdf
+++ b/font/led-koi8-r.bdf
diff --git a/http/Makefile.in b/http/Makefile.in
index c64403b..c3c891a 100644
--- a/http/Makefile.in
+++ b/http/Makefile.in
@@ -1,24 +1,13 @@
srcdir=@srcdir@
VPATH=$(srcdir)
-ROOT=
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=$(ROOT)@bindir@
-mandir=$(ROOT)@mandir@
-
-CC=@CC@
-DEPEND=@DEPEND@
-INSTALL=@INSTALL@
-INSTALL_PROGRAM=@INSTALL_PROGRAM@
-INSTALL_DATA=@INSTALL_DATA@
-INSTALL_DIR=mkdir -p
-
-CFLAGS=-Wall -g -O2 -I. -I$(srcdir)/../libvbi -L../libvbi
+include ../Make.config
+
+CFLAGS=-g @CFLAGS@ $(WARN_FLAGS) $(LIB_FLAGS) -I.
LDLIBS=-lvbi
PROG=alevtd
-OBJS=main.o request.o response.o page.o
+OBJS=main.o request.o response.o page.o devices.o
HTML=alevt.css.h top.html.h bottom.html.h about.html.h
.SUFFIXES: .in .h
@@ -30,10 +19,10 @@ all build: $(PROG)
$(PROG): $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
-main.o: httpd.h
-request.o: httpd.h
-response.o: httpd.h
-page.o: httpd.h $(HTML)
+#main.o: httpd.h
+#request.o: httpd.h
+#response.o: httpd.h
+#page.o: httpd.h $(HTML)
install: all
$(INSTALL_DIR) $(bindir) $(mandir)/man1
@@ -46,7 +35,7 @@ clean:
realclean distclean: clean
rm -f $(PROG) Makefile *~ *.bak
-dep depend:
+dep depend: $(HTML)
$(DEPEND) -- $(CFLAGS) -- *.c
#-------------------------------------------------------------------------
diff --git a/http/alevtd.man b/http/alevtd.man
index b98b380..671335f 100644
--- a/http/alevtd.man
+++ b/http/alevtd.man
@@ -8,6 +8,12 @@ alevtd - webserver for videotext pages
is http daemon which serves videotext pages as HTML. Tune in some
station with a utility like v4lctl or some TV application. Then
start it and point your browser to http://localhost:5654/
+.P
+Pages may be requested either in HTML format
+(http://localhost:5654/<page>/ or
+http://localhost:5654/<page>/<subpage>.html) or in ASCII text format
+(http://localhost:5654/<page>/<subpage>.txt). Subpage "00" can be
+used for pages without subpages.
.SH OPTIONS
.TP
.B -h
@@ -43,7 +49,7 @@ bind to \fBI\fPP-address >ip<.
.TP
.B -l log
\fBl\fPog all requests to the logfile >log< (common log format).
-Using "-" as filename makes webfsd print the access log to stdout,
+Using "-" as filename makes alevtd print the access log to stdout,
which is only useful together with the -F switch (see below).
.TP
.B -L log
@@ -59,8 +65,12 @@ set \fBg\fPid to >group< (after binding to the tcp port). This
option is allowed for root only.
.TP
.B -F
-don't run as daemon. webfsd will not fork into background, not detach
+don't run as daemon. alevtd will not fork into background, not detach
from terminal and report errors to stderr.
+.TP
+.B -r
+poll tv frequency, clear vtx page cache if a frequency change was
+detected.
.SH SEE ALSO
alevt(1), xawtv(1), v4lctl(1)
.SH AUTHOR
diff --git a/http/bottom.html.in b/http/bottom.html.in
index a48f286..aed8480 100644
--- a/http/bottom.html.in
+++ b/http/bottom.html.in
@@ -1,5 +1,3 @@
-</pre>
-<div class=quick>
<a href="/100/">100</a> &nbsp;
<a href="/200/">200</a> &nbsp;
<a href="/300/">300</a> &nbsp;
diff --git a/http/devices.c b/http/devices.c
new file mode 100644
index 0000000..f3d7713
--- /dev/null
+++ b/http/devices.c
@@ -0,0 +1,93 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "devices.h"
+/*
+ * default devices names
+ */
+#if defined(__OpenBSD__) || defined(__FreeBSD__)
+struct ng_device_config ng_dev = {
+ video: "/dev/bktr0",
+ radio: NULL,
+ vbi: "/dev/vbi0",
+ dsp: "/dev/dsp",
+ mixer: "/dev/mixer",
+ video_scan: {
+ "/dev/bktr0",
+ "/dev/bktr1",
+ NULL
+ },
+ mixer_scan: {
+ "/dev/mixer",
+ "/dev/mixer1",
+ "/dev/mixer2",
+ "/dev/mixer3",
+ NULL
+ }
+};
+#endif
+#if defined(__linux__)
+struct ng_device_config ng_dev = {
+ video: "/dev/video0", /* <rant>thank you redhat breaking
+ * /dev/video as symbolic link to the
+ * default video device ... </rant> */
+ radio: "/dev/radio",
+ vbi: "/dev/vbi",
+ dsp: "/dev/dsp",
+ mixer: "/dev/mixer",
+ video_scan: {
+ "/dev/video0",
+ "/dev/video1",
+ "/dev/video2",
+ "/dev/video3",
+ NULL
+ },
+ mixer_scan: {
+ "/dev/mixer",
+ "/dev/mixer1",
+ "/dev/mixer2",
+ "/dev/mixer3",
+ NULL
+ }
+};
+
+struct ng_device_config ng_dev_devfs = {
+ video: "/dev/v4l/video0",
+ radio: "/dev/v4l/radio0",
+ vbi: "/dev/v4l/vbi0",
+ dsp: "/dev/sound/dsp",
+ mixer: "/dev/sound/mixer",
+ video_scan: {
+ "/dev/v4l/video0",
+ "/dev/v4l/video1",
+ "/dev/v4l/video2",
+ "/dev/v4l/video3",
+ NULL
+ },
+ mixer_scan: {
+ "/dev/sound/mixer",
+ "/dev/sound/mixer1",
+ "/dev/sound/mixer2",
+ "/dev/sound/mixer3",
+ NULL
+ }
+};
+#endif
+
+void
+ng_device_init(void)
+{
+#if defined(__linux__)
+ struct stat st;
+
+ if (-1 == lstat("/dev/.devfsd",&st))
+ return;
+ if (!S_ISCHR(st.st_mode))
+ return;
+ ng_dev = ng_dev_devfs;
+#endif
+}
diff --git a/http/devices.h b/http/devices.h
new file mode 100644
index 0000000..c4a2959
--- /dev/null
+++ b/http/devices.h
@@ -0,0 +1,14 @@
+
+struct ng_device_config {
+ char *video;
+ char *radio;
+ char *vbi;
+ char *dsp;
+ char *mixer;
+ char *video_scan[32];
+ char *mixer_scan[32];
+};
+extern struct ng_device_config ng_dev;
+
+void ng_device_init(void);
+
diff --git a/http/main.c b/http/main.c
index 4427d3a..250c5f6 100644
--- a/http/main.c
+++ b/http/main.c
@@ -9,6 +9,7 @@
#include <pwd.h>
#include <grp.h>
#include <time.h>
+#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -19,8 +20,12 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#ifdef __linux__
+# include <linux/videodev.h>
+#endif
#include "httpd.h"
+#include "devices.h"
/* libvbi */
#include "vt.h"
@@ -46,13 +51,13 @@ char *listen_port = "5654";
char server_host[256];
char user[17];
char group[17];
-char *vbidev = "/dev/vbi";
char *logfile = NULL;
FILE *log = NULL;
int flushlog = 0;
int usesyslog = 0;
int have_tty = 1;
int max_conn = 32;
+int cachereset = 0;
time_t now,start;
int slisten;
@@ -79,7 +84,7 @@ dummy_client(struct dl_head *reqs, struct vt_event *ev)
/* ---------------------------------------------------------------------- */
-static int termsig,got_sighup;
+static int termsig,got_sighup,got_sigusr1;
static void catchsig(int sig)
{
@@ -87,6 +92,8 @@ static void catchsig(int sig)
termsig = sig;
if (SIGHUP == sig)
got_sighup = 1;
+ if (SIGUSR1 == sig)
+ got_sigusr1 = 1;
}
/* ---------------------------------------------------------------------- */
@@ -118,9 +125,11 @@ usage(char *name)
" -n host server hostname is >host< [%s]\n"
" -i ip bind to IP-address >ip< [%s]\n"
" -l log write access log to file >log< [%s]\n"
- " -L log same as above + flush every line\n",
+ " -L log same as above + flush every line\n"
+ " -r poll tv frequency and clear cache\n"
+ " on station changes [%s]\n",
h ? h+1 : name,
- vbidev,
+ ng_dev.vbi,
debug ? "on" : "off",
dontdetach ? "on" : "off",
usesyslog ? "on" : "off",
@@ -128,7 +137,8 @@ usage(char *name)
listen_port,
server_host,
listen_ip ? listen_ip : "any",
- logfile ? logfile : "none");
+ logfile ? logfile : "none",
+ cachereset ? "on" : "off");
if (getuid() == 0) {
pw = getpwuid(0);
gr = getgrgid(getgid());
@@ -142,7 +152,7 @@ usage(char *name)
}
static void
-fix_ug()
+fix_ug(void)
{
struct passwd *pw = NULL;
struct group *gr = NULL;
@@ -231,13 +241,13 @@ access_log(struct REQUEST *req, time_t now)
*/
static void
-syslog_init()
+syslog_init(void)
{
openlog("alevtd",LOG_PID, LOG_DAEMON);
}
static void
-syslog_start()
+syslog_start(void)
{
syslog(LOG_NOTICE,
"started (listen on %s:%d, user=%s, group=%s)\n",
@@ -245,7 +255,7 @@ syslog_start()
}
static void
-syslog_stop()
+syslog_stop(void)
{
if (termsig)
syslog(LOG_NOTICE,"stopped on signal %d\n",termsig);
@@ -297,7 +307,7 @@ xerror(int loglevel, char *txt, char *peerhost)
/* ---------------------------------------------------------------------- */
/* main loop */
-void*
+static void*
mainloop(void)
{
struct REQUEST *conns = NULL;
@@ -305,7 +315,7 @@ mainloop(void)
struct REQUEST *req,*prev,*tmp;
struct timeval tv;
- int max,length;
+ int max,length,freq,lastfreq = 0;
fd_set rd,wr;
for (;!termsig;) {
@@ -319,6 +329,13 @@ mainloop(void)
}
got_sighup = 0;
}
+ if (got_sigusr1) {
+ if (debug)
+ fprintf(stderr,"got SIGUSR1, reset cached vbi pages\n");
+ vbi->cache->op->reset(vbi->cache);
+ got_sigusr1 = 0;
+ }
+
FD_ZERO(&rd);
FD_ZERO(&wr);
FD_SET(vbi->fd,&rd);
@@ -356,8 +373,20 @@ mainloop(void)
now = time(NULL);
/* vbi data? */
- if (FD_ISSET(vbi->fd,&rd))
+ if (FD_ISSET(vbi->fd,&rd)) {
+#ifdef __linux__
+ if (cachereset) {
+ ioctl(vbi->fd, VIDIOCGFREQ, &freq);
+ if (lastfreq != freq) {
+ lastfreq = freq;
+ vbi->cache->op->reset( vbi->cache) ;
+ if (debug)
+ fprintf(stderr, "frequency change: cache cleared.\n");
+ }
+ }
+#endif
vbi_handler(vbi,vbi->fd);
+ }
/* new connection ? */
if (FD_ISSET(slisten,&rd)) {
@@ -519,6 +548,7 @@ main(int argc, char *argv[])
char host[INET6_ADDRSTRLEN+1];
char serv[16];
+ ng_device_init();
gethostname(server_host,255);
memset(&ask,0,sizeof(ask));
ask.ai_flags = AI_CANONNAME;
@@ -529,7 +559,7 @@ main(int argc, char *argv[])
/* parse options */
for (;;) {
- if (-1 == (c = getopt(argc,argv,"69hsdFp:n:i:t:c:u:g:l:L:v:")))
+ if (-1 == (c = getopt(argc,argv,"69hsdFrp:n:i:t:c:u:g:l:L:v:")))
break;
switch (c) {
case 'h':
@@ -550,6 +580,9 @@ main(int argc, char *argv[])
case 'F':
dontdetach++;
break;
+ case 'r':
+ cachereset++;
+ break;
case 'n':
strcpy(server_host,optarg);
break;
@@ -578,7 +611,7 @@ main(int argc, char *argv[])
logfile = optarg;
break;
case 'v':
- vbidev = optarg;
+ ng_dev.vbi = optarg;
break;
default:
exit(1);
@@ -589,7 +622,7 @@ main(int argc, char *argv[])
/* open vbi device */
fdset_init(fds);
- vbi = vbi_open(vbidev, cache_open(), 0, bttv);
+ vbi = vbi_open(ng_dev.vbi, cache_open(), 0, bttv);
if (vbi == 0) {
xperror(LOG_ERR,"cannot open vbi device",NULL);
exit(1);
@@ -710,6 +743,7 @@ main(int argc, char *argv[])
sigaction(SIGPIPE,&act,&old);
act.sa_handler = catchsig;
sigaction(SIGHUP,&act,&old);
+ sigaction(SIGUSR1,&act,&old);
sigaction(SIGTERM,&act,&old);
if (debug)
sigaction(SIGINT,&act,&old);
diff --git a/http/page.c b/http/page.c
index 33b6ee6..cb96dc6 100644
--- a/http/page.c
+++ b/http/page.c
@@ -42,7 +42,8 @@ static char page_bottom[] =
/* ---------------------------------------------------------------------- */
-static void vbipage(struct REQUEST *req, struct vt_page *page)
+static void vbipage(struct REQUEST *req, struct vt_page *page,
+ int pagenr, int subnr, int html)
{
char *out;
int size,len,x,y;
@@ -57,7 +58,8 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
out = malloc(size);
len = 0;
- len += sprintf(out+len,page_top,page->pgno,page->subno);
+ if (html)
+ len += sprintf(out+len,page_top,page->pgno,page->subno);
for (y = 0; y < H; y++) {
if (~pg->hid & (1 << y)) { /* !hidden */
for (x = 0; x < W; ++x) {
@@ -85,7 +87,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
for (x = 0; x < W; ++x)
if (L[x].ch == ' ') {
L[x].fg = L[x-1].fg;
- l[x].attr = L[x-1].attr;
+ L[x].attr = L[x-1].attr;
}
/* move fg and attr changes to prev bg change point */
@@ -99,7 +101,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
lcolor = -1; link = -1;
for (x = 0; x < W; ++x) {
/* close link tags */
- if (link >= 0) {
+ if (html && link >= 0) {
if (0 == link)
len += sprintf(out+len,"</a>");
link--;
@@ -107,7 +109,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
/* color handling */
color = (L[x].fg&0x0f) * 10 + (L[x].bg&0x0f);
- if (color != lcolor) {
+ if (html && color != lcolor) {
if (-1 != lcolor)
len += sprintf(out+len,"</span>");
len += sprintf(out+len,"<span class=\"c%02d\">",color);
@@ -115,7 +117,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
}
/* check for refences to other pages */
- if (y > 0 && -1 == link && x < W-2 &&
+ if (html && y > 0 && -1 == link && x < W-2 &&
isdigit(L[x].ch) &&
isdigit(L[x+1].ch) &&
isdigit(L[x+2].ch) &&
@@ -125,14 +127,14 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
L[x].ch, L[x+1].ch, L[x+2].ch);
link = 2;
}
- if (y > 0 && -1 == link && x < W-1 &&
+ if (html && y > 0 && -1 == link && x < W-1 &&
'>' == L[x].ch &&
'>' == L[x+1].ch) {
len += sprintf(out+len,"<a href=\"/%03x/\">",
page->pgno+1);
link = 1;
}
- if (y > 0 && -1 == link && x < W-1 &&
+ if (html && y > 0 && -1 == link && x < W-1 &&
'<' == L[x].ch &&
'<' == L[x+1].ch) {
len += sprintf(out+len,"<a href=\"/%03x/\">",
@@ -140,7 +142,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
link = 1;
}
/* check for refences to other subpages */
- if (y > 0 && -1 == link && x < W-2 &&
+ if (html && y > 0 && -1 == link && x < W-2 &&
page->subno > 0 &&
isdigit(L[x].ch) &&
'/' == L[x+1].ch &&
@@ -156,7 +158,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
link = 2;
}
/* check for FastText links */
- if (page->flof && -1 == link && x<W-2 &&
+ if (html && page->flof && -1 == link && x<W-2 &&
24 == y &&
L[x].fg>0 &&
L[x].fg<8 &&
@@ -188,9 +190,9 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
out[len++] = L[x].ch;
}
/* close any tags + put newline */
- if (link >= 0)
+ if (html && link >= 0)
len += sprintf(out+len,"</a>");
- if (-1 != lcolor)
+ if (html && -1 != lcolor)
len += sprintf(out+len,"</span>");
out[len++] = '\n';
@@ -201,9 +203,33 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
}
}
}
- len += sprintf(out+len,"%s",page_bottom);
+ if (html) {
+#define MAXSUBPAGES 32
+ int subpage;
+
+ /* close preformatted text header */
+ len+=sprintf(out+len,"</pre>\n<div class=quick>\n") ;
+ if (vbi->cache->op->get(vbi->cache,pagenr,1)) {
+ /* link all subpages */
+ len += sprintf(out+len,"Subpages:");
+ for (subpage = 1; subpage <= MAXSUBPAGES; subpage++) {
+ if (NULL == vbi->cache->op->get(vbi->cache,pagenr,subpage))
+ continue;
+ if (subpage != subnr) {
+ len += sprintf(out+len," <a href=\"/%03x/%02x.html\">%02x</a>",
+ pagenr, subpage, subpage);
+ } else {
+ len += sprintf(out+len," %02x", subpage);
+ }
+ }
+ len += sprintf(out+len,"<br>\n") ;
+ }
+ len += sprintf(out+len,"%s",page_bottom);
+ req->mime = "text/html; charset=\"iso-8859-1\"";
+ } else {
+ req->mime = "text/plain; charset=\"iso-8859-1\"";
+ }
- req->mime = "text/html; charset=\"iso-8859-1\"";
req->body = out;
req->lbody = len;
req->free_the_mallocs = 1;
@@ -215,6 +241,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page)
void buildpage(struct REQUEST *req)
{
int pagenr, subpage;
+ char type;
struct vt_page *page;
/* style sheet */
@@ -243,12 +270,12 @@ void buildpage(struct REQUEST *req)
}
/* page with subpages */
- if (2 == sscanf(req->path,"/%3x/%2x.html",&pagenr,&subpage)) {
+ if (3 == sscanf(req->path,"/%3x/%2x.%c",&pagenr,&subpage,&type)) {
if (debug)
fprintf(stderr,"trying %03x/%02x\n",pagenr,subpage);
page = vbi->cache->op->get(vbi->cache,pagenr,subpage);
if (NULL != page) {
- vbipage(req,page);
+ vbipage(req,page,pagenr,subpage,type=='h');
return;
}
mkerror(req,404,1);
@@ -261,7 +288,7 @@ void buildpage(struct REQUEST *req)
fprintf(stderr,"trying %03x\n",pagenr);
page = vbi->cache->op->get(vbi->cache,pagenr,0);
if (NULL != page) {
- vbipage(req,page);
+ vbipage(req,page,pagenr,0,1);
return;
}
page = vbi->cache->op->get(vbi->cache,pagenr,ANY_SUB);
diff --git a/http/response.c b/http/response.c
index 27be324..b544f47 100644
--- a/http/response.c
+++ b/http/response.c
@@ -5,6 +5,7 @@
#include <fcntl.h>
#include <errno.h>
#include <syslog.h>
+#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
diff --git a/libng/Makefile.in b/libng/Makefile.in
index 221d87f..383567c 100644
--- a/libng/Makefile.in
+++ b/libng/Makefile.in
@@ -1,14 +1,14 @@
srcdir=@srcdir@
VPATH=$(srcdir)
-CC=@CC@
-DEPEND=@DEPEND@
+include ../Make.config
-CFLAGS=-Wall -O2 -g @CFLAGS@ -I..
-OBJS=grab-ng.o @NG_GRAB@ \
+CFLAGS=-g @CFLAGS@ $(WARN_FLAGS) $(LFS_FLAGS) -I.. \
+ -DNG_PRIVATE -DLIBDIR='"$(libdir)"'
+OBJS=grab-ng.o devices.o @NG_GRAB@ \
color_common.o color_packed.o color_lut.o \
color_yuv2rgb.o \
- mjpeg.o \
+ clipping.o mjpeg.o \
writefile.o writeavi.o writeqt.o
all build: libng.a
diff --git a/libng/OVERVIEW b/libng/OVERVIEW
new file mode 100644
index 0000000..1da6931
--- /dev/null
+++ b/libng/OVERVIEW
@@ -0,0 +1,135 @@
+
+libng overview
+==============
+
+
+some general notes
+------------------
+
+The text below is not a complete reference (yet?), it just tries to
+give a overview and explain the design of the library. Have a look at
+grab-ng.h, this is the header file where everything is defined.
+
+If you are looking for some simple sample code check out
+webcam/webcam.c. More complex usages of libng can be found everythere
+in the xawtv source code: In src/capture.c for example, where most of
+the threaded movie recording code for xawtv+streamer is.
+
+There are two types of structs: Those which carrying some data (like
+ng_video_fmt or ng_video_buf) and those which define a interface (like
+ng_driver).
+
+The interfaces all have a initialization function which returns a void
+pointer as handle. All other interface functions expect getting that
+handle passed in. The complete state information is kept there.
+Global variables are a no-no, the interfaces need to be reentrant (so
+you can use multiple instances of them at the same time).
+
+
+video buffers (struct ng_video_buf)
+-----------------------------------
+
+One video buffer holds one frame. There are some rules for video
+frames:
+
+ (1) Multiple instances (threads for example) may hold a pointer to
+ the buffer. The refcount variable is used to keep track of the
+ number of references. If you hand out a pointer to the buffer to
+ someone else *and* keep a pointer to the buffer yourself to use
+ it later refcount must be increased by one. If you don't need
+ the buffer any more, just free it with ng_release_video_buf().
+ That function will take care about count down the reference
+ counter and freeing the buffer if refcount is zero.
+
+ (2) The above implies you should not write to ng_video_buf->data
+ because another thread might use the image data while you are
+ modifying it. Allocate a new buffer and put the new data in there
+ instead if you want process the image data. You can use
+ ng_malloc_video_buf() to get a buffer. Don't forget to copy the
+ frame meta data to the new buffer (ng_video_buf->info).
+
+Within the current implementation two types of buffers exist: Those
+malloc()ed ones which are returned by ng_malloc_video_buf() and
+buffers provided by the hardware drivers, where ng_video_buf->data is
+a pointer directly to the mmap()ed buffer(s).
+
+
+video capture / overlay drivers (struct ng_driver)
+--------------------------------------------------
+
+This is a interface to a capture driver. Right now three different
+ones exist:
+
+ (1) video4linux (current linux API, see grab-v4l.c).
+ (2) video4linux two (work in progress - new API for linux, see
+ grab-v4l2.c).
+ (3) bktr (bt848/878 driver for FreeBSD + OpenBSD, see grab-bsd.c).
+
+xawtv uses struct ng_driver for Xvideo support too (see src/xv.c).
+
+open()/close() should be clear. The capabilities() function returns a
+bitfield which specifies the capabilities of the driver. The *attr*
+functions can be used to control several (hardware) settings (see
+below for more on attributes).
+
+To for a overlay use setupfb() and overlay(). For linux setupfb()
+just verifies the driver parameters, it expects the setup is done with
+a extern utility like v4l-conf (because one needs root priviliges for
+that).
+
+To capture frames you have to configure the format with setformat()
+first. Be aware that the image size might have changed on return,
+depending on the capabilities of the underlying hardware. For video
+recording use startvideo(), multiple nextframe() calls and
+stopvideo(), for single frames use getimage().
+
+
+output drivers (struct ng_writer)
+---------------------------------
+
+This is a interface for movie writer code. Four different ones exist:
+
+ (1) Microsoft's AVI
+ (2) Apple Quicktime (using the quicktime4linux library).
+ (3) raw, uncompressed data (one big file).
+ (4) one image file/frame (jpeg or ppm).
+
+The first two write audio and video data into the same stream, the
+last two can write audio data to a separate wav file.
+
+The audio/video args hold a list of supported formats. Usage should
+be pretty straight forward: wr_open(), write data with wr_video() +
+wr_audio(), then wr_close(). You can write both audio-only and
+video-only streams if you want.
+
+
+attributes (struct ng_attribute)
+--------------------------------
+
+Attributes can be used to control properties attributes. Right now
+they are only used for video drivers (struct ng_driver), but that
+might change in the future. There are a number of standard attributes
+defined (tv norm, volume and the like), but it is also possible to
+specify non-standard attributes.
+
+struct ng_driver has functions to list/read/modify the available
+attributes. A number of helper functions to search a attribute list
+by id / name and for multiple choice attribute handling are available
+too.
+
+
+audio
+-----
+
+Right now there are only some structs for audio formats and audio data
+chunks. The movie writers use these. No recording code yet. xawtv's
+audio recording code is in src/oss.c, maybe I move that to libng some
+day. Need to create some sensible interface for it first.
+
+
+misc
+----
+
+There are some helper functions for various stuff, see grab-ng.[ch].
+There are also some arrays with text descriptions and other
+informations about audio/video formats: ng_[va]fmt_to_*.
diff --git a/libng/README b/libng/README
index 4da1e1b..f4a2084 100644
--- a/libng/README
+++ b/libng/README
@@ -1,13 +1,15 @@
-This code is *NOT* (yet) supported to be used as library.
+WARNING: This is work-in-progress.
In the long run I plan to turn this into a v4l capture library. But
-that isn't finished yet and probably will not for some time.
+that isn't finished yet and probably will not for some time. Some
+documentation can be found in OVERVIEW. Complete reference is not
+available.
-There is no documentation written for it. I don't care (yet) about
-backward compatibility. I neither can nor will stop you from using
-the code. But if you do don't complain if I break your applications
-with incompatible changes. You have been warned.
+I don't care (yet) about backward compatibility. I neither can nor
+will stop you from using the code. But if you do don't complain if I
+break your applications with incompatible changes. You have been
+warned.
Please don't distribute this code as shared library. This is just
asking for trouble.
diff --git a/libng/clipping.c b/libng/clipping.c
new file mode 100644
index 0000000..64b2e08
--- /dev/null
+++ b/libng/clipping.c
@@ -0,0 +1,134 @@
+/*
+ * generic window clipping checking / optimization code
+ *
+ * (c) 2001 Gerd Knorr <kraxel@bytesex.org>
+ *
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <pthread.h>
+
+#include "config.h"
+#include "grab-ng.h"
+
+/* --------------------------------------------------------------------- */
+
+static void dump(char *state, struct OVERLAY_CLIP *oc, int count)
+{
+ int i;
+
+ fprintf(stderr,"clip: %s - %d clips\n",state,count);
+ for (i = 0; i < count; i++)
+ fprintf(stderr,"clip: %d: %dx%d+%d+%d\n",i,
+ oc[i].x2 - oc[i].x1,
+ oc[i].y2 - oc[i].y1,
+ oc[i].x1, oc[i].y1);
+}
+
+static void drop(struct OVERLAY_CLIP *oc, int n, int *count)
+{
+ (*count)--;
+ memmove(oc+n, oc+n+1, sizeof(struct OVERLAY_CLIP) * (*count-n));
+}
+
+/* --------------------------------------------------------------------- */
+
+void ng_check_clipping(int width, int height, int xadjust, int yadjust,
+ struct OVERLAY_CLIP *oc, int *count)
+{
+ int i,j;
+
+ if (ng_debug > 1) {
+ fprintf(stderr,"clip: win=%dx%d xa=%d ya=%d\n",
+ width,height,xadjust,yadjust);
+ dump("init",oc,*count);
+ }
+ for (i = 0; i < *count; i++) {
+ /* fixup coordinates */
+ oc[i].x1 += xadjust;
+ oc[i].x2 += xadjust;
+ oc[i].y1 += yadjust;
+ oc[i].y2 += yadjust;
+ }
+ if (ng_debug > 1)
+ dump("fixup adjust",oc,*count);
+
+ for (i = 0; i < *count; i++) {
+ /* fixup borders */
+ if (oc[i].x1 < 0)
+ oc[i].x1 = 0;
+ if (oc[i].x2 < 0)
+ oc[i].x2 = 0;
+ if (oc[i].x1 > width)
+ oc[i].x1 = width;
+ if (oc[i].x2 > width)
+ oc[i].x2 = width;
+ if (oc[i].y1 < 0)
+ oc[i].y1 = 0;
+ if (oc[i].y2 < 0)
+ oc[i].y2 = 0;
+ if (oc[i].y1 > height)
+ oc[i].y1 = height;
+ if (oc[i].y2 > height)
+ oc[i].y2 = height;
+ }
+ if (ng_debug > 1)
+ dump("fixup range",oc,*count);
+
+ /* drop zero-sized clips */
+ for (i = 0; i < *count;) {
+ if (oc[i].x1 == oc[i].x2 || oc[i].y1 == oc[i].y2) {
+ drop(oc,i,count);
+ continue;
+ }
+ i++;
+ }
+ if (ng_debug > 1)
+ dump("zerosize done",oc,*count);
+
+ /* try to merge clips */
+ restart_merge:
+ for (j = *count - 1; j >= 0; j--) {
+ for (i = 0; i < *count; i++) {
+ if (i == j)
+ continue;
+ if (oc[i].x1 == oc[j].x1 &&
+ oc[i].x2 == oc[j].x2 &&
+ oc[i].y1 <= oc[j].y1 &&
+ oc[i].y2 >= oc[j].y1) {
+ if (ng_debug > 1)
+ fprintf(stderr,"clip: merge y %d,%d\n",i,j);
+ if (oc[i].y2 < oc[j].y2)
+ oc[i].y2 = oc[j].y2;
+ drop(oc,j,count);
+ if (ng_debug > 1)
+ dump("merge y done",oc,*count);
+ goto restart_merge;
+ }
+ if (oc[i].y1 == oc[j].y1 &&
+ oc[i].y2 == oc[j].y2 &&
+ oc[i].x1 <= oc[j].x1 &&
+ oc[i].x2 >= oc[j].x1) {
+ if (ng_debug > 1)
+ fprintf(stderr,"clip: merge x %d,%d\n",i,j);
+ if (oc[i].x2 < oc[j].x2)
+ oc[i].x2 = oc[j].x2;
+ drop(oc,j,count);
+ if (ng_debug > 1)
+ dump("merge x done",oc,*count);
+ goto restart_merge;
+ }
+ }
+ }
+ if (ng_debug)
+ dump("final",oc,*count);
+}
+
+/* --------------------------------------------------------------------- */
+/*
+ * Local variables:
+ * compile-command: "(cd ..; make)"
+ * End:
+ */
diff --git a/libng/color_lut.c b/libng/color_lut.c
index afb6839..58952ab 100644
--- a/libng/color_lut.c
+++ b/libng/color_lut.c
@@ -68,8 +68,8 @@ bgr32_to_lut2(unsigned char *dest, unsigned char *src, int p)
unsigned short *d = (unsigned short*)dest;
while (p-- > 0) {
- *(d++) = ng_lut_red[src[3]] | ng_lut_green[src[2]] |
- ng_lut_blue[src[1]];
+ *(d++) = ng_lut_red[src[2]] | ng_lut_green[src[1]] |
+ ng_lut_blue[src[0]];
src += 4;
}
}
@@ -129,8 +129,8 @@ bgr32_to_lut4(unsigned char *dest, unsigned char *src, int p)
unsigned int *d = (unsigned int*)dest;
while (p-- > 0) {
- *(d++) = ng_lut_red[src[3]] | ng_lut_green[src[2]] |
- ng_lut_blue[src[1]];
+ *(d++) = ng_lut_red[src[2]] | ng_lut_green[src[1]] |
+ ng_lut_blue[src[0]];
src += 4;
}
}
@@ -178,6 +178,11 @@ static struct ng_video_conv lut2_list[] = {
fini: ng_conv_nop_fini,
frame: ng_yuv422p_to_lut2,
fmtid_in: VIDEO_YUV422P,
+ },{
+ init: ng_conv_nop_init,
+ fini: ng_conv_nop_fini,
+ frame: ng_yuv420p_to_lut2,
+ fmtid_in: VIDEO_YUV420P,
}
};
@@ -206,13 +211,16 @@ static struct ng_video_conv lut4_list[] = {
NG_GENERIC_PACKED,
fmtid_in: VIDEO_YUV422,
priv: ng_yuv422_to_lut4,
-#if 0
},{
init: ng_conv_nop_init,
fini: ng_conv_nop_fini,
- frame: yuv422p_to_lut4,
+ frame: ng_yuv422p_to_lut4,
fmtid_in: VIDEO_YUV422P,
-#endif
+ },{
+ init: ng_conv_nop_init,
+ fini: ng_conv_nop_fini,
+ frame: ng_yuv420p_to_lut4,
+ fmtid_in: VIDEO_YUV420P,
}
};
diff --git a/libng/color_packed.c b/libng/color_packed.c
index 302ca7e..90178ad 100644
--- a/libng/color_packed.c
+++ b/libng/color_packed.c
@@ -154,7 +154,7 @@ rgb15_le_gray(unsigned char *dest, unsigned char *src, int p)
unsigned char g = (src[1] & 0x03) << 3 | (src[0] & 0xe0) >> 5;
unsigned char b = src[0] & 0x1f;
- *(dest++) = ((3*r + 6*g + b)/10) << 3;
+ *(d++) = ((3*r + 6*g + b)/10) << 3;
src += 2;
}
}
diff --git a/libng/color_yuv2rgb.c b/libng/color_yuv2rgb.c
index bd87dfe..abab3cb 100644
--- a/libng/color_yuv2rgb.c
+++ b/libng/color_yuv2rgb.c
@@ -20,7 +20,7 @@
/* ------------------------------------------------------------------- */
-#define CLIP 320
+#define CLIP 320
#if 0
# define RED_NULL 137
@@ -58,7 +58,20 @@ static unsigned int ng_clip[256 + 2 * CLIP];
#define BLUE(gray,blue) ng_clip[ CLIP + gray + ng_yuv_blue[blue] ]
/* ------------------------------------------------------------------- */
-/* packed pixel yuv to RGB */
+/* packed pixel yuv to gray / rgb */
+
+static void
+yuv422_to_gray(unsigned char *dest, unsigned char *s, int p)
+{
+ unsigned char *d = dest;
+
+ while (p) {
+ d[0] = GRAY(s[0]);
+ p--;
+ d++;
+ s+=2;
+ }
+}
static void
yuv422_to_rgb24(unsigned char *dest, unsigned char *s, int p)
@@ -126,9 +139,64 @@ ng_yuv422_to_lut4(unsigned char *dest, unsigned char *s, int p)
}
/* ------------------------------------------------------------------- */
-/* planar yuv to RGB */
+/* planar yuv to gray / rgb */
-void
+static void
+yuv42xp_to_gray(void *h, struct ng_video_buf *out, struct ng_video_buf *in)
+{
+ unsigned char *y;
+ unsigned char *dp,*d;
+ int i,j;
+
+ dp = out->data;
+ y = in->data;
+
+ for (i = 0; i < in->fmt.height; i++) {
+ d = dp;
+ for (j = 0; j < in->fmt.width; j++) {
+ *d = GRAY(*y);
+ d++,y++;
+ }
+ dp += out->fmt.bytesperline;
+ }
+}
+
+static void
+yuv420p_to_rgb24(void *h, struct ng_video_buf *out, struct ng_video_buf *in)
+{
+ unsigned char *y,*u,*v;
+ unsigned char *us,*vs;
+ unsigned char *dp,*d;
+ int i,j,gray;
+
+ dp = out->data;
+ y = in->data;
+ u = y + in->fmt.width * in->fmt.height;
+ v = u + in->fmt.width * in->fmt.height / 4;
+
+ for (i = 0; i < in->fmt.height; i++) {
+ d = dp;
+ us = u; vs = v;
+ for (j = 0; j < in->fmt.width; j+= 2) {
+ gray = GRAY(*y);
+ *(d++) = RED(gray,*v);
+ *(d++) = GREEN(gray,*v,*u);
+ *(d++) = BLUE(gray,*u);
+ y++;
+ gray = GRAY(*y);
+ *(d++) = RED(gray,*v);
+ *(d++) = GREEN(gray,*v,*u);
+ *(d++) = BLUE(gray,*u);
+ y++; u++; v++;
+ }
+ if (0 == (i % 2)) {
+ u = us; v = vs;
+ }
+ dp += out->fmt.bytesperline;
+ }
+}
+
+static void
yuv422p_to_rgb24(void *h, struct ng_video_buf *out, struct ng_video_buf *in)
{
unsigned char *y,*u,*v;
@@ -159,6 +227,44 @@ yuv422p_to_rgb24(void *h, struct ng_video_buf *out, struct ng_video_buf *in)
}
void
+ng_yuv420p_to_lut2(void *h, struct ng_video_buf *out, struct ng_video_buf *in)
+{
+ unsigned char *y,*u,*v;
+ unsigned char *us,*vs;
+ unsigned char *dp;
+ unsigned short *d;
+ int i,j,gray;
+
+ dp = out->data;
+ y = in->data;
+ u = y + in->fmt.width * in->fmt.height;
+ v = u + in->fmt.width * in->fmt.height / 4;
+
+ for (i = 0; i < in->fmt.height; i++) {
+ d = (unsigned short*) dp;
+ us = u; vs = v;
+ for (j = 0; j < in->fmt.width; j+= 2) {
+ gray = GRAY(*y);
+ *(d++) =
+ ng_lut_red[RED(gray,*v)] |
+ ng_lut_green[GREEN(gray,*v,*u)] |
+ ng_lut_blue[BLUE(gray,*u)];
+ y++;
+ gray = GRAY(*y);
+ *(d++) =
+ ng_lut_red[RED(gray,*v)] |
+ ng_lut_green[GREEN(gray,*v,*u)] |
+ ng_lut_blue[BLUE(gray,*u)];
+ y++; u++; v++;
+ }
+ if (0 == (i % 2)) {
+ u = us; v = vs;
+ }
+ dp += out->fmt.bytesperline;
+ }
+}
+
+void
ng_yuv422p_to_lut2(void *h, struct ng_video_buf *out, struct ng_video_buf *in)
{
unsigned char *y,*u,*v;
@@ -192,6 +298,44 @@ ng_yuv422p_to_lut2(void *h, struct ng_video_buf *out, struct ng_video_buf *in)
}
void
+ng_yuv420p_to_lut4(void *h, struct ng_video_buf *out, struct ng_video_buf *in)
+{
+ unsigned char *y,*u,*v;
+ unsigned char *us,*vs;
+ unsigned char *dp;
+ unsigned int *d;
+ int i,j,gray;
+
+ dp = out->data;
+ y = in->data;
+ u = y + in->fmt.width * in->fmt.height;
+ v = u + in->fmt.width * in->fmt.height / 4;
+
+ for (i = 0; i < in->fmt.height; i++) {
+ d = (unsigned int*) dp;
+ us = u; vs = v;
+ for (j = 0; j < in->fmt.width; j+= 2) {
+ gray = GRAY(*y);
+ *(d++) =
+ ng_lut_red[RED(gray,*v)] |
+ ng_lut_green[GREEN(gray,*v,*u)] |
+ ng_lut_blue[BLUE(gray,*u)];
+ y++;
+ gray = GRAY(*y);
+ *(d++) =
+ ng_lut_red[RED(gray,*v)] |
+ ng_lut_green[GREEN(gray,*v,*u)] |
+ ng_lut_blue[BLUE(gray,*u)];
+ y++; u++; v++;
+ }
+ if (0 == (i % 2)) {
+ u = us; v = vs;
+ }
+ dp += out->fmt.bytesperline;
+ }
+}
+
+void
ng_yuv422p_to_lut4(void *h, struct ng_video_buf *out, struct ng_video_buf *in)
{
unsigned char *y,*u,*v;
@@ -233,11 +377,34 @@ static struct ng_video_conv conv_list[] = {
fmtid_out: VIDEO_RGB24,
priv: yuv422_to_rgb24,
},{
+ NG_GENERIC_PACKED,
+ fmtid_in: VIDEO_YUV422,
+ fmtid_out: VIDEO_GRAY,
+ priv: yuv422_to_gray,
+ },{
init: ng_conv_nop_init,
fini: ng_conv_nop_fini,
frame: yuv422p_to_rgb24,
fmtid_in: VIDEO_YUV422P,
fmtid_out: VIDEO_RGB24,
+ },{
+ init: ng_conv_nop_init,
+ fini: ng_conv_nop_fini,
+ frame: yuv420p_to_rgb24,
+ fmtid_in: VIDEO_YUV420P,
+ fmtid_out: VIDEO_RGB24,
+ },{
+ init: ng_conv_nop_init,
+ fini: ng_conv_nop_fini,
+ frame: yuv42xp_to_gray,
+ fmtid_in: VIDEO_YUV422P,
+ fmtid_out: VIDEO_GRAY,
+ },{
+ init: ng_conv_nop_init,
+ fini: ng_conv_nop_fini,
+ frame: yuv42xp_to_gray,
+ fmtid_in: VIDEO_YUV420P,
+ fmtid_out: VIDEO_GRAY,
}
};
static const int nconv = sizeof(conv_list)/sizeof(struct ng_video_conv);
diff --git a/libng/devices.c b/libng/devices.c
new file mode 100644
index 0000000..f3d7713
--- /dev/null
+++ b/libng/devices.c
@@ -0,0 +1,93 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "devices.h"
+/*
+ * default devices names
+ */
+#if defined(__OpenBSD__) || defined(__FreeBSD__)
+struct ng_device_config ng_dev = {
+ video: "/dev/bktr0",
+ radio: NULL,
+ vbi: "/dev/vbi0",
+ dsp: "/dev/dsp",
+ mixer: "/dev/mixer",
+ video_scan: {
+ "/dev/bktr0",
+ "/dev/bktr1",
+ NULL
+ },
+ mixer_scan: {
+ "/dev/mixer",
+ "/dev/mixer1",
+ "/dev/mixer2",
+ "/dev/mixer3",
+ NULL
+ }
+};
+#endif
+#if defined(__linux__)
+struct ng_device_config ng_dev = {
+ video: "/dev/video0", /* <rant>thank you redhat breaking
+ * /dev/video as symbolic link to the
+ * default video device ... </rant> */
+ radio: "/dev/radio",
+ vbi: "/dev/vbi",
+ dsp: "/dev/dsp",
+ mixer: "/dev/mixer",
+ video_scan: {
+ "/dev/video0",
+ "/dev/video1",
+ "/dev/video2",
+ "/dev/video3",
+ NULL
+ },
+ mixer_scan: {
+ "/dev/mixer",
+ "/dev/mixer1",
+ "/dev/mixer2",
+ "/dev/mixer3",
+ NULL
+ }
+};
+
+struct ng_device_config ng_dev_devfs = {
+ video: "/dev/v4l/video0",
+ radio: "/dev/v4l/radio0",
+ vbi: "/dev/v4l/vbi0",
+ dsp: "/dev/sound/dsp",
+ mixer: "/dev/sound/mixer",
+ video_scan: {
+ "/dev/v4l/video0",
+ "/dev/v4l/video1",
+ "/dev/v4l/video2",
+ "/dev/v4l/video3",
+ NULL
+ },
+ mixer_scan: {
+ "/dev/sound/mixer",
+ "/dev/sound/mixer1",
+ "/dev/sound/mixer2",
+ "/dev/sound/mixer3",
+ NULL
+ }
+};
+#endif
+
+void
+ng_device_init(void)
+{
+#if defined(__linux__)
+ struct stat st;
+
+ if (-1 == lstat("/dev/.devfsd",&st))
+ return;
+ if (!S_ISCHR(st.st_mode))
+ return;
+ ng_dev = ng_dev_devfs;
+#endif
+}
diff --git a/libng/devices.h b/libng/devices.h
new file mode 100644
index 0000000..c4a2959
--- /dev/null
+++ b/libng/devices.h
@@ -0,0 +1,14 @@
+
+struct ng_device_config {
+ char *video;
+ char *radio;
+ char *vbi;
+ char *dsp;
+ char *mixer;
+ char *video_scan[32];
+ char *mixer_scan[32];
+};
+extern struct ng_device_config ng_dev;
+
+void ng_device_init(void);
+
diff --git a/libng/grab-bsd.c b/libng/grab-bsd.c
index 308b93e..2adff41 100644
--- a/libng/grab-bsd.c
+++ b/libng/grab-bsd.c
@@ -48,7 +48,8 @@ struct bsd_handle {
/* attributes */
int muted;
-
+ struct ng_attribute *attr;
+
/* overlay */
struct meteor_video fb,pos;
struct meteor_geomet ovgeo;
@@ -76,8 +77,8 @@ static int bsd_close(void *handle);
/* attributes */
static int bsd_flags(void *handle);
static struct ng_attribute* bsd_attrs(void *handle);
-static int bsd_read_attr(void *handle, struct ng_attribute*);
-static void bsd_write_attr(void *handle, struct ng_attribute*, int val);
+static int bsd_read_attr(struct ng_attribute*);
+static void bsd_write_attr(struct ng_attribute*, int val);
static int bsd_setupfb(void *handle, struct ng_video_fmt *fmt, void *base);
static int bsd_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
@@ -104,8 +105,6 @@ const struct ng_driver bsd_driver = {
capabilities: bsd_flags,
list_attrs: bsd_attrs,
- read_attr: bsd_read_attr,
- write_attr: bsd_write_attr,
setupfb: bsd_setupfb,
overlay: bsd_overlay,
@@ -163,27 +162,39 @@ static struct ng_attribute bsd_attr[] = {
name: "norm",
type: ATTR_TYPE_CHOICE,
choices: norms,
+ read: bsd_read_attr,
+ write: bsd_write_attr,
},{
id: ATTR_ID_INPUT,
name: "input",
type: ATTR_TYPE_CHOICE,
choices: inputs,
+ read: bsd_read_attr,
+ write: bsd_write_attr,
},{
id: ATTR_ID_MUTE,
name: "mute",
type: ATTR_TYPE_BOOL,
+ read: bsd_read_attr,
+ write: bsd_write_attr,
},{
id: ATTR_ID_HUE,
name: "hue",
type: ATTR_TYPE_INTEGER,
+ read: bsd_read_attr,
+ write: bsd_write_attr,
},{
id: ATTR_ID_BRIGHT,
name: "bright",
type: ATTR_TYPE_INTEGER,
+ read: bsd_read_attr,
+ write: bsd_write_attr,
},{
id: ATTR_ID_CONTRAST,
name: "contrast",
type: ATTR_TYPE_INTEGER,
+ read: bsd_read_attr,
+ write: bsd_write_attr,
},{
/* end of list */
}
@@ -197,7 +208,7 @@ static int signal_off = METEOR_SIG_MODE_MASK;
/* ---------------------------------------------------------------------- */
-#define PREFIX "ioctl: "
+#define PREFIX "bktr: ioctl: "
static int
xioctl(int fd, int cmd, void *arg)
@@ -220,7 +231,7 @@ xioctl(int fd, int cmd, void *arg)
{
struct meteor_geomet *a = arg;
- fprintf(stderr,PREFIX "METEORSETGEO(%dx%d,frames=%d,oformat=%ld)",
+ fprintf(stderr,PREFIX "METEORSETGEO(%dx%d,frames=%d,oformat=0x%lx)",
a->columns,a->rows,a->frames,a->oformat);
break;
}
@@ -269,9 +280,8 @@ bsd_print_format(struct meteor_pixfmt *pf, int format)
switch (pf->type) {
case METEOR_PIXTYPE_RGB:
fprintf(stderr,
- "bktr: pf: rgb bpp=%d mask=%ld,%ld,%ld sbytes=%d sshorts=%d",
- pf->Bpp,pf->masks[0],pf->masks[1],pf->masks[2],
- pf->swap_bytes,pf->swap_shorts);
+ "bktr: pf: rgb bpp=%d mask=%ld,%ld,%ld",
+ pf->Bpp,pf->masks[0],pf->masks[1],pf->masks[2]);
break;
case METEOR_PIXTYPE_YUV:
fprintf(stderr,"bktr: pf: yuv h422 v111 (planar)");
@@ -285,7 +295,8 @@ bsd_print_format(struct meteor_pixfmt *pf, int format)
default:
fprintf(stderr,"bktr: pf: unknown");
}
- fprintf(stderr," (fmt=%d)\n",format);
+ fprintf(stderr," sbytes=%d sshorts=%d (fmt=%d)\n",
+ pf->swap_bytes,pf->swap_shorts,format);
}
/* ---------------------------------------------------------------------- */
@@ -294,7 +305,7 @@ static void*
bsd_open(char *filename)
{
struct bsd_handle *h;
- int format;
+ int format,i;
h = malloc(sizeof(*h));
if (NULL == h)
@@ -302,7 +313,7 @@ bsd_open(char *filename)
memset(h,0,sizeof(*h));
if (-1 == (h->fd = open(filename,O_RDONLY))) {
- fprintf(stderr,"open %s: %s\n", filename,strerror(errno));
+ fprintf(stderr,"bktr: open %s: %s\n", filename,strerror(errno));
goto err;
}
@@ -313,7 +324,8 @@ bsd_open(char *filename)
for (h->pf_count = 0; h->pf_count < 64; h->pf_count++) {
h->pf[h->pf_count].index = h->pf_count;
if (-1 == ioctl(h->fd, METEORGSUPPIXFMT,h->pf+h->pf_count)) {
- perror("ioctl METEORGSUPPIXFMT");
+ if (ng_debug)
+ perror("bktr: ioctl METEORGSUPPIXFMT");
if (0 == h->pf_count)
goto err;
break;
@@ -348,17 +360,22 @@ bsd_open(char *filename)
case METEOR_PIXTYPE_YUV:
format = VIDEO_YUV422P;
break;
+#if 0
case METEOR_PIXTYPE_YUV_PACKED:
format = VIDEO_YUV422;
+ h->pf[h->pf_count].swap_shorts = 0; /* seems not to work */
break;
+#endif
case METEOR_PIXTYPE_YUV_12:
+ case METEOR_PIXTYPE_YUV_PACKED:
/* nothing */
break;
}
if (-1 != format)
h->xawtv2pf[format] = h->pf_count;
- bsd_print_format(h->pf+h->pf_count,format);
+ if (ng_debug)
+ bsd_print_format(h->pf+h->pf_count,format);
}
h->map = mmap(0,768*576*4, PROT_READ, MAP_SHARED, h->fd, 0);
@@ -368,10 +385,15 @@ bsd_open(char *filename)
}
if (-1 == (h->tfd = open("/dev/tuner0",O_RDONLY))) {
- fprintf(stderr,"open %s: %s\n", "/dev/tuner0",strerror(errno));
+ fprintf(stderr,"bktr: open %s: %s\n", "/dev/tuner0",strerror(errno));
}
siginit();
+ h->attr = malloc(sizeof(bsd_attr));
+ memcpy(h->attr,bsd_attr,sizeof(bsd_attr));
+ for (i = 0; h->attr[i].name != NULL; i++)
+ h->attr[i].handle = h;
+
return h;
err:
@@ -413,7 +435,9 @@ static int bsd_flags(void *handle)
static struct ng_attribute* bsd_attrs(void *handle)
{
- return bsd_attr;
+ struct bsd_handle *h = handle;
+
+ return h->attr;
}
/* ---------------------------------------------------------------------- */
@@ -446,9 +470,9 @@ bsd_get_range(int id, int *min, int *max, int *get, int *set)
return 0;
}
-static int bsd_read_attr(void *handle, struct ng_attribute *attr)
+static int bsd_read_attr(struct ng_attribute *attr)
{
- struct bsd_handle *h = handle;
+ struct bsd_handle *h = attr->handle;
int arg, min, max, get, set, i;
int value = -1;
@@ -485,9 +509,9 @@ static int bsd_read_attr(void *handle, struct ng_attribute *attr)
return value;
}
-static void bsd_write_attr(void *handle, struct ng_attribute *attr, int value)
+static void bsd_write_attr(struct ng_attribute *attr, int value)
{
- struct bsd_handle *h = handle;
+ struct bsd_handle *h = attr->handle;
int arg, min, max, get, set;
switch (attr->id) {
@@ -522,7 +546,7 @@ static unsigned long bsd_getfreq(void *handle)
unsigned long freq = 0;
if (-1 == ioctl(h->tfd, TVTUNER_GETFREQ, &freq))
- perror("ioctl TVTUNER_GETFREQ");
+ perror("bktr: ioctl TVTUNER_GETFREQ");
if (ng_debug)
fprintf(stderr,"bktr: get freq: %.3f\n",(float)freq/16);
return freq;
@@ -535,7 +559,7 @@ static void bsd_setfreq(void *handle, unsigned long freq)
if (ng_debug)
fprintf(stderr,"bktr: set freq: %.3f\n",(float)freq/16);
if (-1 == ioctl(h->tfd, TVTUNER_SETFREQ, &freq))
- perror("ioctl TVTUNER_SETFREQ");
+ perror("bktr: ioctl TVTUNER_SETFREQ");
}
static int bsd_tuned(void *handle)
@@ -581,7 +605,7 @@ static int bsd_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
struct OVERLAY_CLIP *oc, int count, int aspect)
{
struct bsd_handle *h = handle;
- int i,xadjust=0,yadjust=0,win_width,win_height,win_x,win_y;
+ int i,win_width,win_height,win_x,win_y;
h->ov_enabled = 0;
set_overlay(h,h->ov_enabled);
@@ -606,8 +630,9 @@ static int bsd_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
}
if (aspect)
ng_ratio_fixup(&win_width,&win_height,&win_x,&win_y);
- xadjust = win_x - x;
- yadjust = win_y - y;
+ ng_check_clipping(win_width, win_height,
+ x - win_x, y - win_y,
+ oc, &count);
/* fill data */
h->pos = h->fb;
@@ -627,21 +652,17 @@ static int bsd_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
for (i = 0; i < count; i++) {
#if 0
/* This way it *should* work IMHO ... */
- h->clip[i].x_min = oc[i].x1 - xadjust;
- h->clip[i].x_max = oc[i].x2 - xadjust;
- h->clip[i].y_min = oc[i].y1 - yadjust;
- h->clip[i].y_max = oc[i].y2 - yadjust;
+ h->clip[i].x_min = oc[i].x1;
+ h->clip[i].x_max = oc[i].x2;
+ h->clip[i].y_min = oc[i].y1;
+ h->clip[i].y_max = oc[i].y2;
#else
/* This way it does work. Sort of ... */
- h->clip[i].x_min = (oc[i].y1 - yadjust) >> 1;
- h->clip[i].x_max = (oc[i].y2 - yadjust) >> 1;
- h->clip[i].y_min = oc[i].x1 - xadjust;
- h->clip[i].y_max = oc[i].x2 - xadjust;
+ h->clip[i].x_min = (oc[i].y1) >> 1;
+ h->clip[i].x_max = (oc[i].y2) >> 1;
+ h->clip[i].y_min = oc[i].x1;
+ h->clip[i].y_max = oc[i].x2;
#endif
- if (ng_debug)
- fprintf(stderr,"bktr: clip x=%d-%d y=%d-%d\n",
- h->clip[i].x_min,h->clip[i].x_max,
- h->clip[i].y_min,h->clip[i].y_max);
}
h->ovfmt = h->pf+h->xawtv2pf[fmt->fmtid];
@@ -755,7 +776,7 @@ static struct ng_video_buf* bsd_nextframe(void *handle)
alarm(0);
memcpy(buf->data,h->map,size);
- buf->ts = ng_get_timestamp() - h->start;
+ buf->info.ts = ng_get_timestamp() - h->start;
return buf;
}
diff --git a/libng/grab-ng.c b/libng/grab-ng.c
index 4c0ebe0..ef5718c 100644
--- a/libng/grab-ng.c
+++ b/libng/grab-ng.c
@@ -9,6 +9,10 @@
#include <unistd.h>
#include <string.h>
#include <pthread.h>
+#include <dirent.h>
+#include <fnmatch.h>
+#include <dlfcn.h>
+#include <errno.h>
#include <ctype.h>
#include <sys/time.h>
#ifdef HAVE_ENDIAN_H
@@ -19,7 +23,11 @@
#include "grab-ng.h"
int ng_debug = 0;
-int ng_mjpeg_quality = 50;
+int ng_chromakey = 0x00ff00ff;
+int ng_jpeg_quality = 75;
+int ng_ratio_x = 4;
+int ng_ratio_y = 3;
+
char ng_v4l_conf[256] = "v4l-conf";
/* --------------------------------------------------------------------- */
@@ -243,28 +251,41 @@ ng_attr_listchoices(struct ng_attribute *attr)
/* --------------------------------------------------------------------- */
-static int ratio_x,ratio_y;
-
void
-ng_ratio_configure(int x, int y)
+ng_ratio_fixup(int *width, int *height, int *xoff, int *yoff)
{
- ratio_x = x;
- ratio_y = y;
+ int h = *height;
+ int w = *width;
+
+ if (0 == ng_ratio_x || 0 == ng_ratio_y)
+ return;
+ if (w * ng_ratio_y < h * ng_ratio_x) {
+ *height = *width * ng_ratio_y / ng_ratio_x;
+ if (yoff)
+ *yoff += (h-*height)/2;
+ } else if (w * ng_ratio_y > h * ng_ratio_x) {
+ *width = *height * ng_ratio_x / ng_ratio_y;
+ if (yoff)
+ *xoff += (w-*width)/2;
+ }
}
void
-ng_ratio_fixup(int *width, int *height, int *xoff, int *yoff)
+ng_ratio_fixup2(int *width, int *height, int *xoff, int *yoff,
+ int ratio_x, int ratio_y, int up)
{
int h = *height;
int w = *width;
if (0 == ratio_x || 0 == ratio_y)
return;
- if (w * ratio_y < h * ratio_x) {
+ if ((!up && w * ratio_y < h * ratio_x) ||
+ (up && w * ratio_y > h * ratio_x)) {
*height = *width * ratio_y / ratio_x;
if (yoff)
*yoff += (h-*height)/2;
- } else if (w * ratio_y > h * ratio_x) {
+ } else if ((!up && w * ratio_y > h * ratio_x) ||
+ (up && w * ratio_y < h * ratio_x)) {
*width = *height * ratio_x / ratio_y;
if (yoff)
*xoff += (w-*width)/2;
@@ -382,22 +403,74 @@ ng_conv_register(struct ng_video_conv *list, int count)
struct ng_video_conv*
ng_conv_find(int out, int *i)
{
- if (*i)
- (*i)++;
+ struct ng_video_conv *ret = NULL;
+
for (; *i < ng_nconv; (*i)++) {
#if 0
fprintf(stderr,"\tconv: %-28s => %s\n",
ng_vfmt_to_desc[ng_conv[*i].fmtid_in],
ng_vfmt_to_desc[ng_conv[*i].fmtid_out]);
#endif
- if (ng_conv[*i].fmtid_out == out)
- return &ng_conv[*i];
+ if (ng_conv[*i].fmtid_out == out) {
+ ret = &ng_conv[*i];
+ (*i)++;
+ break;
+ }
}
- return NULL;
+ return ret;
+}
+
+struct ng_filter **ng_filters;
+
+void
+ng_filter_register(struct ng_filter *list, int count)
+{
+ int n = 0;
+
+ if (ng_filters)
+ for (n = 0; NULL != ng_filters[n]; n++)
+ /* nothing */;
+ ng_filters = realloc(ng_filters,sizeof(struct ng_filter*)*(n+count+1));
+ memcpy(ng_filters+n,&list,sizeof(struct ng_filter*)*count);
+ memset(ng_filters+n+count,0,sizeof(struct ng_filter*));
+
+#if 0 /* DEBUG */
+ for (n = 0; NULL != ng_filters[n]; n++)
+ fprintf(stderr,"%s\n",ng_filters[n]->name);
+ fprintf(stderr,"-- \n");
+#endif
}
/* --------------------------------------------------------------------- */
+static void ng_plugins(char *dirname)
+{
+ struct dirent *ent;
+ char filename[1024];
+ void *plugin;
+ void (*initcall)(void);
+ DIR *dir;
+
+ dir = opendir(dirname);
+ if (NULL == dir)
+ return;
+ while (NULL != (ent = readdir(dir))) {
+ if (0 != fnmatch("*.so",ent->d_name,0))
+ continue;
+ sprintf(filename,"%s/%s",dirname,ent->d_name);
+ if (NULL == (plugin = dlopen(filename,RTLD_NOW))) {
+ fprintf(stderr,"dlopen: %s\n",dlerror());
+ continue;
+ }
+ if (NULL == (initcall = dlsym(plugin,"ng_plugin_init"))) {
+ fprintf(stderr,"dlsym: %s\n",dlerror());
+ continue;
+ }
+ initcall();
+ }
+ closedir(dir);
+}
+
void
ng_init(void)
{
@@ -407,7 +480,16 @@ ng_init(void)
fprintf(stderr,"panic: ng_init called twice\n");
exit(1);
}
+ ng_device_init();
ng_color_packed_init();
ng_color_yuv2rgb_init();
ng_mjpg_init();
+
+ ng_plugins(LIBDIR);
}
+
+/*
+ * Local variables:
+ * compile-command: "(cd ..; make)"
+ * End:
+ */
diff --git a/libng/grab-ng.h b/libng/grab-ng.h
index 925db45..1a9d791 100644
--- a/libng/grab-ng.h
+++ b/libng/grab-ng.h
@@ -5,8 +5,13 @@
*
*/
+#include "devices.h"
+
extern int ng_debug;
-extern int ng_mjpeg_quality;
+extern int ng_chromakey;
+extern int ng_jpeg_quality;
+extern int ng_ratio_x;
+extern int ng_ratio_y;
extern char ng_v4l_conf[256];
/* --------------------------------------------------------------------- */
@@ -40,13 +45,18 @@ extern char ng_v4l_conf[256];
#define AUDIO_S16_BE_MONO 5
#define AUDIO_S16_BE_STEREO 6
#define AUDIO_FMT_COUNT 7
+
#if BYTE_ORDER == BIG_ENDIAN
# define AUDIO_S16_NATIVE_MONO AUDIO_S16_BE_MONO
# define AUDIO_S16_NATIVE_STEREO AUDIO_S16_BE_STEREO
+# define VIDEO_RGB15_NATIVE VIDEO_RGB15_BE
+# define VIDEO_RGB16_NATIVE VIDEO_RGB16_BE
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
# define AUDIO_S16_NATIVE_MONO AUDIO_S16_LE_MONO
# define AUDIO_S16_NATIVE_STEREO AUDIO_S16_LE_STEREO
+# define VIDEO_RGB15_NATIVE VIDEO_RGB15_LE
+# define VIDEO_RGB16_NATIVE VIDEO_RGB16_LE
#endif
#define ATTR_TYPE_INTEGER 1 /* range 0 - 65535 */
@@ -67,6 +77,7 @@ extern char ng_v4l_conf[256];
#define CAN_OVERLAY 1
#define CAN_CAPTURE 2
#define CAN_TUNE 4
+#define NEEDS_CHROMAKEY 8
/* --------------------------------------------------------------------- */
@@ -105,8 +116,12 @@ struct ng_video_buf {
int size;
char *data;
- /* frame timestamp */
- long long ts;
+ /* meta info for frame */
+ struct {
+ long long ts; /* time stamp */
+ int seq;
+ int twice;
+ } info;
/*
* the lock is for the reference counter.
@@ -142,7 +157,9 @@ struct ng_audio_buf {
int size;
char *data;
- long long ts;
+ struct {
+ long long ts;
+ } info;
};
@@ -184,6 +201,9 @@ struct ng_attribute {
int defval;
struct STRTAB *choices;
const void *priv;
+ void *handle;
+ int (*read)(struct ng_attribute*);
+ void (*write)(struct ng_attribute*, int val);
};
struct ng_attribute* ng_attr_byid(struct ng_attribute *attrs, int id);
@@ -194,8 +214,9 @@ void ng_attr_listchoices(struct ng_attribute *attr);
/* --------------------------------------------------------------------- */
-void ng_ratio_configure(int x, int y);
void ng_ratio_fixup(int *width, int *height, int *xoff, int *yoff);
+void ng_ratio_fixup2(int *width, int *height, int *xoff, int *yoff,
+ int ratio_x, int ratio_y, int up);
/* --------------------------------------------------------------------- */
/* capture/overlay interface driver */
@@ -208,11 +229,10 @@ struct ng_driver {
int (*close)(void *handle);
/* attributes */
+ char* (*get_devname)(void *handle);
int (*capabilities)(void *handle);
struct ng_attribute* (*list_attrs)(void *handle);
- int (*read_attr)(void *handle, struct ng_attribute*);
- void (*write_attr)(void *handle, struct ng_attribute*, int val);
-
+
/* overlay */
int (*setupfb)(void *handle, struct ng_video_fmt *fmt, void *base);
int (*overlay)(void *handle, struct ng_video_fmt *fmt, int x, int y,
@@ -225,7 +245,6 @@ struct ng_driver {
struct ng_video_buf* (*nextframe)(void *handle); /* video frame */
struct ng_video_buf* (*getimage)(void *handle); /* single image */
-
/* tuner */
unsigned long (*getfreq)(void *handle);
void (*setfreq)(void *handle, unsigned long freq);
@@ -234,7 +253,7 @@ struct ng_driver {
/* --------------------------------------------------------------------- */
-/* maybe add filters for on-the-fly image processing later */
+/* color space converters */
struct ng_video_conv {
int fmtid_in;
@@ -248,15 +267,29 @@ struct ng_video_conv {
void *priv;
};
+/* --------------------------------------------------------------------- */
+/* filters */
+
+struct ng_filter {
+ char *name;
+ int fmts;
+ void* (*init)(struct ng_video_fmt *fmt);
+ struct ng_video_buf* (*frame)(void *handle,
+ struct ng_video_buf *in);
+ void (*fini)(void *handle);
+};
/* --------------------------------------------------------------------- */
extern const struct ng_driver *ng_drivers[];
extern const struct ng_writer *ng_writers[];
+extern struct ng_filter **ng_filters;
void ng_conv_register(struct ng_video_conv *list, int count);
struct ng_video_conv* ng_conv_find(int out, int *i);
+void ng_filter_register(struct ng_filter *list, int count);
+
const struct ng_driver*
ng_grabber_open(char *device, struct ng_video_fmt *screen,
void *base, void **handle);
@@ -271,6 +304,8 @@ void ng_lut_init(unsigned long red_mask, unsigned long green_mask,
/* --------------------------------------------------------------------- */
/* internal stuff starts here */
+#ifdef NG_PRIVATE
+
/* init functions */
void ng_color_packed_init(void);
void ng_color_yuv2rgb_init(void);
@@ -282,8 +317,14 @@ unsigned long ng_lut_green[256];
unsigned long ng_lut_blue[256];
void ng_yuv422_to_lut2(unsigned char *dest, unsigned char *s, int p);
void ng_yuv422_to_lut4(unsigned char *dest, unsigned char *s, int p);
+void ng_yuv420p_to_lut2(void *h, struct ng_video_buf *out,
+ struct ng_video_buf *in);
+void ng_yuv420p_to_lut4(void *h, struct ng_video_buf *out,
+ struct ng_video_buf *in);
void ng_yuv422p_to_lut2(void *h, struct ng_video_buf *out,
struct ng_video_buf *in);
+void ng_yuv422p_to_lut4(void *h, struct ng_video_buf *out,
+ struct ng_video_buf *in);
/* color_common.c stuff */
void* ng_packed_init(struct ng_video_fmt *out, void *priv);
@@ -296,3 +337,16 @@ void ng_conv_nop_fini(void *handle);
init: ng_packed_init, \
frame: ng_packed_frame, \
fini: ng_conv_nop_fini
+
+/* clipping.c stuff */
+void ng_check_clipping(int width, int height, int xadjust, int yadjust,
+ struct OVERLAY_CLIP *oc, int *count);
+
+#endif /* NG_PRIVATE */
+
+/* --------------------------------------------------------------------- */
+/*
+ * Local variables:
+ * compile-command: "(cd ..; make)"
+ * End:
+ */
diff --git a/libng/grab-v4l.c b/libng/grab-v4l.c
index bb2b915..117b4cf 100644
--- a/libng/grab-v4l.c
+++ b/libng/grab-v4l.c
@@ -32,7 +32,7 @@ const struct ng_driver v4l_driver;
#include <linux/videodev.h>
-#define SYNC_TIMEOUT 1
+#define SYNC_TIMEOUT 3
/* ---------------------------------------------------------------------- */
@@ -41,10 +41,11 @@ static void* v4l_open(char *device);
static int v4l_close(void *handle);
/* attributes */
+static char* v4l_devname(void *handle);
static int v4l_flags(void *handle);
static struct ng_attribute* v4l_attrs(void *handle);
-static int v4l_read_attr(void *handle, struct ng_attribute*);
-static void v4l_write_attr(void *handle, struct ng_attribute*, int val);
+static int v4l_read_attr(struct ng_attribute*);
+static void v4l_write_attr(struct ng_attribute*, int val);
/* overlay */
static int v4l_setupfb(void *handle, struct ng_video_fmt *fmt, void *base);
@@ -103,10 +104,10 @@ static struct STRTAB norms_bttv[] = {
{ -1, NULL }
};
-static const unsigned short format2palette[VIDEO_FMT_COUNT] = {
- 0, /* unused */
- VIDEO_PALETTE_HI240, /* RGB8 */
- VIDEO_PALETTE_GREY, /* GRAY8 */
+static unsigned short format2palette[VIDEO_FMT_COUNT] = {
+ 0, /* unused */
+ VIDEO_PALETTE_HI240, /* RGB8 */
+ VIDEO_PALETTE_GREY, /* GRAY8 */
VIDEO_PALETTE_RGB555, /* RGB15_LE */
VIDEO_PALETTE_RGB565, /* RGB16_LE */
0,
@@ -115,15 +116,11 @@ static const unsigned short format2palette[VIDEO_FMT_COUNT] = {
VIDEO_PALETTE_RGB32, /* BGR32 */
0,
0,
- 0, /* LUT 2 */
- 0, /* LUT 4 */
- VIDEO_PALETTE_YUV422, /* YUV422 */
- VIDEO_PALETTE_YUV422P, /* YUV422P */
-#if 0 /* broken in bttv (fixed in 0.8.x) */
- VIDEO_PALETTE_YUV420P, /* YUV420P */
-#else
- 0, /* YUV420P */
-#endif
+ 0, /* LUT 2 */
+ 0, /* LUT 4 */
+ VIDEO_PALETTE_YUV422, /* YUV422 */
+ VIDEO_PALETTE_YUV422P, /* YUV422P */
+ VIDEO_PALETTE_YUV420P, /* YUV420P */
};
#define FMT2PAL(fmt) ((fmt < sizeof(format2palette)/sizeof(unsigned short)) ?\
format2palette[fmt] : 0);
@@ -147,6 +144,7 @@ struct v4l_handle {
int nattr;
struct ng_attribute *attr;
int input;
+ int audio_mode;
/* overlay */
struct video_buffer fbuf;
@@ -183,10 +181,9 @@ const struct ng_driver v4l_driver = {
open: v4l_open,
close: v4l_close,
+ get_devname: v4l_devname,
capabilities: v4l_flags,
list_attrs: v4l_attrs,
- read_attr: v4l_read_attr,
- write_attr: v4l_write_attr,
setupfb: v4l_setupfb,
overlay: v4l_overlay,
@@ -210,7 +207,7 @@ static void
sigalarm(int signal)
{
alarms++;
- fprintf(stderr,"v4l: oops: got sigalarm\n");
+ fprintf(stderr,"v4l: timeout (got SIGALRM), hardware/driver problems?\n");
}
static void
@@ -364,6 +361,10 @@ v4l_add_attr(struct v4l_handle *h, int id, int type,
h->attr[h->nattr].choices = choices;
if (id < ATTR_ID_COUNT)
h->attr[h->nattr].name = ng_attr_to_desc[id];
+
+ h->attr[h->nattr].read = v4l_read_attr;
+ h->attr[h->nattr].write = v4l_write_attr;
+ h->attr[h->nattr].handle = h;
h->nattr++;
}
@@ -490,7 +491,7 @@ v4l_open(char *device)
#define BTTV_VERSION _IOR('v' , BASE_VIDIOCPRIVATE+6, int)
/* dirty hack time / v4l design flaw -- works with bttv only
* this adds support for a few less common PAL versions */
- if (-1 != (rc = ioctl(h->fd,BTTV_VERSION,0))) {
+ if (-1 != (rc = ioctl(h->fd,BTTV_VERSION,&i))) {
norms = norms_bttv;
if (ng_debug || rc < 0x000700)
fprintf(stderr,"v4l: bttv version %d.%d.%d\n",
@@ -587,6 +588,13 @@ v4l_close(void *handle)
/* ---------------------------------------------------------------------- */
+static char*
+v4l_devname(void *handle)
+{
+ struct v4l_handle *h = handle;
+ return h->capability.name;
+}
+
static int v4l_flags(void *handle)
{
struct v4l_handle *h = handle;
@@ -599,6 +607,8 @@ static int v4l_flags(void *handle)
ret |= CAN_CAPTURE;
if (h->capability.type & VID_TYPE_TUNER)
ret |= CAN_TUNE;
+ if (h->capability.type & VID_TYPE_CHROMAKEY)
+ ret |= NEEDS_CHROMAKEY;
return ret;
}
@@ -608,9 +618,9 @@ static struct ng_attribute* v4l_attrs(void *handle)
return h->attr;
}
-static int v4l_read_attr(void *handle, struct ng_attribute *attr)
+static int v4l_read_attr(struct ng_attribute *attr)
{
- struct v4l_handle *h = handle;
+ struct v4l_handle *h = attr->handle;
switch (attr->id) {
case ATTR_ID_INPUT:
@@ -643,9 +653,9 @@ static int v4l_read_attr(void *handle, struct ng_attribute *attr)
return -1;
}
-static void v4l_write_attr(void *handle, struct ng_attribute *attr, int val)
+static void v4l_write_attr(struct ng_attribute *attr, int val)
{
- struct v4l_handle *h = handle;
+ struct v4l_handle *h = attr->handle;
/* read ... */
switch (attr->id) {
@@ -672,9 +682,11 @@ static void v4l_write_attr(void *handle, struct ng_attribute *attr, int val)
switch (attr->id) {
case ATTR_ID_INPUT:
h->input = val;
+ h->audio_mode = 0;
break;
case ATTR_ID_NORM:
h->channels[h->input].norm = val;
+ h->audio_mode = 0;
break;
case ATTR_ID_MUTE:
if (val)
@@ -686,7 +698,7 @@ static void v4l_write_attr(void *handle, struct ng_attribute *attr, int val)
h->audio.volume = val;
break;
case ATTR_ID_AUDIO_MODE:
- h->audio.mode = val;
+ h->audio_mode = val;
break;
case ATTR_ID_COLOR:
h->pict.colour = val;
@@ -701,6 +713,12 @@ static void v4l_write_attr(void *handle, struct ng_attribute *attr, int val)
h->pict.contrast = val;
break;
}
+ /* have to set that all the time as read and write have
+ slightly different semantics:
+ read == bitmask with all available modes flagged
+ write == one bit set (for the selected mode, zero is autodetect)
+ */
+ h->audio.mode = h->audio_mode;
/* ... write */
switch (attr->id) {
@@ -740,6 +758,7 @@ v4l_setfreq(void *handle, unsigned long freq)
if (ng_debug)
fprintf(stderr,"v4l: freq: %.3f\n",(float)freq/16);
xioctl(h->fd, VIDIOCSFREQ, &freq);
+ h->audio_mode = 0;
}
static int
@@ -747,7 +766,7 @@ v4l_tuned(void *handle)
{
struct v4l_handle *h = handle;
- usleep(10000);
+ /* usleep(10000); */
if (-1 == xioctl(h->fd,VIDIOCGTUNER,&h->tuner))
return 0;
return h->tuner.signal ? 1 : 0;
@@ -770,9 +789,10 @@ v4l_setupfb(void *handle, struct ng_video_fmt *fmt, void *base)
}
/* double-check settings */
- fprintf(stderr,"v4l: %dx%d, %d bit/pixel, %d byte/scanline\n",
- h->fbuf.width,h->fbuf.height,
- h->fbuf.depth,h->fbuf.bytesperline);
+ if (ng_debug)
+ fprintf(stderr,"v4l: %dx%d, %d bit/pixel, %d byte/scanline\n",
+ h->fbuf.width,h->fbuf.height,
+ h->fbuf.depth,h->fbuf.bytesperline);
if ((fmt->bytesperline > 0 &&
h->fbuf.bytesperline != fmt->bytesperline) ||
(h->fbuf.width != fmt->width) ||
@@ -812,6 +832,8 @@ v4l_setupfb(void *handle, struct ng_video_fmt *fmt, void *base)
static void
v4l_overlay_set(struct v4l_handle *h, int state)
{
+ int rc;
+
if (0 == state) {
/* off */
if (0 == h->ov_on)
@@ -823,11 +845,17 @@ v4l_overlay_set(struct v4l_handle *h, int state)
h->pict.depth = ng_vfmt_to_depth[h->ov_fmtid];
h->pict.palette = FMT2PAL(h->ov_fmtid);
xioctl(h->fd, VIDIOCSPICT, &h->pict);
- xioctl(h->fd, VIDIOCSWIN, &h->win);
- if (0 != h->ov_on)
- return;
- xioctl(h->fd, VIDIOCCAPTURE, &one);
- h->ov_on = 1;
+ rc = xioctl(h->fd, VIDIOCSWIN, &h->win);
+ if (0 == rc) {
+ if (0 != h->ov_on)
+ return;
+ xioctl(h->fd, VIDIOCCAPTURE, &one);
+ h->ov_on = 1;
+ } else {
+ /* disable overlay on SWIN failure */
+ xioctl(h->fd, VIDIOCCAPTURE, &zero);
+ h->ov_on = 0;
+ }
}
}
@@ -836,7 +864,7 @@ v4l_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
struct OVERLAY_CLIP *oc, int count, int aspect)
{
struct v4l_handle *h = handle;
- int i,xadjust=0,yadjust=0;
+ int i;
if (h->ov_error)
return -1;
@@ -856,7 +884,6 @@ v4l_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
h->win.flags = 0;
h->win.chromakey = 0;
-#if 1
/* check against max. size */
xioctl(h->fd,VIDIOCGCAP,&h->capability);
if (h->win.width > h->capability.maxwidth) {
@@ -870,6 +897,7 @@ v4l_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
if (aspect)
ng_ratio_fixup(&h->win.width,&h->win.height,&h->win.x,&h->win.y);
+#if 1
/* pass aligned values -- the driver does'nt get it right yet */
h->win.width &= ~3;
h->win.height &= ~3;
@@ -878,11 +906,12 @@ v4l_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
h->win.x += 4;
if (h->win.x+h->win.width > x+fmt->width)
h->win.width -= 4;
+#endif
/* fixups */
- xadjust = h->win.x - x;
- yadjust = h->win.y - y;
-#endif
+ ng_check_clipping(h->win.width, h->win.height,
+ x - h->win.x, y - h->win.y,
+ oc, &count);
/* handle clipping */
if (h->win.clips) {
@@ -894,16 +923,14 @@ v4l_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
h->win.clipcount = count;
h->win.clips = malloc(count * sizeof(struct video_clip));
for (i = 0; i < count; i++) {
- h->win.clips[i].x = oc[i].x1 - xadjust;
- h->win.clips[i].y = oc[i].y1 - yadjust;
+ h->win.clips[i].x = oc[i].x1;
+ h->win.clips[i].y = oc[i].y1;
h->win.clips[i].width = oc[i].x2-oc[i].x1;
h->win.clips[i].height = oc[i].y2-oc[i].y1;
- if (ng_debug)
- fprintf(stderr,"v4l: clip=%dx%d+%d+%d\n",
- h->win.clips[i].width,h->win.clips[i].height,
- h->win.clips[i].x,h->win.clips[i].y);
}
}
+ if (h->capability.type & VID_TYPE_CHROMAKEY)
+ h->win.chromakey = ng_chromakey;
h->ov_enabled = 1;
h->ov_fmtid = fmt->fmtid;
v4l_overlay_set(h,h->ov_enabled);
@@ -990,9 +1017,14 @@ mm_probe(struct v4l_handle *h, int fmtid)
ng_vfmt_to_desc[fmtid]);
h->buf_v4l[0].frame = 0;
- h->buf_v4l[0].width = 64;
- h->buf_v4l[0].height = 48;
+ h->buf_v4l[0].width = h->capability.minwidth;
+ h->buf_v4l[0].height = h->capability.minheight;
h->buf_v4l[0].format = FMT2PAL(fmtid);
+#if 1 /* bug compatibility: bttv up to 0.7.67 reports wrong minwidth */
+ if (h->buf_v4l[0].width == 32)
+ h->buf_v4l[0].width = 48;
+#endif
+
if (0 == h->buf_v4l[0].format)
goto fail;
if (-1 == mm_queue(h))
@@ -1108,7 +1140,7 @@ v4l_setformat(void *handle, struct ng_video_fmt *fmt)
#if 0
/* for debugging color space conversion functions:
force xawtv to capture some specific format */
- if (fmt->fmtid != VIDEO_YUV422)
+ if (fmt->fmtid != VIDEO_YUV420P)
return -1;
#endif
@@ -1184,15 +1216,17 @@ v4l_nextframe(void *handle)
v4l_overlay_set(h,h->ov_enabled);
if (NULL == buf)
return NULL;
- buf->ts = ng_get_timestamp() - h->start;
+ memset(&buf->info,0,sizeof(buf->info));
+ buf->info.ts = ng_get_timestamp() - h->start;
return buf;
} else {
mm_queue_all(h);
frame = mm_waiton(h);
if (-1 == frame)
return NULL;
+ memset(&h->buf_me[frame].info,0,sizeof(h->buf_me[frame].info));
h->buf_me[frame].refcount++;
- h->buf_me[frame].ts = ng_get_timestamp() - h->start;
+ h->buf_me[frame].info.ts = ng_get_timestamp() - h->start;
return h->buf_me+frame;
}
}
@@ -1229,3 +1263,8 @@ v4l_getimage(void *handle)
}
#endif /* __linux__ */
+/*
+ * Local variables:
+ * compile-command: "(cd ..; make)"
+ * End:
+ */
diff --git a/libng/grab-v4l2.c b/libng/grab-v4l2.c
index 08cf8cb..5a8c386 100644
--- a/libng/grab-v4l2.c
+++ b/libng/grab-v4l2.c
@@ -19,10 +19,10 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/mman.h>
+#include <pthread.h>
#ifdef HAVE_ENDIAN_H
# include <endian.h>
#endif
-#include <pthread.h>
#include "grab-ng.h"
@@ -40,10 +40,11 @@ static void* v4l2_open(char *device);
static int v4l2_close(void *handle);
/* attributes */
+static char* v4l2_devname(void *handle);
static int v4l2_flags(void *handle);
static struct ng_attribute* v4l2_attrs(void *handle);
-static int v4l2_read_attr(void *handle, struct ng_attribute*);
-static void v4l2_write_attr(void *handle, struct ng_attribute*, int val);
+static int v4l2_read_attr(struct ng_attribute*);
+static void v4l2_write_attr(struct ng_attribute*, int val);
/* overlay */
static int v4l2_setupfb(void *handle, struct ng_video_fmt *fmt, void *base);
@@ -113,10 +114,9 @@ const struct ng_driver v4l2_driver = {
open: v4l2_open,
close: v4l2_close,
+ get_devname: v4l2_devname,
capabilities: v4l2_flags,
list_attrs: v4l2_attrs,
- read_attr: v4l2_read_attr,
- write_attr: v4l2_write_attr,
setupfb: v4l2_setupfb,
overlay: v4l2_overlay,
@@ -134,12 +134,12 @@ const struct ng_driver v4l2_driver = {
static __u32 xawtv_pixelformat[VIDEO_FMT_COUNT] = {
0, /* unused */
- 0, /* RGB8 */
+ V4L2_PIX_FMT_HI240, /* RGB8 */
V4L2_PIX_FMT_GREY, /* GRAY8 */
V4L2_PIX_FMT_RGB555, /* RGB15_LE */
V4L2_PIX_FMT_RGB565, /* RGB16_LE */
- 0, /* RGB15_BE */
- 0, /* RGB16_BE */
+ V4L2_PIX_FMT_RGB555X, /* RGB15_BE */
+ V4L2_PIX_FMT_RGB565X, /* RGB16_BE */
V4L2_PIX_FMT_BGR24, /* BGR24 */
V4L2_PIX_FMT_BGR32, /* BGR32 */
V4L2_PIX_FMT_RGB24, /* RGB24 */
@@ -147,10 +147,22 @@ static __u32 xawtv_pixelformat[VIDEO_FMT_COUNT] = {
0, /* LUT 2 */
0, /* LUT 4 */
V4L2_PIX_FMT_YUYV, /* YUV422 */
- 0, /* YUV422P */
+#if 0
+ V4L2_PIX_FMT_YVU422P, /* YUV422P */
+#else
+ 0,
+#endif
V4L2_PIX_FMT_YUV420, /* YUV420P */
};
+static struct STRTAB stereo[] = {
+ { V4L2_TUNER_MODE_MONO, "mono" },
+ { V4L2_TUNER_MODE_STEREO, "stereo" },
+ { V4L2_TUNER_MODE_LANG1, "lang1" },
+ { V4L2_TUNER_MODE_LANG2, "lang2" },
+ { -1, NULL },
+};
+
/* ---------------------------------------------------------------------- */
/* debug output */
@@ -371,14 +383,14 @@ print_device_capabilities(struct v4l2_handle *h)
/* capture formats */
fprintf(stderr,"capture formats:\n");
for (i = 0; i < h->nfmts; i++) {
- printf(" %d: %c%c%c%c, depth=%d,%s \"%s\"\n", i,
- h->fmt[i].pixelformat & 0xff,
- (h->fmt[i].pixelformat >> 8) & 0xff,
- (h->fmt[i].pixelformat >> 16) & 0xff,
- (h->fmt[i].pixelformat >> 24) & 0xff,
- h->fmt[i].depth,
- (h->fmt[i].flags & V4L2_FMT_FLAG_COMPRESSED) ? " compressed" : "",
- h->fmt[i].description);
+ fprintf(stderr," %d: %c%c%c%c, depth=%d,%s \"%s\"\n", i,
+ h->fmt[i].pixelformat & 0xff,
+ (h->fmt[i].pixelformat >> 8) & 0xff,
+ (h->fmt[i].pixelformat >> 16) & 0xff,
+ (h->fmt[i].pixelformat >> 24) & 0xff,
+ h->fmt[i].depth,
+ (h->fmt[i].flags & V4L2_FMT_FLAG_COMPRESSED) ? " compressed" : "",
+ h->fmt[i].description);
}
/* capture parameters */
@@ -391,7 +403,7 @@ print_device_capabilities(struct v4l2_handle *h)
h->streamparm.parm.capture.timeperframe);
/* controls */
- printf("supported controls:\n");
+ fprintf(stderr,"supported controls:\n");
for (i = 0; i < MAX_CTRL*2; i++) {
if (h->ctl[i].id == -1)
continue;
@@ -555,7 +567,7 @@ v4l2_to_me(const struct v4l2_queryctrl *ctl, int value)
v4l2 >>= 2;
me >>= 2;
}
- value = (value + ctl->minimum) * me / v4l2;
+ value = (value - ctl->minimum) * me / v4l2;
if (value < 0) value = 0;
if (value > 65535) value = 65535;
return value;
@@ -646,14 +658,19 @@ v4l2_add_attr(struct v4l2_handle *h, struct v4l2_queryctrl *ctl,
}
if (h->attr[h->nattr].id < ATTR_ID_COUNT)
h->attr[h->nattr].name = ng_attr_to_desc[h->attr[h->nattr].id];
+
+ h->attr[h->nattr].read = v4l2_read_attr;
+ h->attr[h->nattr].write = v4l2_write_attr;
+ h->attr[h->nattr].handle = h;
h->nattr++;
}
-static int v4l2_read_attr(void *handle, struct ng_attribute *attr)
+static int v4l2_read_attr(struct ng_attribute *attr)
{
- struct v4l2_handle *h = handle;
+ struct v4l2_handle *h = attr->handle;
const struct v4l2_queryctrl *ctl = attr->priv;
struct v4l2_control c;
+ struct v4l2_tuner tuner;
int value = 0;
if (NULL != ctl) {
@@ -671,15 +688,21 @@ static int v4l2_read_attr(void *handle, struct ng_attribute *attr)
} else if (attr->id == ATTR_ID_INPUT) {
xioctl(h->fd,VIDIOC_G_INPUT,&value,0);
+ } else if (attr->id == ATTR_ID_AUDIO_MODE) {
+ memset(&tuner,0,sizeof(tuner));
+ xioctl(h->fd,VIDIOC_G_TUNER,&tuner,0);
+ value = tuner.audmode;
+
}
return value;
}
-static void v4l2_write_attr(void *handle, struct ng_attribute *attr, int value)
+static void v4l2_write_attr(struct ng_attribute *attr, int value)
{
- struct v4l2_handle *h = handle;
+ struct v4l2_handle *h = attr->handle;
const struct v4l2_queryctrl *ctl = attr->priv;
struct v4l2_control c;
+ struct v4l2_tuner tuner;
if (NULL != ctl) {
c.id = ctl->id;
@@ -695,7 +718,12 @@ static void v4l2_write_attr(void *handle, struct ng_attribute *attr, int value)
} else if (attr->id == ATTR_ID_INPUT) {
xioctl(h->fd,VIDIOC_S_INPUT,&value,0);
-
+
+ } else if (attr->id == ATTR_ID_AUDIO_MODE) {
+ memset(&tuner,0,sizeof(tuner));
+ xioctl(h->fd,VIDIOC_G_TUNER,&tuner,0);
+ tuner.audmode = value;
+ xioctl(h->fd,VIDIOC_S_TUNER,&tuner,0);
}
}
@@ -713,7 +741,7 @@ v4l2_open(char *device)
memset(h,0,sizeof(*h));
if (-1 == (h->fd = open(device,O_RDWR))) {
- fprintf(stderr,"open %s: %s\n",device,strerror(errno));
+ fprintf(stderr,"v4l2: open %s: %s\n",device,strerror(errno));
goto err;
}
@@ -722,7 +750,8 @@ v4l2_open(char *device)
if (ng_debug)
fprintf(stderr, "v4l2: open\n");
fcntl(h->fd,F_SETFD,FD_CLOEXEC);
- fprintf(stderr,"v4l2: device is %s\n",h->cap.name);
+ if (ng_debug)
+ fprintf(stderr,"v4l2: device is %s\n",h->cap.name);
get_device_capabilities(h);
if (ng_debug)
@@ -731,6 +760,8 @@ v4l2_open(char *device)
/* attributes */
v4l2_add_attr(h, NULL, ATTR_ID_NORM, build_norms(h));
v4l2_add_attr(h, NULL, ATTR_ID_INPUT, build_inputs(h));
+ if (h->cap.flags & V4L2_FLAG_TUNER)
+ v4l2_add_attr(h, NULL, ATTR_ID_AUDIO_MODE, stereo);
for (i = 0; i < MAX_CTRL*2; i++) {
if (h->ctl[i].id == -1)
continue;
@@ -766,16 +797,22 @@ v4l2_close(void *handle)
return 0;
}
+static char*
+v4l2_devname(void *handle)
+{
+ struct v4l2_handle *h = handle;
+ return h->cap.name;
+}
+
static int v4l2_flags(void *handle)
{
struct v4l2_handle *h = handle;
int ret = 0;
- if (h->cap.flags & V4L2_FLAG_PREVIEW &&
- !h->ov_error)
+ if (h->cap.flags & V4L2_FLAG_PREVIEW && !h->ov_error)
ret |= CAN_OVERLAY;
- if (h->cap.flags & V4L2_FLAG_STREAMING ||
- h->cap.flags & V4L2_FLAG_READ)
+ if ((h->cap.flags & V4L2_FLAG_STREAMING) ||
+ (h->cap.flags & V4L2_FLAG_READ))
ret |= CAN_CAPTURE;
if (h->cap.flags & V4L2_FLAG_TUNER)
ret |= CAN_TUNE;
@@ -830,23 +867,24 @@ v4l2_setupfb(void *handle, struct ng_video_fmt *fmt, void *base)
{
struct v4l2_handle *h = handle;
- if (-1 == ioctl(h->fd, VIDIOC_G_FBUF, &h->ov_fb)) {
- perror("ioctl VIDIOC_G_FBUF");
+ if (-1 == xioctl(h->fd, VIDIOC_G_FBUF, &h->ov_fb, 0))
return -1;
- }
- if (1 /* debug */)
+
+ if (1 /* ng_debug */)
print_fbinfo(&h->ov_fb);
/* double-check settings */
if (NULL != base && h->ov_fb.base[0] != base) {
fprintf(stderr,"v4l2: WARNING: framebuffer base address mismatch\n");
- fprintf(stderr,"v4l2: %p %p\n",base,h->ov_fb.base);
+ fprintf(stderr,"v4l2: me=%p v4l=%p\n",base,h->ov_fb.base);
h->ov_error = 1;
return -1;
}
if (h->ov_fb.fmt.width != fmt->width ||
h->ov_fb.fmt.height != fmt->height) {
fprintf(stderr,"v4l2: WARNING: framebuffer size mismatch\n");
+ fprintf(stderr,"v4l2: me=%dx%d v4l=%dx%d\n",
+ fmt->width,fmt->height,h->ov_fb.fmt.width,h->ov_fb.fmt.height);
h->ov_error = 1;
return -1;
}
@@ -854,14 +892,28 @@ v4l2_setupfb(void *handle, struct ng_video_fmt *fmt, void *base)
fmt->bytesperline > 0 &&
fmt->bytesperline != h->ov_fb.fmt.bytesperline) {
fprintf(stderr,"v4l2: WARNING: framebuffer bpl mismatch\n");
+ fprintf(stderr,"v4l2: me=%d v4l=%d\n",
+ fmt->bytesperline,h->ov_fb.fmt.bytesperline);
h->ov_error = 1;
return -1;
}
+#if 0
if (h->ov_fb.fmt.pixelformat != xawtv_pixelformat[fmt->fmtid]) {
fprintf(stderr,"v4l2: WARNING: framebuffer format mismatch\n");
+ fprintf(stderr,"v4l2: me=%c%c%c%c [%s] v4l=%c%c%c%c\n",
+ xawtv_pixelformat[fmt->fmtid] & 0xff,
+ (xawtv_pixelformat[fmt->fmtid] >> 8) & 0xff,
+ (xawtv_pixelformat[fmt->fmtid] >> 16) & 0xff,
+ (xawtv_pixelformat[fmt->fmtid] >> 24) & 0xff,
+ ng_vfmt_to_desc[fmt->fmtid],
+ h->ov_fb.fmt.pixelformat & 0xff,
+ (h->ov_fb.fmt.pixelformat >> 8) & 0xff,
+ (h->ov_fb.fmt.pixelformat >> 16) & 0xff,
+ (h->ov_fb.fmt.pixelformat >> 24) & 0xff);
h->ov_error = 1;
return -1;
}
+#endif
return 0;
}
@@ -870,7 +922,7 @@ v4l2_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
struct OVERLAY_CLIP *oc, int count, int aspect)
{
struct v4l2_handle *h = handle;
- int i,xadjust=0,yadjust=0;
+ int rc,i;
if (h->ov_error)
return -1;
@@ -907,8 +959,9 @@ v4l2_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
&h->ov_win.x,&h->ov_win.y);
/* fixups */
- xadjust = h->ov_win.x - x;
- yadjust = h->ov_win.y - y;
+ ng_check_clipping(h->ov_win.width, h->ov_win.height,
+ x - h->ov_win.x, y - h->ov_win.y,
+ oc, &count);
if (h->ov_fb.capability & V4L2_FBUF_CAP_CLIPPING) {
h->ov_win.clips = h->ov_clips;
@@ -916,14 +969,10 @@ v4l2_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
for (i = 0; i < count; i++) {
h->ov_clips[i].next = (i+1 == count) ? NULL : &h->ov_clips[i+1];
- h->ov_clips[i].x = oc[i].x1 - xadjust;
- h->ov_clips[i].y = oc[i].y1 - yadjust;
+ h->ov_clips[i].x = oc[i].x1;
+ h->ov_clips[i].y = oc[i].y1;
h->ov_clips[i].width = oc[i].x2-oc[i].x1;
h->ov_clips[i].height = oc[i].y2-oc[i].y1;
- if (ng_debug)
- fprintf(stderr,"v4l2: clip=%dx%d+%d+%d\n",
- h->ov_clips[i].width,h->ov_clips[i].height,
- h->ov_clips[i].x,h->ov_clips[i].y);
}
}
#if 0
@@ -931,10 +980,10 @@ v4l2_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
h->ov_win.chromakey = 0; /* FIXME */
}
#endif
- xioctl(h->fd, VIDIOC_S_WIN, &h->ov_win, 0);
+ rc = xioctl(h->fd, VIDIOC_S_WIN, &h->ov_win, 0);
- h->ov_enabled = 1;
- h->ov_on = 1;
+ h->ov_enabled = (0 == rc) ? 1 : 0;
+ h->ov_on = (0 == rc) ? 1 : 0;
xioctl(h->fd, VIDIOC_PREVIEW, &h->ov_on, 0);
return 0;
@@ -981,12 +1030,15 @@ v4l2_waiton(struct v4l2_handle *h)
fd_set rdset;
/* wait for the next frame */
+ again:
tv.tv_sec = 1;
tv.tv_usec = 0;
FD_ZERO(&rdset);
FD_SET(h->fd, &rdset);
switch (select(h->fd + 1, &rdset, NULL, NULL, &tv)) {
case -1:
+ if (EINTR == errno)
+ goto again;
perror("v4l2: select");
return -1;
case 0:
@@ -1021,7 +1073,8 @@ v4l2_start_streaming(struct v4l2_handle *h, int buffers)
if (-1 == ioctl(h->fd, VIDIOC_QUERYBUF, &h->buf_v4l2[i]))
return -1;
h->buf_me[i].fmt = h->fmt_me;
- h->buf_me[i].size = h->buf_v4l2[i].length;
+ h->buf_me[i].size = h->buf_me[i].fmt.bytesperline *
+ h->buf_me[i].fmt.height;
h->buf_me[i].data = mmap(NULL, h->buf_me[i].size,
PROT_READ | PROT_WRITE, MAP_SHARED,
h->fd, h->buf_v4l2[i].offset);
@@ -1068,6 +1121,8 @@ v4l2_stop_streaming(struct v4l2_handle *h)
/* free buffers */
for (i = 0; i < h->reqbufs.count; i++) {
+ if (0 != h->buf_me[i].refcount)
+ ng_waiton_video_buf(&h->buf_me[i]);
if (-1 == munmap(h->buf_me[i].data,h->buf_me[i].size))
perror("munmap");
}
@@ -1134,7 +1189,7 @@ v4l2_startvideo(void *handle, int fps, int buffers)
h->start = 0;
if (h->cap.flags & V4L2_FLAG_STREAMING)
- v4l2_start_streaming(h,buffers);
+ return v4l2_start_streaming(h,buffers);
return 0;
}
@@ -1157,7 +1212,7 @@ v4l2_nextframe(void *handle)
{
struct v4l2_handle *h = handle;
struct ng_video_buf *buf = NULL;
- int size,frame = 0;
+ int rc,size,frame = 0;
if (h->cap.flags & V4L2_FLAG_STREAMING) {
v4l2_queue_all(h);
@@ -1166,24 +1221,32 @@ v4l2_nextframe(void *handle)
return NULL;
h->buf_me[frame].refcount++;
buf = &h->buf_me[frame];
- buf->ts = h->buf_v4l2[frame].timestamp;
+ memset(&buf->info,0,sizeof(buf->info));
+ buf->info.ts = h->buf_v4l2[frame].timestamp;
} else {
size = h->fmt_me.bytesperline * h->fmt_me.height;
buf = ng_malloc_video_buf(&h->fmt_me,size);
- if (size != read(h->fd,buf->data,size)) {
+ rc = read(h->fd,buf->data,size);
+ if (rc != size) {
+ if (-1 == rc) {
+ perror("v4l2: read");
+ } else {
+ fprintf(stderr, "v4l2: read: rc=%d/size=%d\n",rc,size);
+ }
ng_release_video_buf(buf);
return NULL;
}
- buf->ts = ng_get_timestamp();
+ memset(&buf->info,0,sizeof(buf->info));
+ buf->info.ts = ng_get_timestamp();
}
if (h->first) {
h->first = 0;
- h->start = buf->ts;
+ h->start = buf->info.ts;
if (ng_debug)
fprintf(stderr,"v4l2: start ts=%lld\n",h->start);
}
- buf->ts -= h->start;
+ buf->info.ts -= h->start;
return buf;
}
@@ -1192,17 +1255,26 @@ v4l2_getimage(void *handle)
{
struct v4l2_handle *h = handle;
struct ng_video_buf *buf;
- int size,frame;
+ int size,frame,rc;
size = h->fmt_me.bytesperline * h->fmt_me.height;
buf = ng_malloc_video_buf(&h->fmt_me,size);
if (h->cap.flags & V4L2_FLAG_READ) {
- if (size != read(h->fd,buf->data,size)) {
+ rc = read(h->fd,buf->data,size);
+ if (rc != size) {
+ if (-1 == rc) {
+ perror("v4l2: read");
+ } else {
+ fprintf(stderr, "v4l2: read: rc=%d/size=%d\n",rc,size);
+ }
ng_release_video_buf(buf);
return NULL;
}
} else {
- v4l2_start_streaming(h,1);
+ if (-1 == v4l2_start_streaming(h,1)) {
+ v4l2_stop_streaming(h);
+ return NULL;
+ }
frame = v4l2_waiton(h);
if (-1 == frame) {
v4l2_stop_streaming(h);
@@ -1215,3 +1287,10 @@ v4l2_getimage(void *handle)
}
#endif /* __linux__ */
+
+/* --------------------------------------------------------------------- */
+/*
+ * Local variables:
+ * compile-command: "(cd ..; make)"
+ * End:
+ */
diff --git a/libng/mjpeg.c b/libng/mjpeg.c
index edea865..1bbc2db 100644
--- a/libng/mjpeg.c
+++ b/libng/mjpeg.c
@@ -98,7 +98,7 @@ mjpg_init(struct ng_video_fmt *fmt)
return h;
}
-void
+static void
mjpg_cleanup(void *handle)
{
struct mjpeg_handle *h = handle;
@@ -116,7 +116,7 @@ mjpg_cleanup(void *handle)
/* ---------------------------------------------------------------------- */
-void*
+static void*
mjpg_rgb_init(struct ng_video_fmt *out, void *priv)
{
struct mjpeg_handle *h;
@@ -133,13 +133,13 @@ mjpg_rgb_init(struct ng_video_fmt *out, void *priv)
jpeg_set_defaults(&h->mjpg_cinfo);
h->mjpg_cinfo.dct_method = JDCT_FASTEST;
- jpeg_set_quality(&h->mjpg_cinfo, ng_mjpeg_quality, TRUE);
+ jpeg_set_quality(&h->mjpg_cinfo, ng_jpeg_quality, TRUE);
jpeg_suppress_tables(&h->mjpg_cinfo, TRUE);
return h;
}
-void
+static void
mjpg_rgb_compress(void *handle, struct ng_video_buf *out,
struct ng_video_buf *in)
{
@@ -161,7 +161,7 @@ mjpg_rgb_compress(void *handle, struct ng_video_buf *out,
out->size = h->mjpg_bufused;
}
-void
+static void
mjpg_bgr_compress(void *handle, struct ng_video_buf *out,
struct ng_video_buf *in)
{
@@ -171,7 +171,7 @@ mjpg_bgr_compress(void *handle, struct ng_video_buf *out,
/* ---------------------------------------------------------------------- */
-void*
+static void*
mjpg_yuv_init(struct ng_video_fmt *out, void *priv)
{
struct mjpeg_handle *h;
@@ -189,7 +189,7 @@ mjpg_yuv_init(struct ng_video_fmt *out, void *priv)
jpeg_set_defaults(&h->mjpg_cinfo);
h->mjpg_cinfo.dct_method = JDCT_FASTEST;
- jpeg_set_quality(&h->mjpg_cinfo, ng_mjpeg_quality, TRUE);
+ jpeg_set_quality(&h->mjpg_cinfo, ng_jpeg_quality, TRUE);
h->mjpg_cinfo.raw_data_in = TRUE;
jpeg_set_colorspace(&h->mjpg_cinfo,JCS_YCbCr);
diff --git a/libng/plugins/Makefile.in b/libng/plugins/Makefile.in
new file mode 100644
index 0000000..7883acd
--- /dev/null
+++ b/libng/plugins/Makefile.in
@@ -0,0 +1,29 @@
+srcdir=@srcdir@
+VPATH=$(srcdir)
+
+include ../../Make.config
+
+CFLAGS=-g @CFLAGS@ $(WARN_FLAGS) $(LFS_FLAGS) -I../.. -I..
+PLUGINS=nop.so invert.so
+
+all build: $(PLUGINS)
+
+.SUFFIXES: .so .o
+.o.so:
+ gcc $(CFLAGS) -shared -Wl,-soname,$@ -o $@ $<
+
+clean:
+ rm -f $(PLUGINS) $(OBJS)
+
+distclean realclean: clean
+ rm -f Makefile *~ *.bak
+
+install: all
+ $(INSTALL_DIR) $(libdir)
+ $(INSTALL_PROGRAM) -s $(PLUGINS) $(libdir)
+
+depend dep:
+ $(DEPEND) -- $(CFLAGS) -- *.c
+
+#-------------------------------------------------------------------------
+# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/libng/plugins/invert.c b/libng/plugins/invert.c
new file mode 100644
index 0000000..9b71d37
--- /dev/null
+++ b/libng/plugins/invert.c
@@ -0,0 +1,135 @@
+/*
+ * simple libng filter -- just invert the image
+ *
+ * (c) 2001 Gerd Knorr <kraxel@bytesex.org>
+ *
+ */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#ifdef HAVE_ENDIAN_H
+# include <endian.h>
+#endif
+
+#include "grab-ng.h"
+
+/* ------------------------------------------------------------------- */
+
+static void inline
+invert_bytes(unsigned char *dst, unsigned char *src, int bytes)
+{
+ while (bytes--)
+ *(dst++) = 0xff - *(src++);
+}
+
+static void inline
+invert_native_rgb15(void *d, void *s, int pixels)
+{
+ unsigned short *dst = d;
+ unsigned short *src = s;
+ unsigned short r,g,b;
+
+ while (pixels--) {
+ r = 0x1f - ((*src >> 10) & 0x1f);
+ g = 0x1f - ((*src >> 5) & 0x1f);
+ b = 0x1f - ( *src & 0x1f);
+ *dst = (r << 10) | (g << 5) | b;
+ src++; dst++;
+ }
+}
+
+static void inline
+invert_native_rgb16(void *d, void *s, int pixels)
+{
+ unsigned short *dst = d;
+ unsigned short *src = s;
+ unsigned short r,g,b;
+
+ while (pixels--) {
+ r = 0x1f - ((*src >> 11) & 0x1f);
+ g = 0x3f - ((*src >> 5) & 0x3f);
+ b = 0x1f - ( *src & 0x1f);
+ *dst = (r << 11) | (g << 5) | b;
+ src++; dst++;
+ }
+}
+
+/* ------------------------------------------------------------------- */
+
+static void *init(struct ng_video_fmt *out)
+{
+ /* don't have to carry around status info */
+ static int dummy;
+ return &dummy;
+}
+
+static struct ng_video_buf*
+frame(void *handle, struct ng_video_buf *in)
+{
+ struct ng_video_buf *out;
+ unsigned char *dst;
+ unsigned char *src;
+ int y,cnt;
+
+ out = ng_malloc_video_buf(&in->fmt, in->fmt.height * in->fmt.bytesperline);
+ out->info = in->info;
+
+ dst = out->data;
+ src = in->data;
+ cnt = in->fmt.width * ng_vfmt_to_depth[in->fmt.fmtid] / 8;
+ for (y = 0; y < in->fmt.height; y++) {
+ switch (in->fmt.fmtid) {
+ case VIDEO_GRAY:
+ case VIDEO_BGR24:
+ case VIDEO_RGB24:
+ case VIDEO_BGR32:
+ case VIDEO_RGB32:
+ case VIDEO_YUV422:
+ invert_bytes(dst,src,cnt);
+ break;
+ case VIDEO_RGB15_NATIVE:
+ invert_native_rgb15(dst,src,in->fmt.width);
+ break;
+ case VIDEO_RGB16_NATIVE:
+ invert_native_rgb16(dst,src,in->fmt.width);
+ break;
+ }
+ dst += out->fmt.bytesperline;
+ src += in->fmt.bytesperline;
+ }
+
+ ng_release_video_buf(in);
+ return out;
+}
+
+static void fini(void *handle)
+{
+ /* nothing to clean up */
+}
+
+/* ------------------------------------------------------------------- */
+
+static struct ng_filter filter = {
+ name: "invert",
+ fmts:
+ (1 << VIDEO_GRAY) |
+ (1 << VIDEO_RGB15_NATIVE) |
+ (1 << VIDEO_RGB16_NATIVE) |
+ (1 << VIDEO_BGR24) |
+ (1 << VIDEO_RGB24) |
+ (1 << VIDEO_BGR32) |
+ (1 << VIDEO_RGB32) |
+ (1 << VIDEO_YUV422),
+ init: init,
+ frame: frame,
+ fini: fini,
+};
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_filter_register(&filter,1);
+}
diff --git a/libng/plugins/nop.c b/libng/plugins/nop.c
new file mode 100644
index 0000000..2f624e5
--- /dev/null
+++ b/libng/plugins/nop.c
@@ -0,0 +1,69 @@
+/*
+ * very simple libng filter -- does nothing.
+ * main purpose is to have one bugfree[tm] plugin for debugging.
+ *
+ * If you looking for a template for your own plugin better have a
+ * look at invert.c. This one is very simple too, but it serves
+ * better as template because it actually does something.
+ *
+ * (c) 2001 Gerd Knorr <kraxel@bytesex.org>
+ *
+ */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+#include "grab-ng.h"
+
+/* ------------------------------------------------------------------- */
+
+static void *init(struct ng_video_fmt *out)
+{
+ /* don't have to carry around status info */
+ static int dummy;
+ return &dummy;
+}
+
+static struct ng_video_buf*
+frame(void *handle, struct ng_video_buf *in)
+{
+ /* do nothing -- just return the frame as-is */
+ return in;
+}
+
+static void fini(void *handle)
+{
+ /* nothing to clean up */
+}
+
+/* ------------------------------------------------------------------- */
+
+static struct ng_filter filter = {
+ name: "nop",
+ fmts:
+ (1 << VIDEO_RGB08) |
+ (1 << VIDEO_GRAY) |
+ (1 << VIDEO_RGB15_LE) |
+ (1 << VIDEO_RGB16_LE) |
+ (1 << VIDEO_RGB15_BE) |
+ (1 << VIDEO_RGB16_BE) |
+ (1 << VIDEO_BGR24) |
+ (1 << VIDEO_BGR32) |
+ (1 << VIDEO_RGB24) |
+ (1 << VIDEO_RGB32) |
+ (1 << VIDEO_YUV422) |
+ (1 << VIDEO_YUV422P) |
+ (1 << VIDEO_YUV420P),
+ init: init,
+ frame: frame,
+ fini: fini,
+};
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_filter_register(&filter,1);
+}
diff --git a/libng/videodev2.h b/libng/videodev2.h
index eb37cd1..a05c08b 100644
--- a/libng/videodev2.h
+++ b/libng/videodev2.h
@@ -1,14 +1,19 @@
+#ifndef __LINUX_VIDEODEV2_H
+#define __LINUX_VIDEODEV2_H
/*
* Video for Linux Two
*
- * Header file for V4L2 drivers and applications.
+ * Header file for v4l or V4L2 drivers and applications, for
+ * Linux kernels 2.2.x or 2.4.x.
+ *
+ * See http://www.thedirks.org/v4l2/ for API specs and other
+ * v4l2 documentation.
*
* Author: Bill Dirks <bdirks@pacbell.net>
+ * Justin Schoeman
+ * et al.
*/
-#ifndef __LINUX_VIDEODEV_H
-#define __LINUX_VIDEODEV_H
-
#define V4L2_MAJOR_VERSION 0
#define V4L2_MINOR_VERSION 20
@@ -18,15 +23,14 @@
*/
/* Four-character-code (FOURCC) */
-#define fourcc(a,b,c,d)\
+#define v4l2_fourcc(a,b,c,d)\
(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
/* Open flag for non-capturing opens on capture devices */
#define O_NONCAP O_TRUNC
#define O_NOIO O_TRUNC
-/* Timestamp data type, 64-bit signed integer */
-/* Should be removed from here when UST is added to kernel */
+/* Timestamp data type, 64-bit signed integer, in nanoseconds */
#ifndef STAMP_T
#define STAMP_T
typedef __s64 stamp_t;
@@ -59,6 +63,8 @@ struct v4l2_capability
#define V4L2_TYPE_VTR 5 /* Is a tape recorder controller */
#define V4L2_TYPE_VTX 6 /* Is a teletext device */
#define V4L2_TYPE_RADIO 7 /* Is a radio device */
+#define V4L2_TYPE_VBI_INPUT 4 /* Is a VBI capture device */
+#define V4L2_TYPE_VBI_OUTPUT 9 /* Is a VBI output device */
#define V4L2_TYPE_PRIVATE 1000 /* Start of driver private types */
/* Flags for 'flags' field */
#define V4L2_FLAG_READ 0x00001 /* Can capture via read() call */
@@ -86,37 +92,47 @@ struct v4l2_pix_format
__u32 priv; /* private data, depends on pixelformat */
};
/* Pixel format FOURCC depth Description */
-#define V4L2_PIX_FMT_RGB332 fourcc('R','G','B','1') /* 8 RGB-3-3-2 */
-#define V4L2_PIX_FMT_RGB555 fourcc('R','G','B','O') /* 16 RGB-5-5-5 */
-#define V4L2_PIX_FMT_RGB565 fourcc('R','G','B','P') /* 16 RGB-5-6-5 */
-#define V4L2_PIX_FMT_BGR24 fourcc('B','G','R','3') /* 24 BGR-8-8-8 */
-#define V4L2_PIX_FMT_RGB24 fourcc('R','G','B','3') /* 24 RGB-8-8-8 */
-#define V4L2_PIX_FMT_BGR32 fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */
-#define V4L2_PIX_FMT_RGB32 fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */
-#define V4L2_PIX_FMT_GREY fourcc('G','R','E','Y') /* 8 Greyscale */
-#define V4L2_PIX_FMT_YVU410 fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */
-#define V4L2_PIX_FMT_YVU420 fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */
-#define V4L2_PIX_FMT_YUYV fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */
-#define V4L2_PIX_FMT_UYVY fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */
-#define V4L2_PIX_FMT_YVU422P fourcc('4','2','2','P') /* 16 YVU422 planar */
-#define V4L2_PIX_FMT_YVU411P fourcc('4','1','1','P') /* 16 YVU411 planar */
+#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */
+#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */
+#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */
+#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */
+#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */
+#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */
+#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */
+#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */
+#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */
+#define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */
+#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */
+#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */
+#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */
+#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */
+#if 0
+# define V4L2_PIX_FMT_YVU422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
+# define V4L2_PIX_FMT_YVU411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
+#endif
+#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
/* The following formats are not defined in the V4L2 specification */
-#define V4L2_PIX_FMT_YUV410 fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */
-#define V4L2_PIX_FMT_YUV420 fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */
-#define V4L2_PIX_FMT_YYUV fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */
-#define V4L2_PIX_FMT_HI240 fourcc('H','I','2','4') /* 8 8-bit color */
+#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */
+#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */
+#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */
+#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */
+
+/* Vendor-specific formats */
+#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compres */
/* Flags */
#define V4L2_FMT_FLAG_COMPRESSED 0x0001 /* Compressed format */
#define V4L2_FMT_FLAG_BYTESPERLINE 0x0002 /* bytesperline field valid */
+#define V4L2_FMT_FLAG_NOT_INTERLACED 0x0000
#define V4L2_FMT_FLAG_INTERLACED 0x0004 /* Image is interlaced */
#define V4L2_FMT_FLAG_TOPFIELD 0x0008 /* is a top field only */
#define V4L2_FMT_FLAG_BOTFIELD 0x0010 /* is a bottom field only */
#define V4L2_FMT_FLAG_ODDFIELD V4L2_FMT_FLAG_TOPFIELD
#define V4L2_FMT_FLAG_EVENFIELD V4L2_FMT_FLAG_BOTFIELD
#define V4L2_FMT_FLAG_COMBINED V4L2_FMT_FLAG_INTERLACED
+#define V4L2_FMT_FLAG_FIELD_field 0x001C
#define V4L2_FMT_CS_field 0xF000 /* Color space field mask */
#define V4L2_FMT_CS_601YUV 0x1000 /* ITU YCrCb color space */
#define V4L2_FMT_FLAG_SWCONVERSION 0x0800 /* used only in format enum. */
@@ -234,6 +250,7 @@ struct v4l2_buffer
#define V4L2_BUF_TYPE_EFFECTSOUT 0x00000006
#define V4L2_BUF_TYPE_VIDEOOUT 0x00000007
#define V4L2_BUF_TYPE_FXCONTROL 0x00000008
+#define V4L2_BUF_TYPE_VBI 0x00000009
/* Starting value of driver private buffer types */
#define V4L2_BUF_TYPE_PRIVATE 0x00001000
@@ -576,7 +593,7 @@ struct v4l2_fxcontrol
#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11)
-#define V4l2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
+#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
@@ -588,7 +605,7 @@ struct v4l2_fxcontrol
#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
-#define V4L2_CID_VCENTER (V4l2_CID_BASE+23)
+#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
#define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */
/* Remember to change fill_ctrl_category() in videodev.c */
@@ -685,12 +702,14 @@ struct v4l2_audioout
/*
* D A T A S E R V I C E S ( V B I )
+ *
+ * Data services API by Michael Schimek
*/
struct v4l2_vbi_format
{
__u32 sampling_rate; /* in 1 Hz */
- __u32 reserved1; /* must be zero */
+ __u32 offset;
__u32 samples_per_line;
__u32 sample_format; /* V4L2_VBI_SF_* */
__s32 start[2];
@@ -806,12 +825,6 @@ struct v4l2_streamparm
#ifdef __KERNEL__
/*
- * These things are used only by drivers.
- */
-
-extern int videodev_init(void);
-
-/*
*
* V 4 L 2 D R I V E R H E L P E R A P I
*
@@ -820,10 +833,11 @@ extern int videodev_init(void);
extern void v4l2_version(int *major, int *minor);
extern int v4l2_major_number(void);
+extern void v4l2_fill_ctrl_category(struct v4l2_queryctrl *qc);
/* Memory management */
extern unsigned long v4l2_vmalloc_to_bus(void *virt);
-extern unsigned long v4l2_vmalloc_to_page(void *virt);
+extern struct page *v4l2_vmalloc_to_page(void *virt);
/* Simple queue management */
struct v4l2_q_node
@@ -843,6 +857,7 @@ extern void *v4l2_q_del_tail(struct v4l2_queue *q);
extern void *v4l2_q_peek_head(struct v4l2_queue *q);
extern void *v4l2_q_peek_tail(struct v4l2_queue *q);
extern void *v4l2_q_yank_node(struct v4l2_queue *q, struct v4l2_q_node *node);
+extern int v4l2_q_last(struct v4l2_queue *q);
/* Math functions */
extern u32 v4l2_math_div6432(u64 a, u32 d, u32 *r);
@@ -882,48 +897,24 @@ extern int v4l2_video_std_construct(struct v4l2_standard *vs,
//#define V4L2_STD_SECAM_L 28 /* (France, Luxembourg, Monaco) */
//#define V4L2_STD_SECAM_M 29 /* (Jamaica) */
-/*
- * D E V I C E D R I V E R R E G I S T R A T I O N
- *
- */
-struct v4l2_device
-{
- char name[32];
- int type;
- int minor;
-
- int (*open)(struct v4l2_device *v,
- int flags, void **idptr);
- void (*close)(void *id);
- long (*read)(void *id,
- char *buf, unsigned long count, int noblock);
- long (*write)(void *id,
- const char *buf, unsigned long count, int noblock);
- int (*ioctl)(void *id,
- unsigned int cmd, void *arg);
- int (*mmap)(void *id,
- struct vm_area_struct *vma);
- int (*poll)(void *id,
- struct file *file, poll_table *table);
-
- int (*initialize)(struct v4l2_device *v);
- void *priv; /* may be used by the driver */
-
- int busy; /* open count maintained by videodev.c */
- void *v4l2_priv; /* for V4L2 use */
- int v4l2_reserved[4]; /* for V4L2 use */
-};
-
/* Size of kernel ioctl arg buffer used in ioctl handler */
#define V4L2_MAX_IOCTL_SIZE 256
-extern int v4l2_register_device(struct v4l2_device *);
-extern void v4l2_unregister_device(struct v4l2_device *);
-
-/* V4L2 structures */
-extern struct v4l2_device *v4l2_device_from_file(struct file *file);
-extern void *v4l2_openid_from_file(struct file *file);
-
-#endif/*ifdef __KERNEL__ */
-
+/* Compatibility layer interface */
+struct v4l2_v4l_compat
+{
+ int (*translate_ioctl)(struct inode *inode,
+ struct file *file,
+ int cmd,
+ void *arg);
+#if 0
+ void (*fix_offset)(struct file *file,
+ struct v4l2_device *vfl,
+ struct vm_area_struct *vma);
#endif
+};
+extern int v4l2_v4l_compat_register(struct v4l2_v4l_compat *);
+extern void v4l2_v4l_compat_unregister(struct v4l2_v4l_compat *);
+
+#endif /* __KERNEL__ */
+#endif /* __LINUX_VIDEODEV2_H */
diff --git a/libng/writeavi.c b/libng/writeavi.c
index 100ccdc..ff28f34 100644
--- a/libng/writeavi.c
+++ b/libng/writeavi.c
@@ -358,7 +358,7 @@ avi_open(char *filename, char *dummy,
{
const struct avi_video_priv *pvideo = priv_video;
struct avi_handle *h;
- int i,frame_bytes,depth,streams,rate;
+ int i,frame_bytes,depth,streams,rate,us_frame;
if (NULL == (h = malloc(sizeof(*h))))
return NULL;
@@ -390,7 +390,7 @@ avi_open(char *filename, char *dummy,
rate = 0;
if (h->video.fmtid != VIDEO_NONE) {
streams++;
- rate += pvideo->bytesperpixel * fps;
+ rate += pvideo->bytesperpixel * fps / 1000;
h->avi_hdr.avih.width = AVI_SWAP4(h->video.width);
h->avi_hdr.avih.height = AVI_SWAP4(h->video.height);
}
@@ -400,7 +400,8 @@ avi_open(char *filename, char *dummy,
ng_afmt_to_bits[h->audio.fmtid] *
h->audio.rate / 8;
}
- h->avi_hdr.avih.us_frame = AVI_SWAP4(1000000/fps);
+ us_frame = (long long)1000000000/fps;
+ h->avi_hdr.avih.us_frame = AVI_SWAP4(us_frame);
h->avi_hdr.avih.bps = AVI_SWAP4(rate);
h->avi_hdr.avih.streams = AVI_SWAP4(streams);
h->hdr_size += write(h->fd,&h->avi_hdr,sizeof(struct AVI_HDR));
@@ -414,7 +415,7 @@ avi_open(char *filename, char *dummy,
frame_bytes = pvideo->bytesperpixel * h->video.width * h->video.height;
depth = ng_vfmt_to_depth[h->video.fmtid];
h->frame_hdr.size = AVI_SWAP4(frame_bytes);
- h->avi_hdr_video.strh.scale = AVI_SWAP4(1000000/fps);
+ h->avi_hdr_video.strh.scale = AVI_SWAP4(us_frame);
h->avi_hdr_video.strh.rate = AVI_SWAP4(1000000);
h->avi_hdr_video.strf.size = AVI_SWAP4(sizeof(avi_hdr_video.strf));
h->avi_hdr_video.strf.width = AVI_SWAP4(h->video.width);
diff --git a/libng/writefile.c b/libng/writefile.c
index 5775f1c..6b39b0c 100644
--- a/libng/writefile.c
+++ b/libng/writefile.c
@@ -83,21 +83,15 @@ snap_filename(char *base, char *channel, char *ext)
/* ---------------------------------------------------------------------- */
-int write_jpeg(char *filename, struct ng_video_buf *buf,
- int quality, int gray)
+static int do_write_jpeg(FILE *fp, struct ng_video_buf *buf,
+ int quality, int gray)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
- FILE *fp;
int i;
unsigned char *line;
int line_length;
- if (NULL == (fp = fopen(filename,"w"))) {
- fprintf(stderr,"grab: can't open %s: %s\n",filename,strerror(errno));
- return -1;
- }
-
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_compress(&cinfo);
jpeg_stdio_dest(&cinfo, fp);
@@ -121,6 +115,32 @@ int write_jpeg(char *filename, struct ng_video_buf *buf,
return 0;
}
+int write_jpeg(char *filename, struct ng_video_buf *buf,
+ int quality, int gray)
+{
+ FILE *fp;
+
+ if (NULL == (fp = fopen(filename,"w"))) {
+ fprintf(stderr,"grab: can't open %s: %s\n",filename,strerror(errno));
+ return -1;
+ }
+ return do_write_jpeg(fp,buf,quality,gray);
+}
+
+#if 0
+int write_jpeg_fd(int fd, struct ng_video_buf *buf,
+ int quality, int gray)
+{
+ FILE *fp;
+
+ if (NULL == (fp = fdopen(fd,"w"))) {
+ fprintf(stderr,"grab: can't fdopen(%d): %s\n",fd,strerror(errno));
+ return -1;
+ }
+ return do_write_jpeg(fp,buf,quality,gray);
+}
+#endif
+
int write_ppm(char *filename, struct ng_video_buf *buf)
{
FILE *fp;
@@ -270,7 +290,7 @@ struct files_handle {
int wav_size;
/* misc */
- int gotcha;
+ int gotcha;
};
static void*
@@ -364,10 +384,15 @@ files_close(void *handle)
/* ---------------------------------------------------------------------- */
+struct raw_priv {
+ int yuv4mpeg;
+};
+
struct raw_handle {
/* format */
struct ng_video_fmt video;
struct ng_audio_fmt audio;
+ const struct raw_priv *vpriv;
/* video file*/
int fd;
@@ -384,6 +409,7 @@ raw_open(char *videoname, char *audioname,
struct ng_audio_fmt *audio, const void *priv_audio)
{
struct raw_handle *h;
+ int frame_rate_code = 0;
if (NULL == (h = malloc(sizeof(*h))))
return NULL;
@@ -392,6 +418,7 @@ raw_open(char *videoname, char *audioname,
memset(h,0,sizeof(*h));
h->video = *video;
h->audio = *audio;
+ h->vpriv = priv_video;
/* audio */
if (h->audio.fmtid != AUDIO_NONE) {
@@ -406,6 +433,22 @@ raw_open(char *videoname, char *audioname,
/* video */
if (h->video.fmtid != VIDEO_NONE) {
+ if (h->vpriv && h->vpriv->yuv4mpeg) {
+ switch (fps) {
+ case 23976: frame_rate_code = 1; break; /* 24000 / 1001 */
+ case 24000: frame_rate_code = 2; break;
+ case 25000: frame_rate_code = 3; break;
+ case 29970: frame_rate_code = 4; break; /* 30000 / 1001 */
+ case 30000: frame_rate_code = 5; break;
+ case 50000: frame_rate_code = 6; break;
+ case 59940: frame_rate_code = 7; break; /* 60000 / 1001 */
+ case 60000: frame_rate_code = 8; break;
+ default:
+ fprintf(stderr,"illegal frame rate\n");
+ free(h);
+ return NULL;
+ }
+ }
if (NULL != videoname) {
h->fd = open(videoname, O_CREAT | O_RDWR | O_TRUNC, 0666);
if (-1 == h->fd) {
@@ -418,6 +461,12 @@ raw_open(char *videoname, char *audioname,
} else {
h->fd = 1; /* use stdout */
}
+ if (h->vpriv && h->vpriv->yuv4mpeg) {
+ char header[64];
+ sprintf(header, "YUV4MPEG %d %d %d\n",
+ h->video.width, h->video.height,frame_rate_code);
+ write(h->fd, header, strlen(header));
+ }
}
return h;
@@ -428,6 +477,9 @@ raw_video(void *handle, struct ng_video_buf *buf)
{
struct raw_handle *h = handle;
+ if (h->vpriv && h->vpriv->yuv4mpeg)
+ if (6 != write(h->fd, "FRAME\n", 6))
+ return -1;
if (buf->size != write(h->fd,buf->data,buf->size))
return -1;
return 0;
@@ -479,6 +531,10 @@ static const struct ng_format_list files_vformats[] = {
}
};
+static const struct raw_priv yuv4mpeg = {
+ yuv4mpeg: 1
+};
+
static const struct ng_format_list raw_vformats[] = {
{
name: "rgb",
@@ -497,6 +553,12 @@ static const struct ng_format_list raw_vformats[] = {
ext: "raw",
fmtid: VIDEO_YUV422P,
},{
+ name: "4mpeg",
+ desc: "yuv4mpeg (for mpeg2enc)",
+ ext: "yuv",
+ fmtid: VIDEO_YUV420P,
+ priv: &yuv4mpeg,
+ },{
/* EOF */
}
};
diff --git a/libng/writeqt.c b/libng/writeqt.c
index cfaf85d..3fc5db5 100644
--- a/libng/writeqt.c
+++ b/libng/writeqt.c
@@ -5,6 +5,9 @@
#include <stdio.h>
#include <pthread.h>
#include <quicktime/quicktime.h>
+#ifdef HAVE_ENDIAN_H
+# include <endian.h>
+#endif
#include "grab-ng.h"
@@ -13,6 +16,7 @@
struct qt_video_priv {
const char codec[4];
const int libencode;
+ const int yuvsign;
};
struct qt_audio_priv {
@@ -31,13 +35,15 @@ struct qt_handle {
/* misc */
int lib_video;
int lib_audio;
+ int yuvsign;
int audio_sample;
unsigned char **rows;
+ unsigned char *data;
};
/* ----------------------------------------------------------------------- */
-void*
+static void*
qt_open(char *filename, char *dummy,
struct ng_video_fmt *video, const void *priv_video, int fps,
struct ng_audio_fmt *audio, const void *priv_audio)
@@ -52,8 +58,10 @@ qt_open(char *filename, char *dummy,
memset(h,0,sizeof(*h));
h->video = *video;
h->audio = *audio;
- if (h->video.fmtid != VIDEO_NONE)
+ if (h->video.fmtid != VIDEO_NONE) {
h->lib_video = pvideo->libencode;
+ h->yuvsign = pvideo->yuvsign;
+ }
if (h->audio.fmtid != AUDIO_NONE)
h->lib_audio = paudio->libencode;
@@ -64,6 +72,9 @@ qt_open(char *filename, char *dummy,
if (h->lib_video)
if (NULL == (h->rows = malloc(h->video.height * sizeof(char*))))
goto fail;
+ if (h->yuvsign)
+ if (NULL == (h->data = malloc(h->video.height * h->video.width * 2)))
+ goto fail;
if (h->audio.fmtid != AUDIO_NONE) {
quicktime_set_audio(h->fh,
@@ -79,8 +90,8 @@ qt_open(char *filename, char *dummy,
}
}
if (h->video.fmtid != VIDEO_NONE) {
- quicktime_set_video(h->fh,1,h->video.width,h->video.height,fps,
- (char*)pvideo->codec);
+ quicktime_set_video(h->fh,1,h->video.width,h->video.height,
+ (float)fps/1000,(char*)pvideo->codec);
if (h->lib_video && !quicktime_supported_video(h->fh, 0)) {
fprintf(stderr,"libquicktime: video codec not supported\n");
goto fail;
@@ -92,15 +103,18 @@ qt_open(char *filename, char *dummy,
fail:
if (h->rows)
free(h->rows);
+ if (h->data)
+ free(h->data);
free(h);
return NULL;
}
-int
+static int
qt_video(void *handle, struct ng_video_buf *buf)
{
struct qt_handle *h = handle;
- int rc;
+ unsigned int *src,*dest;
+ int rc,i,n;
if (h->lib_video) {
int row,len;
@@ -111,13 +125,28 @@ qt_video(void *handle, struct ng_video_buf *buf)
for (row = 0, line = buf->data; row < h->video.height; row++, line += len)
h->rows[row] = line;
rc = quicktime_encode_video(h->fh, h->rows, 0);
+
+ } else if (h->yuvsign) {
+ dest = (unsigned int *)h->data;
+ src = (unsigned int *)buf->data;
+ n = buf->size / 4;
+ /* U V values are signed but Y R G B values are unsigned. */
+ for (i = 0; i < n; i++) {
+#if BYTE_ORDER == BIG_ENDIAN
+ *(dest++) = *(src++) ^ 0x00800080;
+#else
+ *(dest++) = *(src++) ^ 0x80008000;
+#endif
+ }
+ rc = quicktime_write_frame(h->fh, h->data, buf->size, 0);
+
} else {
rc = quicktime_write_frame(h->fh, buf->data, buf->size, 0);
}
return rc;
}
-int
+static int
qt_audio(void *handle, struct ng_audio_buf *buf)
{
struct qt_handle *h = handle;
@@ -130,7 +159,7 @@ qt_audio(void *handle, struct ng_audio_buf *buf)
}
}
-int
+static int
qt_close(void *handle)
{
struct qt_handle *h = handle;
@@ -138,6 +167,9 @@ qt_close(void *handle)
quicktime_close(h->fh);
if (h->rows)
free(h->rows);
+ if (h->data)
+ free(h->data);
+ free(h);
return 0;
}
@@ -150,6 +182,11 @@ static const struct qt_video_priv qt_raw = {
static const struct qt_video_priv qt_yuv2 = {
codec: QUICKTIME_YUV2,
libencode: 0,
+ yuvsign: 1,
+};
+static const struct qt_video_priv qt_yv12 = {
+ codec: QUICKTIME_YUV420,
+ libencode: 0,
};
static const struct qt_video_priv qt_jpeg = {
codec: QUICKTIME_JPEG,
@@ -169,13 +206,16 @@ static const struct ng_format_list qt_vformats[] = {
ext: "mov",
fmtid: VIDEO_RGB24,
priv: &qt_raw,
-#if 0 /* FIXME: looks funny, byteswapped? */
},{
name: "yuv2",
ext: "mov",
fmtid: VIDEO_YUV422,
priv: &qt_yuv2,
-#endif
+ },{
+ name: "yv12",
+ ext: "mov",
+ fmtid: VIDEO_YUV420P,
+ priv: &qt_yv12,
},{
name: "jpeg",
ext: "mov",
diff --git a/libvbi/Makefile.in b/libvbi/Makefile.in
index 9f531b2..0718048 100644
--- a/libvbi/Makefile.in
+++ b/libvbi/Makefile.in
@@ -1,10 +1,9 @@
srcdir=@srcdir@
VPATH=$(srcdir)
-CC=@CC@
-DEPEND=@DEPEND@
+include ../Make.config
-CFLAGS=-O2 -g @VBIFLAGS@ #-Wall
+CFLAGS=-g @CFLAGS@ @VBIFLAGS@
# from alevt
OBJS=vbi.o fdset.o misc.o hamm.o lang.o cache.o \
diff --git a/libvbi/README b/libvbi/README
index b77bfa5..1311e37 100644
--- a/libvbi/README
+++ b/libvbi/README
@@ -1,6 +1,10 @@
-This is for vbi decoding. Taken from alevt 1.5.1.
+This is for vbi decoding. Taken from alevt 1.6.0
Changes:
* Makefile written from scratch.
* cache.c: removed help pages.
* vbi.c: removed "static" from vbi_handler
* export.c: removed "static" from fmt_page
+
+Fixes:
+ vbi.c: vbi_open(): BTTV_VBISIZE is _IOR(int) and therefore wants
+ a valid (dummy) pointer as arg.
diff --git a/libvbi/cache.c b/libvbi/cache.c
index 8d63cb8..dcd2caf 100644
--- a/libvbi/cache.c
+++ b/libvbi/cache.c
@@ -115,7 +115,7 @@ cache_put(struct cache *ca, struct vt_page *vtp)
{
struct cache_page *cp;
int h = hash(vtp->pgno);
-
+
for (cp = $ ca->hash[h].first; cp->node->next; cp = $ cp->node->next)
if (cp->page->pgno == vtp->pgno && cp->page->subno == vtp->subno)
break;
@@ -178,7 +178,7 @@ cache_foreach_pg(struct cache *ca, int pgno, int subno, int dir,
if (vtp = cache_lookup(ca, pgno, subno))
subno = vtp->subno;
else if (subno == ANY_SUB)
- subno = dir < 0 ? 0 : 99999;
+ subno = dir < 0 ? 0 : 0xffff;
for (;;)
{
diff --git a/libvbi/cache.h b/libvbi/cache.h
index 320719d..e81f25e 100644
--- a/libvbi/cache.h
+++ b/libvbi/cache.h
@@ -29,7 +29,7 @@ struct cache_ops
struct vt_page *(*put)(struct cache *ca, struct vt_page *vtp);
void (*reset)(struct cache *ca);
struct vt_page *(*foreach_pg)(struct cache *ca, int pgno, int subno,
- int dir, int (*func)(), void *data);
+ int dir, int (*func)(void), void *data);
int (*mode)(struct cache *ca, int mode, int arg);
};
diff --git a/libvbi/exp-gfx.c b/libvbi/exp-gfx.c
index d335eff..091ca10 100644
--- a/libvbi/exp-gfx.c
+++ b/libvbi/exp-gfx.c
@@ -7,81 +7,13 @@
#include "lang.h"
#include "export.h"
-#ifdef WITH_PNG
-#include <png.h>
-#endif
-
#include "font.h"
#define WW (W*CW) /* pixel width of window */
#define WH (H*CH) /* pixel hegiht of window */
-static int gfx_open(struct export *e);
-static int gfx_option(struct export *e, int opt, char *arg);
-static int ppm_output(struct export *e, char *name, struct fmt_page *pg);
-#ifdef WITH_PNG
-static int png_output(struct export *e, char *name, struct fmt_page *pg);
-#endif
-
-
-static char *gfx_opts[] = // module options
-{
- //"compression=<level>", // set compression level
- 0
-};
-
-/*struct gfx_data // private data in struct export
-{
-};
-*/
-
-struct export_module export_ppm[1] = // exported module definition
-{
- "ppm", // id
- "ppm", // extension
- gfx_opts, // options
- 0, // size
- gfx_open, // open
- 0, // close
- gfx_option, // option
- ppm_output // output
-};
-
-#ifdef WITH_PNG
-struct export_module export_png[1] = // exported module definition
-{
- "png", // id
- "png", // extension
- gfx_opts, // options
- 0, // size
- gfx_open, // open
- 0, // close
- gfx_option, // option
- png_output // output
-};
-#endif
-
///////////////////////////////////////////////////////
-
-#define D ((struct gfx_data *)e->data)
-
-static int
-gfx_open(struct export *e)
-{
- //e->reveal=1; // the default should be the same in all formats
- return 0;
-}
-
-static int
-gfx_option(struct export *e, int opt, char *arg)
-{
- switch (opt)
- {
- // no options at the moment...
- }
- return 0;
-}
-
+// COMMON ROUTINES FOR PPM AND PNG
static inline void
draw_char(unsigned char * colour_matrix,
@@ -116,7 +48,7 @@ draw_char(unsigned char * colour_matrix,
}
static void
-prepare_colour_matrix(//*struct export *e,
+prepare_colour_matrix(/*struct export *e,*/
struct fmt_page *pg,
unsigned char *colour_matrix)
{
@@ -150,12 +82,31 @@ prepare_colour_matrix(//*struct export *e,
return;
}
+
+
+///////////////////////////////////////////////////////
+// STUFF FOR PPM OUTPUT
+
+static int ppm_output(struct export *e, char *name, struct fmt_page *pg);
+
+struct export_module export_ppm[1] = // exported module definition
+{
+ "ppm", // id
+ "ppm", // extension
+ 0, // options
+ 0, // size
+ 0, // open
+ 0, // close
+ 0, // option
+ ppm_output // output
+};
+
static int
ppm_output(struct export *e, char *name, struct fmt_page *pg)
{
FILE *fp;
long n;
- const u8 rgb1[][3]={{0,0,0},
+ static u8 rgb1[][3]={{0,0,0},
{1,0,0},
{0,1,0},
{1,1,0},
@@ -199,7 +150,67 @@ ppm_output(struct export *e, char *name, struct fmt_page *pg)
return 0;
}
+
+
+///////////////////////////////////////////////////////
+// STUFF FOR PNG OUTPUT
+
#ifdef WITH_PNG
+
+#include <png.h>
+static int png_open(struct export *e);
+static int png_option(struct export *e, int opt, char *arg);
+static int png_output(struct export *e, char *name, struct fmt_page *pg);
+
+static char *png_opts[] = // module options
+{
+ "compression=<0-9>", // set compression level
+ 0
+};
+
+struct png_data // private data in struct export
+{
+ int compression;
+};
+
+struct export_module export_png[1] = // exported module definition
+{
+ "png", // id
+ "png", // extension
+ png_opts, // options
+ sizeof(struct png_data), // size
+ png_open, // open
+ 0, // close
+ png_option, // option
+ png_output // output
+};
+
+#define D ((struct png_data *)e->data)
+
+
+
+static int
+png_open(struct export *e)
+{
+ //e->reveal=1; // the default should be the same in all formats
+ D->compression = Z_DEFAULT_COMPRESSION;
+ return 0;
+}
+
+static int
+png_option(struct export *e, int opt, char *arg)
+{
+ switch (opt)
+ {
+ case 1: // compression=
+ if (*arg >= '0' && *arg <= '9')
+ D->compression = *arg - '0';
+ break;
+ }
+ return 0;
+}
+
+
static int
png_output(struct export *e, char *name, struct fmt_page *pg)
{
@@ -208,7 +219,7 @@ png_output(struct export *e, char *name, struct fmt_page *pg)
png_structp png_ptr;
png_infop info_ptr;
png_byte *row_pointers[WH];
- const u8 rgb8[][3]={{ 0, 0, 0},
+ static u8 rgb8[][3]={{ 0, 0, 0},
{255, 0, 0},
{ 0,255, 0},
{255,255, 0},
@@ -253,7 +264,7 @@ png_output(struct export *e, char *name, struct fmt_page *pg)
return -1;
}
png_init_io(png_ptr, fp);
- png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);
+ png_set_compression_level(png_ptr, D->compression);
png_set_compression_mem_level(png_ptr, 9);
png_set_compression_window_bits(png_ptr, 15);
png_set_IHDR(png_ptr, info_ptr, WW, WH,
@@ -272,4 +283,5 @@ png_output(struct export *e, char *name, struct fmt_page *pg)
fclose(fp);
return 0;
}
-#endif
+
+#endif /* WITH_PNG */
diff --git a/libvbi/exp-html.c b/libvbi/exp-html.c
index c016b57..bbad276 100644
--- a/libvbi/exp-html.c
+++ b/libvbi/exp-html.c
@@ -134,7 +134,7 @@ if (!D->bare)
int last_nonblank=0;
int first_unprinted=0;
int last_space=1;
- // previous char was &nbsp
+ // previous char was &nbsp;
// is used for deciding to put semicolon or not
int nbsp=0;
@@ -214,7 +214,7 @@ if (!D->bare)
{
if (last_space)
{
- fprintf(fp,"&nbsp");
+ fprintf(fp,"&nbsp;");
last_space=0;
nbsp=1;
}
@@ -251,7 +251,7 @@ if (!D->bare)
{
if (last_space)
{
- fprintf(fp,"&nbsp");
+ fprintf(fp,"&nbsp;");
last_space=0;
nbsp=1;
}
diff --git a/libvbi/exp-txt.c b/libvbi/exp-txt.c
index bec6c23..87bf257 100644
--- a/libvbi/exp-txt.c
+++ b/libvbi/exp-txt.c
@@ -102,7 +102,7 @@ txt_option(struct export *e, int opt, char *arg)
static void
put_attr(struct export *e, struct fmt_char *new)
{
- char buf[64];
+ char buf[512];
char *p = buf;
int fg, bg, attr;
int reset = 0;
diff --git a/libvbi/export.c b/libvbi/export.c
index 8d8e292..8b54dbe 100644
--- a/libvbi/export.c
+++ b/libvbi/export.c
@@ -184,7 +184,7 @@ adjust(char *p, char *str, char fill, int width)
{
int l = width - strlen(str);
- while (l > 0)
+ while (l-- > 0)
*p++ = fill;
while (*p = *str++)
p++;
diff --git a/libvbi/os.h b/libvbi/os.h
index e2fbc32..30de56a 100644
--- a/libvbi/os.h
+++ b/libvbi/os.h
@@ -4,12 +4,6 @@
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBsd__) \
|| defined(__bsdi__)
#define BSD
-#define DEFAULT_SMALL_BUF
-#endif
-
-#if defined(__linux__)
-/* people with the 2.2 kernel's bttv driver may want to define this... */
-//#define DEFAULT_SMALL_BUF
#endif
#endif /* OS_H */
diff --git a/libvbi/vbi.c b/libvbi/vbi.c
index b006ad0..f4855c1 100644
--- a/libvbi/vbi.c
+++ b/libvbi/vbi.c
@@ -12,21 +12,48 @@
#include "hamm.h"
#include "lang.h"
+#define KRAXEL_DEBUG 1
+#define FAC (1<<16) // factor for fix-point arithmetic
-#define BPL 2048
-#define FAC (1<<16)
-#define STEP 335062 // (int)(35.468950/6.9375*FAC+.5) // PAL!
+static u8 *rawbuf; // one common buffer for raw vbi data.
+static int rawbuf_size; // its current size
+
+
+/***** bttv api *****/
#define BASE_VIDIOCPRIVATE 192
#define BTTV_VERSION _IOR('v' , BASE_VIDIOCPRIVATE+6, int)
#define BTTV_VBISIZE _IOR('v' , BASE_VIDIOCPRIVATE+8, int)
+/***** v4l2 vbi-api *****/
+
+struct v4l2_vbi_format
+{
+ u32 sampling_rate; /* in 1 Hz */
+ u32 offset; /* sampling starts # samples after rising hs */
+ u32 samples_per_line;
+ u32 sample_format; /* V4L2_VBI_SF_* */
+ s32 start[2];
+ u32 count[2];
+ u32 flags; /* V4L2_VBI_* */
+ u32 reserved2; /* must be zero */
+};
+
+struct v4l2_format
+{
+ u32 type; /* V4L2_BUF_TYPE_* */
+ union
+ {
+ struct v4l2_vbi_format vbi; /* VBI data */
+ u8 raw_data[200]; /* user-defined */
+ } fmt;
+};
-static u8 rawbuf[BPL*19*2]; // one global buffer for raw vbi data
- // (putting this on the stack may trash the mm-system)
+#define V4L2_VBI_SF_UBYTE 1
+#define V4L2_BUF_TYPE_VBI 0x00000009
+#define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format)
-int vbi_big_buf = -1;
-int vbi_fine_tune = 0; // delay decoding n/10 bit length
+/***** end of api definitions *****/
@@ -152,8 +179,13 @@ vt_line(struct vbi *vbi, u8 *p)
int err = 0;
hdr = hamm16(p, &err);
- if (err & 0xf000)
+ if (err & 0xf000) {
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("vt_line: hamm error\n",pkt);
+#endif
return -4;
+ }
mag = hdr & 7;
mag8 = mag?: 8;
@@ -163,6 +195,10 @@ vt_line(struct vbi *vbi, u8 *p)
rvtp = vbi->rpage + mag;
cvtp = rvtp->page;
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("vt_line: pkt=%d\n",pkt);
+#endif
switch (pkt)
{
case 0:
@@ -174,6 +210,12 @@ vt_line(struct vbi *vbi, u8 *p)
b3 = hamm16(p+4, &err); // subpage number + flags
b4 = hamm16(p+6, &err); // language code + more flags
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("vt_line: bytes %x %x %x %x err %x\n",
+ b1,b2,b3,b4,err);
+#endif
+
if (vbi->ppage->page->flags & PG_MAGSERIAL)
vbi_send_page(vbi, vbi->ppage, b1);
vbi_send_page(vbi, rvtp, b1);
@@ -306,17 +348,22 @@ vbi_line(struct vbi *vbi, u8 *p)
u8 data[43], min, max;
int dt[256], hi[6], lo[6];
int i, n, sync, thr;
+ int bpb = vbi->bpb;
/* remove DC. edge-detector */
- for (i = 40; i < 240; ++i)
- dt[i] = p[i+STEP/FAC] - p[i]; // amplifies the edges best.
+ for (i = vbi->soc; i < vbi->eoc; ++i)
+ dt[i] = p[i+bpb/FAC] - p[i]; // amplifies the edges best.
/* set barrier */
- for (i = 240; i < 256; i += 2)
+ for (i = vbi->eoc; i < vbi->eoc+16; i += 2)
dt[i] = 100, dt[i+1] = -100;
/* find 6 rising and falling edges */
- for (i = 40, n = 0; n < 6; ++n)
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("vbi_line:");
+#endif
+ for (i = vbi->soc, n = 0; n < 6; ++n)
{
while (dt[i] < 32)
i++;
@@ -324,13 +371,28 @@ vbi_line(struct vbi *vbi, u8 *p)
while (dt[i] > -32)
i++;
lo[n] = i;
+#if KRAXEL_DEBUG
+ if (debug)
+ printf(" %d-%d",hi[n],lo[n]);
+#endif
}
- if (i >= 240)
+ if (i >= vbi->eoc) {
+#if KRAXEL_DEBUG
+ if (debug)
+ printf(" - not enough periods found\n");
+#endif
return -1; // not enough periods found
+ }
- i = hi[5] - hi[1]; // length of 4 periods (8 bits), normally 40.9
- if (i < 39 || i > 42)
+ i = hi[5] - hi[1]; // length of 4 periods (8 bits)
+ if (i < vbi->bp8bl || i > vbi->bp8bh) {
+#if KRAXEL_DEBUG
+ if (debug)
+ printf(" - bad frequency [%d-%d / %d]\n",
+ vbi->bp8bl,vbi->bp8bh,i);
+#endif
return -1; // bad frequency
+ }
/* AGC and sync-reference */
min = 255, max = 0, sync = 0;
@@ -345,19 +407,28 @@ vbi_line(struct vbi *vbi, u8 *p)
p += sync;
/* search start-byte 11100100 */
- for (i = 4*STEP + vbi->pll_adj*STEP/10; i < 16*STEP; i += STEP)
- if (p[i/FAC] > thr && p[(i+STEP)/FAC] > thr) // two ones is enough...
+ for (i = 4*bpb + vbi->pll_adj*bpb/10; i < 16*bpb; i += bpb)
+ if (p[i/FAC] > thr && p[(i+bpb)/FAC] > thr) // two ones is enough...
{
/* got it... */
memset(data, 0, sizeof(data));
- for (n = 0; n < 43*8; ++n, i += STEP)
+ for (n = 0; n < 43*8; ++n, i += bpb)
if (p[i/FAC] > thr)
data[n/8] |= 1 << (n%8);
- if (data[0] != 0x27) // really 11100100? (rev order!)
+ if (data[0] != 0x27) { // really 11100100? (rev order!)
+#if KRAXEL_DEBUG
+ if (debug)
+ printf(" - 404 11100100 [0x27 != 0x%d]\n",data[0]);
+#endif
return -1;
+ }
+#if KRAXEL_DEBUG
+ if (debug)
+ printf(" - line ok\n");
+#endif
if (i = vt_line(vbi, data+1))
if (i < 0)
pll_add(vbi, 2, -i);
@@ -365,6 +436,10 @@ vbi_line(struct vbi *vbi, u8 *p)
pll_add(vbi, 1, i);
return 0;
}
+#if KRAXEL_DEBUG
+ if (debug)
+ printf(" - eof\n");
+#endif
return -1;
}
@@ -383,12 +458,21 @@ vbi_handler(struct vbi *vbi, int fd)
if (dl_empty(vbi->clients))
return;
- if (n != vbi->bufsize)
+ if (n != vbi->bufsize) {
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("size mismatch [%d / %d]\n",n,vbi->bufsize);
+#endif
return;
+ }
seq = *(u32 *)&rawbuf[n - 4];
if (vbi->seq+1 != seq)
{
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("out of sync [seq=%d]\n",seq);
+#endif
out_of_sync(vbi);
if (seq < 3 && vbi->seq >= 3)
vbi_reset(vbi);
@@ -396,7 +480,7 @@ vbi_handler(struct vbi *vbi, int fd)
vbi->seq = seq;
if (seq > 1) // the first may contain data from prev channel
- for (i = 0; i+BPL <= n; i += BPL)
+ for (i = 0; i+vbi->bpl <= n; i += vbi->bpl)
vbi_line(vbi, rawbuf + i);
}
@@ -433,6 +517,144 @@ vbi_del_handler(struct vbi *vbi, void *handler, void *data)
+static int
+set_decode_parms(struct vbi *vbi, struct v4l2_vbi_format *p)
+{
+ double fs; // sampling rate
+ double bpb; // bytes per bit
+ int soc, eoc; // start/end of clock run-in
+ int bpl; // bytes per line
+
+ if (p->sample_format != V4L2_VBI_SF_UBYTE)
+ {
+ error("v4l2: unsupported vbi data format");
+ return -1;
+ }
+
+ // some constants from the standard:
+ // horizontal frequency fh = 15625Hz
+ // teletext bitrate ft = 444*fh = 6937500Hz
+ // teletext identification sequence 10101010 10101010 11100100
+ // 13th bit of seq rel to falling hsync 12us -1us +0.4us
+ // I search for the clock run-in (10101010 10101010) from 12us-1us-12.5/ft
+ // (earliest first bit) to 12us+0.4us+3.5/ft (latest last bit)
+ // earlist first bit tf = 12us-1us-12.5/ft = 9.2us
+ // latest last bit tl = 12us+0.4us+3.5/ft = 12.9us
+ // total number of used bits n = (2+1+2+40)*8 = 360
+
+ bpl = p->samples_per_line;
+ fs = p->sampling_rate;
+ bpb = fs/6937500.0;
+ soc = (int)(9.2e-6*fs) - (int)p->offset;
+ eoc = (int)(12.9e-6*fs) - (int)p->offset;
+ if (soc < 0)
+ soc = 0;
+ if (eoc > bpl - (int)(43*8*bpb))
+ eoc = bpl - (int)(43*8*bpb);
+ if (eoc - soc < (int)(16*bpb))
+ {
+ // line too short or offset too large or wrong sample_rate
+ error("v4l2: broken vbi format specification [%d-%d @ %lf]",
+ soc,eoc,bpb);
+ return -1;
+ }
+ if (eoc > 240)
+ {
+ // the vbi_line routine can hold max 240 values in its work buffer
+ error("v4l2: unable to handle these sampling parameters");
+ return -1;
+ }
+
+ vbi->bpb = bpb * FAC + 0.5;
+ vbi->soc = soc;
+ vbi->eoc = eoc;
+ vbi->bp8bl = 0.97 * 8*bpb; // -3% tolerance
+ vbi->bp8bh = 1.03 * 8*bpb; // +3% tolerance
+
+ vbi->bpl = bpl;
+ vbi->bufsize = bpl * (p->count[0] + p->count[1]);
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("params: %d - %d @ %f\n",
+ vbi->soc,vbi->eoc, (float)vbi->bpb / FAC);
+#endif
+
+ return 0;
+}
+
+
+static int
+setup_dev(struct vbi *vbi)
+{
+ struct v4l2_format v4l2_format[1];
+ struct v4l2_vbi_format *vbifmt = &v4l2_format->fmt.vbi;
+ int dummy;
+
+ if (ioctl(vbi->fd, VIDIOC_G_FMT, v4l2_format) == -1
+ || v4l2_format->type != V4L2_BUF_TYPE_VBI)
+ {
+ // not a v4l2 device. assume bttv and create a standard fmt-struct.
+ int size;
+
+ vbifmt->sample_format = V4L2_VBI_SF_UBYTE;
+ vbifmt->sampling_rate = 35468950;
+ vbifmt->samples_per_line = 2048;
+ vbifmt->offset = 244;
+ if ((size = ioctl(vbi->fd, BTTV_VBISIZE, &dummy)) == -1)
+ {
+ // BSD or older bttv driver.
+ vbifmt->count[0] = 16;
+ vbifmt->count[1] = 16;
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("device: old bttv / bsd\n");
+#endif
+ }
+ else if (size % 2048)
+ {
+ error("broken bttv driver (bad buffer size)");
+ return -1;
+ }
+ else
+ {
+ size /= 2048;
+ vbifmt->count[0] = size/2;
+ vbifmt->count[1] = size - size/2;
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("device: new bttv [%d]\n",size);
+#endif
+ }
+ } else {
+#if KRAXEL_DEBUG
+ if (debug)
+ printf("device: v4l2\n");
+#endif
+ }
+
+ if (set_decode_parms(vbi, vbifmt) == -1)
+ return -1;
+
+ if (vbi->bpl < 1 || vbi->bufsize < vbi->bpl || vbi->bufsize % vbi->bpl != 0)
+ {
+ error("strange size of vbi buffer (%d/%d)", vbi->bufsize, vbi->bpl);
+ return -1;
+ }
+
+ // grow buffer if necessary
+ if (rawbuf_size < vbi->bufsize)
+ {
+ if (rawbuf)
+ free(rawbuf);
+ if (not(rawbuf = malloc(rawbuf_size = vbi->bufsize)))
+ out_of_mem(rawbuf_size); // old buffer already freed. abort.
+ }
+
+ return 0;
+}
+
+
+
struct vbi *
vbi_open(char *vbi_name, struct cache *ca, int fine_tune, int big_buf)
{
@@ -455,23 +677,11 @@ vbi_open(char *vbi_name, struct cache *ca, int fine_tune, int big_buf)
goto fail2;
}
- if ((vbi->bufsize = ioctl(vbi->fd, BTTV_VBISIZE)) == -1)
- {
- // big_buf == -1 default, 0 small, 1 large buffer
-#ifdef DEFAULT_SMALL_BUF
- vbi->bufsize = big_buf==1 ? 19*2*2048 : 16*2*2048; // small is def
-#else
- vbi->bufsize = big_buf!=0 ? 19*2*2048 : 16*2*2048; // large is def
-#endif
- }
- else if (vbi->bufsize < BPL || vbi->bufsize > (int)sizeof(rawbuf)
- || vbi->bufsize % BPL != 0)
- {
- error("illegal size of bttv driver's buffer (%d bytes)", vbi->bufsize);
+ if (big_buf != -1)
+ error("-oldbttv/-newbttv is obsolete. option ignored.");
+
+ if (setup_dev(vbi) == -1)
goto fail3;
- }
- else if (big_buf != -1)
- error("-oldbttv/-newbttv option ignored.");
vbi->cache = ca;
diff --git a/libvbi/vbi.h b/libvbi/vbi.h
index 87c0590..086ff6b 100644
--- a/libvbi/vbi.h
+++ b/libvbi/vbi.h
@@ -19,19 +19,23 @@ struct vbi
int fd;
struct cache *cache;
struct dl_head clients[1];
- int bufsize; // 32*2k or 38*2k (depending on bttv version)
+ // raw buffer management
+ int bufsize; // nr of bytes sent by this device
+ int bpl; // bytes per line
u32 seq;
+ // page assembly
struct raw_page rpage[8]; // one for each magazin
struct raw_page *ppage; // points to page of previous pkt0
- /*
- struct vt_page page[8]; // one for each magazin
- struct vt_page *ppage; // points to page of previous pkt0
- */
+ // phase correction
int pll_fixed; // 0 = auto, 1..2*PLL_ADJUST+1 = fixed
int pll_adj;
int pll_dir;
int pll_cnt;
int pll_err, pll_lerr;
+ // v4l2 decoder data
+ int bpb; // bytes per bit * 2^16
+ int bp8bl, bp8bh; // bytes per 8-bit low/high
+ int soc, eoc; // start/end of clock run-in
};
struct vbi_client
diff --git a/man/Makefile.in b/man/Makefile.in
index b318dc9..c2d09cc 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -1,20 +1,15 @@
srcdir=@srcdir@
-ROOT=
-prefix=@prefix@
-mandir=$(ROOT)@mandir@
-
-INSTALL=@INSTALL@
-INSTALL_DATA=@INSTALL_DATA@
-INSTALL_DIR=mkdir -p
+include ../Make.config
all build:
-install: all
- $(INSTALL_DIR) $(mandir)/man1
- for page in $(srcdir)/*.man; do \
- dest=`basename $$page .man`; \
- $(INSTALL_DATA) $$page $(mandir)/man1/$$dest.1; \
+install:
+ for sec in 1 5 8; do \
+ $(INSTALL_DIR) $(mandir)/man$$sec; \
+ for page in $(srcdir)/*.$$sec; do \
+ $(INSTALL_DATA) $$page $(mandir)/man$$sec; \
+ done; \
done
clean:
diff --git a/man/fbtv.man b/man/fbtv.1
index 59e59a5..05eed38 100644
--- a/man/fbtv.man
+++ b/man/fbtv.1
@@ -23,13 +23,13 @@ set basestring for the snapshot output files. The filename will be
Be verbose.
.TP
.B -c device
-video4linux device (default is /dev/video).
+video4linux device (default is /dev/video0).
.TP
.B -d device
framebuffer device (default is $FRAMEBUFFER; /dev/fb0 if unset)
.TP
.B -g
-grayscaled display (works for for 256 color mode only)
+grayscaled display (works for 256 color mode only)
.TP
.B -s widthxheight
display the TV picture in
@@ -40,11 +40,16 @@ size in the upper right corner.
.TP
.B -f font
font for text. Default is to look for lat1-16.psf in
-/usr/lib/kbd/consolefonts and /usr/share/consolefonts.
+/usr/lib/kbd/consolefonts and /usr/share/consolefonts. If you have a
+local X11 font server running (or the FONTSERVER environment variable
+set to some working server), you can also give X11 font specs here.
.TP
.B -m mode
video mode for TV. fbtv will look up the mode in /etc/fb.modes.
.TP
+.B -j joydev
+joystick device to use for controlling fbtv.
+.TP
.B -k
keep capture on when switching consoles. Might be useful together
with -s switch, you have a video picture while working on another
@@ -78,6 +83,7 @@ left/right fine tuning
pgup/pgdown station up/down
ESC,Q \fBQ\fPuit
+X \fBQ\fPuit, but leave sound on.
+/- Volume up/down
Enter mute
diff --git a/man/motv.1 b/man/motv.1
new file mode 100644
index 0000000..c066daf
--- /dev/null
+++ b/man/motv.1
@@ -0,0 +1,235 @@
+.TH motv 1 "(c) 1997-2001 Gerd Knorr"
+.SH NAME
+motv - a Motif program for watching TV
+.SH SYNOPSIS
+.B motv [ options ] [ station name ]
+.SH DESCRIPTION
+.B motv
+is a Motif application for watching TV with your unix box.
+.P
+It is basically xawtv with a more userfriendly GUI. It has the same
+features, uses the same config file, has the same command line
+switches, you can control it using xawtv-remote. Most keyboards
+shortcuts are identical too.
+.SH OPTIONS
+All command line options also have a Resource, so you can put them
+into your .Xdefaults file too.
+.TP
+\fB-h\fP, \fB-help\fP
+Print a short description of all command line options.
+.TP
+\fB-hwscan\fP
+Print a list of available devices.
+.TP
+\fB-f\fP, \fB-fullscreen\fP
+startup in fullscreen mode.
+.br
+Resource: motv.fullscreen (bool).
+.TP
+\fB-n\fP, \fB-noconf\fP
+don't read the config file ($HOME/.xawtv).
+.br
+Resource: motv.readconfig (bool).
+.TP
+\fB-o\fP, \fB-outfile\fP base
+set basestring for the snapshot output files. The filename will be
+"base-timestamp-nr.ext".
+.br
+Resource: motv.basename (string).
+.TP
+\fB-c\fP, \fB-device\fP device
+set video4linux device (default is /dev/video0). This option also
+disables Xvideo support.
+.br
+Resource: motv.device (string).
+.TP
+\fB-C\fP, \fB-dspdev\fP device
+set audio device (default is /dev/dsp).
+.br
+Resource: motv.dspdev (string).
+.TP
+\fB-vbidev\fP device
+set vbi device (default is /dev/vbi).
+.br
+Resource: motv.vbidev (string).
+.TP
+\fB-c\fP, \fB-xvport\fP number
+set Xvideo port (defaults to the first usable if Xvideo is available).
+This option also enables Xvideo support.
+.br
+Resource: motv.xvport (int).
+.TP
+\fB-joydev\fP device
+joystick device to use for controlling xawtv.
+.br
+Resource: xawtv.joydev (string).
+.TP
+\fB-v\fP, \fB-debug\fP level
+Be verbose,
+.B level
+may be 0 (default), 1 or 2. It exists just for debugging and
+trouble-shooting.
+.br
+Resource: motv.debug (int).
+.TP
+\fB-remote\fP
+X11 display is remote. This basically disables overlay mode, you
+might need this if xawtv failes to autodetect a remote X11 display.
+.br
+Resource: motv.remote (bool).
+.TP
+\fB-b\fP, \fB-bpp\fP n
+force xawtv into
+.B n
+bpp color depth. Works for switching between 15/16 and 24/32 bpp.
+This gets just passed through to v4l-conf(1).
+.br
+Resource: motv.bpp (int).
+.TP
+\fB-shift\fP n
+Shift the video display by
+.B n
+bytes. Try this if your video display is'nt within the xawtv window,
+some older matrox cards show this problem. This gets passed through
+to v4l-conf(1) too.
+.br
+Resource: motv.shift (int).
+.TP
+\fB-fb\fP
+Use the framebuffer device to determine the video framebuffer address
+(instead of the DGA extention). Yet another pass through argument.
+.br
+Resource: motv.fbdev (bool).
+.TP
+\fB-xv/-noxv \fP
+enable/disable the usage of the Xvideo extention (for overlay),
+default is on.
+.br
+Resource: motv.xvideo (bool).
+.TP
+\fB-scale/-noscale \fP
+enable/disable the usage of the Xvideo extention (for hardware scaling
+in grabdisplay mode), default is on.
+.br
+Resource: motv.hwscale (bool).
+.TP
+\fB-vm/-novm\fP
+enable/disable the usage of the VidMode extention, default is off.
+If there is a fullscreen video mode configured in the config file,
+the vidmode extention will be enabled automatically.
+.br
+Resource: motv.vidmode (bool).
+.TP
+\fB-dga/-nodga\fP
+enable/disable the usage of the DGA extention, default is on.
+.br
+Resource: motv.dga (bool).
+.TP
+\fB-parallel\fP n
+use n compression threads (default: one).
+.br
+Resource: xawtv.parallel (int).
+.P
+The usual Toolkit options like \fB-geometry\fP are supported too.
+.SH SUPPORTED HARDWARE / INTERFACES
+.TP
+.B v4l
+video4linux - \fBthe\fP linux video capture API.
+.TP
+.B v4l2
+video4linux two - new, improved capture interface which fixes a number
+of v4l design bugs.
+.TP
+.B bktr
+FreeBSD / OpenBSD driver for bt848/878 grabber cards.
+.TP
+.B Xvideo
+X11 Extention for video devices. Note that the Xvideo extention does
+support overlay only, you can't capture images/movies if the Xvideo
+extention is used. On the other hand this is the only way to scaled
+video overlay (i.e. fullscreen without black borders @ 1024x748) if
+both hardware and xfree86 driver support it. See README.xfree4 for
+more details and hints on how to setup Xvideo.
+.SH GETTING STARTED
+.B motv
+starts up with the TV window. The left mouse button shows a menu with
+all TV Stations (empty until you have defined some). The right mouse
+button brings up the control window.
+.P
+The first time you have configure motv, i.e. set TV norm and frequency
+table to the correct values. Check if the hardware works correctly
+(if tuning does not work it is very likely a driver configuration
+issue). If the hardware operates fine, you can let motv look for TV
+stations (Options => Channel scan). The channel buttons have a
+context menu for deleting and editing. Don't forget to save your
+configuration when you are done.
+.P
+You can also create/edit a config file with any text editor, see
+xawtvrc(5) for a description of the config file syntax. There are a
+number of config options which can only be set by editing the config
+file.
+.SH KEYBOARD SHORTCUTS
+Some of them work in the TV window only. The cursor keys for example
+are used by the motif toolkit to allow full keyboard control of the
+GUI and therefore have other functions in the control window.
+.P
+.nf
+V \fIV\fPideo (Capture) on/off
+A \fIA\fPudio on/off
+F \fIF\fPullscreen on/off
+G \fIG\fPrab picture (full size, ppm)
+J Grab picture (full size, \fIj\fPpeg)
+Ctrl+G \fIG\fPrab picture (window size, ppm)
+Ctrl+J Grab picture (window size, \fIj\fPpeg)
+Ctrl+C Copy to clipboard.
+C Popup \fIC\fPontrol Window
+R Popup AVI \fIR\fPecording Window
+S Popup \fIS\fPcale controls
+Z Channel Hopper (\fIz\fPapping, tune in every
+ station a few seconds)
+Ctrl+Z Fast Channel Hopping (grab the images for the
+ Channel Bottons)
+
+up/down tune up/down one channel
+left/right fine tuning
+pgup/pgdown station up/down (the ones you have in the config file)
+space next station (same as pgup)
+backspace previously tuned station
+Ctrl+up scan for next station
+
+ESC,Q \fIQ\fPuit
+
++/- Volume up/down (keypad)
+Enter mute (keypad)
+.fi
+.SH BUGS
+.B Bug reports with images attached go to /dev/null unseen.
+.P
+motv depends on a correct driver configuration. If you can't tune TV
+stations even if the settings in the options window are correct it is
+very likely a driver issue.
+.SH SEE ALSO
+xawtvrc(5), xawtv(1), fbtv(1), v4l-conf(1)
+.br
+http://bytesex.org/xawtv/ (homepage)
+.SH AUTHOR
+Gerd Knorr <kraxel@bytesex.org>
+.SH COPYRIGHT
+Copyright (C) 1997-2001 Gerd Knorr <kraxel@bytesex.org>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+.SH MISC
+Huh? Still with me? Looks like some people \fBdo\fP read manuals
+carefully.
diff --git a/man/rootv.man b/man/rootv.1
index 8a84ddd..8a84ddd 100644
--- a/man/rootv.man
+++ b/man/rootv.1
diff --git a/man/scantv.man b/man/scantv.1
index 7312bb6..4a03391 100644
--- a/man/scantv.man
+++ b/man/scantv.1
@@ -6,20 +6,36 @@ scantv - scan a v4l device for TV stations.
.SH DESCRIPTION
.B scantv
scans a v4l device for available TV stations and writes a
-xawtv/fbtv config file to stdout.
+xawtv/fbtv config file.
.SH OPTIONS
.TP
.B -n norm
-set tv \fBn\fPorm
+set tv \fBn\fPorm. scantv will ask interactively if
+none is given.
.TP
.B -f table
-set \fBf\fPrequency table.
+set \fBf\fPrequency table. scantv will ask interactively if
+none is given.
+.TP
+.B -o outfile
+specify \fBo\fPutput file. If none is specified, scantv write
+to stdout.
+.TP
+.B -c device
+specify video device file. Default is /dev/video0.
+.TP
+.B -C device
+specify vbi device file. Default is /dev/vbi.
+.TP
+.B -s
+skip channel \fBs\fPcan, just write norm + freqtab to the
+config file.
.SH SEE ALSO
xawtv(1), fbtv(1)
.SH AUTHOR
-Gerd Knorr <kraxel@goldbach.in-berlin.de>
+Gerd Knorr <kraxel@bytesex.org>
.SH COPYRIGHT
-Copyright (C) 2000 Gerd Knorr <kraxel@goldbach.in-berlin.de>
+Copyright (C) 2000 Gerd Knorr <kraxel@bytesex.org>
.P
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/man/streamer.1 b/man/streamer.1
new file mode 100644
index 0000000..0ad6b07
--- /dev/null
+++ b/man/streamer.1
@@ -0,0 +1,44 @@
+.TH streamer 1
+.SH NAME
+streamer - record audio and/or video
+.SH SYNOPSIS
+.B streamer [ options ]
+.SH DESCRIPTION
+.B streamer
+reads audio and/or video data from /dev/video0 and /dev/dsp and
+writes the data to the disk. Various output formats are supported.
+Start streamer with '-h' for a list of options and supported output
+formats.
+.P
+streamer will use the file extention of the output file name to figure
+which format to use. You need the -f/-F options only if the extention
+allows more than one format.
+.P
+You can savely stop the recording at any time with Ctrl+C. streamer
+will catch the signal and stop recording correctly (i.e. write movie
+file headers) before exiting.
+.SH EXAMPLES
+.TP
+.B streamer -o foobar.jpeg
+write a single jpeg file.
+.TP
+.B streamer -o quicktime.mov -f yuv2 -F stereo -r 12 -t 120
+record a short quicktime movie (120 frames / 12 fps => 10 seconds).
+.SH SEE ALSO
+xawtv(1), v4lctl(1)
+.SH AUTHOR
+Gerd Knorr <kraxel@bytesex.org>
+.SH COPYRIGHT
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+.P
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+.P
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/man/subtitles.1 b/man/subtitles.1
new file mode 100644
index 0000000..f2ac0e1
--- /dev/null
+++ b/man/subtitles.1
@@ -0,0 +1,20 @@
+.TH subtitles 1 "(c) 2000 Gerd Knorr"
+.SH NAME
+subtitles - display subtitles within xawtv.
+.SH SYNOPSIS
+.B subtitles [ -help | -tty ] <page>
+.SH DESCRIPTION
+.B subtitles
+fetches the given teletext page with the alevt-cap utility and
+displays it using xawtv-remote in an endless loop. It's most
+useful for pages which carry subtitles for the current TV program.
+It's page 150 in germany.
+.SH OPTIONS
+.TP
+.B -help
+print a short help text.
+.TP
+.B -tty
+dump a copy of the videotext page to the tty.
+.SH SEE ALSO
+xawtv(1), xawtv-remote(1), alevt-cap(1)
diff --git a/man/ttv.1 b/man/ttv.1
new file mode 100644
index 0000000..9513a92
--- /dev/null
+++ b/man/ttv.1
@@ -0,0 +1,41 @@
+.TH ttv 1 "(c) 2001 Gerd Knorr"
+.SH NAME
+ttv - display TV/video on a tty
+.SH SYNOPSIS
+.B ttv [ options ] [ station name ]
+.SH DESCRIPTION
+.B ttv
+displays TV/video on a terminal, rendering the images using aalib.
+.SH OPTIONS
+.TP
+.B -h
+print help text.
+.TP
+.B -f
+use fast aalib render function.
+.TP
+.B -c device
+video4linux device (default is /dev/video0).
+.P
+There are also lots of options for aalib, check the aalib documentation
+for more details on them. The help text includes a list.
+.SH SEE ALSO
+xawtv(1), fbtv(1)
+.SH AUTHOR
+Gerd Knorr <kraxel@bytesex.org>
+.SH COPYRIGHT
+Copyright (C) 2000 Gerd Knorr <kraxel@bytesex.org>
+.P
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+.P
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+.P
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/man/v4l-conf.man b/man/v4l-conf.8
index 7dedea4..7dedea4 100644
--- a/man/v4l-conf.man
+++ b/man/v4l-conf.8
diff --git a/man/v4lctl.man b/man/v4lctl.1
index f1509b1..f1509b1 100644
--- a/man/v4lctl.man
+++ b/man/v4lctl.1
diff --git a/man/xawtv-remote.man b/man/xawtv-remote.1
index e2d7f7e..f3e1201 100644
--- a/man/xawtv-remote.man
+++ b/man/xawtv-remote.1
@@ -11,8 +11,8 @@ and
.B v4lctl
can be used to control a video4linux driven TV card.
.B xawtv-remote
-passes the command to a already running xawtv instance using X11
-properties.
+passes the command to a already running xawtv or motv
+instance using X11 properties.
.B v4lctl
sets the parameters directly.
.SH OPTIONS
@@ -81,6 +81,13 @@ Set the parameter to the specified value. Range for all values is 0
accepted too and increase/decrease the parameter by one percent.
"volume" additionally accepts "mute".
.TP
+.B setattr <name> <value>
+Set set the value of some attribute (color, contrast, ... can be set
+this way too).
+.TP
+.B show [ <name> ]
+Show the value current of some attribute.
+.TP
.B snap [ jpeg | ppm ] [ full | win | widthxheight ] <filename>
Capture one image.
.TP
@@ -90,8 +97,24 @@ Capture one image. Does basically the same as "snap jpeg win
to a temporary file and renames it when done, so there is never
a invalid file.
.TP
-.B movie file <filename> | start | stop
-control xawtv's avi recorder.
+.B movie driver [ files | raw | avi | qt ]
+.TP
+.B movie video [ ppm | pgm | jpeg | rgb | gray | 422 | 422p | rgb15 | rgb24 | mjpeg | jpeg | raw | mjpa | png ]
+.TP
+.B movie fps <frames per second>
+.TP
+.B movie audio [ mono8 | mono16 | stereo ]
+.TP
+.B movie rate <sample rate>
+.TP
+.B movie fvideo <filename>
+.TP
+.B movie faudio <filename>
+.TP
+.B movie start
+.TP
+.B movie stop
+control xawtv's movie recorder.
.TP
.B fullscreen
Toggle fullscreen mode.
@@ -110,7 +133,8 @@ You can colorize the text with the control sequence "ESC foreground
background". foreground/background has the range 0-7 (ansi term colors).
Example: "\\03347 hello world " is blue on white. "\\033" must be a real
escape character, the string does'nt work. With the bash you'll get it
-with ^V ESC.
+with ^V ESC. vtx does also understand the ANSI tty escape sequences for
+color.
.TP
.B quit
quit xawtv
@@ -120,11 +144,11 @@ enter digit 'n'. That's the two-digit channel selection, entering two
digits within 5 seconds switches to the selected station. Useful for
lirc.
.SH SEE ALSO
-xawtv(1), fbtv(1)
+xawtv(1), motv(1), xawtvrc(5)
.SH AUTHOR
-Gerd Knorr <kraxel@goldbach.in-berlin.de>
+Gerd Knorr <kraxel@bytesex.org>
.SH COPYRIGHT
-Copyright (C) 1997-99 Gerd Knorr <kraxel@goldbach.in-berlin.de>
+Copyright (C) 1997-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
.P
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/man/xawtv.1 b/man/xawtv.1
new file mode 100644
index 0000000..8548368
--- /dev/null
+++ b/man/xawtv.1
@@ -0,0 +1,237 @@
+.TH xawtv 1 "(c) 1997-2001 Gerd Knorr"
+.SH NAME
+xawtv - a X11 program for watching TV
+.SH SYNOPSIS
+.B xawtv [ options ] [ station name ]
+.SH DESCRIPTION
+.B xawtv
+is a X11 application for watching TV with your unix box. It uses the
+Athena widgets.
+.SH OPTIONS
+All command line options also have a Resource, so you can put them
+into your .Xdefaults file too.
+.TP
+\fB-h\fP, \fB-help\fP
+Print a short description of all command line options.
+.TP
+\fB-hwscan\fP
+Print a list of available devices.
+.TP
+\fB-f\fP, \fB-fullscreen\fP
+startup in fullscreen mode.
+.br
+Resource: xawtv.fullscreen (bool).
+.TP
+\fB-n\fP, \fB-noconf\fP
+don't read the config file ($HOME/.xawtv).
+.br
+Resource: xawtv.readconfig (bool).
+.TP
+\fB-o\fP, \fB-outfile\fP base
+set basestring for the snapshot output files. The filename will be
+"base-timestamp-nr.ext".
+.br
+Resource: xawtv.basename (string).
+.TP
+\fB-c\fP, \fB-device\fP device
+set video4linux device (default is /dev/video0). This option also
+disables Xvideo support.
+.br
+Resource: xawtv.device (string).
+.TP
+\fB-C\fP, \fB-dspdev\fP device
+set audio device (default is /dev/dsp).
+.br
+Resource: xawtv.dspdev (string).
+.TP
+\fB-vbidev\fP device
+set vbi device (default is /dev/vbi).
+.br
+Resource: xawtv.vbidev (string).
+.TP
+\fB-c\fP, \fB-xvport\fP number
+set Xvideo port (defaults to the first usable if Xvideo is available).
+This option also enables Xvideo support.
+.br
+Resource: xawtv.xvport (int).
+.TP
+\fB-joydev\fP device
+joystick device to use for controlling xawtv.
+.br
+Resource: xawtv.joydev (string).
+.TP
+\fB-v\fP, \fB-debug\fP level
+Be verbose,
+.B level
+may be 0 (default), 1 or 2. It exists just for debugging and
+trouble-shooting.
+.br
+Resource: xawtv.debug (int).
+.TP
+\fB-remote\fP
+X11 display is remote. This basically disables overlay mode, you
+might need this if xawtv failes to autodetect a remote X11 display.
+.br
+Resource: xawtv.remote (bool).
+.TP
+\fB-b\fP, \fB-bpp\fP n
+force xawtv into
+.B n
+bpp color depth. Works for switching between 15/16 and 24/32 bpp.
+This gets just passed through to v4l-conf(1).
+.br
+Resource: xawtv.bpp (int).
+.TP
+\fB-shift\fP n
+Shift the video display by
+.B n
+bytes. Try this if your video display is'nt within the xawtv window,
+some older matrox cards show this problem. This gets passed through
+to v4l-conf(1) too.
+.br
+Resource: xawtv.shift (int).
+.TP
+\fB-fb\fP
+Use the framebuffer device to determine the video framebuffer address
+(instead of the DGA extention). Yet another pass through argument.
+.br
+Resource: xawtv.fbdev (bool).
+.TP
+\fB-xv/-noxv \fP
+enable/disable the usage of the Xvideo extention (for overlay),
+default is on.
+.br
+Resource: xawtv.xvideo (bool).
+.TP
+\fB-scale/-noscale \fP
+enable/disable the usage of the Xvideo extention (for hardware scaling
+in grabdisplay mode), default is on.
+.br
+Resource: xawtv.hwscale (bool).
+.TP
+\fB-vm/-novm\fP
+enable/disable the usage of the VidMode extention, default is off.
+If there is a fullscreen video mode configured in the config file,
+the vidmode extention will be enabled automatically.
+.br
+Resource: xawtv.vidmode (bool).
+.TP
+\fB-dga/-nodga\fP
+enable/disable the usage of the DGA extention, default is on.
+.br
+Resource: xawtv.dga (bool).
+.TP
+\fB-parallel\fP n
+use n compression threads (default: one).
+.br
+Resource: xawtv.parallel (int).
+.P
+The usual Toolkit options like \fB-geometry\fP are supported too.
+.SH SUPPORTED HARDWARE / INTERFACES
+.TP
+.B v4l
+video4linux - \fBthe\fP linux video capture API.
+.TP
+.B v4l2
+video4linux two - new, improved capture interface which fixes a number
+of v4l design bugs.
+.TP
+.B bktr
+FreeBSD / OpenBSD driver for bt848/878 grabber cards.
+.TP
+.B Xvideo
+X11 Extention for video devices. Note that the Xvideo extention does
+support overlay only, you can't capture images/movies if the Xvideo
+extention is used. On the other hand this is the only way to scaled
+video overlay (i.e. fullscreen without black borders @ 1024x748) if
+both hardware and xfree86 driver support it. See README.xfree4 for
+more details and hints on how to setup Xvideo.
+.SH GETTING STARTED
+Just start xawtv. Then verify the settings in the options menu (right
+mouse button) and adjust the settings (TV norm, Video source, freqency
+table). With the cursor keys you can control the tuner and look for
+TV Stations. Other useful hotkeys are listed below.
+.P
+The hotkey 'E' will show the channel editor where you can create/edit
+entries your TV stations. Don't forget to click on "save" to write a
+config file. You can also create/edit a config file with any text
+editor, see xawtvrc(5) for a description of the config file syntax.
+There are a number of config options which can only be set by editing
+the config file.
+.P
+You can also check out scantv. That's a command line tool which
+will perform a channel scan and write out a xawtv config file with
+all channels it has found.
+.SS Mouse functions
+The left mouse button will popup a menu with all TV stations found in
+the config file. The middle button switches to the next station. The
+right button brings up a window with alot of options and control
+functions.
+.SS Keyboard Shortcuts
+.nf
+V \fIV\fPideo (Capture) on/off
+A \fIA\fPudio on/off
+F \fIF\fPullscreen on/off
+G \fIG\fPrab picture (full size, ppm)
+J Grab picture (full size, \fIj\fPpeg)
+Ctrl+G \fIG\fPrab picture (window size, ppm)
+Ctrl+J Grab picture (window size, \fIj\fPpeg)
+O Popup \fIO\fPptions Window
+C Popup \fIC\fPhannels Window
+E Popup Channel \fIE\fPditor
+R Popup AVI \fIR\fPecording Window
+Z Channel Hopper (\fIz\fPapping, tune in every
+ station a few seconds)
+Ctrl+Z Fast Channel Hopping (grab the images for the
+ Channel Bottons)
+
+up/down tune up/down one channel
+left/right fine tuning
+pgup/pgdown station up/down (the ones you have in the config file)
+space next station (same as pgup)
+backspace previously tuned station
+Ctrl+up scan for next station
+
+ESC,Q \fIQ\fPuit
+
++/- Volume up/down (keypad)
+Enter mute (keypad)
+.fi
+.SH BUGS
+.B Bug reports with images attached go to /dev/null unseen.
+.P
+xawtv depends on a correct driver configuration. If you can't tune TV
+stations even if the settings in the options window are correct it is
+very likely a driver issue.
+.P
+The mono/stereo display is \fBnot\fP reliable due to v4l API
+restrictions. The API can not report back the current audio mode, but
+a list of the currently available modes. xawtv just does a guess
+based on that, assuming the driver uses the best available mode.
+Depending on your hardware this might not be true. If in doubt
+whenever stereo \fBreally\fP works, please tune in MTV and listen,
+don't trust what xawtv says.
+.SH SEE ALSO
+xawtvrc(5), fbtv(1), v4l-conf(1), scantv(1)
+.br
+http://bytesex.org/xawtv/ (homepage)
+.SH AUTHOR
+Gerd Knorr <kraxel@bytesex.org>
+.SH COPYRIGHT
+Copyright (C) 1997-2001 Gerd Knorr <kraxel@bytesex.org>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+.SH MISC
+You are the 4711th visitor of this page.
diff --git a/man/xawtv.man b/man/xawtv.man
deleted file mode 100644
index 1df5021..0000000
--- a/man/xawtv.man
+++ /dev/null
@@ -1,334 +0,0 @@
-.TH xawtv 1 "(c) 1997-99 Gerd Knorr"
-.SH NAME
-xawtv - a X11 program for watching TV
-.SH SYNOPSIS
-.B xawtv [ options ] [ station name ]
-.SH DESCRIPTION
-.B xawtv
-is a simple program for watching TV with your linux box. It uses the
-Athena widgets.
-.B xawtv
-supports the bttv driver, v4l (video4linux, included in 2.2.x) and the
-Xvideo extention.
-.P
-.B xawtv
-reads the config files /usr/X11R6/lib/X11/xawtvrc and $HOME/.xawtv at
-startup. Settings in the personal config file will overwrite the
-options from the global config file. These files holds the available
-TV stations and a few settings like TV norm. You have to create the
-config file yourself, see below for details.
-.SH OPTIONS
-.TP
-\fB-h\fP, \fB-help\fP
-Print a short desctiption of all command line options.
-.TP
-\fB-f\fP, \fB-fullscreen\fP
-startup in fullscreen mode.
-.TP
-\fB-n\fP, \fB-noconf\fP
-don't read the config file ($HOME/.xawtv).
-.TP
-\fB-o\fP, \fB-outfile\fP base
-set basestring for the snapshot output files. The filename will be
-"base-timestamp-nr.ext".
-.TP
-\fB-c\fP, \fB-device\fP device
-set video4linux device (default is /dev/video).
-.TP
-\fB-c\fP, \fB-xvport\fP number
-set Xvideo port (defaults to the first usable).
-.TP
-\fB-v\fP, \fB-debug\fP level
-Be verbose,
-.B level
-may be 0 (default), 1 or 2. It exists just for debugging and
-trouble-shooting.
-.TP
-\fB-remote\fP
-X11 display is remote. This basically disables overlay mode, you
-might need this if xawtv failes to autodetect a remote X11 display.
-.TP
-\fB-b\fP, \fB-bpp\fP n
-force xawtv into
-.B n
-bpp color depth. Works for switching between 15/16 and 24/32 bpp.
-This gets just passed throuth to v4l-conf(1).
-.TP
-\fB-shift\fP n
-Shift the video display by
-.B n
-bytes. Try this if your video display is'nt within the xawtv window.
-This gets passed throuth to v4l-conf(1) too.
-.TP
-\fB-fb\fP
-Use the framebuffer device to determine the video framebuffer address
-(instead of the DGA extention). Yet another pass throuth argument.
-.TP
-\fB-xv/-noxv \fP
-enable/disable the usage of the Xvideo extention (for overlay),
-default is on.
-.TP
-\fB-scale/-noscale \fP
-enable/disable the usage of the Xvideo extention (for hardware scaling
-in grabdisplay mode), default is on.
-.TP
-\fB-vm/-novm\fP
-enable/disable the usage of the VidMode extention, default is off.
-If there is a fullscreen video mode configured in the config file,
-the vidmode extention will be enabled automatically.
-.TP
-\fB-dga/-nodga\fP
-enable/disable the usage of the DGA extention, default is on.
-.P
-The usual Toolkit options like \fB-geometry\fP are supported too.
-.SH RESOURCES
-\fBxawtv\fP understands all of the core X Toolkit resource names and
-classes as well as:
-.TP
-\fBdevice\fP
-video4linux device
-.TP
-\fBxvideo\fP (bool)
-enable/disable the usage of the Xvideo extention.
-.TP
-\fBvidmode\fP (bool)
-enable/disable the usage of the VidMode extention.
-.TP
-\fBdga\fP (bool)
-enable/disable the usage of the DGA extention.
-.SH GETTING STARTED
-Just start up xawtv, this will work without a config file too. Then
-check out the options (right mouse button) and adjust the settings
-(TV norm, Video source, freqency table). With the cursor keys you
-can control the tuner and look for TV Stations.
-.P
-If you've found one, start up your favorite text editor and stick it
-into the $HOME/.xawtv config file. Or you can check out the new
-channel editor. Hotkey 'E' will start it.
-.B Warning:
-Writing the config file with the channel editor will kill all the
-comments you might have added to your config file.
-.SS Mouse functions
-The left mouse button will popup a menu with all TV stations found in
-the config file. The middle button switches to the next station. The
-right button brings up a window with alot of options and control
-functions.
-.SS Keyboard Shortcuts
-.nf
-V \fBV\fPideo (Capture) on/off
-A \fBA\fPudio on/off
-F \fBF\fPullscreen on/off
-G \fBG\fPrab picture (full size, ppm)
-J Grab picture (full size, \fBj\fPpeg)
-Ctrl+G \fBG\fPrab picture (window size, ppm)
-Ctrl+J Grab picture (window size, \fBj\fPpeg)
-O Popup \fBO\fPptions Window
-C Popup \fBC\fPhannels Window
-E Popup Channel \fBE\fPditor
-R Popup AVI \fBR\fPecording Window
-Z Channel Hopper (\fBz\fPapping, tune in every station
- a few seconds)
-Ctrl+Z Fast Channel Hopping (grab the images for the Channel
- Window)
-
-up/down tune up/down one channel
-left/right fine tuning
-pgup/pgdown station up/down
-space next station (same as pgup)
-backspace previously tuned station
-Ctrl+up scan for next station
-
-ESC,Q \fBQ\fPuit
-
-+/- Volume up/down (keypad)
-Enter mute (keypad)
-.fi
-.SS config file
-You can stick the channels into a config file ($HOME/.xawtv). Looks like this:
-
-.nf
-[ORB]
-channel = 27
-.fi
-
-The branches hold some string (TV station ID), the lines below are the
-settings for that channel. The station ID "defaults" is a special
-case, this one sets the defaults for all channels. Usually the
-channel line is enouth for one station, all other settings can go
-to the "[defaults]" section.
-
-Here is the detailed description of all options:
-.TP
-.B fine = n
-finetuning (what left+right keys do), default: 0
-.TP
-.B norm = pal | ntsc | secam
-which TV norm, default is pal
-.TP
-.B key = keysym
-Hotkey for the channel. All X11 keysyms allowed here. You can prefix
-a keysym with Modifier+, i.e. ^F is "Ctrl+F".
-.TP
-.B capture = off | overlay | grabdisplay
-capture mode: off, overlay (default, TV card => video, 0% cpu) or
-grabdisplay (TV card => main memory => X-Server => video, frame rate
-depends on load and picture size).
-.TP
-.B input = Television | Composite1 | Composite2 | SVHS
-input source. The valid choices depend on the hardware driver, the
-values above are just examples.
-.TP
-.B color = n
-.TP
-.B bright = n
-.TP
-.B hue = n
-.TP
-.B contrast = n
-Valid range is 0-65535, default is 32768. Adding a percent symbol
-changes the range to 0-100, i.e. "50%" has the same effect like
-"32768".
-.TP
-.B audio = mono | stereo | lang1 | lang2
-Set the audio mode for the given channel.
-.TP
-.B freq = n
-Specify the frequency for the given station (kHz, video carrier). You
-shouldn't need this for normal operation, all your channels should be
-listed in the frequency table for your area. Maybe unless you live
-near the border and the foreign country uses another channel scheme.
-.P
-A few global settings go to the "[global]" section:
-.TP
-.B fullscreen = width x height
-specify which video mode should be used for full-screen. Works with
-XFree only, and of cource you need a valid modeline for this mode in
-your XF86Config file. You also have to enable the VidMode extention
-(option -vm, see above) to make this work.
-.TP
-.B wm-off-by = [+-]x[+-]y
-Some WM's handle static gravity not correct (I know mwm and
-kwm). This is somewhat boring with fullscreen mode. With this
-options you can correct this with a displacement for moving
-windows. For example, wm-off-by = -4-24 does the trick for kwm (the
-KDE window manager).
-.TP
-.B freqtab =
-select a channel-to-freqency mapping. Options window->Frequency table
-brings up a menu with all valid entries (and allows table-switching at
-runtime).
-.TP
-.B pixsize = width x height
-size of the channel pixmaps (within Channels window). 0x0 disables this
-feature.
-.TP
-.B pixcols = n
-number of columns the channel window should use. Defaults to 1.
-.TP
-.B mixer = ctl | device:ctl
-This allows to control volume using the sound card mixer. ctl is the
-mixer control, i.e. "vol" for the master volume. "line1" is a good
-candidate for the TV card. device is the mixer device (defaults to
-/dev/mixer in unspecified). Volume-control works with the keypad: +
-is up, - is down, Enter is mute.
-.TP
-.B jpeg-quality = n
-set the quality for jpeg images. As usual the valid range for n is [0
-.. 100] with 75 as default.
-.TP
-.B mjpeg-quality = n
-set the quality for mjpeg AVI movies. Default is 75.
-.TP
-.B keypad-ntsc = on | off
-Configure keypad mode. Default is off. When set to on, numbers typed
-on the keypad are interpreted as channel numbers (this is like NTSC TV
-sets work). Otherwise they are interpreted as programmed station,
-i.e. 1 is the first station from $HOME/.xawtv, ...
-.TP
-.B osd = on | off
-Enable/disable the onscreen display in fullscreen mode. Default is
-on.
-.TP
-.B ratio = x:y
-Set a fixed aspect ratio for the TV image.
-.P
-You can start other programs from within xawtv. This is configured
-with entries in the "[launch]" section:
-.TP
-.B label = key, command line
-The specified hotkey will run the configured program. Calling the
-Action "Launch(label)" works too. If you want to play with the Xt
-translation tables, feel free to do so. But don't complain if you
-broke something while doing so...
-.SS config file example
-My config file looks like this:
-.P
-.nf
-# this is a comment
-# empty lines are ignored too
-
-[global]
-freqtab = pal-europe
-#mixer = line
-fullscreen = 768x576
-
-# for /etc/XF86Config
-# Modeline "pal" 50.00 768 832 856 1000 576 590 595 630 -hsync -vsync
-
-[launch]
-AleVT = Ctrl+A, alevt
-
-[defaults]
-source = television
-norm = pal
-
-[ZDF]
-channel=33
-key=F1
-
-[ORB]
-channel = 27
-key = F2
-
-# more stations follow here
-
-[Camera]
-source = Composite1
-key = K
-.fi
-.SH BUGS
-The mono/stereo display is \fBnot\fP reliable due to v4l API
-restrictions. The API can not report back the current audio
-mode, but a list of the currently available modes. xawtv just
-does a guess based on that, assuming the driver uses the best
-available mode. Depending on your hardware this might not
-be true.
-.P
-If in doubt whenever stereo \fBreally\fP works, please tune
-in MTV and listen, don't trust what xawtv says.
-.P
-.B Bug reports with images attached go to /dev/null unseen.
-.SH SEE ALSO
-fbtv(1), v4l-conf(1)
-.br
-http://www.strusel007.de/kraxel/xawtv/ (homepage)
-.SH AUTHOR
-Gerd Knorr <kraxel@bytesex.org>
-.SH COPYRIGHT
-Copyright (C) 1997-99 Gerd Knorr <kraxel@bytesex.org>
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-.SH MISC
-You are the 4711th visitor of this page.
diff --git a/man/xawtvrc.5 b/man/xawtvrc.5
new file mode 100644
index 0000000..9c0bf1f
--- /dev/null
+++ b/man/xawtvrc.5
@@ -0,0 +1,241 @@
+.TH xawtvrc 5
+.SH NAME
+xawtvrc -- TV apps config file
+.SH SYNOPSIS
+/etc/X11/xawtvrc
+.br
+$HOME/.xawtv
+.SH DESCRIPTION
+.B xawtvrc
+is the config file originally used by xawtv only (that's why the name
+xawtvrc). These days a number of other TV applications / utilities
+read it too to get configuration informations from it.
+.P
+Both a global (/etc/X11/xawtvrc) and personal ($HOME/.xawtv) config
+file are used by the applications. Settings in the personal config
+file will overwrite the global ones.
+.SS Applications
+The following applications use these config files:
+.TP
+.B xawtv
+The classic X11 TV application.
+.TP
+.B motv
+A better, motif-based GUI for xawtv ...
+.TP
+.B fbtv
+TV application for the linux framebuffer console.
+.TP
+.B ttv
+aalib-based TV application for any terminal.
+.TP
+.B v4lctl
+command line tool to control video4linux devices.
+.SS Create a config file
+.B xawtv
+and
+.B motv
+both provide some functions to edit the channels and save the
+configuration. The save function will \fBnot\fP preserve any comments
+you might have put into the config file throught ...
+.P
+You can also use your favorite text editor and modify the config file
+directly.
+.P
+You can use the command line utility
+.B scantv
+to create a initial config file. scantv will automatically scan all
+channels for TV stations and write the ones it has found to the config
+file.
+.SH SYNTAX
+.B xawtvrc
+uses the same syntax like smb.conf: sections starting with [name],
+followed by lines with option = value pairs.
+.P
+There are three special sections: [global], [launch] and [default].
+All other sections describe a TV station each.
+.SS TV station options.
+The following options are allowed for TV stations and the [default]
+section. The options from the [default] sections are used -- as the
+name suggests -- as defaults for all other channels. You can put
+everything which is common for all TV stations (like the TV norm which
+is used in your country) into the [default] section, so you don't have
+to specify it for every single channel.
+.P
+With a reasonable [defaults] section you usually only need to specify
+the channel for each TV station, like this:
+
+.nf
+[ORB]
+channel = 27
+.fi
+
+The other options are:
+.TP
+.B fine = n
+finetuning (what left+right keys do within xawtv), default: 0
+.TP
+.B norm = pal | ntsc | secam
+which TV norm, default is pal
+.TP
+.B key = keysym
+Hotkey for the channel. All X11 keysyms allowed here. You can prefix
+a keysym with Modifier+, "Ctrl+F" for example.
+.TP
+.B capture = off | overlay | grabdisplay
+capture mode: off, overlay (default, TV card => video, 0% cpu) or
+grabdisplay (TV card => main memory => X-Server => video, frame rate
+depends on load and picture size). Default is overlay. If it is not
+possible to use overlay for some reason (remote display, not supported
+by the hardware, whatever) the applications will automatically fallback to
+.TP
+.B input = Television | Composite1 | Composite2 | SVHS
+input source. The valid choices depend on the hardware driver, the
+values above are just examples.
+.TP
+.B color = n
+.TP
+.B bright = n
+.TP
+.B hue = n
+.TP
+.B contrast = n
+Valid range is 0-65535, default is 32768. Adding a percent symbol
+changes the range to 0-100, i.e. "50%" has the same effect like
+"32768".
+.TP
+.B audio = mono | stereo | lang1 | lang2
+Set the audio mode for the given channel.
+.TP
+.B freq = n
+Specify the frequency for the given station (MHz, video carrier). You
+shouldn't need this for normal operation, all your channels should be
+listed in the frequency table for your area (if not, mail me a patch).
+Maybe unless you live near the border and the foreign country uses
+another channel scheme.
+.TP
+.B midi = note
+Use midi noteon event for <note> as hotkey for the channel.
+.P
+.SS Global options
+A number of not channel-related settings go to the "[global]" section:
+.TP
+.B fullscreen = width x height
+specify which video mode should be used for full-screen. Works with
+XFree only, and of cource you need a valid modeline for this mode in
+your XF86Config file. You also have to enable the VidMode extention
+(option -vm, see above) to make this work.
+.TP
+.B wm-off-by = [+-]x[+-]y
+Some WM's handle static gravity not correct (I know mwm and
+kwm). This is somewhat boring with fullscreen mode. With this
+options you can correct this with a displacement for moving
+windows. For example, wm-off-by = -4-24 does the trick for kwm (the
+KDE1 window manager).
+.TP
+.B freqtab =
+select a channel-to-freqency mapping. Options window->Frequency table
+(in xawtv) brings up a menu with all valid entries (and allows
+table-switching at runtime).
+.TP
+.B pixsize = width x height
+size of the channel pixmaps (within Channels window). 0x0 disables this
+feature.
+.TP
+.B pixcols = n
+number of columns the channel window should use. Defaults to 1.
+.TP
+.B mixer = ctl | device:ctl
+This allows to control volume using the sound card mixer. ctl is the
+mixer control, i.e. "vol" for the master volume. "line1" is a good
+candidate for the TV card. device is the mixer device (defaults to
+/dev/mixer in unspecified). Volume-control works with the keypad: +
+is up, - is down, Enter is mute.
+.TP
+.B jpeg-quality = n
+set the quality for (M)JPEG images/frames. As usual the valid range
+for n is [0 .. 100] with 75 as default.
+.TP
+.B keypad-ntsc = on | off
+Configure keypad mode. Default is off. When set to on, numbers typed
+on the keypad are interpreted as channel numbers (this is like NTSC TV
+sets work). Otherwise they are interpreted as programmed station,
+i.e. 1 is the first station from $HOME/.xawtv, ...
+.TP
+.B keypad-partial = on | off
+Another configuration of keypad mode. Default is on. When set to off,
+typing one digit on the keypad doesn't change the station number when
+there are two-digit station numbers starting with that digit.
+.TP
+.B osd = on | off
+Enable/disable the onscreen display in fullscreen mode. Default is
+on.
+.TP
+.B ratio = x:y
+Set a fixed aspect ratio for the TV image. Default is 4:3. Use 0:0
+if you don't want a fixed aspect ratio.
+.TP
+.B mov-driver = files | raw | avi | mov
+.TP
+.B mov-video = ppm | pgm | jpeg | rgb | gray | 422 | 422p | rgb15 | rgb24 | mjpeg | jpeg | raw | mjpa | png
+.TP
+.B mov-fps = fps
+.TP
+.B mov-audio = mono8 | mono16 | stereo
+.TP
+.B mov-rate = rate
+Set defaults for movie recording. Not all possible combinations are
+valid choices. "streamer -h" will print a nice list.
+.TP
+.B midi = port
+You can specify a ALSA port where xawtv should receive midi events
+from. If configured this way, you can program your midi keyboard
+keys as station hotkeys and control the volume via midi.
+.P
+.SS The [launch] section
+You can start other programs from within xawtv. This is configured
+with entries in the "[launch]" section:
+.TP
+.B label = key, command line
+The specified hotkey will run the configured program. Calling the
+Action "Launch(label)" works too. If you want to play with the Xt
+translation tables, feel free to do so. But don't complain if you
+broke something while doing so...
+.SS sample config file
+.nf
+# this is a comment
+# empty lines are ignored too
+
+[global]
+freqtab = europe-west
+#mixer = line
+fullscreen = 768x576
+
+# for /etc/XF86Config
+# Modeline "pal" 50.00 768 832 856 1000 576 590 595 630 -hsync -vsync
+
+[launch]
+mixer = M, gtkaumix
+AleVT = Ctrl+A, alevt
+
+[defaults]
+input = television
+norm = pal
+
+[ZDF]
+channel=33
+key=F1
+
+[ORB]
+channel = 27
+key = F2
+
+# more stations follow here
+
+[Camera]
+input = Composite1
+key = K
+.fi
+
+.SH SEE ALSO
+scantv(1), xawtv(1), motv(1), fbtv(1), ttv(1)
diff --git a/radio/Makefile.in b/radio/Makefile.in
index fd95d94..67cf579 100644
--- a/radio/Makefile.in
+++ b/radio/Makefile.in
@@ -1,19 +1,9 @@
srcdir=@srcdir@
VPATH=$(srcdir)
-ROOT=
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=$(ROOT)@bindir@
-mandir=$(ROOT)@mandir@
+include ../Make.config
-CC=@CC@
-INSTALL=@INSTALL@
-INSTALL_PROGRAM=@INSTALL_PROGRAM@
-INSTALL_DATA=@INSTALL_DATA@
-INSTALL_DIR=mkdir -p
-
-CFLAGS=-g -Wall @CFLAGS@ -I$(srcdir)/.. -I..
+CFLAGS=-g @CFLAGS@ $(WARN_FLAGS) -I$(srcdir)/.. -I..
PROGS=@RADIO@
@@ -25,13 +15,13 @@ radio: radio.o
$(CC) $(CFLAGS) -o $@ radio.o @LIBCURSES@
install: all
- test -f radio &&\
- $(INSTALL_DIR) $(bindir) &&\
- $(INSTALL_PROGRAM) -s radio $(bindir) &&\
- $(INSTALL_DATA) $(srcdir)/radio.man $(mandir)/man1/radio.1 || true
+ test -f radio &&\
+ $(INSTALL_DIR) $(bindir) &&\
+ $(INSTALL_PROGRAM) -s radio $(bindir) &&\
+ $(INSTALL_DATA) $(srcdir)/radio.man $(mandir)/man1/radio.1 || true
clean:
- -rm -f *.o core* TAGS
+ -rm -f *.o core* TAGS radio.fmmap
realclean distclean: clean
-rm -f $(PROGS) Makefile *~ *.bak
diff --git a/radio/radio-old.c b/radio/radio-old.c
index e4ee0ee..eff28e0 100644
--- a/radio/radio-old.c
+++ b/radio/radio-old.c
@@ -5,6 +5,12 @@
*
*/
+/* Changes:
+ * 20 Jun 99 - Juli Merino (JMMV) <jmmv@mail.com> - Added some features:
+ * visual menu, manual 'go to' function, negative symbol and a
+ * good interface. See code for more details.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -12,21 +18,38 @@
#include <errno.h>
#include <fcntl.h>
#include <curses.h>
+#include <sys/time.h>
#include <sys/ioctl.h>
-#include <asm/types.h> /* XXX glibc */
-#include "videodev.h"
+#include <linux/videodev.h>
#define DEVICE "/dev/radio" /* major=81, minor=64 */
-int
+/* JMMV: WINDOWS for radio */
+WINDOW *wfreq, *woptions, *wstations, *wcommand;
+
+/* Determine and return the appropriate frequency multiplier for
+ the first tuner on the open video device with handle FD. */
+static int get_freq_fact(int fd)
+{
+ struct video_tuner tuner;
+
+ tuner.tuner = 0;
+ if (ioctl (fd, VIDIOCGTUNER, &tuner) < 0)
+ return 16;
+ if ((tuner.flags & VIDEO_TUNER_LOW) == 0)
+ return 16;
+ return 16000;
+}
+
+static int
radio_setfreq(int fd, float freq)
{
- int ifreq = (freq+1.0/32)*16;
+ int ifreq = (freq+1.0/32)*get_freq_fact(fd);
return ioctl(fd, VIDIOCSFREQ, &ifreq);
}
-void
+static void
radio_unmute(int fd)
{
struct video_audio vid_aud;
@@ -40,7 +63,7 @@ radio_unmute(int fd)
perror("VIDIOCSAUDIO");
}
-void
+static void
radio_mute(int fd)
{
struct video_audio vid_aud;
@@ -52,6 +75,45 @@ radio_mute(int fd)
perror("VIDIOCSAUDIO");
}
+static void
+radio_getstereo(int fd)
+{
+ struct video_audio va;
+ va.mode=-1;
+
+ if (ioctl (fd, VIDIOCGAUDIO, &va) < 0)
+ mvwprintw(wfreq,2,1," ");
+ mvwprintw(wfreq,2,1,"%s", va.mode == VIDEO_SOUND_STEREO ?
+ "STEREO":" MONO ");
+}
+
+static void
+radio_getsignal(int fd)
+{
+ struct video_tuner vt;
+ int i,signal;
+
+ memset(&vt,0,sizeof(vt));
+ ioctl (fd, VIDIOCGTUNER, &vt);
+ signal=vt.signal>>13;
+
+ for(i=0;i<8;i++)
+ mvwprintw(wfreq,3,i+1,"%s", signal>i ? "*":" ");
+}
+
+static int
+select_wait(int sec)
+{
+ struct timeval tv;
+ fd_set se;
+
+ FD_ZERO(&se);
+ FD_SET(0,&se);
+ tv.tv_sec = sec;
+ tv.tv_usec = 0;
+ return select(1,&se,NULL,NULL,&tv);
+}
+
/* ---------------------------------------------------------------------- */
char *digit[3][10] = {
@@ -60,25 +122,24 @@ char *digit[3][10] = {
{ "|_|", " | ", "|_ ", " _|", " |", " _|", "|_|", " |", "|_|", " _|" }
};
-void print_freq(float freq)
+static void print_freq(float freq)
{
int x,y,i;
- char text[10];
-
- sprintf(text,"%5.1f",freq);
- for (i = 0, x = 0; i < 5; i++, x+=4) {
+ char text[10];
+ sprintf(text,"%6.2f",freq);
+ for (i = 0, x = 8; i < 6; i++, x+=4) {
if (text[i] >= '0' && text[i] <= '9') {
for (y = 0; y < 3; y++)
- mvprintw(y+1,x,"%s",digit[y][text[i]-'0']);
+ mvwprintw(wfreq,y+1,x,"%s",digit[y][text[i]-'0']);
} else if (text[i] == '.') {
- mvprintw(3,x,".");
+ mvwprintw(wfreq,3,x,".");
x -= 2;
} else {
for (y = 0; y < 3; y++)
- mvprintw(y+1,x," ");
+ mvwprintw(wfreq,y+1,x," ");
}
}
- refresh();
+ wrefresh(wfreq);
}
/* ---------------------------------------------------------------------- */
@@ -89,20 +150,23 @@ int freqs[99];
char *labels[99];
int stations;
-void
-read_kradioconfig()
+static void
+read_kradioconfig(void)
{
char name[80],file[256],n;
int ifreq;
FILE *fp;
sprintf(file,"%.225s/.kde/share/config/kradiorc",getenv("HOME"));
- if (NULL == (fp = fopen(file,"r")))
- return;
+ if (NULL == (fp = fopen(file,"r"))) {
+ sprintf(file,"%.225s/.radio",getenv("HOME"));
+ if (NULL == (fp = fopen(file,"r")))
+ return;
+ }
while (NULL != fgets(file,255,fp)) {
if (2 == sscanf(file,"%c=%d",&n,&ifreq) && n >= '1' && n <= '8') {
fkeys[n - '1'] = ifreq;
- } else if (2 == sscanf(file,"%d=%79[^\n]",&ifreq,name) && stations < 99) {
+ } else if (2 == sscanf(file,"%d=%30[^\n]",&ifreq,name) && stations < 99) {
freqs[stations] = ifreq;
labels[stations] = strdup(name);
stations++;
@@ -110,7 +174,7 @@ read_kradioconfig()
}
}
-char*
+static char*
find_label(int ifreq)
{
int i;
@@ -122,28 +186,31 @@ find_label(int ifreq)
return NULL;
}
-char *
+static char *
make_label(int ifreq)
{
static char text[20],*l;
if (NULL != (l = find_label(ifreq)))
return l;
- sprintf(text,"%5.1f MHz",(float)ifreq/1000000);
+ sprintf(text,"%6.2f MHz",(float)ifreq/1000000);
return text;
}
int
main(int argc, char *argv[])
{
- int fd,key,done,i,nomute=0,ifreq = 0,lastfreq = 0;
+ /* JMMV: lastfreq set to 1 to start radio at 0.0 */
+ int fd,key,done,i,ifreq = 0,lastfreq = 1, mute=1;
char *name;
- float ffreq;
+ /* Variables set by JMMV */
+ float ffreq, newfreq = 0;
+ int stset = 0, c;
if (argc > 1 && 1 == sscanf(argv[1],"%f",&ffreq)) {
ifreq = (int)(ffreq * 1000000);
- ifreq += 50000;
- ifreq -= ifreq % 100000;
+ ifreq += 25000;
+ ifreq -= ifreq % 50000;
}
if (-1 == (fd = open(DEVICE, O_RDONLY))) {
@@ -156,16 +223,63 @@ main(int argc, char *argv[])
ifreq = fkeys[0];
initscr();
+ start_color();
cbreak();
noecho();
keypad(stdscr,1);
curs_set(0);
+
+ /* JMMV: Set colors and windows */
+ /* XXX: Color definitions are wrong! BLUE is RED, CYAN is YELLOW and
+ * viceversa */
+ init_pair(1,COLOR_WHITE,COLOR_BLACK);
+ init_pair(2,COLOR_CYAN,COLOR_BLUE);
+ init_pair(3,COLOR_WHITE,COLOR_RED);
+ bkgd(A_BOLD | COLOR_PAIR(1));
+ refresh();
- for (i = 0; i < 8; i++) {
- if (fkeys[i])
- mvprintw(i,22,"F%d: %s",i+1,make_label(fkeys[i]));
- }
+ wfreq = newwin(7,32,1,2);
+ wbkgd(wfreq,A_BOLD | COLOR_PAIR(2));
+ werase(wfreq);
+ box(wfreq, 0, 0);
+ mvwprintw(wfreq, 0, 1, " Tuner ");
+
+ woptions = newwin(7,COLS-38,1,36);
+ wbkgd(woptions,A_BOLD | COLOR_PAIR(3));
+ werase(woptions);
+ box(woptions, 0, 0);
+ mvwprintw(woptions, 0, 1, " Main menu ");
+ wstations = newwin(LINES-14,COLS-4,9,2);
+ wbkgd(wstations,A_BOLD | COLOR_PAIR(3));
+ werase(wstations);
+ box(wstations, 0, 0);
+ mvwprintw(wstations, 0, 1, " Preset stations ");
+
+ wcommand = newwin(3,COLS-4,LINES-4,2);
+ wbkgd(wcommand,A_BOLD | COLOR_PAIR(3));
+ werase(wcommand);
+ box(wcommand,0,0);
+ mvwprintw(wcommand, 0, 1, " Command window ");
+ wrefresh(wcommand);
+
+ /* JMMV: Added key information and windows division */
+ mvwprintw(woptions, 1, 1, "UP Key - increment frequency");
+ mvwprintw(woptions, 2, 1, "DOWN Key - decrease frequency");
+ mvwprintw(woptions, 3, 1, "g - go to frequency...");
+ mvwprintw(woptions, 4, 1, "x - exit");
+ mvwprintw(woptions, 5, 1, "ESC, q, e - mute and exit");
+ wrefresh(woptions);
+ for (i = 0, c = 1; i < 8; i++) {
+ if (fkeys[i]) {
+ mvwprintw(wstations,c,2,"F%d: %s",i+1,make_label(fkeys[i]));
+ c++;
+ stset = 1;
+ }
+ }
+ if (!stset) mvwprintw(wstations,1,1,"[none]");
+ wrefresh(wstations);
+
radio_unmute(fd);
for (done = 0; done == 0;) {
if (ifreq != lastfreq) {
@@ -174,17 +288,27 @@ main(int argc, char *argv[])
radio_setfreq(fd,ffreq);
print_freq(ffreq);
if (NULL != (name = find_label(ifreq)))
- mvprintw(0,0,"%-20.20s",name);
+ mvwprintw(wfreq,5,2,"%-20.20s",name);
else
- mvprintw(0,0,"%-20.20s","");
+ mvwprintw(wfreq,5,2,"%-20.20s","");
}
-
- switch (key = getch()) {
+ radio_getstereo(fd);
+ radio_getsignal(fd);
+ wrefresh(wfreq);
+ wrefresh(wcommand);
+
+ if (0 == select_wait(1)) {
+ mvwprintw(wcommand,1,1,"%50.50s","");
+ wrefresh(wcommand);
+ continue;
+ }
+ key = getch();
+ switch (key) {
+ case EOF: /* for noninteractive use: "radio 95.8 <>/dev/null" */
case 'x':
case 'X':
- nomute=1;
- /* fall */
- case EOF:
+ mute = 0;
+ /* fall throuth */
case 27: /* ESC */
case 'q':
case 'Q':
@@ -192,12 +316,39 @@ main(int argc, char *argv[])
case 'E':
done = 1;
break;
+ case 'g':
+ case 'G':
+ /* JMMV: Added 'go to frequency' function */
+ mvwprintw(wcommand,1,2,"GO: Enter frequency: ");
+ curs_set(1);
+ echo();
+ wrefresh(wcommand);
+ wscanw(wcommand,"%f",&newfreq);
+ noecho();
+ curs_set(0);
+ wrefresh(wcommand);
+ ifreq = newfreq * 1000000;
+ break;
case KEY_UP:
- ifreq += 100000;
+ ifreq += 50000;
+ if (ifreq > 108000000)
+ ifreq = 87500000;
+ mvwprintw(wcommand, 1, 2, "Increment frequency");
break;
case KEY_DOWN:
- ifreq -= 100000;
+ ifreq -= 50000;
+ if (ifreq < 87500000)
+ ifreq = 108000000;
+ mvwprintw(wcommand, 1, 2, "Decrease frequency");
break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
case KEY_F(1):
case KEY_F(2):
case KEY_F(3):
@@ -206,18 +357,25 @@ main(int argc, char *argv[])
case KEY_F(6):
case KEY_F(7):
case KEY_F(8):
- if (fkeys[key - KEY_F(1)])
- ifreq = fkeys[key - KEY_F(1)];
+ i = (key >= '1' && key <= '8') ? key - '1' : key - KEY_F(1);
+ if (fkeys[i]) {
+ ifreq = fkeys[i];
+ mvwprintw(wcommand, 1, 2, "Go to preset station %d", i+1);
+ }
break;
}
}
- if (!nomute)
+ if (mute)
radio_mute(fd);
close(fd);
+ bkgd(0);
clear();
refresh();
endwin();
+ printf("radio\n");
+ printf("copyright (c) 1998-99 Gerd Knorr <kraxel@goldbach.in-berlin.de>\n");
+ printf("interface by Juli Merino <jmmv@mail.com>\n");
return 0;
}
diff --git a/radio/radio.c b/radio/radio.c
index e608b18..e69120d 100644
--- a/radio/radio.c
+++ b/radio/radio.c
@@ -1,5 +1,5 @@
/*
- * radio.c - (c) 1998 Gerd Knorr <kraxel@goldbach.in-berlin.de>
+ * radio.c - (c) 1998-2001 Gerd Knorr <kraxel@bytesex.org>
*
* test tool for bttv + WinTV/Radio
*
@@ -9,6 +9,12 @@
* 20 Jun 99 - Juli Merino (JMMV) <jmmv@mail.com> - Added some features:
* visual menu, manual 'go to' function, negative symbol and a
* good interface. See code for more details.
+ * 30 Aug 2001 - Gunther Mayer <Gunther.Mayer@t-online.de>
+ * Scan for Stations, ad-hoc algorithm for signal strength
+ * analysis. My Temic 4009FR5 finds all 19 stations here,
+ * a Samsung TPI8PSB02P misses two stations below 90MHz,
+ * which are received fine, but the tuner doesn't indicate
+ * signal strength.
*/
#include <stdio.h>
@@ -23,14 +29,15 @@
#include <linux/videodev.h>
-#define DEVICE "/dev/radio" /* major=81, minor=64 */
-
/* JMMV: WINDOWS for radio */
+int ncurses = 0;
+int debug = 0;
+char *device = "/dev/radio";
WINDOW *wfreq, *woptions, *wstations, *wcommand;
/* Determine and return the appropriate frequency multiplier for
the first tuner on the open video device with handle FD. */
-static int get_freq_fact(int fd)
+static int get_freq_fact(int fd)
{
struct video_tuner tuner;
@@ -42,14 +49,14 @@ static int get_freq_fact(int fd)
return 16000;
}
-int
+static int
radio_setfreq(int fd, float freq)
{
int ifreq = (freq+1.0/32)*get_freq_fact(fd);
return ioctl(fd, VIDIOCSFREQ, &ifreq);
}
-void
+static void
radio_unmute(int fd)
{
struct video_audio vid_aud;
@@ -63,7 +70,7 @@ radio_unmute(int fd)
perror("VIDIOCSAUDIO");
}
-void
+static void
radio_mute(int fd)
{
struct video_audio vid_aud;
@@ -75,7 +82,34 @@ radio_mute(int fd)
perror("VIDIOCSAUDIO");
}
-int
+static void
+radio_getstereo(int fd)
+{
+ struct video_audio va;
+ va.mode=-1;
+
+ if (ioctl (fd, VIDIOCGAUDIO, &va) < 0)
+ mvwprintw(wfreq,2,1," ");
+ mvwprintw(wfreq,2,1,"%s", va.mode == VIDEO_SOUND_STEREO ?
+ "STEREO":" MONO ");
+}
+
+static int
+radio_getsignal(int fd)
+{
+ struct video_tuner vt;
+ int i,signal;
+
+ memset(&vt,0,sizeof(vt));
+ ioctl (fd, VIDIOCGTUNER, &vt);
+ signal=vt.signal>>13;
+
+ for(i=0;i<8;i++)
+ mvwprintw(wfreq,3,i+1,"%s", signal>i ? "*":" ");
+ return signal;
+}
+
+static int
select_wait(int sec)
{
struct timeval tv;
@@ -96,7 +130,7 @@ char *digit[3][10] = {
{ "|_|", " | ", "|_ ", " _|", " |", " _|", "|_|", " |", "|_|", " _|" }
};
-void print_freq(float freq)
+static void print_freq(float freq)
{
int x,y,i;
char text[10];
@@ -124,8 +158,8 @@ int freqs[99];
char *labels[99];
int stations;
-void
-read_kradioconfig()
+static void
+read_kradioconfig(void)
{
char name[80],file[256],n;
int ifreq;
@@ -148,7 +182,7 @@ read_kradioconfig()
}
}
-char*
+static char*
find_label(int ifreq)
{
int i;
@@ -160,7 +194,7 @@ find_label(int ifreq)
return NULL;
}
-char *
+static char *
make_label(int ifreq)
{
static char text[20],*l;
@@ -171,31 +205,252 @@ make_label(int ifreq)
return text;
}
+/* ---------------------------------------------------------------------- */
+/* autoscan */
+
+float g[411],baseline;
+int astation[100],max_astation=0,current_astation=-1;
+
+static void
+foundone(int m)
+{
+ int i;
+
+ for(i=0;i<100 && astation[i];i++) {
+ if(abs(astation[i]-m) <5 ) // 20 kHz width
+ break;
+ }
+ if(g[m] > g[astation[i]]) { // select bigger signal
+ astation[i]=m;
+ max_astation=i;
+ fprintf(stderr,"Station %2d: %6.2f MHz - %.2f\n",i,87.5+m*0.05,g[m]);
+ }
+}
+
+static void
+maxi(int m)
+{
+ int i,l,r;
+ float halbwert;
+
+ if (debug)
+ fprintf(stderr,"maxi i %d %f %f\n",m,87.5+m*0.05,g[m]);
+ if(g[m]<baseline)
+ return;
+ halbwert=(g[m]-baseline)/2+baseline;
+
+ for(i=m;i>0;i--)
+ if(g[i]< halbwert)
+ break;
+ l=i;
+ if (debug)
+ fprintf(stderr,"Links i %d %f %f\n",i,87.5+i*0.05,g[i]);
+
+ for(i=m;i<411;i++)
+ if(g[i]< halbwert)
+ break;
+ if (debug)
+ fprintf(stderr,"Rechts i %d %f %f\n",i,87.5+i*0.05,g[i]);
+ r=i;
+ m=(l+r)/2;
+ if (debug)
+ fprintf(stderr,"Mitte %d %f %f\n",m,87.5+m*0.05,g[m]);
+ foundone(m);
+}
+
+static void
+findmax(void)
+{
+ int i;
+
+ for(i=0;i<411;i++){
+ if(g[i+1]<g[i])
+ maxi(i);
+ }
+}
+
+// find the baseline for this tuners signal strength
+static float
+get_baseline(float ming, float maxg)
+{
+ int unt,i,nullfound=0;
+ float nullinie=0,u;
+
+ if (debug)
+ fprintf(stderr,"get_baseline: min=%f max=%f\n",ming,maxg);
+ for(u=ming;u<maxg; u+=0.1) {
+ unt=0;
+ for(i=0;i<411;i++)
+ if (g[i]<u) {
+ unt++;
+ }
+ if(unt>300 && !nullfound) {
+ fprintf(stderr,"baseline at %.2f\n",u);
+ nullinie=u;
+ nullfound=1;
+ }
+ if (debug)
+ fprintf(stderr,"%f %d\n",u,unt);
+ }
+ return nullinie;
+}
+
+static void
+findstations(void)
+{
+ float maxg=0,ming=8;
+ int i;
+
+ for(i=0;i<411;i++) {
+ if(g[i]<ming) ming=g[i];
+ if(g[i]>maxg) maxg=g[i];
+ }
+
+ baseline=get_baseline(ming,maxg);
+ findmax();
+}
+
+static void do_scan(int fd,int scan)
+{
+ FILE * fmap=NULL;
+ float freq,s;
+ int i,j;
+
+ if(scan > 1)
+ fmap=fopen("radio.fmmap","w");
+ for(i=0;i<411;i++) {
+ freq = 87.50+i*0.05;
+ s = 0;
+ radio_setfreq(fd,freq);
+ usleep(10000); /* give the tuner some time to settle */
+ for(j=1;j<5;j++) {
+ s+=radio_getsignal(fd);
+ radio_getstereo(fd);
+ usleep(1000);
+ }
+ s=s/5; // average
+ g[i]=s;
+ if (scan > 1)
+ fprintf(fmap,"%f %f\n", freq,s);
+ fprintf(stderr,"scanning: %6.2f MHz - %.2f\r", freq,s);
+ }
+ fprintf(stderr,"%40s\r","");
+ if (scan > 1)
+ fclose(fmap);
+ findstations();
+}
+
+/* ---------------------------------------------------------------------- */
+
+static void
+usage(FILE *out)
+{
+ fprintf(out,
+ "radio -- interactive ncurses radio application\n"
+ "usage:\n"
+ " radio [ options ]\n"
+ "\n"
+ "options:\n"
+ " -h print this text\n"
+ " -d enable debug output\n"
+ " -m mute radio\n"
+ " -f freq tune given frequency (also unmutes)\n"
+ " -c dev use given device [default: %s]\n"
+ " -s scan\n"
+ " -S scan + write radio.fmmap\n"
+ " -q quit. Useful with other options to control the\n"
+ " radio device without entering interactive mode,\n"
+ " i.e. \"radio -qf 91.4\"\n"
+ "\n"
+ "(c) 1998-2001 Gerd Knorr <kraxel@bytesex.org>\n"
+ "interface by Juli Merino <jmmv@mail.com>\n"
+ "channel scan by Gunther Mayer <Gunther.Mayer@t-online.de>\n",
+ device);
+}
+
int
main(int argc, char *argv[])
{
/* JMMV: lastfreq set to 1 to start radio at 0.0 */
- int fd,key,done,i,ifreq = 0,lastfreq = 1, mute=1;
+ int fd,key=0,done,i,ifreq = 0,lastfreq = 1, mute=1;
char *name;
/* Variables set by JMMV */
float ffreq, newfreq = 0;
int stset = 0, c;
+ int quit=0, scan=0, arg_mute=0;
+
+ /* parse args */
+ for (;;) {
+ c = getopt(argc, argv, "mhqdsSf:c:");
+ if (c == -1)
+ break;
+ switch (c) {
+ case 'm':
+ arg_mute = 1;
+ break;
+ case 'q':
+ quit = 1;
+ break;
+ case 'd':
+ debug= 1;
+ break;
+ case 'S':
+ scan = 2;
+ break;
+ case 's':
+ scan = 1;
+ break;
+ case 'f':
+ if (1 == sscanf(optarg,"%f",&ffreq)) {
+ ifreq = (int)(ffreq * 1000000);
+ ifreq += 25000;
+ ifreq -= ifreq % 50000;
+ }
+ break;
+ case 'c':
+ device = optarg;
+ break;
+ case 'h':
+ usage(stdout);
+ exit(0);
+ default:
+ usage(stderr);
+ exit(1);
+ }
+ }
- if (argc > 1 && 1 == sscanf(argv[1],"%f",&ffreq)) {
- ifreq = (int)(ffreq * 1000000);
- ifreq += 25000;
- ifreq -= ifreq % 50000;
+ if (-1 == (fd = open(device, O_RDONLY))) {
+ fprintf(stderr,"open %s: %s\n",device,strerror(errno));
+ exit(1);
}
- if (-1 == (fd = open(DEVICE, O_RDONLY))) {
- perror("open " DEVICE);
- exit(1);
+ /* non-interactive stuff */
+ if (scan) {
+ do_scan(fd,scan);
+ if (!ifreq && max_astation) {
+ current_astation = 0;
+ ifreq=87500000+astation[current_astation]*50000;
+ }
}
+ if (ifreq) {
+ ffreq = (float)ifreq / 1000000;
+ fprintf(stderr,"tuned %.2f MHz\n",ffreq);
+ radio_setfreq(fd,ffreq);
+ radio_unmute(fd);
+ }
+ if (arg_mute) {
+ fprintf(stderr,"muted radio\n");
+ radio_mute(fd);
+ }
+ if (quit)
+ exit(0);
read_kradioconfig();
if (!ifreq && fkeys[0])
ifreq = fkeys[0];
+ /* enter interactive mode -- init ncurses */
+ ncurses=1;
initscr();
start_color();
cbreak();
@@ -229,7 +484,7 @@ main(int argc, char *argv[])
werase(wstations);
box(wstations, 0, 0);
mvwprintw(wstations, 0, 1, " Preset stations ");
-
+
wcommand = newwin(3,COLS-4,LINES-4,2);
wbkgd(wcommand,A_BOLD | COLOR_PAIR(3));
werase(wcommand);
@@ -251,7 +506,8 @@ main(int argc, char *argv[])
stset = 1;
}
}
- if (!stset) mvwprintw(wstations,1,1,"[none]");
+ if (!stset)
+ mvwprintw(wstations,1,1,"[none]");
wrefresh(wstations);
radio_unmute(fd);
@@ -265,16 +521,20 @@ main(int argc, char *argv[])
mvwprintw(wfreq,5,2,"%-20.20s",name);
else
mvwprintw(wfreq,5,2,"%-20.20s","");
- wrefresh(wfreq);
}
-
- wrefresh(wcommand);
- select_wait(3);
- mvwprintw(wcommand,1,1,"%50.50s","");
+ radio_getstereo(fd);
+ radio_getsignal(fd);
+ wrefresh(wfreq);
wrefresh(wcommand);
+
+ if (0 == select_wait(1)) {
+ mvwprintw(wcommand,1,1,"%50.50s","");
+ wrefresh(wcommand);
+ continue;
+ }
key = getch();
switch (key) {
- case EOF: /* for noninteractive use: "radio 95.8 <>/dev/null" */
+ case EOF:
case 'x':
case 'X':
mute = 0;
@@ -311,6 +571,25 @@ main(int argc, char *argv[])
ifreq = 108000000;
mvwprintw(wcommand, 1, 2, "Decrease frequency");
break;
+ case KEY_PPAGE:
+ case KEY_NPAGE:
+ if (max_astation) {
+ current_astation += (key == KEY_NPAGE) ? -1 : 1;
+ if(current_astation<0)
+ current_astation=max_astation;
+ if(current_astation>max_astation)
+ current_astation=0;
+ ifreq=87500000+astation[current_astation]*50000;
+ }
+ break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
case KEY_F(1):
case KEY_F(2):
case KEY_F(3):
@@ -319,9 +598,10 @@ main(int argc, char *argv[])
case KEY_F(6):
case KEY_F(7):
case KEY_F(8):
- if (fkeys[key - KEY_F(1)]) {
- ifreq = fkeys[key - KEY_F(1)];
- mvwprintw(wcommand, 1, 2, "Go to preset station %d", key - KEY_F(0));
+ i = (key >= '1' && key <= '8') ? key - '1' : key - KEY_F(1);
+ if (fkeys[i]) {
+ ifreq = fkeys[i];
+ mvwprintw(wcommand, 1, 2, "Go to preset station %d", i+1);
}
break;
}
@@ -334,9 +614,5 @@ main(int argc, char *argv[])
clear();
refresh();
endwin();
- printf("radio\n");
- printf("copyright (c) 1998-99 Gerd Knorr <kraxel@goldbach.in-berlin.de>\n");
- printf("interface by Juli Merino <jmmv@mail.com>\n");
-
return 0;
}
diff --git a/radio/radio.man b/radio/radio.man
index 7b46326..e60a4a3 100644
--- a/radio/radio.man
+++ b/radio/radio.man
@@ -1,17 +1,40 @@
-.TH radio 1 "(c) 1998,99 Gerd Knorr"
+.TH radio 1 "(c) 1998-2001 Gerd Knorr"
.SH NAME
radio - console radio application
.SH SYNOPSIS
-.B radio [ frequency ]
+.B radio [ options ]
.SH DESCRIPTION
.B radio
-is a interactice, ncurses-bases console radio application. If a
-command line argument is present,
-.B radio
-tries to interpret this as frequency (in MHz).
-.P
-If you want to use radio non-interactive to set the frequency,
-redirect both stdin and out to /dev/null.
+is a interactive, ncurses-bases console radio application.
+.SH OPTIONS
+.TP
+.B -h
+print a short help text.
+.TP
+.B -d
+enable debug output.
+.TP
+.B -q
+quit after processing the cmd line options, don't enter interactive
+ncurses mode. Only useful together with other options for obvious
+reasons ...
+.TP
+.B -m
+mute radio.
+.TP
+.B -f freq
+tune the specified radio frequency (and unmute the radio).
+.TP
+.B -c dev
+specify radio device (default is /dev/radio).
+.TP
+.B -s
+Do a scan for radio stations.
+.TP
+.B -S
+Same as above + write a radio.fmmap with the signal for every
+frequency. You can get a graph for it with gnuplot (plot
+"radio.fmmap" w lin).
.SH CONFIGURATION
.B radio
picks up station names and present stations from a config file.
@@ -42,9 +65,9 @@ the present stations, they get mapped to F1-F8. The [Stations]
section maps frequencies to station names. The frequencies in
both sections are specified in Hz.
.SH AUTHOR
-Gerd Knorr <kraxel@goldbach.in-berlin.de>
+Gerd Knorr <kraxel@bytesex.org>
.SH COPYRIGHT
-Copyright (C) 1997-99 Gerd Knorr
+Copyright (C) 1997-2001 Gerd Knorr
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/src/Makefile.in b/src/Makefile.in
index 5cdc834..05bfeac 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,118 +1,174 @@
srcdir=@srcdir@
VPATH=$(srcdir)
-ROOT=
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=$(ROOT)@bindir@
-mandir=$(ROOT)@mandir@
-resdir=$(ROOT)@resdir@
-config=@x11conf@/xawtvrc
-
-OS:=$(shell uname -s | tr "A-Z" "a-z")
-
-CC=@CC@
-DEPEND=@DEPEND@
-INSTALL=@INSTALL@
-INSTALL_PROGRAM=@INSTALL_PROGRAM@
-INSTALL_DATA=@INSTALL_DATA@
-INSTALL_DIR=mkdir -p
-SUID_ROOT=-m4755 -o root
-
-VERSION=xawtv-@XAWTV_VERSION@
-
-WARN=-Wall -Wstrict-prototypes
-CFLAGS=-g $(WARN) @CFLAGS@ -D_FILE_OFFSET_BITS=64 \
- -I$(srcdir)/.. -I.. @X_CFLAGS@ -D_REENTRANT \
- -DVERSION='"$(VERSION)"' -DCONFIGFILE='"$(config)"' \
- -I$(srcdir)/../libng -L../libng \
- -I$(srcdir)/../libvbi -L../libvbi
-
-GFXLIBS=@GFXLIBS@
-X11LIBS=@X_LIBS@ @LIBS@ -l@XAWLIB@ -lXmu -lXt @X_PRE_LIBS@ -lXext \
- -lX11 @X_EXTRA_LIBS@
-MOLIBS=@X_LIBS@ @LIBS@ -lXm -lXmu -lXt @X_PRE_LIBS@ -lXext \
- -lX11 @X_EXTRA_LIBS@
-SCRLIBS=@LIBCURSES@
-IRLIBS=@LIRC@
-LDLIBS=@LIBPTHREAD@ @LIBSOUND@
-
-PROGS=xawtv xawtv-remote v4lctl streamer xvideo rootv scantv @PROGS@ @MOTIF@
-
-COMMON_OBJS=sound.o grab.o webcam.o frequencies.o commands.o parseconfig.o capture.o ../libng/libng.a
-LIRC_OBJS=lirc.o
-
-XAWTV_OBJS= main.o xt.o toolbox.o conf.o x11.o xv.o complete.o wmhooks.o \
- channel.o $(COMMON_OBJS) $(LIRC_OBJS)
-MOTV_OBJS= motif.o xt.o x11.o xv.o channel-no-x11.o $(COMMON_OBJS)
-FBTV_OBJS= fbtv.o fbtools.o channel-no-x11.o matrox.o \
- $(COMMON_OBJS) $(LIRC_OBJS)
-V4LCTL_OBJS= v4lctl.o channel-no-x11.o xv.o $(COMMON_OBJS)
-STREAMER_OBJS= streamer.o channel-no-x11.o $(COMMON_OBJS)
-SCANTV_OBJS= scantv.o channel-no-x11.o xv.o $(COMMON_OBJS)
+include ../Make.config
+
+CFLAGS=-g @CFLAGS@ $(WARN_FLAGS) $(LFS_FLAGS) $(X11_FLAGS) $(LIB_FLAGS) \
+ -DVERSION='"$(VERSION)"' -DCONFIGFILE='"$(config)"' \
+ -I$(srcdir)/.. -I.. -I. -D_REENTRANT
+
+# object files /libraries
+COMMON_OBJS = sound.o webcam.o frequencies.o commands.o parseconfig.o \
+ capture.o ../libng/libng.a
+
+XAWTV_OBJS = main.o xt.o toolbox.o conf.o x11.o xv.o complete-xaw.o \
+ wmhooks.o channel.o lirc.o midictrl.o joystick.o \
+ $(COMMON_OBJS)
+XAWTV_LIBS = $(GFX_LIBS) $(LIRC_LIBS) $(ATHENA_LIBS) $(OSS_LIBS) \
+ $(ALSA_LIBS) -lvbi
+
+MOTV_OBJS = motif.o man.o xt.o x11.o xv.o channel-no-x11.o wmhooks.o \
+ RegEdit.o icons.o complete-motif.o lirc.o midictrl.o \
+ joystick.o $(COMMON_OBJS)
+MOTV_LIBS = $(GFX_LIBS) $(LIRC_LIBS) $(MOTIF_LIBS) $(OSS_LIBS) \
+ $(ALSA_LIBS) -lvbi
+
+FBTV_OBJS = fbtv.o fbtools.o fs.o channel-no-x11.o matrox.o lirc.o \
+ midictrl.o joystick.o $(COMMON_OBJS)
+FBTV_LIBS = $(GFX_LIBS) $(LIRC_LIBS) $(CURSES_LIBS) $(ALSA_LIBS) \
+ -L@x_libraries@ @FSLIB@ -lm
+
+TTV_OBJS = aa.o channel-no-x11.o $(COMMON_OBJS)
+TTV_LIBS = $(GFX_LIBS) $(AA_LIBS)
+
+V4LCTL_OBJS = v4lctl.o channel-no-x11.o xv.o $(COMMON_OBJS)
+V4LCTL_LIBS = $(GFX_LIBS) $(ATHENA_LIBS)
+
+STREAMER_OBJS = streamer.o channel-no-x11.o $(COMMON_OBJS)
+STREAMER_LIBS = $(GFX_LIBS) $(OSS_LIBS)
+
+SCANTV_OBJS = scantv.o channel-no-x11.o $(COMMON_OBJS)
+SCANTV_LIBS = $(GFX_LIBS) -lvbi
+
+# what to build / install
+PROGS=v4lctl streamer scantv vbi-debug @PROGS@
+INST=install-dirs install-common @INST@
+LANG=de it
+
+all build: $(PROGS) i18n
##########################################################################
+# app-defaults
-all build: $(PROGS)
+.SUFFIXES: .ad .h
+.ad.h:
+ perl $(srcdir)/fallback.pl < $< > $@
+
+MoTV.ad: $(srcdir)/MoTV-default $(srcdir)/MoTV-fixed
+ cat $(srcdir)/MoTV-default $(srcdir)/MoTV-fixed > MoTV.ad
+
+i18n:
+ for lang in $(LANG); do \
+ cat $(srcdir)/MoTV-$$lang $(srcdir)/MoTV-fixed > MoTV.$$lang.ad; \
+ done
+
+
+##########################################################################
+# build rules
xawtv: $(XAWTV_OBJS)
- $(CC) $(CFLAGS) -o $@ $(XAWTV_OBJS) $(GFXLIBS) $(IRLIBS) $(X11LIBS) $(LDLIBS)
- -test -f Xawtv.ad || cp -v $(srcdir)/Xawtv.ad .
+ $(CC) $(CFLAGS) -o $@ $(XAWTV_OBJS) $(XAWTV_LIBS) -ldl -Wl,-E
motv: $(MOTV_OBJS)
- $(CC) $(CFLAGS) -o $@ $(MOTV_OBJS) $(GFXLIBS) $(IRLIBS) $(MOLIBS) $(LDLIBS)
+ $(CC) $(CFLAGS) -o $@ $(MOTV_OBJS) $(MOTV_LIBS) -ldl -Wl,-E
fbtv: $(FBTV_OBJS)
- $(CC) $(CFLAGS) -o $@ $(FBTV_OBJS) $(GFXLIBS) $(IRLIBS) $(SCRLIBS) $(LDLIBS) -lm
+ $(CC) $(CFLAGS) -o $@ $(FBTV_OBJS) $(FBTV_LIBS) -ldl -Wl,-E
+
+ttv: $(TTV_OBJS)
+ $(CC) $(CFLAGS) -o $@ $(TTV_OBJS) $(TTV_LIBS) -ldl -Wl,-E
v4lctl: $(V4LCTL_OBJS)
- $(CC) $(CFLAGS) -o $@ $(V4LCTL_OBJS) $(GFXLIBS) $(X11LIBS) $(LDLIBS)
+ $(CC) $(CFLAGS) -o $@ $(V4LCTL_OBJS) $(V4LCTL_LIBS) -ldl -Wl,-E
streamer: $(STREAMER_OBJS)
- $(CC) $(CFLAGS) -o $@ $(STREAMER_OBJS) $(GFXLIBS) $(IRLIBS) $(LDLIBS)
+ $(CC) $(CFLAGS) -o $@ $(STREAMER_OBJS) $(STREAMER_LIBS) -ldl -Wl,-E
+
+scantv: $(SCANTV_OBJS)
+ $(CC) $(CFLAGS) -o $@ $(SCANTV_OBJS) $(SCANTV_LIBS) -ldl -Wl,-E
xvideo: xvideo.o
- $(CC) $(CFLAGS) -o $@ xvideo.o $(X11LIBS) #$(LDLIBS)
+ $(CC) $(CFLAGS) -o $@ xvideo.o $(ATHENA_LIBS)
+
+vbi-debug: vbi-debug.o
+ $(CC) $(CFLAGS) -o $@ vbi-debug.o -lvbi
rootv: rootv.o parseconfig.o
- $(CC) $(CFLAGS) -o $@ rootv.o parseconfig.o $(X11LIBS)
+ $(CC) $(CFLAGS) -o $@ rootv.o parseconfig.o $(ATHENA_LIBS)
v4l-conf: v4l-conf.o
- $(CC) $(CFLAGS) -o $@ v4l-conf.o $(X11LIBS)
-
-scantv: $(SCANTV_OBJS)
- $(CC) $(CFLAGS) -o $@ $(SCANTV_OBJS) -lvbi $(GFXLIBS) $(X11LIBS) $(LDLIBS)
+ $(CC) $(CFLAGS) -o $@ v4l-conf.o $(ATHENA_LIBS)
xawtv-remote: xawtv-remote.o
- $(CC) $(CFLAGS) -o $@ xawtv-remote.o $(X11LIBS)
+ $(CC) $(CFLAGS) -o $@ xawtv-remote.o $(ATHENA_LIBS)
+
+mididump: midictrl.c
+ $(CC) $(CFLAGS) -DSTANDALONE -o $@ $(srcdir)/midictrl.c $(ALSA_LIBS)
channel-no-x11.o: $(srcdir)/channel.c
$(CC) $(CFLAGS) -DNO_X11=1 -c -o $@ $(srcdir)/channel.c
-install: all
+complete-xaw.o: $(srcdir)/complete.c
+ $(CC) $(CFLAGS) -DATHENA=1 -c -o $@ $(srcdir)/complete.c
+
+complete-motif.o: $(srcdir)/complete.c
+ $(CC) $(CFLAGS) -DMOTIF=1 -c -o $@ $(srcdir)/complete.c
+
+
+##########################################################################
+# install rules
+
+install: all $(INST)
+
+install-dirs:
$(INSTALL_DIR) $(bindir)
- $(INSTALL_DIR) $(resdir)
- $(INSTALL_PROGRAM) -s xawtv $(bindir)
+ $(INSTALL_DIR) $(resdir)/app-defaults
+ $(INSTALL_DIR) $(resdir)/de/app-defaults
+
+install-common:
+ $(INSTALL_DIR) $(bindir)
+ $(INSTALL_DIR) $(resdir)/app-defaults
+ $(INSTALL_PROGRAM) $(srcdir)/subtitles $(bindir)
$(INSTALL_PROGRAM) -s xawtv-remote $(bindir)
$(INSTALL_PROGRAM) -s streamer $(bindir)
$(INSTALL_PROGRAM) -s v4lctl $(bindir)
$(INSTALL_PROGRAM) -s rootv $(bindir)
$(INSTALL_PROGRAM) -s scantv $(bindir)
- test -f fbtv &&\
- $(INSTALL_PROGRAM) -s fbtv $(bindir) || true
- test -f v4l-conf &&\
- $(INSTALL_PROGRAM) -s $(SUID_ROOT) v4l-conf $(bindir) || true
- $(INSTALL_DATA) $(srcdir)/Xawtv.ad $(resdir)/Xawtv
+ $(INSTALL_PROGRAM) -s xawtv $(bindir)
+ $(INSTALL_DATA) $(srcdir)/Xawtv.ad $(resdir)/app-defaults/Xawtv
+
+install-motv:
+ $(INSTALL_PROGRAM) -s motv $(bindir)
+ $(INSTALL_DIR) $(resdir)/app-defaults
+ $(INSTALL_DATA) MoTV.ad $(resdir)/app-defaults/MoTV
+ for lang in $(LANG); do \
+ $(INSTALL_DIR) $(resdir)/$$lang/app-defaults; \
+ $(INSTALL_DATA) MoTV.$$lang.ad $(resdir)/$$lang/app-defaults/MoTV; \
+ done
+
+install-ttv:
+ $(INSTALL_PROGRAM) -s ttv $(bindir)
+
+install-fbtv:
+ $(INSTALL_PROGRAM) -s fbtv $(bindir)
+
+install-v4l-conf:
+ $(INSTALL_PROGRAM) -s $(SUID_ROOT) v4l-conf $(bindir)
+
+
+##########################################################################
+# misc
clean:
- -rm -f *.o *.moc *core TAGS
+ -rm -f *.o *.moc *core TAGS Xawtv.h MoTV.h MoTV.ad $(I18N)
realclean distclean: clean
-rm -f $(PROGS) Makefile *~ *.bak
-depend dep:
+depend dep: Xawtv.h MoTV.h
$(DEPEND) -- $(CFLAGS) -- *.c
-#-------------------------------------------------------------------------
+
+##########################################################################
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/src/MoTV-de b/src/MoTV-de
new file mode 100644
index 0000000..4379c4a
--- /dev/null
+++ b/src/MoTV-de
@@ -0,0 +1,261 @@
+
+! ----------------------------------------------------------------------------
+! some standard motif stuff [i18n]
+
+*.cancelLabelString: Abbrechen
+*.applyLabelString: Übernehmen
+*.XmFileSelectionBox.dirListLabelString: Verzeichnisse
+*.XmFileSelectionBox.fileListLabelString: Dateien
+*.XmFileSelectionBox.selectionLabelString: Auswahl
+
+
+! ----------------------------------------------------------------------------
+! fonts [i18n]
+
+*renderTable:
+*renderTable.fontType: FONT_IS_FONTSET
+*renderTable.fontName: \
+ -*-helvetica-medium-r-normal--*-120-*-*-*-*, \
+ -*-*-*-r-normal--*-120-*-*-*-*
+
+MoTV.onscreen.label.renderTable:
+MoTV.onscreen.label.renderTable.fontType: FONT_IS_FONTSET
+MoTV.onscreen.label.renderTable.fontName: \
+ -*-ledfixed-medium-r-semicondensed--39-*-*-*-*-*
+
+MoTV.vtx.label.renderTable:
+MoTV.vtx.label.renderTable.fontType: FONT_IS_FONT
+MoTV.vtx.label.renderTable.fontName: 10x20
+
+
+! ----------------------------------------------------------------------------
+! strings [i18n]
+
+MoTV.about_box_popup.title: Über motv
+MoTV*about_box_popup*messageString: \
+ motv - Motif TV application \n\
+ \n\
+ (c) 2001 Gerd Knorr <kraxel@bytesex.org>
+
+MoTV.errbox_popup.title: Fehler
+
+control*menubar*fileM.tearOffTitle: Datei
+control*menubar*editM.tearOffTitle: Bearbeiten
+control*menubar*toolsM.tearOffTitle: Tools
+control*menubar*tuneM.tearOffTitle: Tuner
+control*menubar*grabM.tearOffTitle: Bild speichern
+control*menubar*ratioM.tearOffTitle: Seitenverhältnis
+control*menubar*launchM.tearOffTitle: Launch
+control*menubar*subM.tearOffTitle: Untertitel
+control*menubar*stationsM.tearOffTitle: Sender
+control*menubar*optionsM.tearOffTitle: Einstellungen
+control*menubar*helpM.tearOffTitle: Hilfe
+control*menubar*captureM.tearOffTitle: Capture
+control*menubar*freqM.tearOffTitle: Frequenztabelle
+control*menubar*inputM.tearOffTitle: Eingang
+control*menubar*normM.tearOffTitle: TV Norm
+
+control*menubar.file.labelString: Datei
+control*menubar.file.mnemonic: D
+control*menubar.edit.labelString: Bearbeiten
+control*menubar.edit.mnemonic: B
+control*menubar.tools.labelString: Tools
+control*menubar.tools.mnemonic: T
+control*menubar*tune.labelString: Tuner
+control*menubar*grab.labelString: Bild speichern
+control*menubar*ratio.labelString: Seitenverhältnis
+control*menubar*launch.labelString: Launch
+control*menubar*sub.labelString: Untertitel
+control*menubar.stations.labelString: Sender
+control*menubar.stations.mnemonic: S
+control*menubar.options.labelString: Einstellungen
+control*menubar.options.mnemonic: E
+control*menubar.filter.labelString: Filter
+control*menubar.filter.mnemonic: F
+control*menubar.help.labelString: Hilfe
+control*menubar.help.mnemonic: H
+
+! file menu
+control*menubar*rec.labelString: Film aufnehmen ...
+control*menubar*rec.mnemonic: F
+control*menubar*rec.acceleratorText: R
+control*menubar*rec.accelerator: <Key>R
+control*menubar*quit.labelString: Beenden
+control*menubar*quit.mnemonic: B
+control*menubar*quit.acceleratorText: Q
+control*menubar*quit.accelerator: <Key>Q
+
+! edit menu
+control*menubar*copy.labelString: Kopieren
+control*menubar*copy.mnemonic: K
+control*menubar*copy.acceleratorText: Ctrl+C
+control*menubar*copy.accelerator: Ctrl<Key>C
+
+! tools menu
+control*menubar*mute.labelString: Ton aus
+control*menubar*mute.mnemonic: a
+control*menubar*mute.acceleratorText: A
+control*menubar*mute.accelerator: <Key>A
+control*menubar*full.labelString: Vollbild
+control*menubar*full.acceleratorText: F
+control*menubar*full.accelerator: <Key>F
+control*menubar*ontop.labelString: Stay on Top
+control*menubar*ontop.mnemonic: T
+control*menubar*ontop.acceleratorText: T
+control*menubar*ontop.accelerator: <Key>T
+control*menubar*levels.labelString: Aufnahmepegel ...
+control*menubar*levels.acceleratorText: L
+control*menubar*levels.accelerator: <Key>L
+control*menubar*st_up.labelString: Nächster Sender
+control*menubar*st_up.acceleratorText: page up
+control*menubar*st_dn.labelString: Vorheriger Sender
+control*menubar*st_dn.acceleratorText: page down
+
+control*menubar*ch_up.labelString: Nächster Kanal
+control*menubar*ch_up.acceleratorText: up
+control*menubar*ch_dn.labelString: Vorheriger Kanal
+control*menubar*ch_dn.acceleratorText: down
+control*menubar*fi_up.labelString: Finetune up
+control*menubar*fi_up.acceleratorText: right
+control*menubar*fi_dn.labelString: Finetune down
+control*menubar*fi_dn.acceleratorText: left
+
+control*menubar*ppm_f.labelString: PPM, maximale Größe
+control*menubar*ppm_f.acceleratorText: G
+control*menubar*ppm_f.accelerator: ~Ctrl<Key>G
+control*menubar*ppm_w.labelString: PPM, Fenstergröße
+control*menubar*ppm_w.acceleratorText: Ctrl+G
+control*menubar*ppm_w.accelerator: Ctrl<Key>G
+control*menubar*jpg_f.labelString: JPEG, maximale Größe
+control*menubar*jpg_f.mnemonic: J
+control*menubar*jpg_f.acceleratorText: J
+control*menubar*jpg_f.accelerator: ~Ctrl<Key>J
+control*menubar*jpg_w.labelString: JPEG, Fenstergröße
+control*menubar*jpg_w.acceleratorText: Ctrl+J
+control*menubar*jpg_w.accelerator: Ctrl<Key>J
+
+control*menubar*r_no.labelString: keines
+control*menubar*r_no.mnemonic: k
+control*menubar*r_43.labelString: 4:3
+control*menubar*r_43.mnemonic: 4
+
+control*menubar*s_off.labelString: keine
+control*menubar*s_150.labelString: Seite 150
+control*menubar*s_150.mnemonic: 1
+control*menubar*s_333.labelString: Seite 333
+control*menubar*s_333.mnemonic: 3
+control*menubar*s_777.labelString: Seite 777
+control*menubar*s_777.mnemonic: 7
+control*menubar*s_888.labelString: Seite 888
+control*menubar*s_888.mnemonic: 8
+
+! options menu
+control*menubar*add.labelString: Sender hinzufügen ...
+control*menubar*add.mnemonic: h
+control*menubar*scan.labelString: Sendersuche ...
+control*menubar*pref.labelString: Einstellungen ...
+control*menubar*save.labelString: Konfiguration speichern
+control*menubar*save.mnemonic: s
+
+control*menubar*capture.labelString: Capture
+control*menubar*capture.mnemonic: C
+control*menubar*freq.labelString: Frequenztabelle
+control*menubar*freq.mnemonic: F
+control*menubar*scale.labelString: Regler ...
+control*menubar*scale.acceleratorText: S
+control*menubar*scale.accelerator: <Key>S
+
+control*menubar*input.labelString: Eingang
+control*menubar*input.mnemonic: E
+control*menubar*norm.labelString: Fernsehnorm
+control*menubar*norm.mnemonic: N
+
+! filter menu
+control*menubar*none.labelString: Kein filter
+control*menubar*none.mnemonic: K
+
+! help menu
+control*menubar*man.labelString: Manual anzeigen
+control*menubar*man.mnemonic: M
+control*menubar*about.labelString: Über ...
+control*menubar*about.mnemonic: b
+
+control*box.XmPushButton*menu.del.labelString: Löschen
+control*box.XmPushButton*menu.edit.labelString: Ändern ...
+
+! channel scan
+*chscan_popup.title: Sendersuche
+*chscan_popup*okLabelString: Start
+*chscan_popup*hints.labelString: \
+ Der Sendersuchlauf baut eine komplett neue\n\
+ Senderliste auf, die jetzige Liste wird\n\
+ überschrieben.\n\
+ \n\
+ Damit die Sendersuche richtig funkioniert\n\
+ müssen Fernsehnorm und Frequenztabelle\n\
+ richtig eingestellt sein. Beides ist auch\n\
+ unter "Einstellungen" zu finden.\n
+
+! channel properties
+*prop_popup.title: Einstellungen
+*prop_popup*rc.nameL.labelString: Sendername
+*prop_popup*rc.keyL.labelString: Hotkey
+*prop_popup*rc.channelL.labelString: Kanal
+*prop_popup*rc.buttons.ok.labelString: OK
+*prop_popup*rc.buttons.cancel.labelString: Abbrechen
+*prop_popup*no_name_popup.title: Fehler
+*prop_popup*no_name_popup*messageString: \
+ Einen Namen für den Sender mußt Du schon vergeben.
+
+! preferences
+*pref_popup.title: Einstellungen
+*pref_popup*okLabelString: Speichern
+*pref_popup*fsL.labelString: Vollbild
+*pref_popup*fsT.labelString: Auflösung umschalten
+*pref_popup*fsO.labelString: Auflösung:
+*pref_popup*mixL.labelString: \
+ Lautstärke (funkioniert erst nach Neustart)
+*pref_popup*mixT.labelString: Lautstärke mit Mixer regeln
+*pref_popup*mix1O.labelString: Gerät:
+*pref_popup*mix2O.labelString: Regler:
+*pref_popup*optL.labelString: Optionen
+*pref_popup*osd.labelString: Bei Vollbild OSD benutzen
+*pref_popup*keypad-ntsc.labelString: Nummernblock: ntsc modus
+*pref_popup*keypad-partial.labelString: \
+ Nummernblock: beim ersten Tastendruck umschalten
+*pref_popup*jpeg.label.labelString: JPEG Bildqualität:
+
+scale.title: Regler
+scale*volume.titleString: Lautstärke
+scale*bright.titleString: Helligkeit
+scale*hue.titleString: Farbe
+scale*color.titleString: Sättigung
+scale*contrast.titleString: Kontrast
+
+levels.title: Monitor
+levels*enable.labelstring: einschalten
+
+streamer.title: Film aufnehmen
+streamer*driverL.labelString: Ausgabeformat
+streamer*driver.labelString: Driver:
+streamer*videoL.labelString: Video Einstellungen
+streamer*video.labelString: Format:
+streamer*fpsL.labelString: fps:
+streamer*audioL.labelString: Audio Einstellungen
+streamer*audio.labelString: Format:
+streamer*rateL.labelString: Rate:
+streamer*fileL.labelString: Dateinamen
+streamer*fvideoL.labelString: Video:
+streamer*faudioL.labelString: Audio:
+streamer*status.labelString: fixme
+
+streamer*files.labelString: Browse ...
+streamer*buttons.rec.labelString: Aufnahme
+streamer*buttons.stop.labelString: Stop
+streamer*buttons.play.labelString: Abspielen
+streamer*buttons.cancel.labelString: Schließen
+
+MoTV.man_popup.title: Manual page
+MoTV.man_popup*okLabelString: Fenster schließen
+MoTV.man_popup*label.labelString: bitte warten ...
+
diff --git a/src/MoTV-default b/src/MoTV-default
new file mode 100644
index 0000000..5c68b6b
--- /dev/null
+++ b/src/MoTV-default
@@ -0,0 +1,266 @@
+
+! ----------------------------------------------------------------------------
+! some standard motif stuff [i18n]
+
+!*.cancelLabelString: Cancel
+!*.applyLabelString: Apply
+!*.XmFileSelectionBox.dirListLabelString: Directories
+!*.XmFileSelectionBox.fileListLabelString: Files
+!*.XmFileSelectionBox.selectionLabelString: Selection
+
+
+! ----------------------------------------------------------------------------
+! fonts [i18n]
+
+*renderTable:
+*renderTable.fontType: FONT_IS_FONTSET
+*renderTable.fontName: \
+ -*-helvetica-medium-r-normal--*-120-*-*-*-*, \
+ -*-*-*-r-normal--*-120-*-*-*-*
+
+MoTV.onscreen.label.renderTable:
+MoTV.onscreen.label.renderTable.fontType: FONT_IS_FONTSET
+MoTV.onscreen.label.renderTable.fontName: \
+ -*-ledfixed-medium-r-semicondensed--39-*-*-*-*-*
+
+MoTV.vtx.label.renderTable:
+MoTV.vtx.label.renderTable.fontType: FONT_IS_FONT
+MoTV.vtx.label.renderTable.fontName: 10x20
+
+
+! ----------------------------------------------------------------------------
+! strings [i18n]
+
+MoTV.about_box_popup.title: About motv
+MoTV*about_box_popup*messageString: \
+ motv - Motif TV application \n\
+ \n\
+ (c) 2001 Gerd Knorr <kraxel@bytesex.org>
+
+MoTV.errbox_popup.title: Errors
+
+control*menubar*fileM.tearOffTitle: File
+control*menubar*editM.tearOffTitle: Edit
+control*menubar*toolsM.tearOffTitle: Tools
+control*menubar*tuneM.tearOffTitle: Tuner control
+control*menubar*grabM.tearOffTitle: Grab image
+control*menubar*ratioM.tearOffTitle: Aspect ratio
+control*menubar*launchM.tearOffTitle: Launch
+control*menubar*subM.tearOffTitle: Subtitles
+control*menubar*stationsM.tearOffTitle: TV Stations
+control*menubar*optionsM.tearOffTitle: Options
+control*menubar*helpM.tearOffTitle: Help
+control*menubar*captureM.tearOffTitle: Capture
+control*menubar*freqM.tearOffTitle: Frequency table
+control*menubar*inputM.tearOffTitle: Inputs
+control*menubar*normM.tearOffTitle: TV Norm
+
+control*menubar.file.labelString: File
+control*menubar.file.mnemonic: F
+control*menubar.edit.labelString: Edit
+control*menubar.edit.mnemonic: E
+control*menubar.tools.labelString: Tools
+control*menubar.tools.mnemonic: T
+control*menubar*tune.labelString: Tuner
+control*menubar*grab.labelString: Grab image
+control*menubar*ratio.labelString: Aspect ratio
+control*menubar*launch.labelString: Launch
+control*menubar*sub.labelString: Subtitles
+control*menubar.stations.labelString: Stations
+control*menubar.stations.mnemonic: S
+control*menubar.options.labelString: Options
+control*menubar.options.mnemonic: O
+control*menubar.filter.labelString: Filter
+control*menubar.filter.mnemonic: F
+control*menubar.help.labelString: Help
+control*menubar.help.mnemonic: H
+
+! file menu
+control*menubar*rec.labelString: Record movie ...
+control*menubar*rec.mnemonic: R
+control*menubar*rec.acceleratorText: R
+control*menubar*rec.accelerator: <Key>R
+control*menubar*quit.labelString: Quit
+control*menubar*quit.mnemonic: Q
+control*menubar*quit.acceleratorText: Q
+control*menubar*quit.accelerator: <Key>Q
+
+! edit menu
+control*menubar*copy.labelString: Copy
+control*menubar*copy.mnemonic: C
+control*menubar*copy.acceleratorText: Ctrl+C
+control*menubar*copy.accelerator: Ctrl<Key>C
+
+! tools menu
+control*menubar*mute.labelString: Mute audio
+control*menubar*mute.mnemonic: a
+control*menubar*mute.acceleratorText: A
+control*menubar*mute.accelerator: <Key>A
+control*menubar*full.labelString: Fullscreen
+control*menubar*full.mnemonic: F
+control*menubar*full.acceleratorText: F
+control*menubar*full.accelerator: <Key>F
+control*menubar*ontop.labelString: Stay on Top
+control*menubar*ontop.mnemonic: T
+control*menubar*ontop.acceleratorText: T
+control*menubar*ontop.accelerator: <Key>T
+control*menubar*levels.labelString: Record level monitor ...
+control*menubar*levels.mnemonic: l
+control*menubar*levels.acceleratorText: L
+control*menubar*levels.accelerator: <Key>L
+control*menubar*st_up.labelString: Next station
+control*menubar*st_up.acceleratorText: page up
+control*menubar*st_dn.labelString: Previous station
+control*menubar*st_dn.acceleratorText: page down
+
+control*menubar*ch_up.labelString: Channel up
+control*menubar*ch_up.acceleratorText: up
+control*menubar*ch_dn.labelString: Channel down
+control*menubar*ch_dn.acceleratorText: down
+control*menubar*fi_up.labelString: Finetune up
+control*menubar*fi_up.acceleratorText: right
+control*menubar*fi_dn.labelString: Finetune down
+control*menubar*fi_dn.acceleratorText: left
+
+control*menubar*ppm_f.labelString: PPM, max size
+control*menubar*ppm_f.acceleratorText: G
+control*menubar*ppm_f.accelerator: ~Ctrl<Key>G
+control*menubar*ppm_w.labelString: PPM, window size
+control*menubar*ppm_w.acceleratorText: Ctrl+G
+control*menubar*ppm_w.accelerator: Ctrl<Key>G
+control*menubar*jpg_f.labelString: JPEG, max size
+control*menubar*jpg_f.mnemonic: J
+control*menubar*jpg_f.acceleratorText: J
+control*menubar*jpg_f.accelerator: ~Ctrl<Key>J
+control*menubar*jpg_w.labelString: JPEG, window size
+control*menubar*jpg_w.acceleratorText: Ctrl+J
+control*menubar*jpg_w.accelerator: Ctrl<Key>J
+
+control*menubar*r_no.labelString: no ratio
+control*menubar*r_no.mnemonic: n
+control*menubar*r_43.labelString: 4:3
+control*menubar*r_43.mnemonic: 4
+
+control*menubar*s_off.labelString: disable
+control*menubar*s_150.labelString: page 150
+control*menubar*s_150.mnemonic: 1
+control*menubar*s_333.labelString: page 333
+control*menubar*s_333.mnemonic: 3
+control*menubar*s_777.labelString: page 777
+control*menubar*s_777.mnemonic: 7
+control*menubar*s_888.labelString: page 888
+control*menubar*s_888.mnemonic: 8
+
+! options menu
+control*menubar*add.labelString: Add station ...
+control*menubar*add.mnemonic: A
+control*menubar*scan.labelString: Channel scan ...
+control*menubar*pref.labelString: Preferences ...
+control*menubar*pref.mnemonic: P
+control*menubar*save.labelString: Save configuration
+control*menubar*save.mnemonic: S
+
+control*menubar*capture.labelString: Capture
+control*menubar*capture.mnemonic: C
+control*menubar*freq.labelString: Frequency table
+control*menubar*freq.mnemonic: F
+control*menubar*scale.labelString: Scales ...
+control*menubar*scale.mnemonic: S
+control*menubar*scale.acceleratorText: S
+control*menubar*scale.accelerator: <Key>S
+
+control*menubar*input.labelString: Input
+control*menubar*input.mnemonic: I
+control*menubar*norm.labelString: TV Norm
+control*menubar*norm.mnemonic: N
+
+! filter menu
+control*menubar*none.labelString: No filter
+control*menubar*none.mnemonic: N
+
+! help menu
+control*menubar*man.labelString: Show manpage
+control*menubar*man.mnemonic: m
+control*menubar*about.labelString: About ...
+control*menubar*about.mnemonic: A
+
+control*box.XmPushButton*menu.del.labelString: Delete
+control*box.XmPushButton*menu.edit.labelString: Edit ...
+
+! channel scan
+*chscan_popup.title: Channel scan
+*chscan_popup*okLabelString: Start
+*chscan_popup*hints.labelString: \
+ You can let me scan all channels for\n\
+ TV stations here. This will create a\n\
+ new channel list from scratch, your\n\
+ current list will be lost.\n\
+ \n\
+ Make sure you have configured the correct\n\
+ TV norm and Frequency table first (it's in\n\
+ the options menu too), otherwise the scan\n\
+ will not find any station ...\n\
+ \n
+
+! channel properties
+*prop_popup.title: Edit Station
+*prop_popup*rc.nameL.labelString: Station name
+*prop_popup*rc.keyL.labelString: Hotkey
+*prop_popup*rc.channelL.labelString: Channel
+*prop_popup*rc.buttons.ok.labelString: OK
+*prop_popup*rc.buttons.cancel.labelString: Cancel
+*prop_popup*no_name_popup.title: Error
+*prop_popup*no_name_popup*messageString: \
+ You have to specify a name for the TV Station
+
+! preferences
+*pref_popup.title: Preferences
+*pref_popup*okLabelString: Save
+*pref_popup*fsL.labelString: Fullscreen
+*pref_popup*fsT.labelString: Enable mode switching
+*pref_popup*fsO.labelString: Video mode:
+*pref_popup*mixL.labelString: Volume (needs restart to take effect)
+*pref_popup*mixT.labelString: Use mixer device for volume control
+*pref_popup*mix1O.labelString: mixer device:
+*pref_popup*mix2O.labelString: mixer control:
+*pref_popup*optL.labelString: Options
+*pref_popup*osd.labelString: Use onscreen display in Fullscreen mode
+*pref_popup*keypad-ntsc.labelString: keypad: ntsc mode
+*pref_popup*keypad-partial.labelString: \
+ keypad: enable partial (switch on first key)
+*pref_popup*jpeg.label.labelString: JPEG quality:
+
+scale.title: Scale controls
+scale*volume.titleString: Volume
+scale*bright.titleString: Bright
+scale*hue.titleString: Hue
+scale*color.titleString: Saturation
+scale*contrast.titleString: Contrast
+
+levels.title: Monitor
+levels*enable.labelstring: enable
+
+streamer.title: record a movie
+streamer*driverL.labelString: Output format
+streamer*driver.labelString: Driver:
+streamer*videoL.labelString: Video options
+streamer*video.labelString: Format:
+streamer*fpsL.labelString: fps:
+streamer*audioL.labelString: Audio options
+streamer*audio.labelString: Format:
+streamer*rateL.labelString: Rate:
+streamer*fileL.labelString: Filenames
+streamer*fvideoL.labelString: Video:
+streamer*faudioL.labelString: Audio:
+streamer*status.labelString: fixme
+
+streamer*files.labelString: Browse ...
+streamer*buttons.rec.labelString: Record
+streamer*buttons.stop.labelString: Stop
+streamer*buttons.play.labelString: Playback
+streamer*buttons.cancel.labelString: Close
+
+MoTV.man_popup.title: Manual page
+MoTV.man_popup*okLabelString: close window
+MoTV.man_popup*label.labelString: please wait ...
+
diff --git a/src/MoTV-fixed b/src/MoTV-fixed
new file mode 100644
index 0000000..9a96802
--- /dev/null
+++ b/src/MoTV-fixed
@@ -0,0 +1,311 @@
+! ----------------------------------------------------------------------------
+! main window
+
+MoTV.geometry: 320x240+50+50
+MoTV.winGravity: Static
+
+MoTV.translations: #override \n\
+ <PropertyNotify>: Remote()
+
+MoTV.tv.traversalOn: false
+MoTV.tv.highlightThickness: 0
+MoTV.tv.background: black
+MoTV.tv.translations: #replace \n\
+ <Btn2Down>: Ipc(drag) \n\
+ <Btn3Up>: Popup(control) \n\
+ ~Alt ~Ctrl <Key>C: Popup(control) \n\
+ Ctrl <Key>C: Ipc(primary) \n\
+ Alt <Key>C: Ipc(primary) \n\
+ <Key>R: Popup(streamer) \n\
+ <Key>S: Popup(scale) \n\
+ <Key>L: Popup(levels) \n\
+ <Key>H: man(motv) \n\
+ <Key>F1: man(motv) \n\
+ <Key>osfHelp: man(motv) \n\
+ \
+ <Key>Q: CloseMain() \n\
+ <Key>KP_Add: Command(volume,inc) \n\
+ <Key>KP_Subtract: Command(volume,dec) \n\
+ <Key>KP_Enter: Command(volume,mute) \n\
+ <Key>osfActivate: Command(volume,mute) \n\
+ <Key>A: Command(volume,mute) \n\
+ <Key>F: Command(fullscreen) \n\
+ Ctrl<Key>Z: Zap(fast) \n\
+ <Key>Z: Zap() \n\
+ Ctrl<Key>G: Command(snap,ppm,win) \n\
+ Ctrl<Key>J: Command(snap,jpeg,win) \n\
+ <Key>G: Command(snap,ppm,full) \n\
+ <Key>J: Command(snap,jpeg,full) \n\
+ Ctrl<Key>Up: Scan() \n\
+ Ctrl<Key>osfUp: Scan() \n\
+ ~Ctrl<Key>Up: Command(setchannel,next) \n\
+ ~Ctrl<Key>osfUp: Command(setchannel,next) \n\
+ <Key>Down: Command(setchannel,prev) \n\
+ <Key>osfDown: Command(setchannel,prev) \n\
+ <Key>Right: Command(setchannel,fine_up) \n\
+ <Key>osfRight: Command(setchannel,fine_up) \n\
+ <Key>Left: Command(setchannel,fine_down) \n\
+ <Key>osfLeft: Command(setchannel,fine_down) \n\
+ <Key>Page_Up: Command(setstation,next) \n\
+ <Key>osfPageUp: Command(setstation,next) \n\
+ <Key>Page_Down: Command(setstation,prev) \n\
+ <Key>osfPageDown: Command(setstation,prev) \n\
+ <Key>BackSpace: Command(setstation,back) \n\
+ <Key>osfBackSpace: Command(setstation,back) \n\
+ <Btn4Up>: Command(setstation,next) \n\
+ <Btn5Up>: Command(setstation,prev) \n\
+ <Key>V: Command(capture,toggle) \n\
+ <Key>space: Command(setstation,next) \n\
+ \
+ <Key>KP_0: Command(keypad,0) \n\
+ <Key>KP_1: Command(keypad,1) \n\
+ <Key>KP_2: Command(keypad,2) \n\
+ <Key>KP_3: Command(keypad,3) \n\
+ <Key>KP_4: Command(keypad,4) \n\
+ <Key>KP_5: Command(keypad,5) \n\
+ <Key>KP_6: Command(keypad,6) \n\
+ <Key>KP_7: Command(keypad,7) \n\
+ <Key>KP_8: Command(keypad,8) \n\
+ <Key>KP_9: Command(keypad,9)
+
+
+MoTV.tv*stationsM.menuPost: <Btn1>
+
+MoTV.about_box_popup.deleteResponse: DESTROY
+MoTV.errbox_popup.deleteResponse: UNMAP
+
+MoTV.tv*stationsM.packing: PACK_COLUMN
+control*menubar*stationsM.packing: PACK_COLUMN
+
+
+! ----------------------------------------------------------------------------
+! control window
+
+control.title: MoTV
+control.iconName: MoTV
+control.iconPixmap: TVimg
+control.iconMask: TVmask
+control*highlightThickness: 0
+control*XmPushButton.highlightThickness: 1
+control.XmDialogShell*highlightThickness: 1
+
+control*tool.orientation: HORIZONTAL
+control*tool.?.shadowThickness: 1
+control*tool.?.labelType: PIXMAP
+control*tool.XmSeparator.orientation: VERTICAL
+control*tool.XmSeparator.width: 12
+control*tool.XmSeparator.margin: 3
+control*tool.prev.labelPixmap: prev
+control*tool.next.labelPixmap: next
+control*tool.snap.labelPixmap: snap
+control*tool.movie.labelPixmap: movie
+control*tool.mute.labelPixmap: mute
+control*tool.exit.labelPixmap: exit
+
+control*menubar*XmMenuShell.XmRowColumn.tearOffModel: TEAR_OFF_ENABLED
+!control*box.XmPushButton*menu.tearOffModel: TEAR_OFF_DISABLED
+
+control.form.view.scrollingPolicy: AUTOMATIC
+!control.form.view.scrollBarDisplayPolicy: STATIC
+control.form.view.scrollBarPlacement: BOTTOM_RIGHT
+control.form.view.scrolledWindowChildType: SCROLL_VERT
+control.form.view.box.resizeWidth: false
+control.form.view.box.packing: PACK_TIGHT
+control.form.view.box.orientation: HORIZONTAL
+control.form.view.box.entryAlignment: ALIGNMENT_CENTER
+
+control.form.?.leftAttachment: ATTACH_FORM
+control.form.?.rightAttachment: ATTACH_FORM
+control.form.tool.topAttachment: ATTACH_WIDGET
+control.form.tool.topWidget: menubar
+control.form.view.topAttachment: ATTACH_WIDGET
+control.form.view.topWidget: tool
+control.form.view.bottomAttachment: ATTACH_WIDGET
+control.form.view.bottomWidget: status
+control.form.status.bottomAttachment: ATTACH_FORM
+control.form.status.orientation: HORIZONTAL
+control.form.status.marginWidth: 0
+control.form.status.marginHeight: 0
+control.form.status.spacing: 0
+!control.form.status.adjustLast: True
+control.form.status.f.shadowType: SHADOW_IN
+control.form.status.f.shadowThickness: 1
+control.form.status.f.?.marginLeft: 3
+control.form.status.f.?.marginRight: 3
+control.form.status.f.?.labelString:
+
+
+! ----------------------------------------------------------------------------
+! channel scan
+
+*chscan_popup.deleteResponse: DESTROY
+*chscan_popup*dialogStyle: DIALOG_PRIMARY_APPLICATION_MODAL
+*chscan_popup*okLabelString: Start
+*chscan_popup*channel.editable: False
+*chscan_popup*channel.slidingMode: THERMOMETER
+*chscan_popup*channel.orientation: HORIZONTAL
+*chscan_popup*channel.titleString: -
+*chscan_popup*channel.sliderVisual: SHADOWED_BACKGROUND
+
+
+! ----------------------------------------------------------------------------
+! channel properties
+
+*prop_popup.deleteResponse: UNMAP
+*prop_popup*rc.key.editable: false
+*prop_popup*rc.channel.visibleItemCount: 16
+*prop_popup*rc.channel.comboBoxType: DROP_DOWN_LIST
+*prop_popup*rc.channel.positionMode: ONE_BASED
+*prop_popup*rc.keyL.marginTop: 10
+*prop_popup*rc.channelL.marginTop: 10
+*prop_popup*rc.XmLabel.alignment: ALIGNMENT_BEGINNING
+
+*prop_popup*no_name_popup.deleteResponse: DESTROY
+
+
+! ----------------------------------------------------------------------------
+! preferences
+
+*pref_popup.deleteResponse: UNMAP
+*pref_popup*fsL.frameChildType: FRAME_TITLE_CHILD
+*pref_popup*optL.frameChildType: FRAME_TITLE_CHILD
+*pref_popup*mixL.frameChildType: FRAME_TITLE_CHILD
+*pref_popup*jpeg.orientation: HORIZONTAL
+*pref_popup*jpeg.quality.columns: 3
+
+
+! ----------------------------------------------------------------------------
+! scale controls
+
+scale.form.shadowThickness: 0
+scale*XmScale.orientation: HORIZONTAL
+scale*XmScale.showValue: false
+scale*XmScale.highlightOnEnter: true
+scale*XmScale.highlightThickness: 1
+scale*XmScale.minimum: 0
+scale*XmScale.maximum: 65535
+scale*XmScale.topAttachment: ATTACH_WIDGET
+scale*XmScale.leftAttachment: ATTACH_FORM
+scale*XmScale.rightAttachment: ATTACH_FORM
+scale*XmScale.topOffset: 5
+scale*XmScale.BottomOffset: 5
+scale*XmScale.leftOffset: 10
+scale*XmScale.rightOffset: 10
+scale*XmScale.width: 160
+
+
+! ----------------------------------------------------------------------------
+! levels window (sound level monitor)
+
+levels*highlightThickness: 1
+levels*XmScale.editable: False
+levels*XmScale.slidingMode: THERMOMETER
+levels*XmScale.orientation: HORIZONTAL
+levels*XmScale.sliderVisual: SHADOWED_BACKGROUND
+levels*XmScale.minimum: 0
+levels*XmScale.maximum: 128
+levels*XmScale.width: 256
+
+
+! ----------------------------------------------------------------------------
+! streamer window
+
+streamer.title: record a movie
+streamer*XmComboBox.comboBoxType: DROP_DOWN_COMBO_BOX
+streamer*XmComboBox.width: 100
+streamer*XmLabel.alignment: ALIGNMENT_BEGINNING
+
+streamer*highlightThickness: 1
+!streamer*navigationType: STICKY_TAB_GROUP
+
+streamer*form.?.leftAttachment: ATTACH_FORM
+streamer*form.?.rightAttachment: ATTACH_FORM
+streamer*form.?.topAttachment: ATTACH_WIDGET
+streamer*form.?.topOffset: 10
+streamer*form.?.leftOffset: 10
+streamer*form.?.rightOffset: 10
+streamer*form.XmFrame.marginWidth: 5
+streamer*form.XmFrame.marginHeight: 5
+
+streamer*XmFrame.XmRowColumn.orientation: HORIZONTAL
+streamer*XmFrame.fbox.orientation: VERTICAL
+streamer*XmFrame.fbox.spacing: 0
+streamer*XmFrame.fbox.marginWidth: 0
+streamer*XmFrame.fbox.marginHeight: 0
+streamer*XmFrame.fbox.?.orientation: HORIZONTAL
+
+streamer*form.buttons.marginWidth: 0
+streamer*form.buttons.packing: PACK_COLUMN
+streamer*form.buttons.orientation: HORIZONTAL
+streamer*form.buttons.entryAlignment: ALIGNMENT_CENTER
+streamer*form.buttons.bottomAttachment: ATTACH_FORM
+
+streamer*driverL.frameChildType: FRAME_TITLE_CHILD
+streamer*videoL.frameChildType: FRAME_TITLE_CHILD
+streamer*audioL.frameChildType: FRAME_TITLE_CHILD
+streamer*fileL.frameChildType: FRAME_TITLE_CHILD
+
+streamer*videoF.topWidget: driverF
+streamer*audioF.topWidget: videoF
+streamer*fileF.topWidget: audioF
+streamer*status.topWidget: fileF
+streamer*buttons.topWidget: status
+streamer*buttons.bottomOffset: 10
+
+streamer*rate.itemCount: 6
+streamer*rate.visibleItemCount: 6
+streamer*rate.items: 8000,11025,22050,32000,44100,48000
+streamer*rate.selectedItem: 44100
+streamer*fps.itemCount: 11
+streamer*fps.visibleItemCount: 11
+streamer*fps.items: 3,5,8,10,12,15,18,20,24,25,30
+streamer*fps.selectedItem: 12
+
+streamer*fvideo.translations: #override\
+ Ctrl<Key>Tab: Complete()
+streamer*faudio.translations: #override\
+ Ctrl<Key>Tab: Complete()
+
+! debug
+streamer.form.*.borderWidth: 0
+!streamer.form.*.borderColor: darkred
+!streamer*form.XmFrame.background: yellow
+
+
+! ----------------------------------------------------------------------------
+! man page renderer
+
+MoTV.man_popup.deleteResponse: DESTROY
+MoTV.man_popup*view.width: 500
+MoTV.man_popup*view.height: 600
+MoTV.man_popup*view.scrollingPolicy: AUTOMATIC
+MoTV.man_popup*view.scrollBarPlacement: BOTTOM_RIGHT
+
+MoTV.man_popup*label.alignment: ALIGNMENT_BEGINNING
+MoTV.man_popup*label.marginWidth: 5
+MoTV.man_popup*label.marginHeight: 5
+MoTV.man_popup*label.renderTable: bold,underline
+MoTV.man_popup*label.renderTable.fontType: FONT_IS_FONTSET
+MoTV.man_popup*label.renderTable.fontName: \
+ -*-fixed-medium-r-normal--13-*-*-*-*-*
+MoTV.man_popup*label.renderTable.bold.fontType: FONT_IS_FONTSET
+MoTV.man_popup*label.renderTable.bold.fontName: \
+ -*-fixed-bold-r-normal--13-*-*-*-*-*
+MoTV.man_popup*label.renderTable.underline.underlineType: SINGLE_LINE
+
+
+! ----------------------------------------------------------------------------
+! Onscreen window
+
+MoTV.onscreen.allowShellResize: true
+MoTV.onscreen*background: black
+MoTV.onscreen*borderColor: black
+MoTV.onscreen*foreground: lightgreen
+MoTV.onscreen*highlightThickness: 0
+
+MoTV.vtx.allowShellResize: true
+MoTV.vtx*borderColor: black
+MoTV.vtx*background: black
+MoTV.vtx*foreground: white
+MoTV.vtx*highlightThickness: 0
+
diff --git a/src/MoTV-it b/src/MoTV-it
new file mode 100644
index 0000000..61ef5e4
--- /dev/null
+++ b/src/MoTV-it
@@ -0,0 +1,267 @@
+! Mij <mij@fastwebnet.it>
+
+! ----------------------------------------------------------------------------
+! some standard motif stuff [i18n]
+
+*.cancelLabelString: Annulla
+*.applyLabelString: Applica
+*.XmFileSelectionBox.dirListLabelString: Directory
+*.XmFileSelectionBox.fileListLabelString: File
+*.XmFileSelectionBox.selectionLabelString: Seleziona
+
+
+! ----------------------------------------------------------------------------
+! fonts [i18n]
+
+*renderTable:
+*renderTable.fontType: FONT_IS_FONTSET
+*renderTable.fontName: \
+ -*-helvetica-medium-r-normal--*-120-*-*-*-*, \
+ -*-*-*-r-normal--*-120-*-*-*-*
+
+MoTV.onscreen.label.renderTable:
+MoTV.onscreen.label.renderTable.fontType: FONT_IS_FONTSET
+MoTV.onscreen.label.renderTable.fontName: \
+ -*-ledfixed-medium-r-semicondensed--39-*-*-*-*-*
+
+MoTV.vtx.label.renderTable:
+MoTV.vtx.label.renderTable.fontType: FONT_IS_FONT
+MoTV.vtx.label.renderTable.fontName: 10x20
+
+
+! ----------------------------------------------------------------------------
+! strings [i18n]
+
+MoTV.about_box_popup.title: Info su motv
+MoTV*about_box_popup*messageString: \
+ motv - Motif TV application \n\
+ \n\
+ (c) 2001 Gerd Knorr <kraxel@bytesex.org>
+
+MoTV.errbox_popup.title: Errori
+
+control*menubar*fileM.tearOffTitle: File
+control*menubar*editM.tearOffTitle: Modifica
+control*menubar*toolsM.tearOffTitle: Strumenti
+control*menubar*tuneM.tearOffTitle: Sintonizzatore
+control*menubar*grabM.tearOffTitle: Cattura immagine
+control*menubar*ratioM.tearOffTitle: Aspetto
+control*menubar*launchM.tearOffTitle: Avvia
+control*menubar*subM.tearOffTitle: Sottotitoli
+control*menubar*stationsM.tearOffTitle: Stazioni TV
+control*menubar*optionsM.tearOffTitle: Opzioni
+control*menubar*helpM.tearOffTitle: Aiuto
+control*menubar*captureM.tearOffTitle: Cattura
+control*menubar*freqM.tearOffTitle: Frequency table
+control*menubar*inputM.tearOffTitle: Input
+control*menubar*normM.tearOffTitle: Protocollo TV
+
+control*menubar.file.labelString: File
+control*menubar.file.mnemonic: F
+control*menubar.edit.labelString: Modifica
+control*menubar.edit.mnemonic: M
+control*menubar.tools.labelString: Tools
+control*menubar.tools.mnemonic: T
+control*menubar*tune.labelString: Sintonizzatore
+control*menubar*grab.labelString: Cattura immagine
+control*menubar*ratio.labelString: Aspetto
+control*menubar*launch.labelString: Avvia
+control*menubar*sub.labelString: Sottotitoli
+control*menubar.stations.labelString: Stazioni
+control*menubar.stations.mnemonic: S
+control*menubar.options.labelString: Opzioni
+control*menubar.options.mnemonic: O
+!control*menubar.filter.labelString: Filter
+!control*menubar.filter.mnemonic: F
+control*menubar.help.labelString: Aiuto
+control*menubar.help.mnemonic: A
+
+! file menu
+control*menubar*rec.labelString: Registra filmato ...
+control*menubar*rec.mnemonic: R
+control*menubar*rec.acceleratorText: R
+control*menubar*rec.accelerator: <Key>R
+control*menubar*quit.labelString: Esci
+control*menubar*quit.mnemonic: Q
+control*menubar*quit.acceleratorText: Q
+control*menubar*quit.accelerator: <Key>Q
+
+! edit menu
+control*menubar*copy.labelString: Copia
+control*menubar*copy.mnemonic: C
+control*menubar*copy.acceleratorText: Ctrl+C
+control*menubar*copy.accelerator: Ctrl<Key>C
+
+! tools menu
+control*menubar*mute.labelString: Muto
+control*menubar*mute.mnemonic: a
+control*menubar*mute.acceleratorText: A
+control*menubar*mute.accelerator: <Key>A
+control*menubar*full.labelString: Fullscreen
+control*menubar*full.mnemonic: F
+control*menubar*full.acceleratorText: F
+control*menubar*full.accelerator: <Key>F
+control*menubar*ontop.labelString: Stay on Top
+control*menubar*ontop.mnemonic: T
+control*menubar*ontop.acceleratorText: T
+control*menubar*ontop.accelerator: <Key>T
+!control*menubar*levels.labelString: Record level monitor ...
+!control*menubar*levels.mnemonic: l
+!control*menubar*levels.acceleratorText: L
+!control*menubar*levels.accelerator: <Key>L
+control*menubar*st_up.labelString: Stazione successiva
+control*menubar*st_up.acceleratorText: pagina su
+control*menubar*st_dn.labelString: Stazione precedente
+control*menubar*st_dn.acceleratorText: pagina giù
+
+control*menubar*ch_up.labelString: Canale Successivo
+control*menubar*ch_up.acceleratorText: su
+control*menubar*ch_dn.labelString: Canale precedente
+control*menubar*ch_dn.acceleratorText: giù
+control*menubar*fi_up.labelString: Sintonizzazione di precisione su
+control*menubar*fi_up.acceleratorText: destra
+control*menubar*fi_dn.labelString: Sintonizzazione di precisione giù
+control*menubar*fi_dn.acceleratorText: sinistra
+
+control*menubar*ppm_f.labelString: PPM, dimensione max
+control*menubar*ppm_f.acceleratorText: G
+control*menubar*ppm_f.accelerator: ~Ctrl<Key>G
+control*menubar*ppm_w.labelString: PPM, dimensione finestra
+control*menubar*ppm_w.acceleratorText: Ctrl+G
+control*menubar*ppm_w.accelerator: Ctrl<Key>G
+control*menubar*jpg_f.labelString: JPEG, dimensione max
+control*menubar*jpg_f.mnemonic: J
+control*menubar*jpg_f.acceleratorText: J
+control*menubar*jpg_f.accelerator: ~Ctrl<Key>J
+control*menubar*jpg_w.labelString: JPEG, dimensione finestra
+control*menubar*jpg_w.acceleratorText: Ctrl+J
+control*menubar*jpg_w.accelerator: Ctrl<Key>J
+
+control*menubar*r_no.labelString: non fisso
+control*menubar*r_no.mnemonic: n
+control*menubar*r_43.labelString: 4:3
+control*menubar*r_43.mnemonic: 4
+
+control*menubar*s_off.labelString: disabilita
+control*menubar*s_150.labelString: pagina 150
+control*menubar*s_150.mnemonic: 1
+control*menubar*s_333.labelString: pagina 333
+control*menubar*s_333.mnemonic: 3
+control*menubar*s_777.labelString: pagina 777
+control*menubar*s_777.mnemonic: 7
+control*menubar*s_888.labelString: pagina 888
+control*menubar*s_888.mnemonic: 8
+
+! options menu
+control*menubar*add.labelString: Aggiungi stazione ...
+control*menubar*add.mnemonic: A
+control*menubar*scan.labelString: Scansiona canale ...
+control*menubar*pref.labelString: Preferenze ...
+control*menubar*pref.mnemonic: P
+control*menubar*save.labelString: Salva configurazione
+control*menubar*save.mnemonic: S
+
+control*menubar*capture.labelString: Cattura
+control*menubar*capture.mnemonic: C
+control*menubar*freq.labelString: Frequency table
+control*menubar*freq.mnemonic: F
+control*menubar*scale.labelString: Scala ...
+control*menubar*scale.mnemonic: S
+control*menubar*scale.acceleratorText: S
+control*menubar*scale.accelerator: <Key>S
+
+control*menubar*input.labelString: Input
+control*menubar*input.mnemonic: I
+control*menubar*norm.labelString: Protocollo TV
+control*menubar*norm.mnemonic: N
+
+! filter menu
+!control*menubar*none.labelString: No filter
+!control*menubar*none.mnemonic: N
+
+! help menu
+control*menubar*man.labelString: Mostra la manpage
+control*menubar*man.mnemonic: m
+control*menubar*about.labelString: Informazioni ...
+control*menubar*about.mnemonic: A
+
+control*box.XmPushButton*menu.del.labelString: Cancella
+control*box.XmPushButton*menu.edit.labelString: Modifica ...
+
+! channel scan
+*chscan_popup.title: Scansiona canale
+*chscan_popup*okLabelString: Inizia
+*chscan_popup*hints.labelString: \
+ COn questa opzione puoi lasciarmi\n\
+ scansionare tutti i canali TV. Così\n\
+ sarà creata una nuova lista canali\n\
+ che sovrascriverà quella attuale.\n\
+ \n\
+ Prima assicurati di aver configurato\n\
+ correttamente TV Norm e Frequency table\n\
+ (vedi menu Opzioni), altrimenti la scansione\n\
+ non individuerà alcuna stazione ...\n\
+ \n
+
+! channel properties
+*prop_popup.title: Modifica stazione
+*prop_popup*rc.nameL.labelString: Nome stazione
+*prop_popup*rc.keyL.labelString: Acceleratore
+*prop_popup*rc.channelL.labelString: Canale
+*prop_popup*rc.buttons.ok.labelString: OK
+*prop_popup*rc.buttons.cancel.labelString: Annulla
+*prop_popup*no_name_popup.title: Errore
+*prop_popup*no_name_popup*messageString: \
+ Devi specificare un nome per la stazione
+
+! preferences
+*pref_popup.title: Preferenze
+*pref_popup*okLabelString: Salva
+*pref_popup*fsL.labelString: Fullscreen
+*pref_popup*fsT.labelString: Abilita lo switchng video
+*pref_popup*fsO.labelString: Modalità video:
+*pref_popup*mixL.labelString: Volume (necessario riavviare)
+*pref_popup*mixT.labelString: Usa il mixer per regolare il volume
+*pref_popup*mix1O.labelString: Periferica mixer:
+*pref_popup*mix2O.labelString: Controllo mixer:
+*pref_popup*optL.labelString: Opzioni
+*pref_popup*osd.labelString: Usa onscreen display in modalità fullscreen
+*pref_popup*keypad-ntsc.labelString: keypad: modalità ntsc
+*pref_popup*keypad-partial.labelString: \
+ keypad: abilita parzialmente (cambia al primo tasto)
+*pref_popup*jpeg.label.labelString: Qaulità JPEG:
+
+scale.title: Controlli scala
+scale*volume.titleString: Volume
+scale*bright.titleString: Luminosità
+scale*hue.titleString: Tono
+scale*color.titleString: Saturazione
+scale*contrast.titleString: Contrasto
+
+!levels.title: Monitor
+!levels*enable.labelstring: enable
+
+streamer.title: registra filmato
+streamer*driverL.labelString: Formato
+streamer*driver.labelString: Driver:
+streamer*videoL.labelString: Opzioni video
+streamer*video.labelString: Formato:
+streamer*fpsL.labelString: fps:
+streamer*audioL.labelString: Opzioni audio
+streamer*audio.labelString: Formato:
+streamer*rateL.labelString: frequenza:
+streamer*fileL.labelString: Nome file
+streamer*fvideoL.labelString: Video:
+streamer*faudioL.labelString: Audio:
+streamer*status.labelString: fissa
+
+streamer*files.labelString: Naviga ...
+streamer*buttons.rec.labelString: Registra
+streamer*buttons.stop.labelString: Stop
+streamer*buttons.play.labelString: Playback
+streamer*buttons.cancel.labelString: Chiudi
+
+MoTV.man_popup.title: Manuale
+MoTV.man_popup*okLabelString: chiudi finestra
+MoTV.man_popup*label.labelString: Attendi ...
+
diff --git a/src/MoTV.ad b/src/MoTV.ad
deleted file mode 100644
index c99e761..0000000
--- a/src/MoTV.ad
+++ /dev/null
@@ -1,55 +0,0 @@
-MoTV*fontList: -*-helvetica-medium-r-normal-*-120-*
-!MoTV*fontList: -*-lucida-medium-r-normal-*-120-*
-
-MoTV.geometry: 320x240
-MoTV.tv.background: black
-MoTV.tv.translations: #override \n\
- <Btn2Up>: Command(setstation,next) \n\
- <Btn3Up>: Popup(control) \n\
- <Key>osfPageUp: Command(setstation,next) \n\
- <Key>osfPageDown: Command(setstation,prev) \n\
- <Key>space: Command(setstation,next)
-
-*menu.leftAttachment: ATTACH_FORM
-*menu.rightAttachment: ATTACH_FORM
-*volume.topAttachment: ATTACH_WIDGET
-*color.topAttachment: ATTACH_WIDGET
-
-*XmMenuShell.XmRowColumn.tearOffModel: TEAR_OFF_ENABLED
-*menu*fileM.tearOffTitle: File
-*menu*stationsM.tearOffTitle: TV Stations
-*menu*optionsM.tearOffTitle: Options
-*menu*inputM.tearOffTitle: Inputs
-*menu*normM.tearOffTitle: TV Norm
-
-*menu.file.labelString: File
-*menu.file.mnemonic: F
-*menu.stations.labelString: Stations
-*menu.stations.mnemonic: S
-*menu.options.labelString: Options
-*menu.options.mnemonic: O
-
-*menu*quit.labelString: Quit
-*menu*quit.mnemonic: Q
-*menu*quit.acceleratorText: Q
-*menu*quit.accelerator: <Key>Q
-
-*menu*pointer.labelString: Mouse Pointer
-*menu*pointer.mnemonic: M
-*menu*pointer.acceleratorText: M
-*menu*pointer.accelerator: <Key>M
-*menu*ontop.labelString: Stay on Top
-*menu*ontop.mnemonic: T
-*menu*ontop.acceleratorText: T
-*menu*ontop.accelerator: <Key>T
-*menu*input.labelString: Input
-*menu*input.mnemonic: I
-*menu*norm.labelString: TV Norm
-*menu*norm.mnemonic: N
-
-*XmScale.orientation: HORIZONTAL
-*XmScale.showValue: true
-*XmScale.highlightOnEnter: true
-*XmScale.highlightThickness: 1
-*volume.titleString: Volume
-*color.titleString: Color
diff --git a/src/MoTV.de.ad b/src/MoTV.de.ad
new file mode 100644
index 0000000..37f07c8
--- /dev/null
+++ b/src/MoTV.de.ad
@@ -0,0 +1,572 @@
+
+! ----------------------------------------------------------------------------
+! some standard motif stuff [i18n]
+
+*.cancelLabelString: Abbrechen
+*.applyLabelString: Übernehmen
+*.XmFileSelectionBox.dirListLabelString: Verzeichnisse
+*.XmFileSelectionBox.fileListLabelString: Dateien
+*.XmFileSelectionBox.selectionLabelString: Auswahl
+
+
+! ----------------------------------------------------------------------------
+! fonts [i18n]
+
+*renderTable:
+*renderTable.fontType: FONT_IS_FONTSET
+*renderTable.fontName: \
+ -*-helvetica-medium-r-normal--*-120-*-*-*-*, \
+ -*-*-*-r-normal--*-120-*-*-*-*
+
+MoTV.onscreen.label.renderTable:
+MoTV.onscreen.label.renderTable.fontType: FONT_IS_FONTSET
+MoTV.onscreen.label.renderTable.fontName: \
+ -*-ledfixed-medium-r-semicondensed--39-*-*-*-*-*
+
+MoTV.vtx.label.renderTable:
+MoTV.vtx.label.renderTable.fontType: FONT_IS_FONT
+MoTV.vtx.label.renderTable.fontName: 10x20
+
+
+! ----------------------------------------------------------------------------
+! strings [i18n]
+
+MoTV.about_box_popup.title: Über motv
+MoTV*about_box_popup*messageString: \
+ motv - Motif TV application \n\
+ \n\
+ (c) 2001 Gerd Knorr <kraxel@bytesex.org>
+
+MoTV.errbox_popup.title: Fehler
+
+control*menubar*fileM.tearOffTitle: Datei
+control*menubar*editM.tearOffTitle: Bearbeiten
+control*menubar*toolsM.tearOffTitle: Tools
+control*menubar*tuneM.tearOffTitle: Tuner
+control*menubar*grabM.tearOffTitle: Bild speichern
+control*menubar*ratioM.tearOffTitle: Seitenverhältnis
+control*menubar*launchM.tearOffTitle: Launch
+control*menubar*subM.tearOffTitle: Untertitel
+control*menubar*stationsM.tearOffTitle: Sender
+control*menubar*optionsM.tearOffTitle: Einstellungen
+control*menubar*helpM.tearOffTitle: Hilfe
+control*menubar*captureM.tearOffTitle: Capture
+control*menubar*freqM.tearOffTitle: Frequenztabelle
+control*menubar*inputM.tearOffTitle: Eingang
+control*menubar*normM.tearOffTitle: TV Norm
+
+control*menubar.file.labelString: Datei
+control*menubar.file.mnemonic: D
+control*menubar.edit.labelString: Bearbeiten
+control*menubar.edit.mnemonic: B
+control*menubar.tools.labelString: Tools
+control*menubar.tools.mnemonic: T
+control*menubar*tune.labelString: Tuner
+control*menubar*grab.labelString: Bild speichern
+control*menubar*ratio.labelString: Seitenverhältnis
+control*menubar*launch.labelString: Launch
+control*menubar*sub.labelString: Untertitel
+control*menubar.stations.labelString: Sender
+control*menubar.stations.mnemonic: S
+control*menubar.options.labelString: Einstellungen
+control*menubar.options.mnemonic: E
+control*menubar.filter.labelString: Filter
+control*menubar.filter.mnemonic: F
+control*menubar.help.labelString: Hilfe
+control*menubar.help.mnemonic: H
+
+! file menu
+control*menubar*rec.labelString: Film aufnehmen ...
+control*menubar*rec.mnemonic: F
+control*menubar*rec.acceleratorText: R
+control*menubar*rec.accelerator: <Key>R
+control*menubar*quit.labelString: Beenden
+control*menubar*quit.mnemonic: B
+control*menubar*quit.acceleratorText: Q
+control*menubar*quit.accelerator: <Key>Q
+
+! edit menu
+control*menubar*copy.labelString: Kopieren
+control*menubar*copy.mnemonic: K
+control*menubar*copy.acceleratorText: Ctrl+C
+control*menubar*copy.accelerator: Ctrl<Key>C
+
+! tools menu
+control*menubar*mute.labelString: Ton aus
+control*menubar*mute.mnemonic: a
+control*menubar*mute.acceleratorText: A
+control*menubar*mute.accelerator: <Key>A
+control*menubar*full.labelString: Vollbild
+control*menubar*full.acceleratorText: F
+control*menubar*full.accelerator: <Key>F
+control*menubar*ontop.labelString: Stay on Top
+control*menubar*ontop.mnemonic: T
+control*menubar*ontop.acceleratorText: T
+control*menubar*ontop.accelerator: <Key>T
+control*menubar*levels.labelString: Aufnahmepegel ...
+control*menubar*levels.acceleratorText: L
+control*menubar*levels.accelerator: <Key>L
+control*menubar*st_up.labelString: Nächster Sender
+control*menubar*st_up.acceleratorText: page up
+control*menubar*st_dn.labelString: Vorheriger Sender
+control*menubar*st_dn.acceleratorText: page down
+
+control*menubar*ch_up.labelString: Nächster Kanal
+control*menubar*ch_up.acceleratorText: up
+control*menubar*ch_dn.labelString: Vorheriger Kanal
+control*menubar*ch_dn.acceleratorText: down
+control*menubar*fi_up.labelString: Finetune up
+control*menubar*fi_up.acceleratorText: right
+control*menubar*fi_dn.labelString: Finetune down
+control*menubar*fi_dn.acceleratorText: left
+
+control*menubar*ppm_f.labelString: PPM, maximale Größe
+control*menubar*ppm_f.acceleratorText: G
+control*menubar*ppm_f.accelerator: ~Ctrl<Key>G
+control*menubar*ppm_w.labelString: PPM, Fenstergröße
+control*menubar*ppm_w.acceleratorText: Ctrl+G
+control*menubar*ppm_w.accelerator: Ctrl<Key>G
+control*menubar*jpg_f.labelString: JPEG, maximale Größe
+control*menubar*jpg_f.mnemonic: J
+control*menubar*jpg_f.acceleratorText: J
+control*menubar*jpg_f.accelerator: ~Ctrl<Key>J
+control*menubar*jpg_w.labelString: JPEG, Fenstergröße
+control*menubar*jpg_w.acceleratorText: Ctrl+J
+control*menubar*jpg_w.accelerator: Ctrl<Key>J
+
+control*menubar*r_no.labelString: keines
+control*menubar*r_no.mnemonic: k
+control*menubar*r_43.labelString: 4:3
+control*menubar*r_43.mnemonic: 4
+
+control*menubar*s_off.labelString: keine
+control*menubar*s_150.labelString: Seite 150
+control*menubar*s_150.mnemonic: 1
+control*menubar*s_333.labelString: Seite 333
+control*menubar*s_333.mnemonic: 3
+control*menubar*s_777.labelString: Seite 777
+control*menubar*s_777.mnemonic: 7
+control*menubar*s_888.labelString: Seite 888
+control*menubar*s_888.mnemonic: 8
+
+! options menu
+control*menubar*add.labelString: Sender hinzufügen ...
+control*menubar*add.mnemonic: h
+control*menubar*scan.labelString: Sendersuche ...
+control*menubar*pref.labelString: Einstellungen ...
+control*menubar*save.labelString: Konfiguration speichern
+control*menubar*save.mnemonic: s
+
+control*menubar*capture.labelString: Capture
+control*menubar*capture.mnemonic: C
+control*menubar*freq.labelString: Frequenztabelle
+control*menubar*freq.mnemonic: F
+control*menubar*scale.labelString: Regler ...
+control*menubar*scale.acceleratorText: S
+control*menubar*scale.accelerator: <Key>S
+
+control*menubar*input.labelString: Eingang
+control*menubar*input.mnemonic: E
+control*menubar*norm.labelString: Fernsehnorm
+control*menubar*norm.mnemonic: N
+
+! filter menu
+control*menubar*none.labelString: Kein filter
+control*menubar*none.mnemonic: K
+
+! help menu
+control*menubar*man.labelString: Manual anzeigen
+control*menubar*man.mnemonic: M
+control*menubar*about.labelString: Über ...
+control*menubar*about.mnemonic: b
+
+control*box.XmPushButton*menu.del.labelString: Löschen
+control*box.XmPushButton*menu.edit.labelString: Ändern ...
+
+! channel scan
+*chscan_popup.title: Sendersuche
+*chscan_popup*okLabelString: Start
+*chscan_popup*hints.labelString: \
+ Der Sendersuchlauf baut eine komplett neue\n\
+ Senderliste auf, die jetzige Liste wird\n\
+ überschrieben.\n\
+ \n\
+ Damit die Sendersuche richtig funkioniert\n\
+ müssen Fernsehnorm und Frequenztabelle\n\
+ richtig eingestellt sein. Beides ist auch\n\
+ unter "Einstellungen" zu finden.\n
+
+! channel properties
+*prop_popup.title: Einstellungen
+*prop_popup*rc.nameL.labelString: Sendername
+*prop_popup*rc.keyL.labelString: Hotkey
+*prop_popup*rc.channelL.labelString: Kanal
+*prop_popup*rc.buttons.ok.labelString: OK
+*prop_popup*rc.buttons.cancel.labelString: Abbrechen
+*prop_popup*no_name_popup.title: Fehler
+*prop_popup*no_name_popup*messageString: \
+ Einen Namen für den Sender mußt Du schon vergeben.
+
+! preferences
+*pref_popup.title: Einstellungen
+*pref_popup*okLabelString: Speichern
+*pref_popup*fsL.labelString: Vollbild
+*pref_popup*fsT.labelString: Auflösung umschalten
+*pref_popup*fsO.labelString: Auflösung:
+*pref_popup*mixL.labelString: \
+ Lautstärke (funkioniert erst nach Neustart)
+*pref_popup*mixT.labelString: Lautstärke mit Mixer regeln
+*pref_popup*mix1O.labelString: Gerät:
+*pref_popup*mix2O.labelString: Regler:
+*pref_popup*optL.labelString: Optionen
+*pref_popup*osd.labelString: Bei Vollbild OSD benutzen
+*pref_popup*keypad-ntsc.labelString: Nummernblock: ntsc modus
+*pref_popup*keypad-partial.labelString: \
+ Nummernblock: beim ersten Tastendruck umschalten
+*pref_popup*jpeg.label.labelString: JPEG Bildqualität:
+
+scale.title: Regler
+scale*volume.titleString: Lautstärke
+scale*bright.titleString: Helligkeit
+scale*hue.titleString: Farbe
+scale*color.titleString: Sättigung
+scale*contrast.titleString: Kontrast
+
+levels.title: Monitor
+levels*enable.labelstring: einschalten
+
+streamer.title: Film aufnehmen
+streamer*driverL.labelString: Ausgabeformat
+streamer*driver.labelString: Driver:
+streamer*videoL.labelString: Video Einstellungen
+streamer*video.labelString: Format:
+streamer*fpsL.labelString: fps:
+streamer*audioL.labelString: Audio Einstellungen
+streamer*audio.labelString: Format:
+streamer*rateL.labelString: Rate:
+streamer*fileL.labelString: Dateinamen
+streamer*fvideoL.labelString: Video:
+streamer*faudioL.labelString: Audio:
+streamer*status.labelString: fixme
+
+streamer*files.labelString: Browse ...
+streamer*buttons.rec.labelString: Aufnahme
+streamer*buttons.stop.labelString: Stop
+streamer*buttons.play.labelString: Abspielen
+streamer*buttons.cancel.labelString: Schließen
+
+MoTV.man_popup.title: Manual page
+MoTV.man_popup*okLabelString: Fenster schließen
+MoTV.man_popup*label.labelString: bitte warten ...
+
+! ----------------------------------------------------------------------------
+! main window
+
+MoTV.geometry: 320x240+50+50
+MoTV.winGravity: Static
+
+MoTV.translations: #override \n\
+ <PropertyNotify>: Remote()
+
+MoTV.tv.traversalOn: false
+MoTV.tv.highlightThickness: 0
+MoTV.tv.background: black
+MoTV.tv.translations: #replace \n\
+ <Btn2Down>: Ipc(drag) \n\
+ <Btn3Up>: Popup(control) \n\
+ ~Alt ~Ctrl <Key>C: Popup(control) \n\
+ Ctrl <Key>C: Ipc(primary) \n\
+ Alt <Key>C: Ipc(primary) \n\
+ <Key>R: Popup(streamer) \n\
+ <Key>S: Popup(scale) \n\
+ <Key>L: Popup(levels) \n\
+ <Key>H: man(motv) \n\
+ <Key>F1: man(motv) \n\
+ <Key>osfHelp: man(motv) \n\
+ \
+ <Key>Q: CloseMain() \n\
+ <Key>KP_Add: Command(volume,inc) \n\
+ <Key>KP_Subtract: Command(volume,dec) \n\
+ <Key>KP_Enter: Command(volume,mute) \n\
+ <Key>osfActivate: Command(volume,mute) \n\
+ <Key>A: Command(volume,mute) \n\
+ <Key>F: Command(fullscreen) \n\
+ Ctrl<Key>Z: Zap(fast) \n\
+ <Key>Z: Zap() \n\
+ Ctrl<Key>G: Command(snap,ppm,win) \n\
+ Ctrl<Key>J: Command(snap,jpeg,win) \n\
+ <Key>G: Command(snap,ppm,full) \n\
+ <Key>J: Command(snap,jpeg,full) \n\
+ Ctrl<Key>Up: Scan() \n\
+ Ctrl<Key>osfUp: Scan() \n\
+ ~Ctrl<Key>Up: Command(setchannel,next) \n\
+ ~Ctrl<Key>osfUp: Command(setchannel,next) \n\
+ <Key>Down: Command(setchannel,prev) \n\
+ <Key>osfDown: Command(setchannel,prev) \n\
+ <Key>Right: Command(setchannel,fine_up) \n\
+ <Key>osfRight: Command(setchannel,fine_up) \n\
+ <Key>Left: Command(setchannel,fine_down) \n\
+ <Key>osfLeft: Command(setchannel,fine_down) \n\
+ <Key>Page_Up: Command(setstation,next) \n\
+ <Key>osfPageUp: Command(setstation,next) \n\
+ <Key>Page_Down: Command(setstation,prev) \n\
+ <Key>osfPageDown: Command(setstation,prev) \n\
+ <Key>BackSpace: Command(setstation,back) \n\
+ <Key>osfBackSpace: Command(setstation,back) \n\
+ <Btn4Up>: Command(setstation,next) \n\
+ <Btn5Up>: Command(setstation,prev) \n\
+ <Key>V: Command(capture,toggle) \n\
+ <Key>space: Command(setstation,next) \n\
+ \
+ <Key>KP_0: Command(keypad,0) \n\
+ <Key>KP_1: Command(keypad,1) \n\
+ <Key>KP_2: Command(keypad,2) \n\
+ <Key>KP_3: Command(keypad,3) \n\
+ <Key>KP_4: Command(keypad,4) \n\
+ <Key>KP_5: Command(keypad,5) \n\
+ <Key>KP_6: Command(keypad,6) \n\
+ <Key>KP_7: Command(keypad,7) \n\
+ <Key>KP_8: Command(keypad,8) \n\
+ <Key>KP_9: Command(keypad,9)
+
+
+MoTV.tv*stationsM.menuPost: <Btn1>
+
+MoTV.about_box_popup.deleteResponse: DESTROY
+MoTV.errbox_popup.deleteResponse: UNMAP
+
+MoTV.tv*stationsM.packing: PACK_COLUMN
+control*menubar*stationsM.packing: PACK_COLUMN
+
+
+! ----------------------------------------------------------------------------
+! control window
+
+control.title: MoTV
+control.iconName: MoTV
+control.iconPixmap: TVimg
+control.iconMask: TVmask
+control*highlightThickness: 0
+control*XmPushButton.highlightThickness: 1
+control.XmDialogShell*highlightThickness: 1
+
+control*tool.orientation: HORIZONTAL
+control*tool.?.shadowThickness: 1
+control*tool.?.labelType: PIXMAP
+control*tool.XmSeparator.orientation: VERTICAL
+control*tool.XmSeparator.width: 12
+control*tool.XmSeparator.margin: 3
+control*tool.prev.labelPixmap: prev
+control*tool.next.labelPixmap: next
+control*tool.snap.labelPixmap: snap
+control*tool.movie.labelPixmap: movie
+control*tool.mute.labelPixmap: mute
+control*tool.exit.labelPixmap: exit
+
+control*menubar*XmMenuShell.XmRowColumn.tearOffModel: TEAR_OFF_ENABLED
+!control*box.XmPushButton*menu.tearOffModel: TEAR_OFF_DISABLED
+
+control.form.view.scrollingPolicy: AUTOMATIC
+!control.form.view.scrollBarDisplayPolicy: STATIC
+control.form.view.scrollBarPlacement: BOTTOM_RIGHT
+control.form.view.scrolledWindowChildType: SCROLL_VERT
+control.form.view.box.resizeWidth: false
+control.form.view.box.packing: PACK_TIGHT
+control.form.view.box.orientation: HORIZONTAL
+control.form.view.box.entryAlignment: ALIGNMENT_CENTER
+
+control.form.?.leftAttachment: ATTACH_FORM
+control.form.?.rightAttachment: ATTACH_FORM
+control.form.tool.topAttachment: ATTACH_WIDGET
+control.form.tool.topWidget: menubar
+control.form.view.topAttachment: ATTACH_WIDGET
+control.form.view.topWidget: tool
+control.form.view.bottomAttachment: ATTACH_WIDGET
+control.form.view.bottomWidget: status
+control.form.status.bottomAttachment: ATTACH_FORM
+control.form.status.orientation: HORIZONTAL
+control.form.status.marginWidth: 0
+control.form.status.marginHeight: 0
+control.form.status.spacing: 0
+!control.form.status.adjustLast: True
+control.form.status.f.shadowType: SHADOW_IN
+control.form.status.f.shadowThickness: 1
+control.form.status.f.?.marginLeft: 3
+control.form.status.f.?.marginRight: 3
+control.form.status.f.?.labelString:
+
+
+! ----------------------------------------------------------------------------
+! channel scan
+
+*chscan_popup.deleteResponse: DESTROY
+*chscan_popup*dialogStyle: DIALOG_PRIMARY_APPLICATION_MODAL
+*chscan_popup*okLabelString: Start
+*chscan_popup*channel.editable: False
+*chscan_popup*channel.slidingMode: THERMOMETER
+*chscan_popup*channel.orientation: HORIZONTAL
+*chscan_popup*channel.titleString: -
+*chscan_popup*channel.sliderVisual: SHADOWED_BACKGROUND
+
+
+! ----------------------------------------------------------------------------
+! channel properties
+
+*prop_popup.deleteResponse: UNMAP
+*prop_popup*rc.key.editable: false
+*prop_popup*rc.channel.visibleItemCount: 16
+*prop_popup*rc.channel.comboBoxType: DROP_DOWN_LIST
+*prop_popup*rc.channel.positionMode: ONE_BASED
+*prop_popup*rc.keyL.marginTop: 10
+*prop_popup*rc.channelL.marginTop: 10
+*prop_popup*rc.XmLabel.alignment: ALIGNMENT_BEGINNING
+
+*prop_popup*no_name_popup.deleteResponse: DESTROY
+
+
+! ----------------------------------------------------------------------------
+! preferences
+
+*pref_popup.deleteResponse: UNMAP
+*pref_popup*fsL.frameChildType: FRAME_TITLE_CHILD
+*pref_popup*optL.frameChildType: FRAME_TITLE_CHILD
+*pref_popup*mixL.frameChildType: FRAME_TITLE_CHILD
+*pref_popup*jpeg.orientation: HORIZONTAL
+*pref_popup*jpeg.quality.columns: 3
+
+
+! ----------------------------------------------------------------------------
+! scale controls
+
+scale.form.shadowThickness: 0
+scale*XmScale.orientation: HORIZONTAL
+scale*XmScale.showValue: false
+scale*XmScale.highlightOnEnter: true
+scale*XmScale.highlightThickness: 1
+scale*XmScale.minimum: 0
+scale*XmScale.maximum: 65535
+scale*XmScale.topAttachment: ATTACH_WIDGET
+scale*XmScale.leftAttachment: ATTACH_FORM
+scale*XmScale.rightAttachment: ATTACH_FORM
+scale*XmScale.topOffset: 5
+scale*XmScale.BottomOffset: 5
+scale*XmScale.leftOffset: 10
+scale*XmScale.rightOffset: 10
+scale*XmScale.width: 160
+
+
+! ----------------------------------------------------------------------------
+! levels window (sound level monitor)
+
+levels*highlightThickness: 1
+levels*XmScale.editable: False
+levels*XmScale.slidingMode: THERMOMETER
+levels*XmScale.orientation: HORIZONTAL
+levels*XmScale.sliderVisual: SHADOWED_BACKGROUND
+levels*XmScale.minimum: 0
+levels*XmScale.maximum: 128
+levels*XmScale.width: 256
+
+
+! ----------------------------------------------------------------------------
+! streamer window
+
+streamer.title: record a movie
+streamer*XmComboBox.comboBoxType: DROP_DOWN_COMBO_BOX
+streamer*XmComboBox.width: 100
+streamer*XmLabel.alignment: ALIGNMENT_BEGINNING
+
+streamer*highlightThickness: 1
+!streamer*navigationType: STICKY_TAB_GROUP
+
+streamer*form.?.leftAttachment: ATTACH_FORM
+streamer*form.?.rightAttachment: ATTACH_FORM
+streamer*form.?.topAttachment: ATTACH_WIDGET
+streamer*form.?.topOffset: 10
+streamer*form.?.leftOffset: 10
+streamer*form.?.rightOffset: 10
+streamer*form.XmFrame.marginWidth: 5
+streamer*form.XmFrame.marginHeight: 5
+
+streamer*XmFrame.XmRowColumn.orientation: HORIZONTAL
+streamer*XmFrame.fbox.orientation: VERTICAL
+streamer*XmFrame.fbox.spacing: 0
+streamer*XmFrame.fbox.marginWidth: 0
+streamer*XmFrame.fbox.marginHeight: 0
+streamer*XmFrame.fbox.?.orientation: HORIZONTAL
+
+streamer*form.buttons.marginWidth: 0
+streamer*form.buttons.packing: PACK_COLUMN
+streamer*form.buttons.orientation: HORIZONTAL
+streamer*form.buttons.entryAlignment: ALIGNMENT_CENTER
+streamer*form.buttons.bottomAttachment: ATTACH_FORM
+
+streamer*driverL.frameChildType: FRAME_TITLE_CHILD
+streamer*videoL.frameChildType: FRAME_TITLE_CHILD
+streamer*audioL.frameChildType: FRAME_TITLE_CHILD
+streamer*fileL.frameChildType: FRAME_TITLE_CHILD
+
+streamer*videoF.topWidget: driverF
+streamer*audioF.topWidget: videoF
+streamer*fileF.topWidget: audioF
+streamer*status.topWidget: fileF
+streamer*buttons.topWidget: status
+streamer*buttons.bottomOffset: 10
+
+streamer*rate.itemCount: 6
+streamer*rate.visibleItemCount: 6
+streamer*rate.items: 8000,11025,22050,32000,44100,48000
+streamer*rate.selectedItem: 44100
+streamer*fps.itemCount: 11
+streamer*fps.visibleItemCount: 11
+streamer*fps.items: 3,5,8,10,12,15,18,20,24,25,30
+streamer*fps.selectedItem: 12
+
+streamer*fvideo.translations: #override\
+ Ctrl<Key>Tab: Complete()
+streamer*faudio.translations: #override\
+ Ctrl<Key>Tab: Complete()
+
+! debug
+streamer.form.*.borderWidth: 0
+!streamer.form.*.borderColor: darkred
+!streamer*form.XmFrame.background: yellow
+
+
+! ----------------------------------------------------------------------------
+! man page renderer
+
+MoTV.man_popup.deleteResponse: DESTROY
+MoTV.man_popup*view.width: 500
+MoTV.man_popup*view.height: 600
+MoTV.man_popup*view.scrollingPolicy: AUTOMATIC
+MoTV.man_popup*view.scrollBarPlacement: BOTTOM_RIGHT
+
+MoTV.man_popup*label.alignment: ALIGNMENT_BEGINNING
+MoTV.man_popup*label.marginWidth: 5
+MoTV.man_popup*label.marginHeight: 5
+MoTV.man_popup*label.renderTable: bold,underline
+MoTV.man_popup*label.renderTable.fontType: FONT_IS_FONTSET
+MoTV.man_popup*label.renderTable.fontName: \
+ -*-fixed-medium-r-normal--13-*-*-*-*-*
+MoTV.man_popup*label.renderTable.bold.fontType: FONT_IS_FONTSET
+MoTV.man_popup*label.renderTable.bold.fontName: \
+ -*-fixed-bold-r-normal--13-*-*-*-*-*
+MoTV.man_popup*label.renderTable.underline.underlineType: SINGLE_LINE
+
+
+! ----------------------------------------------------------------------------
+! Onscreen window
+
+MoTV.onscreen.allowShellResize: true
+MoTV.onscreen*background: black
+MoTV.onscreen*borderColor: black
+MoTV.onscreen*foreground: lightgreen
+MoTV.onscreen*highlightThickness: 0
+
+MoTV.vtx.allowShellResize: true
+MoTV.vtx*borderColor: black
+MoTV.vtx*background: black
+MoTV.vtx*foreground: white
+MoTV.vtx*highlightThickness: 0
+
diff --git a/src/MoTV.it.ad b/src/MoTV.it.ad
new file mode 100644
index 0000000..8cd2fd0
--- /dev/null
+++ b/src/MoTV.it.ad
@@ -0,0 +1,578 @@
+! Mij <mij@fastwebnet.it>
+
+! ----------------------------------------------------------------------------
+! some standard motif stuff [i18n]
+
+*.cancelLabelString: Annulla
+*.applyLabelString: Applica
+*.XmFileSelectionBox.dirListLabelString: Directory
+*.XmFileSelectionBox.fileListLabelString: File
+*.XmFileSelectionBox.selectionLabelString: Seleziona
+
+
+! ----------------------------------------------------------------------------
+! fonts [i18n]
+
+*renderTable:
+*renderTable.fontType: FONT_IS_FONTSET
+*renderTable.fontName: \
+ -*-helvetica-medium-r-normal--*-120-*-*-*-*, \
+ -*-*-*-r-normal--*-120-*-*-*-*
+
+MoTV.onscreen.label.renderTable:
+MoTV.onscreen.label.renderTable.fontType: FONT_IS_FONTSET
+MoTV.onscreen.label.renderTable.fontName: \
+ -*-ledfixed-medium-r-semicondensed--39-*-*-*-*-*
+
+MoTV.vtx.label.renderTable:
+MoTV.vtx.label.renderTable.fontType: FONT_IS_FONT
+MoTV.vtx.label.renderTable.fontName: 10x20
+
+
+! ----------------------------------------------------------------------------
+! strings [i18n]
+
+MoTV.about_box_popup.title: Info su motv
+MoTV*about_box_popup*messageString: \
+ motv - Motif TV application \n\
+ \n\
+ (c) 2001 Gerd Knorr <kraxel@bytesex.org>
+
+MoTV.errbox_popup.title: Errori
+
+control*menubar*fileM.tearOffTitle: File
+control*menubar*editM.tearOffTitle: Modifica
+control*menubar*toolsM.tearOffTitle: Strumenti
+control*menubar*tuneM.tearOffTitle: Sintonizzatore
+control*menubar*grabM.tearOffTitle: Cattura immagine
+control*menubar*ratioM.tearOffTitle: Aspetto
+control*menubar*launchM.tearOffTitle: Avvia
+control*menubar*subM.tearOffTitle: Sottotitoli
+control*menubar*stationsM.tearOffTitle: Stazioni TV
+control*menubar*optionsM.tearOffTitle: Opzioni
+control*menubar*helpM.tearOffTitle: Aiuto
+control*menubar*captureM.tearOffTitle: Cattura
+control*menubar*freqM.tearOffTitle: Frequency table
+control*menubar*inputM.tearOffTitle: Input
+control*menubar*normM.tearOffTitle: Protocollo TV
+
+control*menubar.file.labelString: File
+control*menubar.file.mnemonic: F
+control*menubar.edit.labelString: Modifica
+control*menubar.edit.mnemonic: M
+control*menubar.tools.labelString: Tools
+control*menubar.tools.mnemonic: T
+control*menubar*tune.labelString: Sintonizzatore
+control*menubar*grab.labelString: Cattura immagine
+control*menubar*ratio.labelString: Aspetto
+control*menubar*launch.labelString: Avvia
+control*menubar*sub.labelString: Sottotitoli
+control*menubar.stations.labelString: Stazioni
+control*menubar.stations.mnemonic: S
+control*menubar.options.labelString: Opzioni
+control*menubar.options.mnemonic: O
+!control*menubar.filter.labelString: Filter
+!control*menubar.filter.mnemonic: F
+control*menubar.help.labelString: Aiuto
+control*menubar.help.mnemonic: A
+
+! file menu
+control*menubar*rec.labelString: Registra filmato ...
+control*menubar*rec.mnemonic: R
+control*menubar*rec.acceleratorText: R
+control*menubar*rec.accelerator: <Key>R
+control*menubar*quit.labelString: Esci
+control*menubar*quit.mnemonic: Q
+control*menubar*quit.acceleratorText: Q
+control*menubar*quit.accelerator: <Key>Q
+
+! edit menu
+control*menubar*copy.labelString: Copia
+control*menubar*copy.mnemonic: C
+control*menubar*copy.acceleratorText: Ctrl+C
+control*menubar*copy.accelerator: Ctrl<Key>C
+
+! tools menu
+control*menubar*mute.labelString: Muto
+control*menubar*mute.mnemonic: a
+control*menubar*mute.acceleratorText: A
+control*menubar*mute.accelerator: <Key>A
+control*menubar*full.labelString: Fullscreen
+control*menubar*full.mnemonic: F
+control*menubar*full.acceleratorText: F
+control*menubar*full.accelerator: <Key>F
+control*menubar*ontop.labelString: Stay on Top
+control*menubar*ontop.mnemonic: T
+control*menubar*ontop.acceleratorText: T
+control*menubar*ontop.accelerator: <Key>T
+!control*menubar*levels.labelString: Record level monitor ...
+!control*menubar*levels.mnemonic: l
+!control*menubar*levels.acceleratorText: L
+!control*menubar*levels.accelerator: <Key>L
+control*menubar*st_up.labelString: Stazione successiva
+control*menubar*st_up.acceleratorText: pagina su
+control*menubar*st_dn.labelString: Stazione precedente
+control*menubar*st_dn.acceleratorText: pagina giù
+
+control*menubar*ch_up.labelString: Canale Successivo
+control*menubar*ch_up.acceleratorText: su
+control*menubar*ch_dn.labelString: Canale precedente
+control*menubar*ch_dn.acceleratorText: giù
+control*menubar*fi_up.labelString: Sintonizzazione di precisione su
+control*menubar*fi_up.acceleratorText: destra
+control*menubar*fi_dn.labelString: Sintonizzazione di precisione giù
+control*menubar*fi_dn.acceleratorText: sinistra
+
+control*menubar*ppm_f.labelString: PPM, dimensione max
+control*menubar*ppm_f.acceleratorText: G
+control*menubar*ppm_f.accelerator: ~Ctrl<Key>G
+control*menubar*ppm_w.labelString: PPM, dimensione finestra
+control*menubar*ppm_w.acceleratorText: Ctrl+G
+control*menubar*ppm_w.accelerator: Ctrl<Key>G
+control*menubar*jpg_f.labelString: JPEG, dimensione max
+control*menubar*jpg_f.mnemonic: J
+control*menubar*jpg_f.acceleratorText: J
+control*menubar*jpg_f.accelerator: ~Ctrl<Key>J
+control*menubar*jpg_w.labelString: JPEG, dimensione finestra
+control*menubar*jpg_w.acceleratorText: Ctrl+J
+control*menubar*jpg_w.accelerator: Ctrl<Key>J
+
+control*menubar*r_no.labelString: non fisso
+control*menubar*r_no.mnemonic: n
+control*menubar*r_43.labelString: 4:3
+control*menubar*r_43.mnemonic: 4
+
+control*menubar*s_off.labelString: disabilita
+control*menubar*s_150.labelString: pagina 150
+control*menubar*s_150.mnemonic: 1
+control*menubar*s_333.labelString: pagina 333
+control*menubar*s_333.mnemonic: 3
+control*menubar*s_777.labelString: pagina 777
+control*menubar*s_777.mnemonic: 7
+control*menubar*s_888.labelString: pagina 888
+control*menubar*s_888.mnemonic: 8
+
+! options menu
+control*menubar*add.labelString: Aggiungi stazione ...
+control*menubar*add.mnemonic: A
+control*menubar*scan.labelString: Scansiona canale ...
+control*menubar*pref.labelString: Preferenze ...
+control*menubar*pref.mnemonic: P
+control*menubar*save.labelString: Salva configurazione
+control*menubar*save.mnemonic: S
+
+control*menubar*capture.labelString: Cattura
+control*menubar*capture.mnemonic: C
+control*menubar*freq.labelString: Frequency table
+control*menubar*freq.mnemonic: F
+control*menubar*scale.labelString: Scala ...
+control*menubar*scale.mnemonic: S
+control*menubar*scale.acceleratorText: S
+control*menubar*scale.accelerator: <Key>S
+
+control*menubar*input.labelString: Input
+control*menubar*input.mnemonic: I
+control*menubar*norm.labelString: Protocollo TV
+control*menubar*norm.mnemonic: N
+
+! filter menu
+!control*menubar*none.labelString: No filter
+!control*menubar*none.mnemonic: N
+
+! help menu
+control*menubar*man.labelString: Mostra la manpage
+control*menubar*man.mnemonic: m
+control*menubar*about.labelString: Informazioni ...
+control*menubar*about.mnemonic: A
+
+control*box.XmPushButton*menu.del.labelString: Cancella
+control*box.XmPushButton*menu.edit.labelString: Modifica ...
+
+! channel scan
+*chscan_popup.title: Scansiona canale
+*chscan_popup*okLabelString: Inizia
+*chscan_popup*hints.labelString: \
+ COn questa opzione puoi lasciarmi\n\
+ scansionare tutti i canali TV. Così\n\
+ sarà creata una nuova lista canali\n\
+ che sovrascriverà quella attuale.\n\
+ \n\
+ Prima assicurati di aver configurato\n\
+ correttamente TV Norm e Frequency table\n\
+ (vedi menu Opzioni), altrimenti la scansione\n\
+ non individuerà alcuna stazione ...\n\
+ \n
+
+! channel properties
+*prop_popup.title: Modifica stazione
+*prop_popup*rc.nameL.labelString: Nome stazione
+*prop_popup*rc.keyL.labelString: Acceleratore
+*prop_popup*rc.channelL.labelString: Canale
+*prop_popup*rc.buttons.ok.labelString: OK
+*prop_popup*rc.buttons.cancel.labelString: Annulla
+*prop_popup*no_name_popup.title: Errore
+*prop_popup*no_name_popup*messageString: \
+ Devi specificare un nome per la stazione
+
+! preferences
+*pref_popup.title: Preferenze
+*pref_popup*okLabelString: Salva
+*pref_popup*fsL.labelString: Fullscreen
+*pref_popup*fsT.labelString: Abilita lo switchng video
+*pref_popup*fsO.labelString: Modalità video:
+*pref_popup*mixL.labelString: Volume (necessario riavviare)
+*pref_popup*mixT.labelString: Usa il mixer per regolare il volume
+*pref_popup*mix1O.labelString: Periferica mixer:
+*pref_popup*mix2O.labelString: Controllo mixer:
+*pref_popup*optL.labelString: Opzioni
+*pref_popup*osd.labelString: Usa onscreen display in modalità fullscreen
+*pref_popup*keypad-ntsc.labelString: keypad: modalità ntsc
+*pref_popup*keypad-partial.labelString: \
+ keypad: abilita parzialmente (cambia al primo tasto)
+*pref_popup*jpeg.label.labelString: Qaulità JPEG:
+
+scale.title: Controlli scala
+scale*volume.titleString: Volume
+scale*bright.titleString: Luminosità
+scale*hue.titleString: Tono
+scale*color.titleString: Saturazione
+scale*contrast.titleString: Contrasto
+
+!levels.title: Monitor
+!levels*enable.labelstring: enable
+
+streamer.title: registra filmato
+streamer*driverL.labelString: Formato
+streamer*driver.labelString: Driver:
+streamer*videoL.labelString: Opzioni video
+streamer*video.labelString: Formato:
+streamer*fpsL.labelString: fps:
+streamer*audioL.labelString: Opzioni audio
+streamer*audio.labelString: Formato:
+streamer*rateL.labelString: frequenza:
+streamer*fileL.labelString: Nome file
+streamer*fvideoL.labelString: Video:
+streamer*faudioL.labelString: Audio:
+streamer*status.labelString: fissa
+
+streamer*files.labelString: Naviga ...
+streamer*buttons.rec.labelString: Registra
+streamer*buttons.stop.labelString: Stop
+streamer*buttons.play.labelString: Playback
+streamer*buttons.cancel.labelString: Chiudi
+
+MoTV.man_popup.title: Manuale
+MoTV.man_popup*okLabelString: chiudi finestra
+MoTV.man_popup*label.labelString: Attendi ...
+
+! ----------------------------------------------------------------------------
+! main window
+
+MoTV.geometry: 320x240+50+50
+MoTV.winGravity: Static
+
+MoTV.translations: #override \n\
+ <PropertyNotify>: Remote()
+
+MoTV.tv.traversalOn: false
+MoTV.tv.highlightThickness: 0
+MoTV.tv.background: black
+MoTV.tv.translations: #replace \n\
+ <Btn2Down>: Ipc(drag) \n\
+ <Btn3Up>: Popup(control) \n\
+ ~Alt ~Ctrl <Key>C: Popup(control) \n\
+ Ctrl <Key>C: Ipc(primary) \n\
+ Alt <Key>C: Ipc(primary) \n\
+ <Key>R: Popup(streamer) \n\
+ <Key>S: Popup(scale) \n\
+ <Key>L: Popup(levels) \n\
+ <Key>H: man(motv) \n\
+ <Key>F1: man(motv) \n\
+ <Key>osfHelp: man(motv) \n\
+ \
+ <Key>Q: CloseMain() \n\
+ <Key>KP_Add: Command(volume,inc) \n\
+ <Key>KP_Subtract: Command(volume,dec) \n\
+ <Key>KP_Enter: Command(volume,mute) \n\
+ <Key>osfActivate: Command(volume,mute) \n\
+ <Key>A: Command(volume,mute) \n\
+ <Key>F: Command(fullscreen) \n\
+ Ctrl<Key>Z: Zap(fast) \n\
+ <Key>Z: Zap() \n\
+ Ctrl<Key>G: Command(snap,ppm,win) \n\
+ Ctrl<Key>J: Command(snap,jpeg,win) \n\
+ <Key>G: Command(snap,ppm,full) \n\
+ <Key>J: Command(snap,jpeg,full) \n\
+ Ctrl<Key>Up: Scan() \n\
+ Ctrl<Key>osfUp: Scan() \n\
+ ~Ctrl<Key>Up: Command(setchannel,next) \n\
+ ~Ctrl<Key>osfUp: Command(setchannel,next) \n\
+ <Key>Down: Command(setchannel,prev) \n\
+ <Key>osfDown: Command(setchannel,prev) \n\
+ <Key>Right: Command(setchannel,fine_up) \n\
+ <Key>osfRight: Command(setchannel,fine_up) \n\
+ <Key>Left: Command(setchannel,fine_down) \n\
+ <Key>osfLeft: Command(setchannel,fine_down) \n\
+ <Key>Page_Up: Command(setstation,next) \n\
+ <Key>osfPageUp: Command(setstation,next) \n\
+ <Key>Page_Down: Command(setstation,prev) \n\
+ <Key>osfPageDown: Command(setstation,prev) \n\
+ <Key>BackSpace: Command(setstation,back) \n\
+ <Key>osfBackSpace: Command(setstation,back) \n\
+ <Btn4Up>: Command(setstation,next) \n\
+ <Btn5Up>: Command(setstation,prev) \n\
+ <Key>V: Command(capture,toggle) \n\
+ <Key>space: Command(setstation,next) \n\
+ \
+ <Key>KP_0: Command(keypad,0) \n\
+ <Key>KP_1: Command(keypad,1) \n\
+ <Key>KP_2: Command(keypad,2) \n\
+ <Key>KP_3: Command(keypad,3) \n\
+ <Key>KP_4: Command(keypad,4) \n\
+ <Key>KP_5: Command(keypad,5) \n\
+ <Key>KP_6: Command(keypad,6) \n\
+ <Key>KP_7: Command(keypad,7) \n\
+ <Key>KP_8: Command(keypad,8) \n\
+ <Key>KP_9: Command(keypad,9)
+
+
+MoTV.tv*stationsM.menuPost: <Btn1>
+
+MoTV.about_box_popup.deleteResponse: DESTROY
+MoTV.errbox_popup.deleteResponse: UNMAP
+
+MoTV.tv*stationsM.packing: PACK_COLUMN
+control*menubar*stationsM.packing: PACK_COLUMN
+
+
+! ----------------------------------------------------------------------------
+! control window
+
+control.title: MoTV
+control.iconName: MoTV
+control.iconPixmap: TVimg
+control.iconMask: TVmask
+control*highlightThickness: 0
+control*XmPushButton.highlightThickness: 1
+control.XmDialogShell*highlightThickness: 1
+
+control*tool.orientation: HORIZONTAL
+control*tool.?.shadowThickness: 1
+control*tool.?.labelType: PIXMAP
+control*tool.XmSeparator.orientation: VERTICAL
+control*tool.XmSeparator.width: 12
+control*tool.XmSeparator.margin: 3
+control*tool.prev.labelPixmap: prev
+control*tool.next.labelPixmap: next
+control*tool.snap.labelPixmap: snap
+control*tool.movie.labelPixmap: movie
+control*tool.mute.labelPixmap: mute
+control*tool.exit.labelPixmap: exit
+
+control*menubar*XmMenuShell.XmRowColumn.tearOffModel: TEAR_OFF_ENABLED
+!control*box.XmPushButton*menu.tearOffModel: TEAR_OFF_DISABLED
+
+control.form.view.scrollingPolicy: AUTOMATIC
+!control.form.view.scrollBarDisplayPolicy: STATIC
+control.form.view.scrollBarPlacement: BOTTOM_RIGHT
+control.form.view.scrolledWindowChildType: SCROLL_VERT
+control.form.view.box.resizeWidth: false
+control.form.view.box.packing: PACK_TIGHT
+control.form.view.box.orientation: HORIZONTAL
+control.form.view.box.entryAlignment: ALIGNMENT_CENTER
+
+control.form.?.leftAttachment: ATTACH_FORM
+control.form.?.rightAttachment: ATTACH_FORM
+control.form.tool.topAttachment: ATTACH_WIDGET
+control.form.tool.topWidget: menubar
+control.form.view.topAttachment: ATTACH_WIDGET
+control.form.view.topWidget: tool
+control.form.view.bottomAttachment: ATTACH_WIDGET
+control.form.view.bottomWidget: status
+control.form.status.bottomAttachment: ATTACH_FORM
+control.form.status.orientation: HORIZONTAL
+control.form.status.marginWidth: 0
+control.form.status.marginHeight: 0
+control.form.status.spacing: 0
+!control.form.status.adjustLast: True
+control.form.status.f.shadowType: SHADOW_IN
+control.form.status.f.shadowThickness: 1
+control.form.status.f.?.marginLeft: 3
+control.form.status.f.?.marginRight: 3
+control.form.status.f.?.labelString:
+
+
+! ----------------------------------------------------------------------------
+! channel scan
+
+*chscan_popup.deleteResponse: DESTROY
+*chscan_popup*dialogStyle: DIALOG_PRIMARY_APPLICATION_MODAL
+*chscan_popup*okLabelString: Start
+*chscan_popup*channel.editable: False
+*chscan_popup*channel.slidingMode: THERMOMETER
+*chscan_popup*channel.orientation: HORIZONTAL
+*chscan_popup*channel.titleString: -
+*chscan_popup*channel.sliderVisual: SHADOWED_BACKGROUND
+
+
+! ----------------------------------------------------------------------------
+! channel properties
+
+*prop_popup.deleteResponse: UNMAP
+*prop_popup*rc.key.editable: false
+*prop_popup*rc.channel.visibleItemCount: 16
+*prop_popup*rc.channel.comboBoxType: DROP_DOWN_LIST
+*prop_popup*rc.channel.positionMode: ONE_BASED
+*prop_popup*rc.keyL.marginTop: 10
+*prop_popup*rc.channelL.marginTop: 10
+*prop_popup*rc.XmLabel.alignment: ALIGNMENT_BEGINNING
+
+*prop_popup*no_name_popup.deleteResponse: DESTROY
+
+
+! ----------------------------------------------------------------------------
+! preferences
+
+*pref_popup.deleteResponse: UNMAP
+*pref_popup*fsL.frameChildType: FRAME_TITLE_CHILD
+*pref_popup*optL.frameChildType: FRAME_TITLE_CHILD
+*pref_popup*mixL.frameChildType: FRAME_TITLE_CHILD
+*pref_popup*jpeg.orientation: HORIZONTAL
+*pref_popup*jpeg.quality.columns: 3
+
+
+! ----------------------------------------------------------------------------
+! scale controls
+
+scale.form.shadowThickness: 0
+scale*XmScale.orientation: HORIZONTAL
+scale*XmScale.showValue: false
+scale*XmScale.highlightOnEnter: true
+scale*XmScale.highlightThickness: 1
+scale*XmScale.minimum: 0
+scale*XmScale.maximum: 65535
+scale*XmScale.topAttachment: ATTACH_WIDGET
+scale*XmScale.leftAttachment: ATTACH_FORM
+scale*XmScale.rightAttachment: ATTACH_FORM
+scale*XmScale.topOffset: 5
+scale*XmScale.BottomOffset: 5
+scale*XmScale.leftOffset: 10
+scale*XmScale.rightOffset: 10
+scale*XmScale.width: 160
+
+
+! ----------------------------------------------------------------------------
+! levels window (sound level monitor)
+
+levels*highlightThickness: 1
+levels*XmScale.editable: False
+levels*XmScale.slidingMode: THERMOMETER
+levels*XmScale.orientation: HORIZONTAL
+levels*XmScale.sliderVisual: SHADOWED_BACKGROUND
+levels*XmScale.minimum: 0
+levels*XmScale.maximum: 128
+levels*XmScale.width: 256
+
+
+! ----------------------------------------------------------------------------
+! streamer window
+
+streamer.title: record a movie
+streamer*XmComboBox.comboBoxType: DROP_DOWN_COMBO_BOX
+streamer*XmComboBox.width: 100
+streamer*XmLabel.alignment: ALIGNMENT_BEGINNING
+
+streamer*highlightThickness: 1
+!streamer*navigationType: STICKY_TAB_GROUP
+
+streamer*form.?.leftAttachment: ATTACH_FORM
+streamer*form.?.rightAttachment: ATTACH_FORM
+streamer*form.?.topAttachment: ATTACH_WIDGET
+streamer*form.?.topOffset: 10
+streamer*form.?.leftOffset: 10
+streamer*form.?.rightOffset: 10
+streamer*form.XmFrame.marginWidth: 5
+streamer*form.XmFrame.marginHeight: 5
+
+streamer*XmFrame.XmRowColumn.orientation: HORIZONTAL
+streamer*XmFrame.fbox.orientation: VERTICAL
+streamer*XmFrame.fbox.spacing: 0
+streamer*XmFrame.fbox.marginWidth: 0
+streamer*XmFrame.fbox.marginHeight: 0
+streamer*XmFrame.fbox.?.orientation: HORIZONTAL
+
+streamer*form.buttons.marginWidth: 0
+streamer*form.buttons.packing: PACK_COLUMN
+streamer*form.buttons.orientation: HORIZONTAL
+streamer*form.buttons.entryAlignment: ALIGNMENT_CENTER
+streamer*form.buttons.bottomAttachment: ATTACH_FORM
+
+streamer*driverL.frameChildType: FRAME_TITLE_CHILD
+streamer*videoL.frameChildType: FRAME_TITLE_CHILD
+streamer*audioL.frameChildType: FRAME_TITLE_CHILD
+streamer*fileL.frameChildType: FRAME_TITLE_CHILD
+
+streamer*videoF.topWidget: driverF
+streamer*audioF.topWidget: videoF
+streamer*fileF.topWidget: audioF
+streamer*status.topWidget: fileF
+streamer*buttons.topWidget: status
+streamer*buttons.bottomOffset: 10
+
+streamer*rate.itemCount: 6
+streamer*rate.visibleItemCount: 6
+streamer*rate.items: 8000,11025,22050,32000,44100,48000
+streamer*rate.selectedItem: 44100
+streamer*fps.itemCount: 11
+streamer*fps.visibleItemCount: 11
+streamer*fps.items: 3,5,8,10,12,15,18,20,24,25,30
+streamer*fps.selectedItem: 12
+
+streamer*fvideo.translations: #override\
+ Ctrl<Key>Tab: Complete()
+streamer*faudio.translations: #override\
+ Ctrl<Key>Tab: Complete()
+
+! debug
+streamer.form.*.borderWidth: 0
+!streamer.form.*.borderColor: darkred
+!streamer*form.XmFrame.background: yellow
+
+
+! ----------------------------------------------------------------------------
+! man page renderer
+
+MoTV.man_popup.deleteResponse: DESTROY
+MoTV.man_popup*view.width: 500
+MoTV.man_popup*view.height: 600
+MoTV.man_popup*view.scrollingPolicy: AUTOMATIC
+MoTV.man_popup*view.scrollBarPlacement: BOTTOM_RIGHT
+
+MoTV.man_popup*label.alignment: ALIGNMENT_BEGINNING
+MoTV.man_popup*label.marginWidth: 5
+MoTV.man_popup*label.marginHeight: 5
+MoTV.man_popup*label.renderTable: bold,underline
+MoTV.man_popup*label.renderTable.fontType: FONT_IS_FONTSET
+MoTV.man_popup*label.renderTable.fontName: \
+ -*-fixed-medium-r-normal--13-*-*-*-*-*
+MoTV.man_popup*label.renderTable.bold.fontType: FONT_IS_FONTSET
+MoTV.man_popup*label.renderTable.bold.fontName: \
+ -*-fixed-bold-r-normal--13-*-*-*-*-*
+MoTV.man_popup*label.renderTable.underline.underlineType: SINGLE_LINE
+
+
+! ----------------------------------------------------------------------------
+! Onscreen window
+
+MoTV.onscreen.allowShellResize: true
+MoTV.onscreen*background: black
+MoTV.onscreen*borderColor: black
+MoTV.onscreen*foreground: lightgreen
+MoTV.onscreen*highlightThickness: 0
+
+MoTV.vtx.allowShellResize: true
+MoTV.vtx*borderColor: black
+MoTV.vtx*background: black
+MoTV.vtx*foreground: white
+MoTV.vtx*highlightThickness: 0
+
diff --git a/src/RegEdit.c b/src/RegEdit.c
new file mode 100644
index 0000000..fa01b88
--- /dev/null
+++ b/src/RegEdit.c
@@ -0,0 +1,1795 @@
+/* $XConsortium: RegEdit.c /main/5 1995/07/15 20:44:04 drk $ */
+/*
+ * @OPENGROUP_COPYRIGHT@
+ * COPYRIGHT NOTICE
+ * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
+ * ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
+ * the full copyright text.
+ *
+ * This software is subject to an open license. It may only be
+ * used on, with or for operating systems which are themselves open
+ * source systems. You must contact The Open Group for a license
+ * allowing distribution and sublicensing of this software on, with,
+ * or for operating systems which are not Open Source programs.
+ *
+ * See http://www.opengroup.org/openmotif/license for full
+ * details of the license agreement. Any use, reproduction, or
+ * distribution of the program constitutes recipient's acceptance of
+ * this agreement.
+ *
+ * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+ * PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+ * WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+ * OR FITNESS FOR A PARTICULAR PURPOSE
+ *
+ * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+ * NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
+ * EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+/*
+ * HISTORY
+ */
+#include <stdio.h>
+#include <Xm/XmP.h>
+#include <X11/ShellP.h>
+#include "RegEditI.h"
+
+
+/* static forward. move from global in the original Editres code */
+static void _XEditResCheckMessages();
+static void _XEditResPutString8();
+static void _XEditResPut8();
+static void _XEditResPut16();
+static void _XEditResPut32();
+static void _XEditResPutWidgetInfo();
+static void _XEditResResetStream();
+static Boolean _XEditResGet8();
+static Boolean _XEditResGet16();
+static Boolean _XEditResGetSigned16();
+static Boolean _XEditResGet32();
+static Boolean _XEditResGetString8();
+static Boolean _XEditResGetWidgetInfo();
+
+/* the only entry point here */
+void
+XmdRegisterEditres(Widget toplevel)
+{
+ XtAddEventHandler(toplevel, (EventMask) 0, TRUE,
+ _XEditResCheckMessages, NULL);
+}
+
+
+/************************************************************
+ *
+ * Dump the content of the R5 lib/Xmu/EditresCom.c module.
+ * just move global as static.
+ *
+ ************************************************************/
+
+#define _XEditResPutBool _XEditResPut8
+#define _XEditResPutResourceType _XEditResPut8
+
+/************************************************************
+ *
+ * Local structure definitions.
+ *
+ ************************************************************/
+
+typedef enum { BlockNone, BlockSetValues, BlockAll } EditresBlock;
+
+typedef struct _SetValuesEvent {
+ EditresCommand type; /* first field must be type. */
+ WidgetInfo * widgets;
+ unsigned short num_entries; /* number of set values requests. */
+ char * name;
+ char * res_type;
+ XtPointer value;
+ unsigned short value_len;
+} SetValuesEvent;
+
+typedef struct _SVErrorInfo {
+ SetValuesEvent * event;
+ ProtocolStream * stream;
+ unsigned short * count;
+ WidgetInfo * entry;
+} SVErrorInfo;
+
+typedef struct _FindChildEvent {
+ EditresCommand type; /* first field must be type. */
+ WidgetInfo * widgets;
+ short x, y;
+} FindChildEvent;
+
+typedef struct _GenericGetEvent {
+ EditresCommand type; /* first field must be type. */
+ WidgetInfo * widgets;
+ unsigned short num_entries; /* number of set values requests. */
+} GenericGetEvent, GetResEvent, GetGeomEvent;
+
+/*
+ * Things that are common to all events.
+ */
+
+typedef struct _AnyEvent {
+ EditresCommand type; /* first field must be type. */
+ WidgetInfo * widgets;
+} AnyEvent;
+
+/*
+ * The event union.
+ */
+
+typedef union _EditresEvent {
+ AnyEvent any_event;
+ SetValuesEvent set_values_event;
+ GetResEvent get_resources_event;
+ GetGeomEvent get_geometry_event;
+ FindChildEvent find_child_event;
+} EditresEvent;
+
+typedef struct _Globals {
+ EditresBlock block;
+ SVErrorInfo error_info;
+ ProtocolStream stream;
+ ProtocolStream * command_stream; /* command stream. */
+} Globals;
+
+#define CURRENT_PROTOCOL_VERSION 4L
+
+#define streq(a,b) (strcmp( (a), (b) ) == 0)
+
+static Atom res_editor_command, res_editor_protocol, client_value;
+
+static Globals globals;
+
+static void SendFailure(), SendCommand(), InsertWidget(), ExecuteCommand();
+static void FreeEvent(), ExecuteSetValues(), ExecuteGetGeometry();
+static void ExecuteGetResources();
+
+static void GetCommand();
+static void LoadResources();
+static Boolean IsChild();
+static void DumpChildren();
+static char *DumpWidgets(), *DoSetValues(), *DoFindChild();
+static char *DoGetGeometry(), *DoGetResources();
+
+/************************************************************
+ *
+ * Resource Editor Communication Code
+ *
+ ************************************************************/
+
+/* Function Name: _XEditResCheckMessages
+ * Description: This callback routine is set on all shell widgets,
+ * and checks to see if a client message event
+ * has come from the resource editor.
+ * Arguments: w - the shell widget.
+ * data - *** UNUSED ***
+ * event - The X Event that triggered this handler.
+ * cont - *** UNUSED ***.
+ * Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+_XEditResCheckMessages(w, data, event, cont)
+Widget w;
+XtPointer data;
+XEvent *event;
+Boolean *cont;
+{
+ Time time;
+ ResIdent ident;
+ static Boolean first_time = FALSE;
+ static Atom res_editor, res_comm;
+ Display * dpy;
+
+ if (event->type == ClientMessage) {
+ XClientMessageEvent * c_event = (XClientMessageEvent *) event;
+ dpy = XtDisplay(w);
+
+ if (!first_time) {
+ first_time = TRUE;
+ res_editor = XInternAtom(dpy, EDITRES_NAME, False);
+ res_editor_command = XInternAtom(dpy, EDITRES_COMMAND_ATOM, False);
+ res_editor_protocol = XInternAtom(dpy, EDITRES_PROTOCOL_ATOM,
+ False);
+
+ /* Used in later procedures. */
+ client_value = XInternAtom(dpy, EDITRES_CLIENT_VALUE, False);
+ LoadResources(w);
+ }
+
+ if ((c_event->message_type != res_editor) ||
+ (c_event->format != EDITRES_SEND_EVENT_FORMAT))
+ return;
+
+ time = c_event->data.l[0];
+ res_comm = c_event->data.l[1];
+ ident = (ResIdent) c_event->data.l[2];
+ if (c_event->data.l[3] != CURRENT_PROTOCOL_VERSION) {
+ _XEditResResetStream(&globals.stream);
+ _XEditResPut8(&globals.stream, CURRENT_PROTOCOL_VERSION);
+ SendCommand(w, res_comm, ident, ProtocolMismatch, &globals.stream);
+ return;
+ }
+
+ XtGetSelectionValue(w, res_comm, res_editor_command,
+ GetCommand, (XtPointer) (long) ident, time);
+ }
+}
+
+/* Function Name: BuildEvent
+ * Description: Takes the info out the protocol stream an constructs
+ * the proper event structure.
+ * Arguments: w - widget to own selection, in case of error.
+ * sel - selection to send error message beck in.
+ * data - the data for the request.
+ * ident - the id number we are looking for.
+ * length - length of request.
+ * Returns: the event, or NULL.
+ */
+
+#define ERROR_MESSAGE ("Client: Improperly formatted protocol request")
+
+static EditresEvent *
+BuildEvent(w, sel, data, ident, length)
+Widget w;
+Atom sel;
+XtPointer data;
+ResIdent ident;
+unsigned long length;
+{
+ EditresEvent * event;
+ ProtocolStream alloc_stream, *stream;
+ unsigned char temp;
+ register unsigned int i;
+
+ stream = &alloc_stream; /* easier to think of it this way... */
+
+ stream->current = stream->top = (unsigned char *) data;
+ stream->size = HEADER_SIZE; /* size of header. */
+
+ /*
+ * Retrieve the Header.
+ */
+
+ if (length < HEADER_SIZE) {
+ SendFailure(w, sel, ident, Failure, ERROR_MESSAGE);
+ return(NULL);
+ }
+
+ (void) _XEditResGet8(stream, &temp);
+ if (temp != ident) /* Id's don't match, ignore request. */
+ return(NULL);
+
+ event = (EditresEvent *) XtCalloc(sizeof(EditresEvent), 1);
+
+ (void) _XEditResGet8(stream, &temp);
+ event->any_event.type = (EditresCommand) temp;
+ (void) _XEditResGet32(stream, &(stream->size));
+ stream->top = stream->current; /* reset stream to top of value.*/
+
+ /*
+ * Now retrieve the data segment.
+ */
+
+ switch(event->any_event.type) {
+ case SendWidgetTree:
+ break; /* no additional info */
+ case SetValues:
+ {
+ SetValuesEvent * sv_event = (SetValuesEvent *) event;
+
+ if ( !(_XEditResGetString8(stream, &(sv_event->name)) &&
+ _XEditResGetString8(stream, &(sv_event->res_type))))
+ {
+ goto done;
+ }
+
+ /*
+ * Since we need the value length, we have to pull the
+ * value out by hand.
+ */
+
+ if (!_XEditResGet16(stream, &(sv_event->value_len)))
+ goto done;
+
+ sv_event->value = XtMalloc(sizeof(char) *
+ (sv_event->value_len + 1));
+
+ for (i = 0; i < sv_event->value_len; i++) {
+ if (!_XEditResGet8(stream,
+ (unsigned char *) sv_event->value + i))
+ {
+ goto done;
+ }
+ }
+ ((char*)sv_event->value)[i] = '\0'; /* NULL terminate that sucker. */
+
+ if (!_XEditResGet16(stream, &(sv_event->num_entries)))
+ goto done;
+
+ sv_event->widgets = (WidgetInfo *)
+ XtCalloc(sizeof(WidgetInfo), sv_event->num_entries);
+
+ for (i = 0; i < sv_event->num_entries; i++) {
+ if (!_XEditResGetWidgetInfo(stream, sv_event->widgets + i))
+ goto done;
+ }
+ }
+ break;
+ case FindChild:
+ {
+ FindChildEvent * find_event = (FindChildEvent *) event;
+
+ find_event->widgets = (WidgetInfo *)
+ XtCalloc(sizeof(WidgetInfo), 1);
+
+ if (!(_XEditResGetWidgetInfo(stream, find_event->widgets) &&
+ _XEditResGetSigned16(stream, &(find_event->x)) &&
+ _XEditResGetSigned16(stream, &(find_event->y))))
+ {
+ goto done;
+ }
+
+ }
+ break;
+ case GetGeometry:
+ case GetResources:
+ {
+ GenericGetEvent * get_event = (GenericGetEvent *) event;
+
+ if (!_XEditResGet16(stream, &(get_event->num_entries)))
+ goto done;
+
+ get_event->widgets = (WidgetInfo *)
+ XtCalloc(sizeof(WidgetInfo), get_event->num_entries);
+ for (i = 0; i < get_event->num_entries; i++) {
+ if (!_XEditResGetWidgetInfo(stream, get_event->widgets + i))
+ goto done;
+ }
+ }
+ break;
+ default:
+ {
+ char buf[BUFSIZ];
+
+ sprintf(buf, "Unknown Protocol request %d.",event->any_event.type);
+ SendFailure(w, sel, ident, buf);
+ return(NULL);
+ }
+ }
+ return(event);
+
+ done:
+
+ SendFailure(w, sel, ident, ERROR_MESSAGE);
+ FreeEvent(event);
+ return(NULL);
+}
+
+/* Function Name: FreeEvent
+ * Description: Frees the event structure and any other pieces
+ * in it that need freeing.
+ * Arguments: event - the event to free.
+ * Returns: none.
+ */
+
+static void
+FreeEvent(event)
+EditresEvent * event;
+{
+ if (event->any_event.widgets != NULL) {
+ XtFree((char *)event->any_event.widgets->ids);
+ XtFree((char *)event->any_event.widgets);
+ }
+
+ if (event->any_event.type == SetValues) {
+ XtFree(event->set_values_event.name); /* XtFree does not free if */
+ XtFree(event->set_values_event.res_type); /* value is NULL. */
+ }
+
+ XtFree((char *)event);
+}
+
+/* Function Name: GetCommand
+ * Description: Gets the Command out of the selection asserted by the
+ * resource manager.
+ * Arguments: (See Xt XtConvertSelectionProc)
+ * data - contains the ident number for the command.
+ * Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+GetCommand(w, data, selection, type, value, length, format)
+Widget w;
+XtPointer data, value;
+Atom *selection, *type;
+unsigned long *length;
+int * format;
+{
+ ResIdent ident = (ResIdent) (long) data;
+ EditresEvent * event;
+
+ if ( (*type != res_editor_protocol) || (*format != EDITRES_FORMAT) )
+ return;
+
+ if ((event = BuildEvent(w, *selection, value, ident, *length)) != NULL) {
+ ExecuteCommand(w, *selection, ident, event);
+ FreeEvent(event);
+ }
+}
+
+/* Function Name: ExecuteCommand
+ * Description: Executes a command string received from the
+ * resource editor.
+ * Arguments: w - a widget.
+ * command - the command to execute.
+ * value - the associated with the command.
+ * Returns: none.
+ *
+ * NOTES: munges str
+ */
+
+/* ARGSUSED */
+static void
+ExecuteCommand(w, sel, ident, event)
+Widget w;
+Atom sel;
+ResIdent ident;
+EditresEvent * event;
+{
+ char * (*func)();
+ char * str;
+
+ if (globals.block == BlockAll) {
+ SendFailure(w, sel, ident,
+ "This client has blocked all Editres commands.");
+ return;
+ }
+ else if ((globals.block == BlockSetValues) &&
+ (event->any_event.type == SetValues)) {
+ SendFailure(w, sel, ident,
+ "This client has blocked all SetValues requests.");
+ return;
+ }
+
+ switch(event->any_event.type) {
+ case SendWidgetTree:
+ func = DumpWidgets;
+ break;
+ case SetValues:
+ func = DoSetValues;
+ break;
+ case FindChild:
+ func = DoFindChild;
+ break;
+ case GetGeometry:
+ func = DoGetGeometry;
+ break;
+ case GetResources:
+ func = DoGetResources;
+ break;
+ default:
+ {
+ char buf[BUFSIZ];
+ sprintf(buf,"Unknown Protocol request %d.",event->any_event.type);
+ SendFailure(w, sel, ident, buf);
+ return;
+ }
+ }
+
+ _XEditResResetStream(&globals.stream);
+ if ((str = (*func)(w, event, &globals.stream)) == NULL)
+ SendCommand(w, sel, ident, PartialSuccess, &globals.stream);
+ else {
+ SendFailure(w, sel, ident, str);
+ XtFree(str);
+ }
+}
+
+/* Function Name: ConvertReturnCommand
+ * Description: Converts a selection.
+ * Arguments: w - the widget that owns the selection.
+ * selection - selection to convert.
+ * target - target type for this selection.
+ * type_ret - type of the selection.
+ * value_ret - selection value;
+ * length_ret - lenght of this selection.
+ * format_ret - the format the selection is in.
+ * Returns: True if conversion was sucessful.
+ */
+
+/* ARGSUSED */
+static Boolean
+ConvertReturnCommand(w, selection, target,
+ type_ret, value_ret, length_ret, format_ret)
+Widget w;
+Atom * selection, * target, * type_ret;
+XtPointer *value_ret;
+unsigned long * length_ret;
+int * format_ret;
+{
+ /*
+ * I assume the intrinsics give me the correct selection back.
+ */
+
+ if ((*target != client_value))
+ return(FALSE);
+
+ *type_ret = res_editor_protocol;
+ *value_ret = (XtPointer) globals.command_stream->real_top;
+ *length_ret = globals.command_stream->size + HEADER_SIZE;
+ *format_ret = EDITRES_FORMAT;
+
+ return(TRUE);
+}
+
+/* Function Name: CommandDone
+ * Description: done with the selection.
+ * Arguments: *** UNUSED ***
+ * Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+CommandDone(widget, selection, target)
+Widget widget;
+Atom *selection;
+Atom *target;
+{
+ /* Keep the toolkit from automaticaly freeing the selection value */
+}
+
+/* Function Name: SendFailure
+ * Description: Sends a failure message.
+ * Arguments: w - the widget to own the selection.
+ * sel - the selection to assert.
+ * ident - the identifier.
+ * str - the error message.
+ * Returns: none.
+ */
+
+static void
+SendFailure(w, sel, ident, str)
+Widget w;
+Atom sel;
+ResIdent ident;
+char * str;
+{
+ _XEditResResetStream(&globals.stream);
+ _XEditResPutString8(&globals.stream, str);
+ SendCommand(w, sel, ident, Failure, &globals.stream);
+}
+
+/* Function Name: BuildReturnPacket
+ * Description: Builds a return packet, given the data to send.
+ * Arguments: ident - the identifier.
+ * command - the command code.
+ * stream - the protocol stream.
+ * Returns: packet - the packet to send.
+ */
+
+static XtPointer
+BuildReturnPacket(ident, command, stream)
+ResIdent ident;
+EditresCommand command;
+ProtocolStream * stream;
+{
+ long old_alloc, old_size;
+ unsigned char * old_current;
+
+ /*
+ * We have cleverly keep enough space at the top of the header
+ * for the return protocol stream, so all we have to do is
+ * fill in the space.
+ */
+
+ /*
+ * Fool the insert routines into putting the header in the right
+ * place while being damn sure not to realloc (that would be very bad.
+ */
+
+ old_current = stream->current;
+ old_alloc = stream->alloc;
+ old_size = stream->size;
+
+ stream->current = stream->real_top;
+ stream->alloc = stream->size + (2 * HEADER_SIZE);
+
+ _XEditResPut8(stream, ident);
+ _XEditResPut8(stream, (unsigned char) command);
+ _XEditResPut32(stream, old_size);
+
+ stream->alloc = old_alloc;
+ stream->current = old_current;
+ stream->size = old_size;
+
+ return((XtPointer) stream->real_top);
+}
+
+/* Function Name: SendCommand
+ * Description: Builds a return command line.
+ * Arguments: w - the widget to own the selection.
+ * sel - the selection to assert.
+ * ident - the identifier.
+ * command - the command code.
+ * stream - the protocol stream.
+ * Returns: none.
+ */
+
+static void
+SendCommand(w, sel, ident, command, stream)
+Widget w;
+Atom sel;
+ResIdent ident;
+EditresCommand command;
+ProtocolStream * stream;
+{
+ BuildReturnPacket(ident, command, stream);
+ globals.command_stream = stream;
+
+/*
+ * I REALLY want to own the selection. Since this was not triggered
+ * by a user action, and I am the only one using this atom it is safe to
+ * use CurrentTime.
+ */
+
+ XtOwnSelection(w, sel, CurrentTime,
+ ConvertReturnCommand, NULL, CommandDone);
+}
+
+/************************************************************
+ *
+ * Generic Utility Functions.
+ *
+ ************************************************************/
+
+/* Function Name: FindChildren
+ * Description: Retuns all children (popup, normal and otherwise)
+ * of this widget
+ * Arguments: parent - the parent widget.
+ * children - the list of children.
+ * normal - return normal children.
+ * popup - return popup children.
+ * Returns: the number of children.
+ */
+
+static int
+FindChildren(parent, children, normal, popup)
+Widget parent, **children;
+Boolean normal, popup;
+{
+ CompositeWidget cw = (CompositeWidget) parent;
+ int i, num_children, current = 0;
+
+ num_children = 0;
+
+ if (XtIsWidget(parent) && popup)
+ num_children += parent->core.num_popups;
+
+ if (XtIsComposite(parent) && normal)
+ num_children += cw->composite.num_children;
+
+ if (num_children == 0) {
+ *children = NULL;
+ return(0);
+ }
+
+ *children =(Widget*) XtMalloc((Cardinal) sizeof(Widget) * num_children);
+
+ if (XtIsComposite(parent) && normal)
+ for (i = 0; i < cw->composite.num_children; i++,current++)
+ (*children)[current] = cw->composite.children[i];
+
+ if (XtIsWidget(parent) && popup)
+ for ( i = 0; i < parent->core.num_popups; i++, current++)
+ (*children)[current] = parent->core.popup_list[i];
+
+ return(num_children);
+}
+
+/* Function Name: IsChild
+ * Description: check to see of child is a child of parent.
+ * Arguments: top - the top of the tree.
+ * parent - the parent widget.
+ * child - the child.
+ * Returns: none.
+ */
+
+static Boolean
+IsChild(top, parent, child)
+Widget top, parent, child;
+{
+ int i, num_children;
+ Widget * children;
+
+ if (parent == NULL)
+ return(top == child);
+
+ num_children = FindChildren(parent, &children, TRUE, TRUE);
+
+ for (i = 0; i < num_children; i++) {
+ if (children[i] == child) {
+ XtFree((char *)children);
+ return(TRUE);
+ }
+ }
+
+ XtFree((char *)children);
+ return(FALSE);
+}
+
+/* Function Name: VerifyWidget
+ * Description: Makes sure all the widgets still exist.
+ * Arguments: w - any widget in the tree.
+ * info - the info about the widget to verify.
+ * Returns: an error message or NULL.
+ */
+
+static char *
+VerifyWidget(w, info)
+Widget w;
+WidgetInfo *info;
+{
+ Widget top;
+
+ register int count;
+ register Widget parent;
+ register unsigned long * child;
+
+ for (top = w; XtParent(top) != NULL; top = XtParent(top)) {}
+
+ parent = NULL;
+ child = info->ids;
+ count = 0;
+
+ while (TRUE) {
+ if (!IsChild(top, parent, (Widget) *child))
+ return(XtNewString("This widget no longer exists in the client."));
+
+ if (++count == info->num_widgets)
+ break;
+
+ parent = (Widget) *child++;
+ }
+
+ info->real_widget = (Widget) *child;
+ return(NULL);
+}
+
+/************************************************************
+ *
+ * Code to Perform SetValues operations.
+ *
+ ************************************************************/
+
+
+/* Function Name: DoSetValues
+ * Description: performs the setvalues requested.
+ * Arguments: w - a widget in the tree.
+ * event - the event that caused this action.
+ * stream - the protocol stream to add.
+ * Returns: NULL.
+ */
+
+static char *
+DoSetValues(w, event, stream)
+Widget w;
+EditresEvent * event;
+ProtocolStream * stream;
+{
+ char * str;
+ register unsigned i;
+ unsigned short count = 0;
+ SetValuesEvent * sv_event = (SetValuesEvent *) event;
+
+ _XEditResPut16(stream, count); /* insert 0, will be overwritten later. */
+
+ for (i = 0 ; i < sv_event->num_entries; i++) {
+ if ((str = VerifyWidget(w, &(sv_event->widgets[i]))) != NULL) {
+ _XEditResPutWidgetInfo(stream, &(sv_event->widgets[i]));
+ _XEditResPutString8(stream, str);
+ XtFree(str);
+ count++;
+ }
+ else
+ ExecuteSetValues(sv_event->widgets[i].real_widget,
+ sv_event, sv_event->widgets + i, stream, &count);
+ }
+
+ /*
+ * Overwrite the first 2 bytes with the real count.
+ */
+
+ *(stream->top) = count >> XER_NBBY;
+ *(stream->top + 1) = count;
+ return(NULL);
+}
+
+/* Function Name: HandleToolkitErrors
+ * Description: Handles X Toolkit Errors.
+ * Arguments: name - name of the error.
+ * type - type of the error.
+ * class - class of the error.
+ * msg - the default message.
+ * params, num_params - the extra parameters for this message.
+ * Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+HandleToolkitErrors(name, type, class, msg, params, num_params)
+String name, type, class, msg, *params;
+Cardinal * num_params;
+{
+ SVErrorInfo * info = &globals.error_info;
+ char buf[BUFSIZ];
+
+ if ( streq(name, "unknownType") )
+ sprintf(buf, "The `%s' resource is not used by this widget.",
+ info->event->name);
+ else if ( streq(name, "noColormap") )
+ sprintf(buf, msg, params[0]);
+ else if (streq(name, "conversionFailed") || streq(name, "conversionError"))
+ {
+ if (streq(info->event->value, XtRString))
+ sprintf(buf,
+ "Could not convert the string '%s' for the `%s' resource.",
+ (char*)info->event->value, info->event->name);
+ else
+ sprintf(buf, "Could not convert the `%s' resource.",
+ info->event->name);
+ }
+ else
+ sprintf(buf, "Name: %s, Type: %s, Class: %s, Msg: %s",
+ name, type, class, msg);
+
+ /*
+ * Insert this info into the protocol stream, and update the count.
+ */
+
+ (*(info->count))++;
+ _XEditResPutWidgetInfo(info->stream, info->entry);
+ _XEditResPutString8(info->stream, buf);
+}
+
+/* Function Name: ExecuteSetValues
+ * Description: Performs a setvalues for a given command.
+ * Arguments: w - the widget to perform the set_values on.
+ * sv_event - the set values event.
+ * sv_info - the set_value info.
+ * Returns: none.
+ */
+
+static void
+ExecuteSetValues(w, sv_event, entry, stream, count)
+Widget w;
+SetValuesEvent * sv_event;
+WidgetInfo * entry;
+ProtocolStream * stream;
+unsigned short * count;
+{
+ XtErrorMsgHandler old;
+
+ SVErrorInfo * info = &globals.error_info;
+ info->event = sv_event; /* No data can be passed to */
+ info->stream = stream; /* an error handler, so we */
+ info->count = count; /* have to use a global, YUCK... */
+ info->entry = entry;
+
+ old = XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(w),
+ HandleToolkitErrors);
+
+ XtVaSetValues(w, XtVaTypedArg,
+ sv_event->name, sv_event->res_type,
+ sv_event->value, sv_event->value_len,
+ NULL);
+
+ (void)XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(w), old);
+}
+
+
+/************************************************************
+ *
+ * Code for Creating and dumping widget tree.
+ *
+ ************************************************************/
+
+/* Function Name: DumpWidgets
+ * Description: Given a widget it builds a protocol packet
+ * containing the entire widget heirarchy.
+ * Arguments: w - a widget in the tree.
+ * event - the event that caused this action.
+ * stream - the protocol stream to add.
+ * Returns: NULL
+ */
+
+/* ARGSUSED */
+static char *
+DumpWidgets(w, event, stream)
+Widget w;
+EditresEvent * event; /* UNUSED */
+ProtocolStream * stream;
+{
+ unsigned short count = 0;
+
+ /* Find Tree's root. */
+ for ( ; XtParent(w) != NULL; w = XtParent(w)) {}
+
+ /*
+ * hold space for count, overwritten later.
+ */
+
+ _XEditResPut16(stream, (unsigned int) 0);
+
+ DumpChildren(w, stream, &count);
+
+ /*
+ * Overwrite the first 2 bytes with the real count.
+ */
+
+ *(stream->top) = count >> XER_NBBY;
+ *(stream->top + 1) = count;
+ return(NULL);
+}
+
+/* Function Name: DumpChildren
+ * Description: Adds a child's name to the list.
+ * Arguments: w - the widget to dump.
+ * stream - the stream to dump to.
+ * count - number of dumps we have performed.
+ * Returns: none.
+ */
+
+/* This is a trick/kludge. To make shared libraries happier (linking
+ * against Xmu but not linking against Xt, and apparently even work
+ * as we desire on SVR4, we need to avoid an explicit data reference
+ * to applicationShellWidgetClass. XtIsTopLevelShell is known
+ * (implementation dependent assumption!) to use a bit flag. So we
+ * go that far. Then, we test whether it is an applicationShellWidget
+ * class by looking for an explicit class name. Seems pretty safe.
+ */
+static Bool isApplicationShell(w)
+ Widget w;
+{
+ register WidgetClass c;
+
+ if (!XtIsTopLevelShell(w))
+ return False;
+ for (c = XtClass(w); c; c = c->core_class.superclass) {
+ if (!strcmp(c->core_class.class_name, "ApplicationShell"))
+ return True;
+ }
+ return False;
+}
+
+static void
+DumpChildren(w, stream, count)
+Widget w;
+ProtocolStream * stream;
+unsigned short *count;
+{
+ int i, num_children;
+ Widget *children;
+ unsigned long window;
+ char * class;
+
+ (*count)++;
+
+ InsertWidget(stream, w); /* Insert the widget into the stream. */
+
+ _XEditResPutString8(stream, XtName(w)); /* Insert name */
+
+ if (isApplicationShell(w))
+ class = ((ApplicationShellWidget) w)->application.class;
+ else
+ class = XtClass(w)->core_class.class_name;
+
+ _XEditResPutString8(stream, class); /* Insert class */
+
+ if (XtIsWidget(w))
+ if (XtIsRealized(w))
+ window = XtWindow(w);
+ else
+ window = EDITRES_IS_UNREALIZED;
+ else
+ window = EDITRES_IS_OBJECT;
+
+ _XEditResPut32(stream, window); /* Insert window id. */
+
+ /*
+ * Find children and recurse.
+ */
+
+ num_children = FindChildren(w, &children, TRUE, TRUE);
+ for (i = 0; i < num_children; i++)
+ DumpChildren(children[i], stream, count);
+
+ XtFree((char *)children);
+}
+
+/************************************************************
+ *
+ * Code for getting the geometry of widgets.
+ *
+ ************************************************************/
+
+/* Function Name: DoGetGeometry
+ * Description: retrieves the Geometry of each specified widget.
+ * Arguments: w - a widget in the tree.
+ * event - the event that caused this action.
+ * stream - the protocol stream to add.
+ * Returns: NULL
+ */
+
+static char *
+DoGetGeometry(w, event, stream)
+Widget w;
+EditresEvent * event;
+ProtocolStream * stream;
+{
+ unsigned i;
+ char * str;
+ GetGeomEvent * geom_event = (GetGeomEvent *) event;
+
+ _XEditResPut16(stream, geom_event->num_entries);
+
+ for (i = 0 ; i < geom_event->num_entries; i++) {
+
+ /*
+ * Send out the widget id.
+ */
+
+ _XEditResPutWidgetInfo(stream, &(geom_event->widgets[i]));
+ if ((str = VerifyWidget(w, &(geom_event->widgets[i]))) != NULL) {
+ _XEditResPutBool(stream, True); /* an error occured. */
+ _XEditResPutString8(stream, str); /* set message. */
+ XtFree(str);
+ }
+ else
+ ExecuteGetGeometry(geom_event->widgets[i].real_widget, stream);
+ }
+ return(NULL);
+}
+
+/* Function Name: ExecuteGetGeometry
+ * Description: Gets the geometry for each widget specified.
+ * Arguments: w - the widget to get geom on.
+ * stream - stream to append to.
+ * Returns: True if no error occured.
+ */
+
+static void
+ExecuteGetGeometry(w, stream)
+Widget w;
+ProtocolStream * stream;
+{
+ int i;
+ Boolean mapped_when_man;
+ Dimension width, height, border_width;
+ Arg args[8];
+ Cardinal num_args = 0;
+ Position x, y;
+
+ if ( !XtIsRectObj(w) || (XtIsWidget(w) && !XtIsRealized(w)) ) {
+ _XEditResPutBool(stream, False); /* no error. */
+ _XEditResPutBool(stream, False); /* not visable. */
+ for (i = 0; i < 5; i++) /* fill in extra space with 0's. */
+ _XEditResPut16(stream, 0);
+ return;
+ }
+
+ XtSetArg(args[num_args], XtNwidth, &width); num_args++;
+ XtSetArg(args[num_args], XtNheight, &height); num_args++;
+ XtSetArg(args[num_args], XtNborderWidth, &border_width); num_args++;
+ XtSetArg(args[num_args], XtNmappedWhenManaged, &mapped_when_man);
+ num_args++;
+ XtGetValues(w, args, num_args);
+
+ if (!(XtIsManaged(w) && mapped_when_man) && XtIsWidget(w)) {
+ XWindowAttributes attrs;
+
+ /*
+ * The toolkit does not maintain mapping state, we have
+ * to go to the server.
+ */
+
+ if (XGetWindowAttributes(XtDisplay(w), XtWindow(w), &attrs) != 0) {
+ if (attrs.map_state != IsViewable) {
+ _XEditResPutBool(stream, False); /* no error. */
+ _XEditResPutBool(stream, False); /* not visable. */
+ for (i = 0; i < 5; i++) /* fill in extra space with 0's. */
+ _XEditResPut16(stream, 0);
+ return;
+ }
+ }
+ else {
+ _XEditResPut8(stream, True); /* Error occured. */
+ _XEditResPutString8(stream, "XGetWindowAttributes failed.");
+ return;
+ }
+ }
+
+ XtTranslateCoords(w, -((int) border_width), -((int) border_width), &x, &y);
+
+ _XEditResPutBool(stream, False); /* no error. */
+ _XEditResPutBool(stream, True); /* Visable. */
+ _XEditResPut16(stream, x);
+ _XEditResPut16(stream, y);
+ _XEditResPut16(stream, width);
+ _XEditResPut16(stream, height);
+ _XEditResPut16(stream, border_width);
+}
+
+/************************************************************
+ *
+ * Code for executing FindChild.
+ *
+ ************************************************************/
+
+/* Function Name: PositionInChild
+ * Description: returns true if this location is in the child.
+ * Arguments: child - the child widget to check.
+ * x, y - location of point to check in the parent's
+ * coord space.
+ * Returns: TRUE if the position is in this child.
+ */
+
+static Boolean
+PositionInChild(child, x, y)
+Widget child;
+int x, y;
+{
+ Arg args[6];
+ Cardinal num;
+ Dimension width, height, border_width;
+ Position child_x, child_y;
+ Boolean mapped_when_managed;
+
+ if (!XtIsRectObj(child)) /* we must at least be a rect obj. */
+ return(FALSE);
+
+ num = 0;
+ XtSetArg(args[num], XtNmappedWhenManaged, &mapped_when_managed); num++;
+ XtSetArg(args[num], XtNwidth, &width); num++;
+ XtSetArg(args[num], XtNheight, &height); num++;
+ XtSetArg(args[num], XtNx, &child_x); num++;
+ XtSetArg(args[num], XtNy, &child_y); num++;
+ XtSetArg(args[num], XtNborderWidth, &border_width); num++;
+ XtGetValues(child, args, num);
+
+ /*
+ * The only way we will know of the widget is mapped is to see if
+ * mapped when managed is True and this is a managed child. Otherwise
+ * we will have to ask the server if this window is mapped.
+ */
+
+ if (XtIsWidget(child) && !(mapped_when_managed && XtIsManaged(child)) ) {
+ XWindowAttributes attrs;
+
+ if (XGetWindowAttributes(XtDisplay(child),
+ XtWindow(child), &attrs) != 0) {
+ /* oops */
+ }
+ else if (attrs.map_state != IsViewable)
+ return(FALSE);
+ }
+
+ return (x >= child_x) &&
+ (x <= (child_x + (Position)width + 2 * (Position)border_width)) &&
+ (y >= child_y) &&
+ (y <= (child_y + (Position)height + 2 * (Position)border_width));
+}
+
+/* Function Name: _FindChild
+ * Description: Finds the child that actually contatians the point shown.
+ * Arguments: parent - a widget that is known to contain the point
+ * specified.
+ * x, y - The point in coordinates relative to the
+ * widget specified.
+ * Returns: none.
+ */
+
+static Widget
+_FindChild(parent, x, y)
+Widget parent;
+int x, y;
+{
+ Widget * children;
+ int i = FindChildren(parent, &children, TRUE, FALSE);
+
+ while (i > 0) {
+ i--;
+
+ if (PositionInChild(children[i], x, y)) {
+ Widget child = children[i];
+
+ XtFree((char *)children);
+ return(_FindChild(child, x - child->core.x, y - child->core.y));
+ }
+ }
+
+ XtFree((char *)children);
+ return(parent);
+}
+
+/* Function Name: DoFindChild
+ * Description: finds the child that contains the location specified.
+ * Arguments: w - a widget in the tree.
+ * event - the event that caused this action.
+ * stream - the protocol stream to add.
+ * Returns: an allocated error message if something went horribly
+ * wrong and no set values were performed, else NULL.
+ */
+
+static char *
+DoFindChild(w, event, stream)
+Widget w;
+EditresEvent * event;
+ProtocolStream * stream;
+{
+ char * str;
+ Widget parent, child;
+ Position parent_x, parent_y;
+ FindChildEvent * find_event = (FindChildEvent *) event;
+
+ if ((str = VerifyWidget(w, find_event->widgets)) != NULL)
+ return(str);
+
+ parent = find_event->widgets->real_widget;
+
+ XtTranslateCoords(parent, (Position) 0, (Position) 0,
+ &parent_x, &parent_y);
+
+ child = _FindChild(parent, find_event->x - (int) parent_x,
+ find_event->y - (int) parent_y);
+
+ InsertWidget(stream, child);
+ return(NULL);
+}
+
+/************************************************************
+ *
+ * Procedures for performing GetResources.
+ *
+ ************************************************************/
+
+/* Function Name: DoGetResources
+ * Description: Gets the Resources associated with the widgets passed.
+ * Arguments: w - a widget in the tree.
+ * event - the event that caused this action.
+ * stream - the protocol stream to add.
+ * Returns: NULL
+ */
+
+static char *
+DoGetResources(w, event, stream)
+Widget w;
+EditresEvent * event;
+ProtocolStream * stream;
+{
+ unsigned int i;
+ char * str;
+ GetResEvent * res_event = (GetResEvent *) event;
+
+ _XEditResPut16(stream, res_event->num_entries); /* number of replys */
+
+ for (i = 0 ; i < res_event->num_entries; i++) {
+ /*
+ * Send out the widget id.
+ */
+ _XEditResPutWidgetInfo(stream, &(res_event->widgets[i]));
+ if ((str = VerifyWidget(w, &(res_event->widgets[i]))) != NULL) {
+ _XEditResPutBool(stream, True); /* an error occured. */
+ _XEditResPutString8(stream, str); /* set message. */
+ XtFree(str);
+ }
+ else {
+ _XEditResPutBool(stream, False); /* no error occured. */
+ ExecuteGetResources(res_event->widgets[i].real_widget,
+ stream);
+ }
+ }
+ return(NULL);
+}
+
+/* Function Name: ExecuteGetResources.
+ * Description: Gets the resources for any individual widget.
+ * Arguments: w - the widget to get resources on.
+ * stream - the protocol stream.
+ * Returns: none.
+ */
+
+static void
+ExecuteGetResources(w, stream)
+Widget w;
+ProtocolStream * stream;
+{
+ XtResourceList norm_list, cons_list;
+ Cardinal num_norm, num_cons;
+ register int i;
+
+ /*
+ * Get Normal Resources.
+ */
+
+ XtGetResourceList(XtClass(w), &norm_list, &num_norm);
+
+ if (XtParent(w) != NULL)
+ XtGetConstraintResourceList(XtClass(XtParent(w)),&cons_list,&num_cons);
+ else
+ num_cons = 0;
+
+ _XEditResPut16(stream, num_norm + num_cons); /* how many resources. */
+
+ /*
+ * Insert all the normal resources.
+ */
+
+ for ( i = 0; i < (int) num_norm; i++) {
+ _XEditResPutResourceType(stream, NormalResource);
+ _XEditResPutString8(stream, norm_list[i].resource_name);
+ _XEditResPutString8(stream, norm_list[i].resource_class);
+ _XEditResPutString8(stream, norm_list[i].resource_type);
+ }
+ XtFree((char *) norm_list);
+
+ /*
+ * Insert all the constraint resources.
+ */
+
+ if (num_cons > 0) {
+ for ( i = 0; i < (int) num_cons; i++) {
+ _XEditResPutResourceType(stream, ConstraintResource);
+ _XEditResPutString8(stream, cons_list[i].resource_name);
+ _XEditResPutString8(stream, cons_list[i].resource_class);
+ _XEditResPutString8(stream, cons_list[i].resource_type);
+ }
+ XtFree((char *) cons_list);
+ }
+}
+
+/************************************************************
+ *
+ * Code for inserting values into the protocol stream.
+ *
+ ************************************************************/
+
+/* Function Name: InsertWidget
+ * Description: Inserts the full parent heirarchy of this
+ * widget into the protocol stream as a widget list.
+ * Arguments: stream - the protocol stream.
+ * w - the widget to insert.
+ * Returns: none
+ */
+
+static void
+InsertWidget(stream, w)
+ProtocolStream * stream;
+Widget w;
+{
+ Widget temp;
+ unsigned long * widget_list;
+ register int i, num_widgets;
+
+ for (temp = w, i = 0; temp != 0; temp = XtParent(temp), i++) {}
+
+ num_widgets = i;
+ widget_list = (unsigned long *)
+ XtMalloc(sizeof(unsigned long) * num_widgets);
+
+ /*
+ * Put the widgets into the list.
+ * make sure that they are inserted in the list from parent -> child.
+ */
+
+ for (i--, temp = w; temp != NULL; temp = XtParent(temp), i--)
+ widget_list[i] = (unsigned long) temp;
+
+ _XEditResPut16(stream, num_widgets); /* insert number of widgets. */
+ for (i = 0; i < num_widgets; i++) /* insert Widgets themselves. */
+ _XEditResPut32(stream, widget_list[i]);
+
+ XtFree((char *)widget_list);
+}
+
+/************************************************************
+ *
+ * All of the following routines are public.
+ *
+ ************************************************************/
+
+/* Function Name: _XEditResPutString8
+ * Description: Inserts a string into the protocol stream.
+ * Arguments: stream - stream to insert string into.
+ * str - string to insert.
+ * Returns: none.
+ */
+
+static void
+_XEditResPutString8(stream, str)
+ProtocolStream * stream;
+char * str;
+{
+ int i, len = strlen(str);
+
+ _XEditResPut16(stream, len);
+ for (i = 0 ; i < len ; i++, str++)
+ _XEditResPut8(stream, *str);
+}
+
+/* Function Name: _XEditResPut8
+ * Description: Inserts an 8 bit integer into the protocol stream.
+ * Arguments: stream - stream to insert string into.
+ * value - value to insert.
+ * Returns: none
+ */
+
+static void
+_XEditResPut8(stream, value)
+ProtocolStream * stream;
+unsigned int value;
+{
+ unsigned char temp;
+
+ if (stream->size >= stream->alloc) {
+ stream->alloc += 100;
+ stream->real_top = (unsigned char *) XtRealloc(
+ (char *)stream->real_top,
+ stream->alloc + HEADER_SIZE);
+ stream->top = stream->real_top + HEADER_SIZE;
+ stream->current = stream->top + stream->size;
+ }
+
+ temp = (unsigned char) (value & BYTE_MASK);
+ *((stream->current)++) = temp;
+ (stream->size)++;
+}
+
+/* Function Name: _XEditResPut16
+ * Description: Inserts a 16 bit integer into the protocol stream.
+ * Arguments: stream - stream to insert string into.
+ * value - value to insert.
+ * Returns: void
+ */
+
+static void
+_XEditResPut16(stream, value)
+ProtocolStream * stream;
+unsigned int value;
+{
+ _XEditResPut8(stream, (value >> XER_NBBY) & BYTE_MASK);
+ _XEditResPut8(stream, value & BYTE_MASK);
+}
+
+/* Function Name: _XEditResPut32
+ * Description: Inserts a 32 bit integer into the protocol stream.
+ * Arguments: stream - stream to insert string into.
+ * value - value to insert.
+ * Returns: void
+ */
+
+static void
+_XEditResPut32(stream, value)
+ProtocolStream * stream;
+unsigned long value;
+{
+ int i;
+
+ for (i = 3; i >= 0; i--)
+ _XEditResPut8(stream, (value >> (XER_NBBY*i)) & BYTE_MASK);
+}
+
+/* Function Name: _XEditResPutWidgetInfo
+ * Description: Inserts the widget info into the protocol stream.
+ * Arguments: stream - stream to insert widget info into.
+ * info - info to insert.
+ * Returns: none
+ */
+
+static void
+_XEditResPutWidgetInfo(stream, info)
+ProtocolStream * stream;
+WidgetInfo * info;
+{
+ unsigned int i;
+
+ _XEditResPut16(stream, info->num_widgets);
+ for (i = 0; i < info->num_widgets; i++)
+ _XEditResPut32(stream, info->ids[i]);
+}
+
+/************************************************************
+ *
+ * Code for retrieving values from the protocol stream.
+ *
+ ************************************************************/
+
+/* Function Name: _XEditResResetStream
+ * Description: resets the protocol stream
+ * Arguments: stream - the stream to reset.
+ * Returns: none.
+ */
+
+static void
+_XEditResResetStream(stream)
+ProtocolStream * stream;
+{
+ stream->current = stream->top;
+ stream->size = 0;
+ if (stream->real_top == NULL) {
+ stream->real_top = (unsigned char *) XtRealloc(
+ (char *)stream->real_top,
+ stream->alloc + HEADER_SIZE);
+ stream->top = stream->real_top + HEADER_SIZE;
+ stream->current = stream->top + stream->size;
+ }
+}
+
+/*
+ * NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
+ *
+ * The only modified field if the "current" field.
+ *
+ * The only fields that must be set correctly are the "current", "top"
+ * and "size" fields.
+ */
+
+/* Function Name: _XEditResGetg8
+ * Description: Retrieves an unsigned 8 bit value
+ * from the protocol stream.
+ * Arguments: stream.
+ * val - a pointer to value to return.
+ * Returns: TRUE if sucessful.
+ */
+
+static Boolean
+_XEditResGet8(stream, val)
+ProtocolStream * stream;
+unsigned char * val;
+{
+ if (stream->size < (stream->current - stream->top))
+ return(FALSE);
+
+ *val = *((stream->current)++);
+ return(TRUE);
+}
+
+/* Function Name: _XEditResGet16
+ * Description: Retrieves an unsigned 16 bit value
+ * from the protocol stream.
+ * Arguments: stream.
+ * val - a pointer to value to return.
+ * Returns: TRUE if sucessful.
+ */
+
+static Boolean
+_XEditResGet16(stream, val)
+ProtocolStream * stream;
+unsigned short * val;
+{
+ unsigned char temp1, temp2;
+
+ if ( !(_XEditResGet8(stream, &temp1) && _XEditResGet8(stream, &temp2)) )
+ return(FALSE);
+
+ *val = (((unsigned short) temp1 << XER_NBBY) + ((unsigned short) temp2));
+ return(TRUE);
+}
+
+/* Function Name: _XEditResGetSigned16
+ * Description: Retrieves an signed 16 bit value from the protocol stream.
+ * Arguments: stream.
+ * val - a pointer to value to return.
+ * Returns: TRUE if sucessful.
+ */
+
+static Boolean
+_XEditResGetSigned16(stream, val)
+ProtocolStream * stream;
+short * val;
+{
+ unsigned char temp1, temp2;
+
+ if ( !(_XEditResGet8(stream, &temp1) && _XEditResGet8(stream, &temp2)) )
+ return(FALSE);
+
+ if (temp1 & (1 << (XER_NBBY - 1))) { /* If the sign bit is active. */
+ *val = -1; /* store all 1's */
+ *val &= (temp1 << XER_NBBY); /* Now and in the MSB */
+ *val &= temp2; /* and LSB */
+ }
+ else
+ *val = (((unsigned short) temp1 << XER_NBBY) + ((unsigned short) temp2));
+
+ return(TRUE);
+}
+
+/* Function Name: _XEditResGet32
+ * Description: Retrieves an unsigned 32 bit value
+ * from the protocol stream.
+ * Arguments: stream.
+ * val - a pointer to value to return.
+ * Returns: TRUE if sucessful.
+ */
+
+static Boolean
+_XEditResGet32(stream, val)
+ProtocolStream * stream;
+unsigned long * val;
+{
+ unsigned short temp1, temp2;
+
+ if ( !(_XEditResGet16(stream, &temp1) && _XEditResGet16(stream, &temp2)) )
+ return(FALSE);
+
+ *val = (((unsigned short) temp1 << (XER_NBBY * 2)) +
+ ((unsigned short) temp2));
+ return(TRUE);
+}
+
+/* Function Name: _XEditResGetString8
+ * Description: Retrieves an 8 bit string value from the protocol stream.
+ * Arguments: stream - the protocol stream
+ * str - the string to retrieve.
+ * Returns: True if retrieval was successful.
+ */
+
+static Boolean
+_XEditResGetString8(stream, str)
+ProtocolStream * stream;
+char ** str;
+{
+ unsigned short len;
+ register unsigned i;
+
+ if (!_XEditResGet16(stream, &len)) {
+ return(FALSE);
+ }
+
+ *str = XtMalloc(sizeof(char) * (len + 1));
+
+ for (i = 0; i < len; i++) {
+ if (!_XEditResGet8(stream, (unsigned char *) *str + i)) {
+ XtFree(*str);
+ *str = NULL;
+ return(FALSE);
+ }
+ }
+ (*str)[i] = '\0'; /* NULL terminate that sucker. */
+ return(TRUE);
+}
+
+/* Function Name: _XEditResGetWidgetInfo
+ * Description: Retrieves the list of widgets that follow and stores
+ * them in the widget info structure provided.
+ * Arguments: stream - the protocol stream
+ * info - the widget info struct to store into.
+ * Returns: True if retrieval was successful.
+ */
+
+static Boolean
+_XEditResGetWidgetInfo(stream, info)
+ProtocolStream * stream;
+WidgetInfo * info;
+{
+ unsigned int i;
+
+ if (!_XEditResGet16(stream, &(info->num_widgets)))
+ return(FALSE);
+
+ info->ids = (unsigned long *) XtMalloc(sizeof(long) * (info->num_widgets));
+
+ for (i = 0; i < info->num_widgets; i++) {
+ if (!_XEditResGet32(stream, info->ids + i)) {
+ XtFree((char *)info->ids);
+ info->ids = NULL;
+ return(FALSE);
+ }
+ }
+ return(TRUE);
+}
+
+/************************************************************
+ *
+ * Code for Loading the EditresBlock resource.
+ *
+ ************************************************************/
+
+/* Function Name: CvStringToBlock
+ * Description: Converts a string to an editres block value.
+ * Arguments: dpy - the display.
+ * args, num_args - **UNUSED **
+ * from_val, to_val - value to convert, and where to put result
+ * converter_data - ** UNUSED **
+ * Returns: TRUE if conversion was sucessful.
+ */
+
+/* ARGSUSED */
+static Boolean
+CvtStringToBlock(dpy, args, num_args, from_val, to_val, converter_data)
+Display * dpy;
+XrmValue * args;
+Cardinal * num_args;
+XrmValue * from_val, * to_val;
+XtPointer * converter_data;
+{
+ char ptr[BUFSIZ];
+ static EditresBlock block;
+
+/* XmuCopyISOLatin1Lowered(ptr, from_val->addr);*/
+
+
+ if (streq(ptr, "none"))
+ block = BlockNone;
+ else if (streq(ptr, "setvalues"))
+ block = BlockSetValues;
+ else if (streq(ptr, "all"))
+ block = BlockAll;
+ else {
+ Cardinal num_params = 1;
+ String params[1];
+
+ params[0] = from_val->addr;
+ XtAppWarningMsg(XtDisplayToApplicationContext(dpy),
+ "CvtStringToBlock", "unknownValue", "EditresError",
+ "Could not convert string \"%s\" to EditresBlock.",
+ params, &num_params);
+ return(FALSE);
+ }
+
+ if (to_val->addr != NULL) {
+ if (to_val->size < sizeof(EditresBlock)) {
+ to_val->size = sizeof(EditresBlock);
+ return(FALSE);
+ }
+ *(EditresBlock *)(to_val->addr) = block;
+ }
+ else
+ to_val->addr = (XtPointer) block;
+
+ to_val->size = sizeof(EditresBlock);
+ return(TRUE);
+}
+
+#define XtREditresBlock ("EditresBlock")
+
+/* Function Name: LoadResources
+ * Description: Loads a global resource the determines of this
+ * application should allow Editres requests.
+ * Arguments: w - any widget in the tree.
+ * Returns: none.
+ */
+
+static void
+LoadResources(w)
+Widget w;
+{
+ static XtResource resources[] = {
+ {"editresBlock", "EditresBlock", XtREditresBlock, sizeof(EditresBlock),
+ XtOffsetOf(Globals, block), XtRImmediate, (XtPointer) BlockNone}
+ };
+
+ for (; XtParent(w) != NULL; w = XtParent(w)) {}
+
+ XtAppSetTypeConverter(XtWidgetToApplicationContext(w),
+ XtRString, XtREditresBlock, CvtStringToBlock,
+ NULL, (Cardinal) 0, XtCacheAll, NULL);
+
+ XtGetApplicationResources( w, (caddr_t) &globals, resources,
+ XtNumber(resources), NULL, (Cardinal) 0);
+}
+
+
diff --git a/src/RegEdit.h b/src/RegEdit.h
new file mode 100644
index 0000000..5274151
--- /dev/null
+++ b/src/RegEdit.h
@@ -0,0 +1,65 @@
+/* $XConsortium: RegEdit.h /main/5 1995/07/15 20:44:09 drk $ */
+/*
+ * @OPENGROUP_COPYRIGHT@
+ * COPYRIGHT NOTICE
+ * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
+ * ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
+ * the full copyright text.
+ *
+ * This software is subject to an open license. It may only be
+ * used on, with or for operating systems which are themselves open
+ * source systems. You must contact The Open Group for a license
+ * allowing distribution and sublicensing of this software on, with,
+ * or for operating systems which are not Open Source programs.
+ *
+ * See http://www.opengroup.org/openmotif/license for full
+ * details of the license agreement. Any use, reproduction, or
+ * distribution of the program constitutes recipient's acceptance of
+ * this agreement.
+ *
+ * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+ * PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+ * WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+ * OR FITNESS FOR A PARTICULAR PURPOSE
+ *
+ * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+ * NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
+ * EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+/*
+ * HISTORY
+ */
+
+ /* Ensure that the file be included only once. */
+#ifndef _XmdRegEdit_h
+#define _XmdRegEdit_h
+
+#include <Xm/Xm.h>
+
+/* Allow for C++ compilation. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern void XmdRegisterEditres(Widget toplevel);
+
+/* Allow for C++ compilation. */
+#ifdef __cplusplus
+} /* Close scope of 'extern "C"' declaration which encloses file. */
+#endif
+
+
+/* Ensure that the file be included only once. */
+#endif /* _XmdRegEdit_h */
+/* DON'T ADD ANYTHING AFTER THIS #endif */
+
diff --git a/src/RegEditI.h b/src/RegEditI.h
new file mode 100644
index 0000000..4608593
--- /dev/null
+++ b/src/RegEditI.h
@@ -0,0 +1,368 @@
+/*
+ * @OPENGROUP_COPYRIGHT@
+ * COPYRIGHT NOTICE
+ * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
+ * ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
+ * the full copyright text.
+ *
+ * This software is subject to an open license. It may only be
+ * used on, with or for operating systems which are themselves open
+ * source systems. You must contact The Open Group for a license
+ * allowing distribution and sublicensing of this software on, with,
+ * or for operating systems which are not Open Source programs.
+ *
+ * See http://www.opengroup.org/openmotif/license for full
+ * details of the license agreement. Any use, reproduction, or
+ * distribution of the program constitutes recipient's acceptance of
+ * this agreement.
+ *
+ * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+ * PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+ * WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+ * OR FITNESS FOR A PARTICULAR PURPOSE
+ *
+ * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+ * NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
+ * EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+/*
+ * HISTORY
+ */
+
+
+/* $XConsortium: RegEditI.h /main/4 1995/07/14 10:05:01 drk $ */
+
+/*
+
+Copyright (c) 1989 X Consortium
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to d