aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changes18
-rw-r--r--Makefile.in80
-rw-r--r--README43
-rw-r--r--README.bttv10
-rw-r--r--README.network4
-rw-r--r--README.recording57
-rw-r--r--TODO1
-rw-r--r--acconfig.h23
-rw-r--r--common/Subdir.mk6
-rw-r--r--common/channel.c24
-rw-r--r--common/channel.h2
-rw-r--r--common/commands.c231
-rw-r--r--common/frequencies.c21
-rw-r--r--common/parseconfig.c31
-rw-r--r--common/parseconfig.h3
-rw-r--r--config.h.in131
-rwxr-xr-xconfigure3111
-rw-r--r--configure.ac30
-rw-r--r--console/Subdir.mk2
-rw-r--r--console/fbtv.c2
-rw-r--r--console/showqt.c670
-rw-r--r--console/streamer.c16
-rw-r--r--console/ttv.c2
-rw-r--r--console/v4l-conf.c13
-rw-r--r--console/webcam.c29
-rw-r--r--contrib/xawtvsort.pl459
-rw-r--r--libng/Subdir.mk5
-rw-r--r--libng/contrib-plugins/Makefile2
-rw-r--r--libng/contrib-plugins/Subdir.mk21
-rw-r--r--libng/contrib-plugins/flt-smooth.c (renamed from libng/plugins/flt-smooth.c)12
-rw-r--r--libng/contrib-plugins/snd-alsa.cc237
-rw-r--r--libng/grab-ng.c20
-rw-r--r--libng/grab-ng.h24
-rw-r--r--libng/plugins/Subdir.mk26
-rw-r--r--libng/plugins/drv0-v4l2-old.c1263
-rw-r--r--libng/plugins/drv0-v4l2.c303
-rw-r--r--libng/plugins/flt-disor.c15
-rw-r--r--libng/plugins/read-avi.c6
-rw-r--r--libng/plugins/read-dv.c325
-rw-r--r--libng/plugins/read-qt.c37
-rw-r--r--libng/plugins/snd-oss.c5
-rw-r--r--libng/plugins/write-dv.c226
-rw-r--r--libng/videodev2-old.h918
-rw-r--r--libng/videodev2.h861
-rw-r--r--man/Subdir.mk16
-rw-r--r--man/fbtv.14
-rw-r--r--man/motv.120
-rw-r--r--man/pia.110
-rw-r--r--man/propwatch.12
-rw-r--r--man/streamer.12
-rw-r--r--man/v4l-conf.812
-rw-r--r--man/webcam.110
-rw-r--r--man/xawtv-remote.15
-rw-r--r--man/xawtv.122
-rw-r--r--man/xawtvrc.520
-rw-r--r--scripts/html.pl6
-rw-r--r--vbistuff/about.html.in2
-rw-r--r--vbistuff/alevt.css.in2
-rw-r--r--vbistuff/request.c2
-rw-r--r--vbistuff/response.c2
-rw-r--r--x11/Subdir.mk20
-rw-r--r--x11/blit.c61
-rw-r--r--x11/blit.h4
-rw-r--r--x11/conf.c3
-rw-r--r--x11/motv.c20
-rw-r--r--x11/pia.c132
-rw-r--r--x11/v4lctl.c2
-rw-r--r--x11/videodev2-new.h862
-rw-r--r--x11/wmhooks.c24
-rw-r--r--x11/x11.c59
-rw-r--r--x11/x11.h5
-rw-r--r--x11/xawtv.c18
-rw-r--r--x11/xt.c43
-rw-r--r--x11/xt.h5
-rw-r--r--xawtv.spec11
-rw-r--r--xawtv.spec.in9
76 files changed, 8869 insertions, 1871 deletions
diff --git a/Changes b/Changes
index 3f28638..cf2e0f7 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,22 @@
+3.76 => 3.77
+============
+
+ * fixed broken alevtd
+ * swapped gnome + netwm protocol checks (wmhooks.c), netwm is
+ preferred now.
+ * Added showqt utility (dumps structure of QuickTime files like
+ showriff does for AVI files).
+ * Added vdr control code.
+ * webcam's archive function now creates directories if needed.
+ * fixed spec file.
+ * started adding support for reading/writing raw dv files via libdv.
+ Probably not that useful yet, at least my box is far away from
+ being able to encode dv streams in real time. Even playback drops
+ more than 50% of the frames.
+ * added alsa mixer plugin (Malte Starostik <malte.starostik@t-online.de>).
+
+
3.75 => 3.76
============
diff --git a/Makefile.in b/Makefile.in
index b66bbb2..608ee0f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -16,6 +16,7 @@ config := @x11conf@/xawtvrc
# programs
CC := @CC@
+CXX := @CXX@
INSTALL := @INSTALL@
INSTALL_PROGRAM := @INSTALL_PROGRAM@ -s
INSTALL_DATA := @INSTALL_DATA@
@@ -45,12 +46,14 @@ AA_LIBS := @AALIBS@
QT_LIBS := @QTLIBS@
VBI_LIBS := @LIBZVBI@ -lm
GL_LIBS := @LIBGL@
+DV_LIBS := @LIBDV@
FS_LIBS := -L@x_libraries@ @FSLIB@
DLFLAGS := @DLFLAGS@
# stuff configure has found
FOUND_AALIB := @FOUND_AALIB@
FOUND_ALSA := @FOUND_ALSA@
+FOUND_DV := @FOUND_DV@
FOUND_GL := @FOUND_GL@
FOUND_LQT := @FOUND_LQT@
FOUND_MOTIF := @FOUND_MOTIF@
@@ -67,6 +70,7 @@ CFLAGS += $(LIB_FLAGS)
CFLAGS += -DCONFIGFILE='"$(config)"'
CFLAGS += -DLIBDIR='"$(libdir)"'
CFLAGS += -DVERSION='"$(VERSION)"'
+CXXFLAGS = $(CFLAGS)
# shared objects need -fPIC
%.so : CFLAGS += -fPIC
@@ -83,6 +87,9 @@ build: all
Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
$(srcdir)/configure
+$(srcdir)/configure: $(srcdir)/configure.ac
+ (cd $(srcdir); autoconf && autoheader)
+
install:: all
$(INSTALL_DIR) $(bindir)
@@ -90,9 +97,8 @@ clean::
find . -name \*~ -print | xargs rm -f
find . -name \*.o -print | xargs rm -f
find . -name \*.a -print | xargs rm -f
- find . -name \*.d -print | xargs rm -f
- find . -name \*.pic -print | xargs rm -f
find . -name \*.dep -print | xargs rm -f
+ rm -f .deps.*
distclean:: clean
-rm -f Makefile Make.config
@@ -109,27 +115,63 @@ realclean:: distclean
#########################################################
# some rules ...
-.SUFFIXES: .c .h .o .so .in .ad .bdf .pcf.gz
+tmpdep = $*.dep
+depfile = .deps.$(subst /,_,$*)
+
+compile_c = $(CC) $(CFLAGS) -Wp,-MD,$(tmpdep) -c -o $@ $<
+compile_cc = $(CXX) $(CXXFLAGS) -Wp,-MD,$(tmpdep) -c -o $@ $<
+fixup_deps = sed -e "s|.*\.o:|$@::|" < $(tmpdep) > $(depfile) && rm -f $(tmpdep)
+
+link_app = $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+link_so = $(CC) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $< $(LDLIBS)
+ar_lib = rm -f $@ && ar -r $@ $^ && ranlib $@
+
+# non-verbose output
+VERBOSE = no
+ifeq ($(VERBOSE),yes)
+echo_compile_c = echo $(compile_c)
+echo_compile_cc = echo $(compile_cc)
+echo_link_app = echo $(link_app)
+echo_link_so = echo $(link_so)
+echo_ar_lib = echo $(ar_lib)
+else
+echo_compile_c = echo "compile " $@
+echo_compile_cc = echo "compile " $@
+echo_link_app = echo "link " $@
+echo_link_so = echo "link " $@
+echo_ar_lib = echo "archive " $@
+endif
+
+.SUFFIXES: .c .cc .h .o .so .in .ad
+# .bdf .pcf.gz
.c.o:
- $(CC) $(CFLAGS) -Wp,-MD,$*.dep -c -o $@ $<
- @sed -e "s|.*\.o:|$@::|" < $*.dep > $*.d && rm -f $*.dep
+ @$(echo_compile_c)
+ @$(compile_c)
+ @$(fixup_deps)
+
+.cc.o:
+ @$(echo_compile_cc)
+ @$(compile_cc)
+ @$(fixup_deps)
.o.so:
- $(CC) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $< $(LDLIBS)
+ @$(echo_link_so)
+ @$(link_so)
%: %.o
- $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+ @$(echo_link_app)
+ @$(link_app)
.in.h:
- perl -ne 's/\"/\\\"/g; chop; print "\"$$_\\n\"\n"' $< > $@
+ perl $(srcdir)/scripts/html.pl < $< > $@
.ad.h:
perl $(srcdir)/scripts/fallback.pl < $< > $@
-.bdf.pcf.gz:
- bdftopcf -o $*.pcf $<
- gzip $*.pcf
+#.bdf.pcf.gz:
+# bdftopcf -o $*.pcf $<
+# gzip $*.pcf
#########################################################
@@ -143,20 +185,14 @@ include $(srcdir)/console/Subdir.mk
include $(srcdir)/debug/Subdir.mk
include $(srcdir)/libng/Subdir.mk
include $(srcdir)/libng/plugins/Subdir.mk
+include $(srcdir)/libng/contrib-plugins/Subdir.mk
include $(srcdir)/man/Subdir.mk
include $(srcdir)/scripts/Subdir.mk
include $(srcdir)/vbistuff/Subdir.mk
include $(srcdir)/x11/Subdir.mk
# dependences
--include common/*.d
--include console/*.d
--include debug/*.d
--include jwz/*.d
--include libng/*.d
--include libng/plugins/*.d
--include vbistuff/*.d
--include x11/*.d
+-include .deps.*
#########################################################
@@ -183,9 +219,3 @@ snapshot: distclean
(cd ..; tar cvzf xawtv-snap-`date +%Y-%m-%d`.tar.gz \
xawtv-$(VERSION))
-auto: distclean
- rm -f config.cache
- autoconf
- autoheader
- ./configure
- make
diff --git a/README b/README
index 1d23db2..f3b7ff1 100644
--- a/README
+++ b/README
@@ -44,9 +44,9 @@ For problem/bug reports:
* emails with questions answered in the documentation will go to
/dev/null.
* emails which don't have any useful informations (like "xawtv
- does'nt work, please help me") will go to /dev/null.
+ doesn't work, please help me") will go to /dev/null.
-"useful informations" includes at least:
+"useful information" includes at least:
- xawtv version
- kernel version
- which driver (+ version if you know)
@@ -60,13 +60,13 @@ If you are using bttv as driver:
- the insmod arguments for the modules
- the kernel messages printed by bttv while loading.
-If you are _really_sure_ some information is'nt important for your
+If you are _really_sure_ some information isn't important for your
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 add a comment on 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.
* Complete patches have better chances to go in. Quick+dirty hacks
@@ -86,7 +86,7 @@ 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
+If it fails, 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.
@@ -109,7 +109,7 @@ bttv
bttv is'nt bundled with xawtv any more. You can the latest version
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
+very unlikely that you need an update, the bttv driver in 2.4.x is
updated in regular intervals.
@@ -118,7 +118,7 @@ v4l-conf
v4l-conf is a small tool which tells video4linux about the current
video mode (size and color depth). This requires root priviliges,
-becauce it is easy to crash the box by passing bogous values there.
+becauce it is easy to crash the box by passing bogus values there.
It requires the X-Server with DGA support up and running or a
framebuffer device. It is a temporary hack, this problem will be
solved in a better way with a X11 extention. See README.xfree4
@@ -126,7 +126,7 @@ for details.
Try "v4l-conf -h" for a short description. It is installed suid-root,
and xawtv runs it at startup. Should work out-of-the-box without
-extra configuration. Normally you should'nt need to worry about it,
+extra configuration. Normally you shouldn't need to worry about it,
but for debugging it is handy do run it from the shell and check the
output.
@@ -136,7 +136,7 @@ xawtv
There is a man page now, read it. Don't expect you can use xawtv
without reading the documentation at least once. You are lost if you
-don't know the keyboard shortcuts, xawtv is'nt a mouse-only program.
+don't know the keyboard shortcuts, xawtv isn't a mouse-only program.
xawtv will not work without the app-defaults. If you want to try
xawtv without installing it, use this...
@@ -146,7 +146,7 @@ xawtv without installing it, use this...
$ ./xawtv
...to make sure xawtv finds the application defaults (the Xawtv.ad
-file). If v4l-conf is'nt installed too, you have to run it once
+file). If v4l-conf isn't installed too, you have to run it once
(as root) before starting xawtv.
@@ -154,7 +154,7 @@ 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
+is very close to xawtv, they share a lot of code (basically everything
but the athena/motif GUI code).
motv uses Motif 2.x features (utm, render tables). This means you
@@ -188,6 +188,13 @@ ttv
aa-lib based TV app which renders the TV image on any text terminal.
+scantv
+------
+
+scans for tv stations and writes a initial config file for xawtv and
+motv.
+
+
v4lctl
------
@@ -203,6 +210,13 @@ frames work too. Try the '-h' switch for a description. A (short)
man page is available too.
+pia
+---
+
+simple movie player, should play every movie file (mov+avi) recorded
+by streamer, xawtv and motv.
+
+
radio
-----
@@ -216,7 +230,7 @@ kradio config file. You can't configure anything with radio, you'll
have to use kradio or vi for this. The config file format is
documented in the man page.
-kradio (my KDE radio app) is'nt included any more, it is available as
+kradio (my KDE radio app) isn't included any more, it is available as
separate tarball now.
@@ -225,8 +239,9 @@ videotext / teletext
alevt is _the_ videotext application for bttv. URL below.
-A http server for videotext which is based on alevt's vbi decoder engine
-is in the http subdirectory. It's called alevtd.
+A http server for videotext called 'alevtd' is in the vbistuff
+subdirectory. Recent xawtv version also come with mtt, which is a
+interactive videotext application for X11 (Motif) and console.
webcam
diff --git a/README.bttv b/README.bttv
index cda93af..74f489f 100644
--- a/README.bttv
+++ b/README.bttv
@@ -11,7 +11,7 @@ general hints
bttv0: model: BT848(Hauppauge old)
- If your card is'nt autodetected correctly, you have to specify the
+ If your card isn't 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
@@ -19,11 +19,11 @@ general hints
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
+ to upgrade as the 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
+ bttv 0.7.x knows a lot more cards than the 2.2.x kernel driver, the
+ autodetect is much improved and a number of known problems is
fixed.
(3) If you have problems with xawtv, you should open a xterm (or
@@ -57,7 +57,7 @@ common problems
?: 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
+!: xawtv / v4l-conf didn't 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
diff --git a/README.network b/README.network
index 6fc2e37..acb35fb 100644
--- a/README.network
+++ b/README.network
@@ -3,7 +3,7 @@ How send audio/video data over the net?
=======================================
-Just some pointers where to look. I havn't tried everything myself.
+Just some pointers where to look. I haven't tried everything myself.
still images (webcam)
@@ -20,7 +20,7 @@ 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
+should even interoperate with M$ Netmeeting. I've heard there is a
project named "gnomemeeting" ...
You might want to have a look at videolan (http://www.videolan.org).
diff --git a/README.recording b/README.recording
index 06622ed..19b7292 100644
--- a/README.recording
+++ b/README.recording
@@ -32,7 +32,7 @@ correctly.
Video
=====
-Note that video recording does not work if the Xvideo extention is in
+Note that video recording does not work if the Xvideo extension is in
use. For recording stuff with xawtv you might have to start the
application with the -noxv switch to disable Xvideo.
@@ -48,7 +48,7 @@ xawtv/streamer handle video recording with multiple threads:
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.
+temporarily 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,
@@ -59,13 +59,9 @@ configure the number at insmod time (gbuffers option). Using more
buffers (say 4-8 instead of just two which is the default) should help
to reduce the number of dropped frames.
-If you want to record quicktime movies install the quicktime4linux
-libraries (http://heroines.sourceforge.net/quicktime.php3), then
-(re-)build xawtv. The configure script should find the library
-automatically. Note: /me still uses version 1.3. Tried 1.5 recently,
-it didn't work for me. The library itself needs a (trivial) fix to
-build (gcc 2.95.4, maybe gcc 3.x is less picky). "make util" failes
-with unresolved symbols :-( Waiting for 1.6 ...
+If you want to record quicktime movies install libquicktime
+(http://libquicktime.sf.net), then (re-)build xawtv. The configure
+script should find the library automatically.
Known problems (and workarounds)
@@ -80,34 +76,19 @@ With v4l2 xawtv uses the frame timestamps provided by the driver.
Troubleshooting syncronisation problems
=======================================
-If you are recording a movie with xawtv/stremaer you get a display
-like this on stderr:
+A/V sync should simply work if your box can keep up with the data
+rate. xawtv/streamer displays some debug info (time shift) on stderr.
+"a/r" is the difference between audio and real time, "a/v" is the
+difference between audio and video.
-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). It is
- displayed relative to real time.
- - "video" is the same for video: total frames divided by the
- frames/second (also displayed relative to 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
-taken into accout here, i.e. if you see "fifo full" error messages
-your movie will have bad syncronisation even if the display looks
-fine. Possible fixes: Try using more buffers. Try recording
-compressed video. Try tuning the hard disk using hdparm. Buy a
-faster hard disk. Buy a faster computer.
+Ff you see "fifo full" error messages your box likely can't keep up
+with the data rate. Possible fixes: Try using more buffers. Try
+recording compressed video. Try tuning the hard disk using hdparm.
+Buy a faster hard disk. Buy a faster computer.
If xawtv/streamer says "queueing frame twice" it has put a the same
video frame twice into the output queue to avoid video running out of
-sync. If this happens alot it indicates that either your computer
+sync. If this happens a lot it indicates that either your computer
can't keep up with compressing the frames or that your v4l device
can't capture frames with the frame rate you are asking for. A single
message now and then is harmless.
@@ -121,7 +102,7 @@ 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
+If you don't have enough 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.
@@ -131,7 +112,7 @@ Large Files
===========
xawtv has LFS support, i.e. it can write files >2GB without problems.
-The AVI format has a 2GB limit. There is a extention to overcome this
+The AVI format has a 2GB limit. There is a extension to overcome this
[http://www.matrox.com/videoweb/news/press/papers/odmlff2.pdf], but not
all applications can deal with it. The quicktime format usually works
better as there is the quicktime4linux library everybody uses to
@@ -141,6 +122,10 @@ read/write *.mov files, thus there are less compatibility issues.
Read, Convert, Edit + Playback stuff
====================================
+Recent xawtv versions come with the "pia" utility. That is a simple
+player which should be able to playback all AVI and QuickTime movies
+recorded by xawtv, motv and streamer.
+
avi format
* xanim plays everything without problems.
@@ -152,7 +137,7 @@ avi format
* avifile can't deal with the uncompressed video correctly
[fixed in recent versions].
mjpeg/jpeg doesn't work either for me as it seems not to
- recognise the MainConcept codec, althought I've copied
+ recognise the MainConcept codec, although I've copied
stuff to /usr/lib/win32. Maybe it works with another
one.
* MainActor (linux) can read the mjpeg but not the jpeg
diff --git a/TODO b/TODO
index c4e21ed..42b0841 100644
--- a/TODO
+++ b/TODO
@@ -13,6 +13,7 @@ general
* mono/stereo config file options.
* hotkeys/remote commands for mono/stereo/...
* two (more?) channel lists: "all" & "frequently used".
+ * record subtitles (QuickTime text track?).
avi
diff --git a/acconfig.h b/acconfig.h
deleted file mode 100644
index 9ccc951..0000000
--- a/acconfig.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* no comment */
-#undef HAVE_XMU
-
-/* lirc lib */
-#undef HAVE_LIBLIRC_CLIENT
-
-/* libzvbi */
-#undef HAVE_ZVBI
-
-/* opengl */
-#undef HAVE_GL
-
-/* alsa */
-#undef HAVE_ALSA
-
-/* quicktime lib */
-#undef HAVE_LIBQUICKTIME
-
-/* Define if you have the Xdpms library (-lXdpms). */
-#undef HAVE_LIBXDPMS
-
-/* ipv6 struct sockaddr_storage */
-#undef HAVE_SOCKADDR_STORAGE
diff --git a/common/Subdir.mk b/common/Subdir.mk
index 4888899..0b8b5ec 100644
--- a/common/Subdir.mk
+++ b/common/Subdir.mk
@@ -17,7 +17,9 @@ OBJS-common-input := \
# RegEdit.c is good old K&R ...
common/RegEdit.o : CFLAGS += -Wno-missing-prototypes -Wno-strict-prototypes
+common/channel-no-x11.o: CFLAGS += -DNO_X11=1
common/channel-no-x11.o:: common/channel.c
- $(CC) $(CFLAGS) -DNO_X11=1 -Wp,-MD,$*.dep -c -o $@ $<
- @sed -e "s|.*\.o:|$@::|" < $*.dep > $*.d && rm -f $*.dep
+ @$(echo_compile_c)
+ @$(compile_c)
+ @$(fixup_deps)
diff --git a/common/channel.c b/common/channel.c
index 57c3750..1b89c17 100644
--- a/common/channel.c
+++ b/common/channel.c
@@ -99,6 +99,9 @@ int nlaunch = 0;
int lookup_channel(char *channel)
{
+#if 0
+ /* Hmm, why the heck that used to be that complex?
+ * Any good reason I forgot ? */
int i,nr1,nr2;
char tag1[5],tag2[5];
@@ -130,6 +133,18 @@ int lookup_channel(char *channel)
return -1;
return i;
+#else
+ int i;
+
+ if (NULL == channel)
+ return -1;
+ for (i = 0; i < chancount; i++)
+ if (0 == strcasecmp(chanlist[i].name,channel))
+ break;
+ if (i == chancount)
+ return -1;
+ return i;
+#endif
}
int get_freq(int i)
@@ -365,7 +380,7 @@ init_channel(char *name, struct CHANNEL *c)
}
void
-read_config(char *conffile)
+read_config(char *conffile, int *argc, char **argv)
{
char filename[100];
char *val;
@@ -381,6 +396,8 @@ read_config(char *conffile)
if (0 == cfg_parse_file(filename))
have_config = 1;
}
+ if (argc)
+ cfg_parse_options(argc,argv);
/* misc global settings */
if (NULL != (val = cfg_get_str("global","mixer"))) {
@@ -460,6 +477,11 @@ read_config(char *conffile)
mov_audio = val;
if (NULL != (val = cfg_get_str("global","mov-rate")))
mov_rate = val;
+
+ if (NULL != (val = cfg_get_str("global","filter")))
+ for (i = 0; NULL != ng_filters[i]; i++)
+ if (0 == strcasecmp(ng_filters[i]->name, val))
+ cur_filter=ng_filters[i];
}
void
diff --git a/common/channel.h b/common/channel.h
index b5b04f1..4dfabe7 100644
--- a/common/channel.h
+++ b/common/channel.h
@@ -70,7 +70,7 @@ void configure_channel(struct CHANNEL *channel);
void del_channel(int nr);
void calc_frequencies(void);
-void read_config(char *conffile);
+void read_config(char *conffile, int *argc, char **argv);
void parse_config(void);
void save_config(void);
diff --git a/common/commands.c b/common/commands.c
index 0587861..66a3a95 100644
--- a/common/commands.c
+++ b/common/commands.c
@@ -11,8 +11,14 @@
#include <math.h>
#include <stdarg.h>
#include <time.h>
+#include <fcntl.h>
#include <pthread.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+
#include "grab-ng.h"
#include "capture.h"
@@ -91,6 +97,7 @@ static int movie_handler(char *name, int argc, char **argv);
static int fullscreen_handler(char *name, int argc, char **argv);
static int msg_handler(char *name, int argc, char **argv);
static int showtime_handler(char *name, int argc, char **argv);
+static int vdr_handler(char *name, int argc, char **argv);
#if TT
static int vtx_handler(char *name, int argc, char **argv);
#endif
@@ -105,6 +112,7 @@ static struct COMMANDS {
} commands[] = {
{ "setstation", 0, setstation_handler },
{ "setchannel", 0, setchannel_handler },
+ { "setfreq", 1, setchannel_handler },
{ "setfreqtab", 1, setfreqtab_handler },
{ "capture", 1, capture_handler },
@@ -137,6 +145,7 @@ static struct COMMANDS {
{ "keypad", 1, keypad_handler },
{ "showtime", 0, showtime_handler },
+ { "vdr", 1, vdr_handler },
{ NULL, 0, NULL }
};
@@ -651,48 +660,54 @@ static int setchannel_handler(char *name, int argc, char **argv)
display_message("grabber busy");
return -1;
}
-
- if (0 == strcasecmp(argv[0],"next")) {
- cur_channel = (cur_channel+1) % chancount;
- cur_fine = defaults.fine;
- } else if (0 == strcasecmp(argv[0],"prev")) {
- cur_channel = (cur_channel+chancount-1) % chancount;
- cur_fine = defaults.fine;
- } else if (0 == strcasecmp(argv[0],"fine_up")) {
- cur_fine++;
- } else if (0 == strcasecmp(argv[0],"fine_down")) {
- cur_fine--;
+
+ if (0 == strcasecmp("setfreq",name)) {
+ cur_freq = (unsigned long)(atof(argv[0])*16);
+ cur_sender = -1;
+ cur_channel = -1;
+ cur_fine = 0;
} else {
- if (-1 != (c = lookup_channel(argv[0]))) {
- cur_channel = c;
+ if (0 == strcasecmp(argv[0],"next")) {
+ cur_channel = (cur_channel+1) % chancount;
+ cur_fine = defaults.fine;
+ } else if (0 == strcasecmp(argv[0],"prev")) {
+ cur_channel = (cur_channel+chancount-1) % chancount;
cur_fine = defaults.fine;
+ } else if (0 == strcasecmp(argv[0],"fine_up")) {
+ cur_fine++;
+ } else if (0 == strcasecmp(argv[0],"fine_down")) {
+ cur_fine--;
+ } else {
+ if (-1 != (c = lookup_channel(argv[0]))) {
+ cur_channel = c;
+ cur_fine = defaults.fine;
+ }
}
- }
-
- if (0 != strncmp(argv[0],"fine",4)) {
- /* look if there is a known station on that channel */
- for (i = 0; i < count; i++) {
- if (cur_channel == channels[i]->channel) {
- char *argv[2];
- argv[0] = channels[i]->name;
- argv[1] = NULL;
- return setstation_handler("", argc, argv);
+
+ if (0 != strncmp(argv[0],"fine",4)) {
+ /* look if there is a known station on that channel */
+ for (i = 0; i < count; i++) {
+ if (cur_channel == channels[i]->channel) {
+ char *argv[2];
+ argv[0] = channels[i]->name;
+ argv[1] = NULL;
+ return setstation_handler("", argc, argv);
+ }
}
}
+ cur_sender = -1;
+ if (-1 != cur_channel)
+ cur_freq = get_freq(cur_channel)+cur_fine;
+ else {
+ cur_freq += cur_fine;
+ cur_fine = 0;
+ }
}
if (channel_switch_hook)
channel_switch_hook();
set_capture(CAPTURE_OFF,1);
- cur_sender = -1;
- if (-1 != cur_channel)
- cur_freq = get_freq(cur_channel)+cur_fine;
- else {
- cur_freq += cur_fine;
- cur_fine = 0;
- }
-
mute = ng_attr_byid(attrs,ATTR_ID_MUTE);
if (mute && !cur_attrs[ATTR_ID_MUTE])
mute->write(mute,1);
@@ -1157,6 +1172,160 @@ exit_handler(char *name, int argc, char **argv)
/* ----------------------------------------------------------------------- */
+static char *strfamily(int family)
+{
+ switch (family) {
+ case PF_INET6: return "ipv6";
+ case PF_INET: return "ipv4";
+ case PF_UNIX: return "unix";
+ }
+ return "????";
+}
+
+static int
+tcp_connect(struct addrinfo *ai, char *host, char *serv)
+{
+ struct addrinfo *res,*e;
+ char uhost[INET6_ADDRSTRLEN+1];
+ char userv[33];
+ int sock,rc,opt=1;
+
+ ai->ai_flags = AI_CANONNAME;
+ if (debug)
+ fprintf(stderr,"tcp: lookup %s:%s ... ",host,serv);
+ if (0 != (rc = getaddrinfo(host, serv, ai, &res))) {
+ fprintf(stderr,"tcp: getaddrinfo (%s:%s): %s\n",
+ host,serv,gai_strerror(rc));
+ return -1;
+ }
+ if (debug)
+ fprintf(stderr,"ok\n");
+ for (e = res; e != NULL; e = e->ai_next) {
+ if (0 != getnameinfo((struct sockaddr*)e->ai_addr,e->ai_addrlen,
+ uhost,INET6_ADDRSTRLEN,userv,32,
+ NI_NUMERICHOST | NI_NUMERICSERV)) {
+ fprintf(stderr,"tcp: getnameinfo (peer): oops\n");
+ continue;
+ }
+ if (debug)
+ fprintf(stderr,"tcp: trying %s (%s:%s) ... ",
+ strfamily(e->ai_family),uhost,userv);
+ if (-1 == (sock = socket(e->ai_family, e->ai_socktype,
+ e->ai_protocol))) {
+ fprintf(stderr,"tcp: socket: %s\n",strerror(errno));
+ continue;
+ }
+ setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,&opt,sizeof(opt));
+ if (-1 == connect(sock,e->ai_addr,e->ai_addrlen)) {
+ fprintf(stderr,"tcp: connect: %s\n",strerror(errno));
+ close(sock);
+ continue;
+ }
+ if (debug)
+ fprintf(stderr,"ok\n");
+ fcntl(sock,F_SETFL,O_NONBLOCK);
+ fcntl(sock,F_SETFD,FD_CLOEXEC);
+ return sock;
+ }
+ return -1;
+}
+
+static int tcp_readbuf(int sock, int timeout, char *dest, char dlen)
+{
+ struct timeval tv;
+ fd_set set;
+ int rc;
+
+ again:
+ FD_ZERO(&set);
+ FD_SET(sock,&set);
+ tv.tv_sec = timeout;
+ tv.tv_usec = 0;
+ rc = select(sock+1,&set,NULL,NULL,&tv);
+ if (-1 == rc && EINTR == errno)
+ goto again;
+ if (-1 == rc) {
+ if (debug)
+ perror("tcp: select");
+ return -1;
+ }
+ if (0 == rc) {
+ if (debug)
+ fprintf(stderr,"tcp: select timeout\n");
+ return -1;
+ }
+ rc = read(sock,dest,dlen-1);
+ if (-1 == rc) {
+ if (debug)
+ perror("tcp: read");
+ return -1;
+ }
+ dest[rc] = 0;
+ return rc;
+}
+
+static int vdr_sock = -1;
+
+static int
+vdr_handler(char *name, int argc, char **argv)
+{
+ char line[80];
+ struct addrinfo ask;
+ int i,l,len;
+
+ if (-1 == vdr_sock) {
+ memset(&ask,0,sizeof(ask));
+ ask.ai_family = PF_UNSPEC;
+ ask.ai_socktype = SOCK_STREAM;
+ vdr_sock = tcp_connect(&ask,"localhost","2001");
+ if (-1 == vdr_sock)
+ return -1;
+
+ /* skip greeting line */
+ if (-1 == tcp_readbuf(vdr_sock,3,line,sizeof(line)))
+ goto oops;
+ if (debug)
+ fprintf(stderr,"vdr: << %s",line);
+ }
+
+ /* send command */
+ line[0] = 0;
+ for (i = 0, len = 0; i < argc; i++) {
+ l = strlen(argv[i]);
+ if (len+l+4 > sizeof(line))
+ break;
+ if (len) {
+ strcpy(line+len," ");
+ len++;
+ }
+ strcpy(line+len,argv[i]);
+ len += l;
+ }
+ strcpy(line+len,"\r\n");
+ len += 2;
+ if (len != write(vdr_sock,line,len)) {
+ if (debug)
+ perror("tcp: write");
+ goto oops;
+ }
+ if (debug)
+ fprintf(stderr,"vdr: >> %s",line);
+
+ /* skip answer */
+ if (-1 == tcp_readbuf(vdr_sock,3,line,sizeof(line)))
+ goto oops;
+ if (debug)
+ fprintf(stderr,"vdr: << %s",line);
+ return 0;
+
+oops:
+ close(vdr_sock);
+ vdr_sock = -1;
+ return -1;
+}
+
+/* ----------------------------------------------------------------------- */
+
#if TT
static struct TEXTELEM*
parse_vtx(int lines, char **text)
diff --git a/common/frequencies.c b/common/frequencies.c
index c41555d..553275b 100644
--- a/common/frequencies.c
+++ b/common/frequencies.c
@@ -1144,14 +1144,19 @@ static struct CHANLIST pal_bcast_cn[] = {
/* South Africa Broadcast */
static struct CHANLIST pal_bcast_za[] ={
- { "1", 175250 },
- { "2", 183250 },
- { "3", 191250 },
- { "4", 199250 },
- { "5", 207250 },
- { "6", 215250 },
- { "7", 223250 },
- { "8", 231250 },
+ { "1", 175250 },
+ { "2", 183250 },
+ { "3", 191250 },
+ { "4", 199250 },
+ { "5", 207250 },
+ { "6", 215250 },
+ { "7", 223250 },
+ { "8", 231250 },
+ { "9", 239250 },
+ { "10", 247250 },
+ { "11", 255250 },
+ { "12", 263250 },
+ { "13", 271250 },
FREQ_UHF
};
diff --git a/common/parseconfig.c b/common/parseconfig.c
index 7a0dd66..9c6eeaa 100644
--- a/common/parseconfig.c
+++ b/common/parseconfig.c
@@ -145,6 +145,37 @@ cfg_parse_file(char *filename)
/* ------------------------------------------------------------------------ */
+void
+cfg_parse_option(char *section, char *tag, char *value)
+{
+ struct CFG_ENTRIES *e = NULL;
+
+ if (NULL == c)
+ c = cfg_init_sections();
+ e = cfg_find_section(c,section);
+ cfg_set_entry(e,tag,value);
+}
+
+void
+cfg_parse_options(int *argc, char **argv)
+{
+ char section[64], tag[64];
+ int i,j;
+
+ for (i = 1; i+1 < *argc;) {
+ if (2 == sscanf(argv[i],"-%63[^:]:%63s",section,tag)) {
+ cfg_parse_option(section,tag,argv[i+1]);
+ for (j = i; j < *argc-1; j++)
+ argv[j] = argv[j+2];
+ (*argc) -= 2;
+ } else {
+ i++;
+ }
+ }
+}
+
+/* ------------------------------------------------------------------------ */
+
char**
cfg_list_sections()
{
diff --git a/common/parseconfig.h b/common/parseconfig.h
index e3b609d..57a462c 100644
--- a/common/parseconfig.h
+++ b/common/parseconfig.h
@@ -1,4 +1,7 @@
int cfg_parse_file(char *filename);
+void cfg_parse_option(char *section, char *tag, char *value);
+void cfg_parse_options(int *argc, char **argv);
+
char** cfg_list_sections(void);
char** cfg_list_entries(char *name);
char* cfg_get_str(char *sec, char *ent);
diff --git a/config.h.in b/config.h.in
index a6b0643..0c42bd4 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,90 +1,133 @@
-/* config.h.in. Generated automatically from configure.ac by autoheader. */
-/* no comment */
-#undef HAVE_XMU
-
-/* lirc lib */
-#undef HAVE_LIBLIRC_CLIENT
-
-/* libzvbi */
-#undef HAVE_ZVBI
+/* config.h.in. Generated from configure.ac by autoheader. */
-/* opengl */
-#undef HAVE_GL
-
-/* alsa */
+/* "have alsa" */
#undef HAVE_ALSA
-/* quicktime lib */
-#undef HAVE_LIBQUICKTIME
-
-/* Define if you have the Xdpms library (-lXdpms). */
-#undef HAVE_LIBXDPMS
-
-/* ipv6 struct sockaddr_storage */
-#undef HAVE_SOCKADDR_STORAGE
-
-/* Define if you have the <alsa/asoundlib.h> header file. */
+/* Define to 1 if you have the <alsa/asoundlib.h> header file. */
#undef HAVE_ALSA_ASOUNDLIB_H
-/* Define if you have the <dev/ic/bt8xx.h> header file. */
+/* Define to 1 if you have the <dev/ic/bt8xx.h> header file. */
#undef HAVE_DEV_IC_BT8XX_H
-/* Define if you have the `dlopen' function. */
+/* Define to 1 if you have the `dlopen' function. */
#undef HAVE_DLOPEN
-/* Define if you have the `fseeko' function. */
+/* "have dv" */
+#undef HAVE_DV
+
+/* Define to 1 if you have the `fseeko' function. */
#undef HAVE_FSEEKO
-/* Define if you have the `ftello' function. */
+/* Define to 1 if you have the `ftello' function. */
#undef HAVE_FTELLO
-/* Define if you have the `getnameinfo' function. */
+/* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO
-/* Define if you have the <getopt.h> header file. */
+/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
-/* Define if you have the `getopt_long' function. */
+/* Define to 1 if you have the `getopt_long' function. */
#undef HAVE_GETOPT_LONG
-/* Define if you have the `getpt' function. */
+/* Define to 1 if you have the `getpt' function. */
#undef HAVE_GETPT
-/* Define if you have the `Xdpms' library (-lXdpms). */
+/* "have opengl" */
+#undef HAVE_GL
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* "have lirc" */
+#undef HAVE_LIBLIRC_CLIENT
+
+/* "have libquicktime" */
+#undef HAVE_LIBQUICKTIME
+
+/* Define to 1 if you have the `Xdpms' library (-lXdpms). */
#undef HAVE_LIBXDPMS
-/* Define if you have the `Xinerama' library (-lXinerama). */
+/* Define to 1 if you have the `Xinerama' library (-lXinerama). */
#undef HAVE_LIBXINERAMA
-/* Define if you have the `Xv' library (-lXv). */
+/* Define to 1 if you have the `Xv' library (-lXv). */
#undef HAVE_LIBXV
-/* Define if you have the `Xxf86dga' library (-lXxf86dga). */
+/* Define to 1 if you have the `Xxf86dga' library (-lXxf86dga). */
#undef HAVE_LIBXXF86DGA
-/* Define if you have the `Xxf86vm' library (-lXxf86vm). */
+/* Define to 1 if you have the `Xxf86vm' library (-lXxf86vm). */
#undef HAVE_LIBXXF86VM
-/* Define if you have the <linux/joystick.h> header file. */
+/* Define to 1 if you have the <linux/joystick.h> header file. */
#undef HAVE_LINUX_JOYSTICK_H
-/* Define if you have the <machine/ioctl_bt848.h> header file. */
+/* Define to 1 if you have the <machine/ioctl_bt848.h> header file. */
#undef HAVE_MACHINE_IOCTL_BT848_H
-/* Define if you have the <soundcard.h> header file. */
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* "have opv6" */
+#undef HAVE_SOCKADDR_STORAGE
+
+/* Define to 1 if you have the <soundcard.h> header file. */
#undef HAVE_SOUNDCARD_H
-/* Define if you have the `strcasestr' function. */
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasestr' function. */
#undef HAVE_STRCASESTR
-/* Define if you have the <sys/select.h> header file. */
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
-/* Define if you have the <sys/soundcard.h> header file. */
+/* Define to 1 if you have the <sys/soundcard.h> header file. */
#undef HAVE_SYS_SOUNDCARD_H
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if the X Window System is missing or not being used. */
+/* "have xmu" */
+#undef HAVE_XMU
+
+/* "have zvbi" */
+#undef HAVE_ZVBI
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
diff --git a/configure b/configure
index 1db762e..2b64142 100755
--- a/configure
+++ b/configure
@@ -1,24 +1,22 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.52.
+# Generated by GNU Autoconf 2.53.
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -28,8 +26,165 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+# NLS nuisances.
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
+ { $as_unset LANG || test "${LANG+set}" != set; } ||
+ { LANG=C; export LANG; }
+(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
+ { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
+ { LC_ALL=C; export LC_ALL; }
+(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
+ { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
+ { LC_TIME=C; export LC_TIME; }
+(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
+ { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
+ { LC_CTYPE=C; export LC_CTYPE; }
+(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
+ { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
+ { LANGUAGE=C; export LANGUAGE; }
+(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
+ { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
+ { LC_COLLATE=C; export LC_COLLATE; }
+(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
+ { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
+ { LC_NUMERIC=C; export LC_NUMERIC; }
+(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
+ { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
+ { LC_MESSAGES=C; export LC_MESSAGES; }
+
+
# Name of the executable.
-as_me=`echo "$0" |sed 's,.*[\\/],,'`
+as_me=`(basename "$0") 2>/dev/null ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conftest.sh
+ echo "exit 0" >>conftest.sh
+ chmod +x conftest.sh
+ if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conftest.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
@@ -57,22 +212,12 @@ rm -f conf$$ conf$$.exe conf$$.file
as_executable_p="test -f"
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-# NLS nuisances.
-$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
-$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
-$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
-$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
-$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
-$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
-$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
-$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
# IFS
# We need space, tab and new line, in precisely that order.
@@ -81,7 +226,8 @@ as_nl='
IFS=" $as_nl"
# CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
+
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@@ -96,7 +242,8 @@ exec 6>&1
ac_default_prefix=/usr/local
cross_compiling=no
subdirs=
-MFLAGS= MAKEFLAGS=
+MFLAGS=
+MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
@@ -104,7 +251,51 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# only ac_max_sed_lines should be used.
: ${ac_max_here_lines=38}
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
ac_unique_file="xawtv.spec.in"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
# Initialize some variables set by options.
ac_init_help=
@@ -144,13 +335,6 @@ oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
ac_prev=
for ac_option
do
@@ -283,7 +467,7 @@ do
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
+ | --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -462,7 +646,7 @@ do
eval ac_val=$`echo $ac_var`
case $ac_val in
[\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
{ (exit 1); exit 1; }; };;
esac
done
@@ -474,18 +658,19 @@ do
eval ac_val=$`echo $ac_var`
case $ac_val in
[\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
{ (exit 1); exit 1; }; };;
esac
done
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
+# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
-# FIXME: should be removed in autoconf 3.0.
+# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
@@ -501,13 +686,23 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
+
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
@@ -517,10 +712,10 @@ else
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
{ (exit 1); exit 1; }; }
else
- { echo "$as_me: error: cannot find sources in $srcdir" >&2
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
{ (exit 1); exit 1; }; }
fi
fi
@@ -553,6 +748,14 @@ ac_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_env_CPPFLAGS_value=$CPPFLAGS
ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
ac_env_CPP_set=${CPP+set}
ac_env_CPP_value=$CPP
ac_cv_env_CPP_set=${CPP+set}
@@ -564,7 +767,7 @@ ac_cv_env_CPP_value=$CPP
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
- cat <<EOF
+ cat <<_ACEOF
\`configure' configures this package to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -585,9 +788,9 @@ Configuration:
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
-EOF
+_ACEOF
- cat <<EOF
+ cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
@@ -614,19 +817,19 @@ Fine tuning of the installation directories:
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--infodir=DIR info documentation [PREFIX/info]
--mandir=DIR man documentation [PREFIX/man]
-EOF
+_ACEOF
- cat <<\EOF
+ cat <<\_ACEOF
X features:
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
-EOF
+_ACEOF
fi
if test -n "$ac_init_help"; then
- cat <<\EOF
+ cat <<\_ACEOF
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
@@ -653,45 +856,67 @@ Some influential environment variables:
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
headers in a nonstandard directory <include dir>
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
CPP C preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-EOF
+_ACEOF
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
ac_popdir=`pwd`
- for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
- cd $ac_subdir
- # A "../" for each directory in /$ac_subdir.
- ac_dots=`echo $ac_subdir |
- sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
-
- case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_sub_srcdir=$srcdir ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_sub_srcdir=$srcdir/$ac_subdir ;;
- *) # Relative path.
- ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
- esac
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
# Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_sub_srcdir/configure.gnu; then
+ if test -f $ac_srcdir/configure.gnu; then
echo
- $SHELL $ac_sub_srcdir/configure.gnu --help=recursive
- elif test -f $ac_sub_srcdir/configure; then
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
echo
- $SHELL $ac_sub_srcdir/configure --help=recursive
- elif test -f $ac_sub_srcdir/configure.ac ||
- test -f $ac_sub_srcdir/configure.in; then
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
echo
$ac_configure --help
else
- echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi
cd $ac_popdir
done
@@ -699,31 +924,31 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
- cat <<\EOF
+ cat <<\_ACEOF
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
-EOF
+_ACEOF
exit 0
fi
exec 5>config.log
-cat >&5 <<EOF
+cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.52. Invocation command line was
+generated by GNU Autoconf 2.53. Invocation command line was
$ $0 $@
-EOF
+_ACEOF
{
cat <<_ASUNAME
-## ---------- ##
-## Platform. ##
-## ---------- ##
+## --------- ##
+## Platform. ##
+## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
@@ -742,17 +967,27 @@ hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-PATH = $PATH
-
_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
} >&5
-cat >&5 <<EOF
-## ------------ ##
-## Core tests. ##
-## ------------ ##
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
-EOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
@@ -763,15 +998,17 @@ for ac_arg
do
case $ac_arg in
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
+ | --no-cr | --no-c | -n ) continue ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ continue ;;
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- ac_sep=" " ;;
- *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
- ac_sep=" " ;;
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ ac_sep=" " ;;
esac
# Get rid of the leading space.
done
@@ -779,14 +1016,19 @@ done
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
- echo >&5
- echo "## ----------------- ##" >&5
- echo "## Cache variables. ##" >&5
- echo "## ----------------- ##" >&5
- echo >&5
- # The following way of writing the cache mishandles newlines in values,
+ {
+ echo
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
{
(set) 2>&1 |
case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
@@ -800,21 +1042,24 @@ trap 'exit_status=$?
"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
-} >&5
- sed "/^$/d" confdefs.h >conftest.log
- if test -s conftest.log; then
- echo >&5
- echo "## ------------ ##" >&5
- echo "## confdefs.h. ##" >&5
- echo "## ------------ ##" >&5
- echo >&5
- cat conftest.log >&5
- fi
- (echo; echo) >&5
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal" >&5
- echo "$as_me: exit $exit_status" >&5
- rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
+}
+ echo
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core core.* *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
@@ -827,6 +1072,33 @@ rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo >confdefs.h
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
@@ -838,9 +1110,9 @@ if test -z "$CONFIG_SITE"; then
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- { echo "$as_me:841: loading site script $ac_site_file" >&5
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
- cat "$ac_site_file" >&5
+ sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
@@ -849,7 +1121,7 @@ if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special
# files actually), so we avoid doing that.
if test -f "$cache_file"; then
- { echo "$as_me:852: loading cache $cache_file" >&5
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . $cache_file;;
@@ -857,7 +1129,7 @@ echo "$as_me: loading cache $cache_file" >&6;}
esac
fi
else
- { echo "$as_me:860: creating cache $cache_file" >&5
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
@@ -873,42 +1145,42 @@ for ac_var in `(set) 2>&1 |
eval ac_new_val="\$ac_env_${ac_var}_value"
case $ac_old_set,$ac_new_set in
set,)
- { echo "$as_me:876: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { echo "$as_me:880: error: \`$ac_var' was not set in the previous run" >&5
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:886: error: \`$ac_var' has changed since the previous run:" >&5
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:888: former value: $ac_old_val" >&5
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:890: current value: $ac_new_val" >&5
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
ac_cache_corrupted=:
fi;;
esac
- # Pass precious variables to config.status. It doesn't matter if
- # we pass some twice (in addition to the command line arguments).
+ # Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
- ac_configure_args="$ac_configure_args '$ac_arg'"
- ;;
- *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
- ;;
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
- { echo "$as_me:909: error: changes in the environment can compromise the build" >&5
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:911: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -919,29 +1191,28 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-echo "#! $SHELL" >conftest.sh
-echo "exit 0" >>conftest.sh
-chmod +x conftest.sh
-if { (echo "$as_me:931: PATH=\".;.\"; conftest.sh") >&5
- (PATH=".;."; conftest.sh) 2>&5
- ac_status=$?
- echo "$as_me:934: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- ac_path_separator=';'
-else
- ac_path_separator=:
-fi
-PATH_SEPARATOR="$ac_path_separator"
-rm -f conftest.sh
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
ac_config_headers="$ac_config_headers config.h"
+
+
+
# Check whether --enable-xfree-ext or --disable-xfree-ext was given.
if test "${enable_xfree_ext+set}" = set; then
enableval="$enable_xfree_ext"
@@ -988,6 +1259,8 @@ if test "${enable_zvbi+set}" = set; then
fi;
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -996,7 +1269,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:999: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1004,25 +1277,28 @@ else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_CC="${ac_tool_prefix}gcc"
-echo "$as_me:1014: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1022: result: $CC" >&5
+ echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1025: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1031,7 +1307,7 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo "$as_me:1034: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1039,25 +1315,28 @@ else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_CC="gcc"
-echo "$as_me:1049: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:1057: result: $ac_ct_CC" >&5
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$as_me:1060: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1070,7 +1349,7 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:1073: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1078,25 +1357,28 @@ else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_CC="${ac_tool_prefix}cc"
-echo "$as_me:1088: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1096: result: $CC" >&5
+ echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1099: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1105,7 +1387,7 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo "$as_me:1108: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1113,25 +1395,28 @@ else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_CC="cc"
-echo "$as_me:1123: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:1131: result: $ac_ct_CC" >&5
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$as_me:1134: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1144,7 +1429,7 @@ fi
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 "$as_me:1147: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1153,19 +1438,22 @@ else
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- $as_executable_p "$ac_dir/$ac_word" || continue
-if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
-fi
-ac_cv_prog_CC="cc"
-echo "$as_me:1167: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
if test $ac_prog_rejected = yes; then
@@ -1177,7 +1465,7 @@ if test $ac_prog_rejected = yes; then
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- set dummy "$ac_dir/$ac_word" ${1+"$@"}
+ set dummy "$as_dir/$ac_word" ${1+"$@"}
shift
ac_cv_prog_CC="$@"
fi
@@ -1186,10 +1474,10 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1189: result: $CC" >&5
+ echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1192: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1200,7 +1488,7 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:1203: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1208,25 +1496,28 @@ else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-echo "$as_me:1218: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1226: result: $CC" >&5
+ echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1229: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1239,7 +1530,7 @@ if test -z "$CC"; then
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 "$as_me:1242: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1247,25 +1538,28 @@ else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_CC="$ac_prog"
-echo "$as_me:1257: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:1265: result: $ac_ct_CC" >&5
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$as_me:1268: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1277,34 +1571,41 @@ fi
fi
-test -z "$CC" && { { echo "$as_me:1280: error: no acceptable cc found in \$PATH" >&5
-echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;}
{ (exit 1); exit 1; }; }
# Provide some information about the compiler.
-echo "$as_me:1285:" \
+echo "$as_me:$LINENO:" \
"checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:1288: \"$ac_compiler --version </dev/null >&5\"") >&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
(eval $ac_compiler --version </dev/null >&5) 2>&5
ac_status=$?
- echo "$as_me:1291: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:1293: \"$ac_compiler -v </dev/null >&5\"") >&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
(eval $ac_compiler -v </dev/null >&5) 2>&5
ac_status=$?
- echo "$as_me:1296: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:1298: \"$ac_compiler -V </dev/null >&5\"") >&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
(eval $ac_compiler -V </dev/null >&5) 2>&5
ac_status=$?
- echo "$as_me:1301: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
-#line 1305 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -1318,22 +1619,26 @@ ac_clean_files="$ac_clean_files a.out a.exe"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:1321: checking for C compiler default output" >&5
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:1324: \"$ac_link_default\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
(eval $ac_link_default) 2>&5
ac_status=$?
- echo "$as_me:1327: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
# Find the output, starting from the most likely. This scheme is
# not robust to junk in `.', hence go to wildcards (a.*) only as a last
# resort.
-for ac_file in `ls a.exe conftest.exe 2>/dev/null;
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null;
ls a.out conftest 2>/dev/null;
ls a.* conftest.* 2>/dev/null`; do
case $ac_file in
- *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+ *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;;
a.out ) # We found the default executable, but exeext='' is most
# certainly right.
break;;
@@ -1347,34 +1652,34 @@ done
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-{ { echo "$as_me:1350: error: C compiler cannot create executables" >&5
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5
echo "$as_me: error: C compiler cannot create executables" >&2;}
{ (exit 77); exit 77; }; }
fi
ac_exeext=$ac_cv_exeext
-echo "$as_me:1356: result: $ac_file" >&5
+echo "$as_me:$LINENO: result: $ac_file" >&5
echo "${ECHO_T}$ac_file" >&6
# Check the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:1361: checking whether the C compiler works" >&5
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
if { ac_try='./$ac_file'
- { (eval echo "$as_me:1367: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1370: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { echo "$as_me:1377: error: cannot run C compiled programs.
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'." >&5
echo "$as_me: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'." >&2;}
@@ -1382,24 +1687,24 @@ If you meant to cross compile, use \`--host'." >&2;}
fi
fi
fi
-echo "$as_me:1385: result: yes" >&5
+echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
rm -f a.out a.exe conftest$ac_cv_exeext
ac_clean_files=$ac_clean_files_save
# Check the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:1392: checking whether we are cross compiling" >&5
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:1394: result: $cross_compiling" >&5
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
echo "${ECHO_T}$cross_compiling" >&6
-echo "$as_me:1397: checking for executable suffix" >&5
-echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
-if { (eval echo "$as_me:1399: \"$ac_link\"") >&5
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:1402: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
@@ -1415,27 +1720,33 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
esac
done
else
- { { echo "$as_me:1418: error: cannot compute EXEEXT: cannot compile and link" >&5
-echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest$ac_cv_exeext
-echo "$as_me:1424: result: $ac_cv_exeext" >&5
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
echo "${ECHO_T}$ac_cv_exeext" >&6
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-echo "$as_me:1430: checking for object suffix" >&5
-echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
if test "${ac_cv_objext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 1436 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -1445,10 +1756,10 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:1448: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1451: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
case $ac_file in
@@ -1460,26 +1771,32 @@ done
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-{ { echo "$as_me:1463: error: cannot compute OBJEXT: cannot compile" >&5
-echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-echo "$as_me:1470: result: $ac_cv_objext" >&5
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
echo "${ECHO_T}$ac_cv_objext" >&6
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-echo "$as_me:1474: checking whether we are using the GNU C compiler" >&5
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
if test "${ac_cv_c_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 1480 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -1492,16 +1809,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1495: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1498: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1501: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1504: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_compiler_gnu=yes
else
@@ -1513,21 +1830,27 @@ rm -f conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-echo "$as_me:1516: result: $ac_cv_c_compiler_gnu" >&5
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
CFLAGS="-g"
-echo "$as_me:1522: checking whether $CC accepts -g" >&5
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 1528 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -1537,16 +1860,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1540: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1543: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1546: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1549: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
@@ -1556,7 +1879,7 @@ ac_cv_prog_cc_g=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:1559: result: $ac_cv_prog_cc_g" >&5
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
@@ -1583,16 +1906,16 @@ cat >conftest.$ac_ext <<_ACEOF
#endif
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1586: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1589: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1592: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1595: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
for ac_declaration in \
''\
@@ -1604,10 +1927,16 @@ if { (eval echo "$as_me:1586: \"$ac_compile\"") >&5
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
-#line 1607 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -1617,16 +1946,16 @@ exit (42);
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1620: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1623: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1626: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1629: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -1636,9 +1965,15 @@ continue
fi
rm -f conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
-#line 1639 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
$ac_declaration
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -1648,16 +1983,16 @@ exit (42);
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1651: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1654: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1657: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1660: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
break
else
@@ -1684,12 +2019,336 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+ CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cxx_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_declaration
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:1692: checking how to run the C preprocessor" >&5
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
@@ -1710,18 +2369,18 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line 1713 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#include <assert.h>
Syntax error
_ACEOF
-if { (eval echo "$as_me:1718: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:1724: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1744,17 +2403,17 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line 1747 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:1751: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:1757: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1791,7 +2450,7 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-echo "$as_me:1794: result: $CPP" >&5
+echo "$as_me:$LINENO: result: $CPP" >&5
echo "${ECHO_T}$CPP" >&6
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
@@ -1801,18 +2460,18 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line 1804 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#include <assert.h>
Syntax error
_ACEOF
-if { (eval echo "$as_me:1809: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:1815: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1835,17 +2494,17 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line 1838 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:1842: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:1848: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1873,7 +2532,7 @@ rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
- { { echo "$as_me:1876: error: C preprocessor \"$CPP\" fails sanity check" >&5
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5
echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -1884,6 +2543,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -1901,7 +2561,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
fi
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:1904: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -1921,43 +2581,48 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:1924: checking for a BSD compatible install" >&5
-echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_IFS=$IFS; IFS=$ac_path_separator
- for ac_dir in $PATH; do
- IFS=$ac_save_IFS
- # Account for people who put trailing slashes in PATH elements.
- case $ac_dir/ in
- / | ./ | .// | /cC/* \
- | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
- | /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if $as_executable_p "$ac_dir/$ac_prog"; then
- if test $ac_prog = install &&
- grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
done
- ;;
- esac
- done
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
@@ -1970,7 +2635,7 @@ fi
INSTALL=$ac_install_sh
fi
fi
-echo "$as_me:1973: result: $INSTALL" >&5
+echo "$as_me:$LINENO: result: $INSTALL" >&5
echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -1985,7 +2650,7 @@ for ac_prog in gccmakedep makedepend
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 "$as_me:1988: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_DEPEND+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1993,25 +2658,28 @@ else
if test -n "$DEPEND"; then
ac_cv_prog_DEPEND="$DEPEND" # Let the user override the test.
else
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_DEPEND="$ac_prog"
-echo "$as_me:2003: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DEPEND="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
fi
fi
DEPEND=$ac_cv_prog_DEPEND
if test -n "$DEPEND"; then
- echo "$as_me:2011: result: $DEPEND" >&5
+ echo "$as_me:$LINENO: result: $DEPEND" >&5
echo "${ECHO_T}$DEPEND" >&6
else
- echo "$as_me:2014: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -2019,8 +2687,20 @@ fi
done
test -n "$DEPEND" || DEPEND="true"
+
+
+
+
+
+
+
+
+
+
+
FOUND_AALIB="no"
FOUND_ALSA="no"
+FOUND_DV="no"
FOUND_LQT="no"
FOUND_MOTIF="no"
FOUND_OS="unknown"
@@ -2040,48 +2720,297 @@ case "`uname -s`" in
FOUND_OS="bsd"
;;
*)
- echo "$as_me:2043: checking if xawtv will build on \`uname -s\`" >&5
+ echo "$as_me:$LINENO: checking if xawtv will build on \`uname -s\`" >&5
echo $ECHO_N "checking if xawtv will build on \`uname -s\`... $ECHO_C" >&6
- echo "$as_me:2045: result: maybe" >&5
+ echo "$as_me:$LINENO: result: maybe" >&5
echo "${ECHO_T}maybe" >&6
;;
esac
+
+
+
+
cat >conftest.$ac_ext <<_ACEOF
-#line 2051 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#include <sys/socket.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "sockaddr_storage" >/dev/null 2>&1; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SOCKADDR_STORAGE 1
-EOF
+_ACEOF
fi
rm -f conftest*
-for ac_header in getopt.h soundcard.h unistd.h sys/select.h sys/soundcard.h alsa/asoundlib.h linux/joystick.h dev/ic/bt8xx.h machine/ioctl_bt848.h
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:2068: checking for $ac_header" >&5
+echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 2074 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
+$ac_includes_default
+
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:2078: \"$ac_cpp conftest.$ac_ext\"") >&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in getopt.h soundcard.h unistd.h sys/select.h sys/soundcard.h alsa/asoundlib.h linux/joystick.h dev/ic/bt8xx.h machine/ioctl_bt848.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:2084: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2092,34 +3021,68 @@ else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
- eval "$as_ac_Header=yes"
+ ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
- eval "$as_ac_Header=no"
+ ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-echo "$as_me:2103: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-EOF
+_ACEOF
fi
+
done
+
+
+
+
+
+
+
for ac_func in ftello fseeko getpt getnameinfo getopt_long strcasestr dlopen
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:2116: checking for $ac_func" >&5
+echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 2122 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below. */
@@ -2133,6 +3096,12 @@ extern "C"
char $ac_func ();
char (*f) ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2150,16 +3119,16 @@ f = $ac_func;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2153: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2156: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2159: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2162: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
@@ -2169,19 +3138,21 @@ eval "$as_ac_var=no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:2172: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
+_ACEOF
fi
done
+
+
DLFLAGS=""
if test "$ac_cv_func_dlopen" = "no"; then
- echo "$as_me:2184: checking for dlopen in -ldl" >&5
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2189,7 +3160,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 2192 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -2199,6 +3170,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dlopen ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2208,16 +3185,16 @@ dlopen ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2211: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2214: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2217: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2220: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_dl_dlopen=yes
else
@@ -2228,25 +3205,25 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:2231: result: $ac_cv_lib_dl_dlopen" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
if test $ac_cv_lib_dl_dlopen = yes; then
DLFLAGS="-ldl"
fi
fi
-echo "$as_me:2238: checking for ELF" >&5
+echo "$as_me:$LINENO: checking for ELF" >&5
echo $ECHO_N "checking for ELF... $ECHO_C" >&6
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
- echo "$as_me:2241: result: yes" >&5
+ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
DLFLAGS="$DLFLAGS -Wl,-E"
else
- echo "$as_me:2245: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-echo "$as_me:2249: checking for pthread_create in -lpthread" >&5
+echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2254,7 +3231,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 2257 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -2264,6 +3241,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pthread_create ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2273,16 +3256,16 @@ pthread_create ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2276: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2279: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2282: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2285: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_pthread_pthread_create=yes
else
@@ -2293,14 +3276,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:2296: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
if test $ac_cv_lib_pthread_pthread_create = yes; then
LIBPTHREAD="-lpthread"
fi
if test "$LIBPTHREAD" = ""; then
- echo "$as_me:2303: checking for pthread_create in -lc_r" >&5
+ echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5
echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6
if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2308,7 +3291,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc_r $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 2311 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -2318,6 +3301,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pthread_create ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2327,16 +3316,16 @@ pthread_create ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2330: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2333: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2336: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2339: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_c_r_pthread_create=yes
else
@@ -2347,14 +3336,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:2350: result: $ac_cv_lib_c_r_pthread_create" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6
if test $ac_cv_lib_c_r_pthread_create = yes; then
LIBPTHREAD="-lc_r"
fi
fi
-echo "$as_me:2357: checking for main in -lossaudio" >&5
+echo "$as_me:$LINENO: checking for main in -lossaudio" >&5
echo $ECHO_N "checking for main in -lossaudio... $ECHO_C" >&6
if test "${ac_cv_lib_ossaudio_main+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2362,9 +3351,16 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lossaudio $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 2365 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2374,16 +3370,16 @@ main ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2377: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2380: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2383: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2386: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_ossaudio_main=yes
else
@@ -2394,13 +3390,13 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:2397: result: $ac_cv_lib_ossaudio_main" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_ossaudio_main" >&5
echo "${ECHO_T}$ac_cv_lib_ossaudio_main" >&6
if test $ac_cv_lib_ossaudio_main = yes; then
LIBOSS="-lossaudio"
fi
-echo "$as_me:2403: checking for initscr in -lncurses" >&5
+echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5
echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6
if test "${ac_cv_lib_ncurses_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2408,7 +3404,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncurses $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 2411 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -2418,6 +3414,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char initscr ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2427,16 +3429,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2430: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2433: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2436: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2439: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_ncurses_initscr=yes
else
@@ -2447,14 +3449,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:2450: result: $ac_cv_lib_ncurses_initscr" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6
if test $ac_cv_lib_ncurses_initscr = yes; then
LIBCURSES="-lncurses"
fi
if test "$LIBCURSES" = ""; then
- echo "$as_me:2457: checking for initscr in -lcurses" >&5
+ echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5
echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6
if test "${ac_cv_lib_curses_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2462,7 +3464,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcurses $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 2465 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -2472,6 +3474,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char initscr ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2481,16 +3489,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2484: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2487: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2490: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2493: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_curses_initscr=yes
else
@@ -2501,7 +3509,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:2504: result: $ac_cv_lib_curses_initscr" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6
if test $ac_cv_lib_curses_initscr = yes; then
LIBCURSES="-lcurses"
@@ -2515,9 +3523,15 @@ if test "$LIBCURSES" = ""; then
exit 1
fi
-echo "$as_me:2518: checking for X" >&5
+
+
+
+
+
+echo "$as_me:$LINENO: checking for X" >&5
echo $ECHO_N "checking for X... $ECHO_C" >&6
+
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
withval="$with_x"
@@ -2541,10 +3555,10 @@ rm -fr conftest.dir
if mkdir conftest.dir; then
cd conftest.dir
# Make sure to not put "make" in the Imakefile rules, since we grep it out.
- cat >Imakefile <<'EOF'
+ cat >Imakefile <<'_ACEOF'
acfindx:
@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
-EOF
+_ACEOF
if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
@@ -2612,17 +3626,17 @@ if test "$ac_x_includes" = no; then
# Guess where to find include files, by looking for Intrinsic.h.
# First, try using that file with no special directory specified.
cat >conftest.$ac_ext <<_ACEOF
-#line 2615 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
_ACEOF
-if { (eval echo "$as_me:2619: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:2625: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2655,9 +3669,15 @@ if test "$ac_x_libraries" = no; then
ac_save_LIBS=$LIBS
LIBS="-lXt $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 2658 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2667,16 +3687,16 @@ XtMalloc (0)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2670: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2673: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2676: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2679: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
LIBS=$ac_save_LIBS
# We can link X programs with no special library path.
@@ -2714,7 +3734,7 @@ fi
fi # $with_x != no
if test "$have_x" != yes; then
- echo "$as_me:2717: result: $have_x" >&5
+ echo "$as_me:$LINENO: result: $have_x" >&5
echo "${ECHO_T}$have_x" >&6
no_x=yes
else
@@ -2724,16 +3744,16 @@ else
# Update the cache value to reflect the command line values.
ac_cv_have_x="have_x=yes \
ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
- echo "$as_me:2727: result: libraries $x_libraries, headers $x_includes" >&5
+ echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
fi
if test "$no_x" = yes; then
# Not all programs may use this symbol, but it does not hurt to define it.
-cat >>confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define X_DISPLAY_MISSING 1
-EOF
+_ACEOF
X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
else
@@ -2748,13 +3768,19 @@ else
# others require no space. Words are not sufficient . . . .
case `(uname -sr) 2>/dev/null` in
"SunOS 5"*)
- echo "$as_me:2751: checking whether -R must be followed by a space" >&5
+ echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
cat >conftest.$ac_ext <<_ACEOF
-#line 2755 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2764,16 +3790,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2767: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2770: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2773: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2776: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_R_nospace=yes
else
@@ -2783,15 +3809,21 @@ ac_R_nospace=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
if test $ac_R_nospace = yes; then
- echo "$as_me:2786: result: no" >&5
+ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
X_LIBS="$X_LIBS -R$x_libraries"
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat >conftest.$ac_ext <<_ACEOF
-#line 2792 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2801,16 +3833,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2804: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2807: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2810: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2813: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_R_space=yes
else
@@ -2820,11 +3852,11 @@ ac_R_space=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
if test $ac_R_space = yes; then
- echo "$as_me:2823: result: yes" >&5
+ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
X_LIBS="$X_LIBS -R $x_libraries"
else
- echo "$as_me:2827: result: neither works" >&5
+ echo "$as_me:$LINENO: result: neither works" >&5
echo "${ECHO_T}neither works" >&6
fi
fi
@@ -2844,7 +3876,7 @@ echo "${ECHO_T}neither works" >&6
# the Alpha needs dnet_stub (dnet does not exist).
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
cat >conftest.$ac_ext <<_ACEOF
-#line 2847 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -2854,6 +3886,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char XOpenDisplay ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2863,22 +3901,22 @@ XOpenDisplay ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2866: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2869: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2872: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2875: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:2881: checking for dnet_ntoa in -ldnet" >&5
+echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2886,7 +3924,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 2889 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -2896,6 +3934,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dnet_ntoa ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2905,16 +3949,16 @@ dnet_ntoa ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2908: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2911: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2914: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2917: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_dnet_dnet_ntoa=yes
else
@@ -2925,14 +3969,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:2928: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
- echo "$as_me:2935: checking for dnet_ntoa in -ldnet_stub" >&5
+ echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2940,7 +3984,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet_stub $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 2943 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -2950,6 +3994,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dnet_ntoa ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -2959,16 +4009,16 @@ dnet_ntoa ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2962: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2965: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2968: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2971: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_dnet_stub_dnet_ntoa=yes
else
@@ -2979,7 +4029,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:2982: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
@@ -2998,13 +4048,13 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
# on Irix 5.2, according to T.E. Dickey.
# The functions gethostbyname, getservbyname, and inet_addr are
# in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
- echo "$as_me:3001: checking for gethostbyname" >&5
+ echo "$as_me:$LINENO: checking for gethostbyname" >&5
echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
if test "${ac_cv_func_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 3007 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname (); below. */
@@ -3018,6 +4068,12 @@ extern "C"
char gethostbyname ();
char (*f) ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3035,16 +4091,16 @@ f = gethostbyname;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3038: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3041: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3044: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3047: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_gethostbyname=yes
else
@@ -3054,11 +4110,11 @@ ac_cv_func_gethostbyname=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:3057: result: $ac_cv_func_gethostbyname" >&5
+echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
if test $ac_cv_func_gethostbyname = no; then
- echo "$as_me:3061: checking for gethostbyname in -lnsl" >&5
+ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3066,7 +4122,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3069 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3076,6 +4132,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostbyname ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3085,16 +4147,16 @@ gethostbyname ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3088: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3091: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3094: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3097: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_nsl_gethostbyname=yes
else
@@ -3105,14 +4167,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3108: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
if test $ac_cv_lib_nsl_gethostbyname = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
fi
if test $ac_cv_lib_nsl_gethostbyname = no; then
- echo "$as_me:3115: checking for gethostbyname in -lbsd" >&5
+ echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3120,7 +4182,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3123 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3130,6 +4192,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostbyname ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3139,16 +4207,16 @@ gethostbyname ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3142: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3145: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3148: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3151: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_bsd_gethostbyname=yes
else
@@ -3159,7 +4227,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3162: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
if test $ac_cv_lib_bsd_gethostbyname = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
@@ -3175,13 +4243,13 @@ fi
# variants that don't use the nameserver (or something). -lsocket
# must be given before -lnsl if both are needed. We assume that
# if connect needs -lnsl, so does gethostbyname.
- echo "$as_me:3178: checking for connect" >&5
+ echo "$as_me:$LINENO: checking for connect" >&5
echo $ECHO_N "checking for connect... $ECHO_C" >&6
if test "${ac_cv_func_connect+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 3184 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect (); below. */
@@ -3195,6 +4263,12 @@ extern "C"
char connect ();
char (*f) ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3212,16 +4286,16 @@ f = connect;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3215: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3218: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3221: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3224: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_connect=yes
else
@@ -3231,11 +4305,11 @@ ac_cv_func_connect=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:3234: result: $ac_cv_func_connect" >&5
+echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
echo "${ECHO_T}$ac_cv_func_connect" >&6
if test $ac_cv_func_connect = no; then
- echo "$as_me:3238: checking for connect in -lsocket" >&5
+ echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
if test "${ac_cv_lib_socket_connect+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3243,7 +4317,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3246 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3253,6 +4327,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char connect ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3262,16 +4342,16 @@ connect ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3265: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3268: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3271: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3274: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_socket_connect=yes
else
@@ -3282,7 +4362,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3285: result: $ac_cv_lib_socket_connect" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
if test $ac_cv_lib_socket_connect = yes; then
X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
@@ -3291,13 +4371,13 @@ fi
fi
# Guillermo Gomez says -lposix is necessary on A/UX.
- echo "$as_me:3294: checking for remove" >&5
+ echo "$as_me:$LINENO: checking for remove" >&5
echo $ECHO_N "checking for remove... $ECHO_C" >&6
if test "${ac_cv_func_remove+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 3300 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove (); below. */
@@ -3311,6 +4391,12 @@ extern "C"
char remove ();
char (*f) ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3328,16 +4414,16 @@ f = remove;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3331: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3334: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3337: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3340: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_remove=yes
else
@@ -3347,11 +4433,11 @@ ac_cv_func_remove=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:3350: result: $ac_cv_func_remove" >&5
+echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
echo "${ECHO_T}$ac_cv_func_remove" >&6
if test $ac_cv_func_remove = no; then
- echo "$as_me:3354: checking for remove in -lposix" >&5
+ echo "$as_me:$LINENO: checking for remove in -lposix" >&5
echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
if test "${ac_cv_lib_posix_remove+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3359,7 +4445,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lposix $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3362 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3369,6 +4455,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char remove ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3378,16 +4470,16 @@ remove ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3381: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3384: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3387: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3390: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_posix_remove=yes
else
@@ -3398,7 +4490,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3401: result: $ac_cv_lib_posix_remove" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
if test $ac_cv_lib_posix_remove = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
@@ -3407,13 +4499,13 @@ fi
fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
- echo "$as_me:3410: checking for shmat" >&5
+ echo "$as_me:$LINENO: checking for shmat" >&5
echo $ECHO_N "checking for shmat... $ECHO_C" >&6
if test "${ac_cv_func_shmat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 3416 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat (); below. */
@@ -3427,6 +4519,12 @@ extern "C"
char shmat ();
char (*f) ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3444,16 +4542,16 @@ f = shmat;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3447: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3450: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3453: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3456: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_shmat=yes
else
@@ -3463,11 +4561,11 @@ ac_cv_func_shmat=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:3466: result: $ac_cv_func_shmat" >&5
+echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
echo "${ECHO_T}$ac_cv_func_shmat" >&6
if test $ac_cv_func_shmat = no; then
- echo "$as_me:3470: checking for shmat in -lipc" >&5
+ echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
if test "${ac_cv_lib_ipc_shmat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3475,7 +4573,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lipc $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3478 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3485,6 +4583,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char shmat ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3494,16 +4598,16 @@ shmat ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3497: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3500: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3503: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3506: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_ipc_shmat=yes
else
@@ -3514,7 +4618,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3517: result: $ac_cv_lib_ipc_shmat" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
if test $ac_cv_lib_ipc_shmat = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
@@ -3532,7 +4636,7 @@ fi
# These have to be linked with before -lX11, unlike the other
# libraries we check for below, so use a different variable.
# John Interrante, Karl Berry
- echo "$as_me:3535: checking for IceConnectionNumber in -lICE" >&5
+ echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3540,7 +4644,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3543 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3550,6 +4654,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char IceConnectionNumber ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3559,16 +4669,16 @@ IceConnectionNumber ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3562: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3565: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3568: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3571: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_ICE_IceConnectionNumber=yes
else
@@ -3579,7 +4689,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3582: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
@@ -3598,7 +4708,18 @@ else
FSLIB=""
fi
-echo "$as_me:3601: checking for jpeg_start_compress in -ljpeg" >&5
+
+
+
+
+
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for jpeg_start_compress in -ljpeg" >&5
echo $ECHO_N "checking for jpeg_start_compress in -ljpeg... $ECHO_C" >&6
if test "${ac_cv_lib_jpeg_jpeg_start_compress+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3606,7 +4727,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ljpeg $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3609 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3616,6 +4737,12 @@ extern "C"
/* 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 ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3625,16 +4752,16 @@ jpeg_start_compress ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3628: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3631: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3634: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3637: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_jpeg_jpeg_start_compress=yes
else
@@ -3645,7 +4772,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3648: result: $ac_cv_lib_jpeg_jpeg_start_compress" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_start_compress" >&5
echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_start_compress" >&6
if test $ac_cv_lib_jpeg_jpeg_start_compress = yes; then
JPEG="found"
@@ -3658,9 +4785,10 @@ if test "$JPEG" != "found"; then
exit 1
fi
+
LIBALSA=""
if test "$enable_alsa" != "no"; then
- echo "$as_me:3663: checking for snd_seq_open in -lasound" >&5
+ echo "$as_me:$LINENO: checking for snd_seq_open in -lasound" >&5
echo $ECHO_N "checking for snd_seq_open in -lasound... $ECHO_C" >&6
if test "${ac_cv_lib_asound_snd_seq_open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3668,7 +4796,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lasound $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3671 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3678,6 +4806,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char snd_seq_open ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3687,16 +4821,16 @@ snd_seq_open ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3690: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3693: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3696: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3699: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_asound_snd_seq_open=yes
else
@@ -3707,12 +4841,13 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3710: result: $ac_cv_lib_asound_snd_seq_open" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_seq_open" >&5
echo "${ECHO_T}$ac_cv_lib_asound_snd_seq_open" >&6
if test $ac_cv_lib_asound_snd_seq_open = yes; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_ALSA 1
-EOF
+_ACEOF
FOUND_ALSA="yes"; LIBALSA="-lasound"
fi
@@ -3720,9 +4855,10 @@ else
echo "*** alsa disabled"
fi
+
LIRC=""
if test "$enable_lirc" != "no"; then
- echo "$as_me:3725: checking for lirc_init in -llirc_client" >&5
+ echo "$as_me:$LINENO: checking for lirc_init in -llirc_client" >&5
echo $ECHO_N "checking for lirc_init in -llirc_client... $ECHO_C" >&6
if test "${ac_cv_lib_lirc_client_lirc_init+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3730,7 +4866,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-llirc_client $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3733 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3740,6 +4876,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char lirc_init ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3749,16 +4891,16 @@ lirc_init ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3752: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3755: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3758: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3761: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_lirc_client_lirc_init=yes
else
@@ -3769,12 +4911,13 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3772: result: $ac_cv_lib_lirc_client_lirc_init" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_lirc_client_lirc_init" >&5
echo "${ECHO_T}$ac_cv_lib_lirc_client_lirc_init" >&6
if test $ac_cv_lib_lirc_client_lirc_init = yes; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBLIRC_CLIENT 1
-EOF
+_ACEOF
LIRC="-llirc_client"
fi
@@ -3782,9 +4925,10 @@ else
echo "*** lirc disabled"
fi
+
LIBZVBI=""
if test "$enable_zvbi" != "no"; then
- echo "$as_me:3787: checking for vbi_capture_fd in -lzvbi" >&5
+ echo "$as_me:$LINENO: checking for vbi_capture_fd in -lzvbi" >&5
echo $ECHO_N "checking for vbi_capture_fd in -lzvbi... $ECHO_C" >&6
if test "${ac_cv_lib_zvbi_vbi_capture_fd+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3792,7 +4936,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lzvbi $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3795 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3802,6 +4946,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char vbi_capture_fd ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3811,16 +4961,16 @@ vbi_capture_fd ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3814: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3817: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3820: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3823: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_zvbi_vbi_capture_fd=yes
else
@@ -3831,12 +4981,13 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3834: result: $ac_cv_lib_zvbi_vbi_capture_fd" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_zvbi_vbi_capture_fd" >&5
echo "${ECHO_T}$ac_cv_lib_zvbi_vbi_capture_fd" >&6
if test $ac_cv_lib_zvbi_vbi_capture_fd = yes; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_ZVBI 1
-EOF
+_ACEOF
FOUND_ZVBI="yes"; LIBZVBI="-lzvbi"
fi
@@ -3844,9 +4995,10 @@ else
echo "*** zvbi disabled"
fi
+
AALIBS=""
if test "$enable_aa" != "no"; then
- echo "$as_me:3849: checking for aa_autoinit in -laa" >&5
+ echo "$as_me:$LINENO: checking for aa_autoinit in -laa" >&5
echo $ECHO_N "checking for aa_autoinit in -laa... $ECHO_C" >&6
if test "${ac_cv_lib_aa_aa_autoinit+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3854,7 +5006,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-laa $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3857 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3864,6 +5016,12 @@ extern "C"
/* 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 ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3873,16 +5031,16 @@ aa_autoinit ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3876: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3879: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3882: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3885: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_aa_aa_autoinit=yes
else
@@ -3893,7 +5051,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3896: result: $ac_cv_lib_aa_aa_autoinit" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_aa_aa_autoinit" >&5
echo "${ECHO_T}$ac_cv_lib_aa_aa_autoinit" >&6
if test $ac_cv_lib_aa_aa_autoinit = yes; then
FOUND_AALIB="yes"
@@ -3909,8 +5067,78 @@ else
echo "*** aalib support disabled"
fi
+
+LIBDV=""
+if test "$enable_dv" != "no"; then
+ echo "$as_me:$LINENO: checking for dv_decoder_new in -ldv" >&5
+echo $ECHO_N "checking for dv_decoder_new in -ldv... $ECHO_C" >&6
+if test "${ac_cv_lib_dv_dv_decoder_new+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldv $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dv_decoder_new ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+dv_decoder_new ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dv_dv_decoder_new=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dv_dv_decoder_new=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dv_dv_decoder_new" >&5
+echo "${ECHO_T}$ac_cv_lib_dv_dv_decoder_new" >&6
+if test $ac_cv_lib_dv_dv_decoder_new = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DV 1
+_ACEOF
+ FOUND_DV="yes"; LIBDV="-ldv"
+fi
+
+else
+ echo "*** DV disabled"
+fi
+
if test "$enable_quicktime" != "no"; then
- echo "$as_me:3913: checking for lqt_query_registry in -lquicktime" >&5
+ echo "$as_me:$LINENO: checking for lqt_query_registry in -lquicktime" >&5
echo $ECHO_N "checking for lqt_query_registry in -lquicktime... $ECHO_C" >&6
if test "${ac_cv_lib_quicktime_lqt_query_registry+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3918,7 +5146,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lquicktime -ldl -lglib $LIBPTHREAD $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3921 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3928,6 +5156,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char lqt_query_registry ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -3937,16 +5171,16 @@ lqt_query_registry ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3940: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:3943: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:3946: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3949: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_quicktime_lqt_query_registry=yes
else
@@ -3957,12 +5191,13 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:3960: result: $ac_cv_lib_quicktime_lqt_query_registry" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_quicktime_lqt_query_registry" >&5
echo "${ECHO_T}$ac_cv_lib_quicktime_lqt_query_registry" >&6
if test $ac_cv_lib_quicktime_lqt_query_registry = yes; then
- FOUND_LQT="yes"; cat >>confdefs.h <<\EOF
+ FOUND_LQT="yes";
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBQUICKTIME 1
-EOF
+_ACEOF
fi
@@ -3974,9 +5209,10 @@ if test "$FOUND_LQT" = "yes"; then
QTLIBS="-lquicktime -ldl -lglib -lm"
fi
+
if test "$enable_xfree_ext" != "no"; then
-echo "$as_me:3979: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
+echo "$as_me:$LINENO: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
echo $ECHO_N "checking for XF86DGAQueryExtension in -lXxf86dga... $ECHO_C" >&6
if test "${ac_cv_lib_Xxf86dga_XF86DGAQueryExtension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3984,7 +5220,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXxf86dga $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 3987 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -3994,6 +5230,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char XF86DGAQueryExtension ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -4003,16 +5245,16 @@ XF86DGAQueryExtension ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4006: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4009: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4012: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4015: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xxf86dga_XF86DGAQueryExtension=yes
else
@@ -4023,18 +5265,19 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4026: result: $ac_cv_lib_Xxf86dga_XF86DGAQueryExtension" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xxf86dga_XF86DGAQueryExtension" >&5
echo "${ECHO_T}$ac_cv_lib_Xxf86dga_XF86DGAQueryExtension" >&6
if test $ac_cv_lib_Xxf86dga_XF86DGAQueryExtension = yes; then
- cat >>confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define HAVE_LIBXXF86DGA 1
-EOF
+_ACEOF
LIBS="-lXxf86dga $LIBS"
fi
-echo "$as_me:4037: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5
+
+echo "$as_me:$LINENO: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5
echo $ECHO_N "checking for XF86VidModeQueryExtension in -lXxf86vm... $ECHO_C" >&6
if test "${ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4042,7 +5285,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXxf86vm $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4045 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4052,6 +5295,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char XF86VidModeQueryExtension ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -4061,16 +5310,16 @@ XF86VidModeQueryExtension ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4064: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4067: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4070: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4073: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension=yes
else
@@ -4081,18 +5330,19 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4084: result: $ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension" >&5
echo "${ECHO_T}$ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension" >&6
if test $ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension = yes; then
- cat >>confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define HAVE_LIBXXF86VM 1
-EOF
+_ACEOF
LIBS="-lXxf86vm $LIBS"
fi
-echo "$as_me:4095: checking for DPMSQueryExtension in -lXdpms" >&5
+
+echo "$as_me:$LINENO: checking for DPMSQueryExtension in -lXdpms" >&5
echo $ECHO_N "checking for DPMSQueryExtension in -lXdpms... $ECHO_C" >&6
if test "${ac_cv_lib_Xdpms_DPMSQueryExtension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4100,7 +5350,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXdpms $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4103 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4110,6 +5360,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char DPMSQueryExtension ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -4119,16 +5375,16 @@ DPMSQueryExtension ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4122: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4125: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4128: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4131: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xdpms_DPMSQueryExtension=yes
else
@@ -4139,19 +5395,19 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4142: result: $ac_cv_lib_Xdpms_DPMSQueryExtension" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xdpms_DPMSQueryExtension" >&5
echo "${ECHO_T}$ac_cv_lib_Xdpms_DPMSQueryExtension" >&6
if test $ac_cv_lib_Xdpms_DPMSQueryExtension = yes; then
- cat >>confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define HAVE_LIBXDPMS 1
-EOF
+_ACEOF
LIBS="-lXdpms $LIBS"
fi
if test "$ac_cv_lib_Xdpms_DPMSQueryExtension" = "no"; then
- echo "$as_me:4154: checking for DPMSQueryExtension in -lXext" >&5
+ echo "$as_me:$LINENO: checking for DPMSQueryExtension in -lXext" >&5
echo $ECHO_N "checking for DPMSQueryExtension in -lXext... $ECHO_C" >&6
if test "${ac_cv_lib_Xext_DPMSQueryExtension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4159,7 +5415,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXext $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4162 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4169,6 +5425,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char DPMSQueryExtension ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -4178,16 +5440,16 @@ DPMSQueryExtension ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4181: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4184: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4187: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4190: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xext_DPMSQueryExtension=yes
else
@@ -4198,18 +5460,18 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4201: result: $ac_cv_lib_Xext_DPMSQueryExtension" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_DPMSQueryExtension" >&5
echo "${ECHO_T}$ac_cv_lib_Xext_DPMSQueryExtension" >&6
if test $ac_cv_lib_Xext_DPMSQueryExtension = yes; then
- cat >>confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBXDPMS 1
-EOF
+_ACEOF
fi
fi
-echo "$as_me:4212: checking for XineramaQueryExtension in -lXinerama" >&5
+echo "$as_me:$LINENO: checking for XineramaQueryExtension in -lXinerama" >&5
echo $ECHO_N "checking for XineramaQueryExtension in -lXinerama... $ECHO_C" >&6
if test "${ac_cv_lib_Xinerama_XineramaQueryExtension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4217,7 +5479,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXinerama $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4220 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4227,6 +5489,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char XineramaQueryExtension ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -4236,16 +5504,16 @@ XineramaQueryExtension ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4239: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4242: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4245: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4248: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xinerama_XineramaQueryExtension=yes
else
@@ -4256,12 +5524,12 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4259: result: $ac_cv_lib_Xinerama_XineramaQueryExtension" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaQueryExtension" >&5
echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaQueryExtension" >&6
if test $ac_cv_lib_Xinerama_XineramaQueryExtension = yes; then
- cat >>confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define HAVE_LIBXINERAMA 1
-EOF
+_ACEOF
LIBS="-lXinerama $LIBS"
@@ -4273,7 +5541,7 @@ fi
if test "$enable_xvideo" != "no"; then
-echo "$as_me:4276: checking for XvQueryExtension in -lXv" >&5
+echo "$as_me:$LINENO: checking for XvQueryExtension in -lXv" >&5
echo $ECHO_N "checking for XvQueryExtension in -lXv... $ECHO_C" >&6
if test "${ac_cv_lib_Xv_XvQueryExtension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4281,7 +5549,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXv $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4284 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4291,6 +5559,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char XvQueryExtension ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -4300,16 +5574,16 @@ XvQueryExtension ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4303: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4306: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4309: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4312: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xv_XvQueryExtension=yes
else
@@ -4320,12 +5594,12 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4323: result: $ac_cv_lib_Xv_XvQueryExtension" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xv_XvQueryExtension" >&5
echo "${ECHO_T}$ac_cv_lib_Xv_XvQueryExtension" >&6
if test $ac_cv_lib_Xv_XvQueryExtension = yes; then
- cat >>confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define HAVE_LIBXV 1
-EOF
+_ACEOF
LIBS="-lXv $LIBS"
@@ -4336,7 +5610,7 @@ else
fi
if test "$enable_motif" != "no"; then
- echo "$as_me:4339: checking for XmStringGenerate in -lXm" >&5
+ echo "$as_me:$LINENO: checking for XmStringGenerate in -lXm" >&5
echo $ECHO_N "checking for XmStringGenerate in -lXm... $ECHO_C" >&6
if test "${ac_cv_lib_Xm_XmStringGenerate+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4344,7 +5618,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXm $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4347 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4354,6 +5628,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char XmStringGenerate ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -4363,16 +5643,16 @@ XmStringGenerate ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4366: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4369: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4372: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4375: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xm_XmStringGenerate=yes
else
@@ -4383,7 +5663,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4386: result: $ac_cv_lib_Xm_XmStringGenerate" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xm_XmStringGenerate" >&5
echo "${ECHO_T}$ac_cv_lib_Xm_XmStringGenerate" >&6
if test $ac_cv_lib_Xm_XmStringGenerate = yes; then
FOUND_MOTIF="yes"
@@ -4393,9 +5673,10 @@ else
echo "*** motif support disabled"
fi
+
LIBGL=""
if test "$enable_gl" != "no"; then
- echo "$as_me:4398: checking for glXChooseVisual in -lGL" >&5
+ echo "$as_me:$LINENO: checking for glXChooseVisual in -lGL" >&5
echo $ECHO_N "checking for glXChooseVisual in -lGL... $ECHO_C" >&6
if test "${ac_cv_lib_GL_glXChooseVisual+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4403,7 +5684,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lGL $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS -lm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4406 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4413,6 +5694,12 @@ extern "C"
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char glXChooseVisual ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
@@ -4422,16 +5709,16 @@ glXChooseVisual ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4425: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4428: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4431: \"$ac_try\"") >&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4434: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_GL_glXChooseVisual=yes
else
@@ -4442,12 +5729,13 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4445: result: $ac_cv_lib_GL_glXChooseVisual" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_GL_glXChooseVisual" >&5
echo "${ECHO_T}$ac_cv_lib_GL_glXChooseVisual" >&6
if test $ac_cv_lib_GL_glXChooseVisual = yes; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_GL 1
-EOF
+_ACEOF
FOUND_GL="yes"; LIBGL="-lGLU -lGL -lm"
fi
@@ -4457,27 +5745,32 @@ fi
VERSION="`(cd $srcdir; pwd) | sed -e 's/.*-//'`"
-echo "$as_me:4460: checking for X11 config directory" >&5
+
+echo "$as_me:$LINENO: checking for X11 config directory" >&5
echo $ECHO_N "checking for X11 config directory... $ECHO_C" >&6
x11conf=/usr/X11R6/lib/X11
if test -d /etc/X11; then
x11conf=/etc/X11
fi
-echo "$as_me:4466: result: $x11conf" >&5
+echo "$as_me:$LINENO: result: $x11conf" >&5
echo "${ECHO_T}$x11conf" >&6
-echo "$as_me:4469: checking for X11 app-defaults directory" >&5
+
+echo "$as_me:$LINENO: checking for X11 app-defaults directory" >&5
echo $ECHO_N "checking for X11 app-defaults directory... $ECHO_C" >&6
resdir=/usr/X11R6/lib/X11
if test -d /etc/X11/app-defaults; then
resdir=/etc/X11
fi
-echo "$as_me:4475: result: $resdir/app-defaults" >&5
+echo "$as_me:$LINENO: result: $resdir/app-defaults" >&5
echo "${ECHO_T}$resdir/app-defaults" >&6
-cat >>confdefs.h <<\EOF
+
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_XMU 1
-EOF
+_ACEOF
+
ac_config_files="$ac_config_files Makefile xawtv.spec"
cat >confcache <<\_ACEOF
@@ -4556,25 +5849,29 @@ fi
DEFS=-DHAVE_CONFIG_H
+
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:4562: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
-# Generated automatically by configure.
+# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
SHELL=\${CONFIG_SHELL-$SHELL}
-ac_cs_invocation="\$0 \$@"
-
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
+
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
@@ -4583,8 +5880,167 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+# NLS nuisances.
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
+ { $as_unset LANG || test "${LANG+set}" != set; } ||
+ { LANG=C; export LANG; }
+(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
+ { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
+ { LC_ALL=C; export LC_ALL; }
+(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
+ { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
+ { LC_TIME=C; export LC_TIME; }
+(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
+ { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
+ { LC_CTYPE=C; export LC_CTYPE; }
+(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
+ { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
+ { LANGUAGE=C; export LANGUAGE; }
+(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
+ { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
+ { LC_COLLATE=C; export LC_COLLATE; }
+(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
+ { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
+ { LC_NUMERIC=C; export LC_NUMERIC; }
+(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
+ { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
+ { LC_MESSAGES=C; export LC_MESSAGES; }
+
+
# Name of the executable.
-as_me=`echo "$0" |sed 's,.*[\\/],,'`
+as_me=`(basename "$0") 2>/dev/null ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conftest.sh
+ echo "exit 0" >>conftest.sh
+ chmod +x conftest.sh
+ if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conftest.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
@@ -4612,22 +6068,12 @@ rm -f conf$$ conf$$.exe conf$$.file
as_executable_p="test -f"
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-# NLS nuisances.
-$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
-$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
-$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
-$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
-$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
-$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
-$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
-$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
# IFS
# We need space, tab and new line, in precisely that order.
@@ -4636,10 +6082,34 @@ as_nl='
IFS=" $as_nl"
# CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
exec 6>&1
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.53. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
_ACEOF
# Files that config.status was made for.
@@ -4659,7 +6129,7 @@ if test -n "$ac_config_commands"; then
echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
fi
-cat >>$CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
@@ -4683,12 +6153,12 @@ Configuration headers:
$config_headers
Report bugs to <bug-autoconf@gnu.org>."
-EOF
+_ACEOF
-cat >>$CONFIG_STATUS <<EOF
+cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.52,
+configured by $0, generated by GNU Autoconf 2.53,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
@@ -4697,9 +6167,9 @@ This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir
INSTALL="$INSTALL"
-EOF
+_ACEOF
-cat >>$CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
# If no file are specified by the user, then we need to provide default
# value. By we need to know if files were specified by the user.
ac_need_defaults=:
@@ -4721,18 +6191,18 @@ do
case $1 in
# Handling of the options.
-EOF
-cat >>$CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
-EOF
-cat >>$CONFIG_STATUS <<\EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
--version | --vers* | -V )
echo "$ac_cs_version"; exit 0 ;;
--he | --h)
# Conflict between --help and --header
- { { echo "$as_me:4735: error: ambiguous option: $1
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
@@ -4751,7 +6221,7 @@ Try \`$0 --help' for more information." >&2;}
ac_need_defaults=false;;
# This is an error.
- -*) { { echo "$as_me:4754: error: unrecognized option: $1
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
@@ -4763,25 +6233,13 @@ Try \`$0 --help' for more information." >&2;}
shift
done
-exec 5>>config.log
-cat >&5 << _ACEOF
+_ACEOF
-## ----------------------- ##
-## Running config.status. ##
-## ----------------------- ##
-This file was extended by $as_me 2.52, executed with
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- > $ac_cs_invocation
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-_ACEOF
-EOF
-cat >>$CONFIG_STATUS <<\EOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
for ac_config_target in $ac_config_targets
do
case "$ac_config_target" in
@@ -4789,7 +6247,7 @@ do
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"xawtv.spec" ) CONFIG_FILES="$CONFIG_FILES xawtv.spec" ;;
"config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- *) { { echo "$as_me:4792: error: invalid argument: $ac_config_target" >&5
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
@@ -4826,9 +6284,9 @@ $debug ||
{ (exit 1); exit 1; }
}
-EOF
+_ACEOF
-cat >>$CONFIG_STATUS <<EOF
+cat >>$CONFIG_STATUS <<_ACEOF
#
# CONFIG_FILES section.
@@ -4841,6 +6299,12 @@ if test -n "\$CONFIG_FILES"; then
sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
s,@exec_prefix@,$exec_prefix,;t t
s,@prefix@,$prefix,;t t
s,@program_transform_name@,$program_transform_name,;t t
@@ -4856,19 +6320,13 @@ s,@includedir@,$includedir,;t t
s,@oldincludedir@,$oldincludedir,;t t
s,@infodir@,$infodir,;t t
s,@mandir@,$mandir,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
s,@build_alias@,$build_alias,;t t
s,@host_alias@,$host_alias,;t t
s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
s,@ECHO_C@,$ECHO_C,;t t
s,@ECHO_N@,$ECHO_N,;t t
s,@ECHO_T@,$ECHO_T,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@DEFS@,$DEFS,;t t
s,@LIBS@,$LIBS,;t t
s,@CC@,$CC,;t t
s,@CFLAGS@,$CFLAGS,;t t
@@ -4877,6 +6335,9 @@ s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@ac_ct_CC@,$ac_ct_CC,;t t
s,@EXEEXT@,$EXEEXT,;t t
s,@OBJEXT@,$OBJEXT,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
s,@CPP@,$CPP,;t t
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
@@ -4884,6 +6345,7 @@ s,@INSTALL_DATA@,$INSTALL_DATA,;t t
s,@DEPEND@,$DEPEND,;t t
s,@FOUND_AALIB@,$FOUND_AALIB,;t t
s,@FOUND_ALSA@,$FOUND_ALSA,;t t
+s,@FOUND_DV@,$FOUND_DV,;t t
s,@FOUND_LQT@,$FOUND_LQT,;t t
s,@FOUND_MOTIF@,$FOUND_MOTIF,;t t
s,@FOUND_OS@,$FOUND_OS,;t t
@@ -4909,6 +6371,7 @@ s,@LIBALSA@,$LIBALSA,;t t
s,@LIRC@,$LIRC,;t t
s,@LIBZVBI@,$LIBZVBI,;t t
s,@AALIBS@,$AALIBS,;t t
+s,@LIBDV@,$LIBDV,;t t
s,@QTLIBS@,$QTLIBS,;t t
s,@LIBGL@,$LIBGL,;t t
s,@VERSION@,$VERSION,;t t
@@ -4916,9 +6379,9 @@ s,@x11conf@,$x11conf,;t t
s,@resdir@,$resdir,;t t
CEOF
-EOF
+_ACEOF
- cat >>$CONFIG_STATUS <<\EOF
+ cat >>$CONFIG_STATUS <<\_ACEOF
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_lines=48
@@ -4957,8 +6420,8 @@ EOF
fi
fi # test -n "$CONFIG_FILES"
-EOF
-cat >>$CONFIG_STATUS <<\EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
@@ -4972,7 +6435,8 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
esac
# Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| \
@@ -4983,8 +6447,7 @@ echo X"$ac_file" |
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- { case "$ac_dir" in
+ { case "$ac_dir" in
[\\/]* | ?:[\\/]* ) as_incr_dir=;;
*) as_incr_dir=.;;
esac
@@ -4995,48 +6458,68 @@ for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
?:) as_incr_dir=$as_mkdir_dir ;;
*)
as_incr_dir=$as_incr_dir/$as_mkdir_dir
- test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+ test -d "$as_incr_dir" ||
+ mkdir "$as_incr_dir" ||
+ { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }
;;
esac
done; }
- ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
- else
- ac_dir_suffix= ac_dots=
- fi
+ ac_builddir=.
- case $srcdir in
- .) ac_srcdir=.
- if test -z "$ac_dots"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* )
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
*) # Relative path.
- ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_dots$srcdir ;;
- esac
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_dots$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
if test x"$ac_file" != x-; then
- { echo "$as_me:5031: creating $ac_file" >&5
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
- # /* config.h. Generated automatically by config.status. */
- configure_input="Generated automatically from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
# First look for the input files in the build tree, otherwise in the
# src tree.
@@ -5046,7 +6529,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:5049: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@@ -5059,23 +6542,29 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:5062: error: cannot find input file: $f" >&5
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
esac
done` || { (exit 1); exit 1; }
-EOF
-cat >>$CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
$extrasub
-EOF
-cat >>$CONFIG_STATUS <<\EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s,@configure_input@,$configure_input,;t t
s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
s,@INSTALL@,$ac_INSTALL,;t t
" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
rm -f $tmp/stdin
@@ -5087,8 +6576,8 @@ s,@INSTALL@,$ac_INSTALL,;t t
fi
done
-EOF
-cat >>$CONFIG_STATUS <<\EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
#
# CONFIG_HEADER section.
@@ -5120,7 +6609,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
* ) ac_file_in=$ac_file.in ;;
esac
- test x"$ac_file" != x- && { echo "$as_me:5123: creating $ac_file" >&5
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
# First look for the input files in the build tree, otherwise in the
@@ -5131,7 +6620,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:5134: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@@ -5144,7 +6633,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:5147: error: cannot find input file: $f" >&5
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
@@ -5153,7 +6642,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
# Remove the trailing spaces.
sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
-EOF
+_ACEOF
# Transform confdefs.h into two sed scripts, `conftest.defines' and
# `conftest.undefs', that substitutes the proper values into
@@ -5169,16 +6658,16 @@ rm -f conftest.defines conftest.undefs
# `end' is used to avoid that the second main sed command (meant for
# 0-ary CPP macros) applies to n-ary macro definitions.
# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\EOF
+cat >confdef2sed.sed <<\_ACEOF
s/[\\&,]/\\&/g
s,[\\$`],\\&,g
t clear
: clear
-s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
t end
s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
: end
-EOF
+_ACEOF
# If some macros were called several times there might be several times
# the same #defines, which is useless. Nevertheless, we may not want to
# sort them, since we want the *last* AC-DEFINE to be honored.
@@ -5189,9 +6678,9 @@ rm -f confdef2sed.sed
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\EOF
+cat >>conftest.undefs <<\_ACEOF
s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-EOF
+_ACEOF
# Break up conftest.defines because some shells have a limit on the size
# of here documents, and old seds have small limits too (100 cmds).
@@ -5248,23 +6737,24 @@ do
done
rm -f conftest.undefs
-cat >>$CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
- # /* config.h. Generated automatically by config.status. */
+ # /* config.h. Generated by config.status. */
if test x"$ac_file" = x-; then
- echo "/* Generated automatically by configure. */" >$tmp/config.h
+ echo "/* Generated by configure. */" >$tmp/config.h
else
- echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
fi
cat $tmp/in >>$tmp/config.h
rm -f $tmp/in
if test x"$ac_file" != x-; then
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
- { echo "$as_me:5264: $ac_file is unchanged" >&5
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
- ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| \
@@ -5275,8 +6765,7 @@ echo X"$ac_file" |
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- { case "$ac_dir" in
+ { case "$ac_dir" in
[\\/]* | ?:[\\/]* ) as_incr_dir=;;
*) as_incr_dir=.;;
esac
@@ -5287,12 +6776,15 @@ for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
?:) as_incr_dir=$as_mkdir_dir ;;
*)
as_incr_dir=$as_incr_dir/$as_mkdir_dir
- test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+ test -d "$as_incr_dir" ||
+ mkdir "$as_incr_dir" ||
+ { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }
;;
esac
done; }
- fi
rm -f $ac_file
mv $tmp/config.h $ac_file
fi
@@ -5301,15 +6793,16 @@ done; }
rm -f $tmp/config.h
fi
done
-EOF
+_ACEOF
-cat >>$CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
{ (exit 0); exit 0; }
-EOF
+_ACEOF
chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
+
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
@@ -5329,8 +6822,8 @@ if test "$no_create" != yes; then
fi
for dir in \
- common console debug fonts jwz \
- libng/plugins libvbi vbistuff x11
+ common console debug fonts jwz libvbi vbistuff x11 \
+ libng libng/plugins libng/contrib-plugins
do
test -d $dir && continue
mkdir -p $dir
diff --git a/configure.ac b/configure.ac
index 30d7732..d3f8f05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,7 @@ dnl ---------------------------------------------------------------------
dnl Checks for programs.
AC_PROG_CC
+AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
@@ -42,6 +43,7 @@ dnl do some OS specific stuff here
AC_SUBST(FOUND_AALIB)
AC_SUBST(FOUND_ALSA)
+AC_SUBST(FOUND_DV)
AC_SUBST(FOUND_LQT)
AC_SUBST(FOUND_MOTIF)
AC_SUBST(FOUND_OS)
@@ -50,6 +52,7 @@ AC_SUBST(FOUND_GL)
AC_SUBST(FOUND_ZVBI)
FOUND_AALIB="no"
FOUND_ALSA="no"
+FOUND_DV="no"
FOUND_LQT="no"
FOUND_MOTIF="no"
FOUND_OS="unknown"
@@ -78,7 +81,7 @@ esac
dnl ---------------------------------------------------------------------
dnl Checks for functions
-AC_EGREP_HEADER(sockaddr_storage,sys/socket.h,AC_DEFINE(HAVE_SOCKADDR_STORAGE))
+AC_EGREP_HEADER(sockaddr_storage,sys/socket.h,AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,"have opv6"))
AC_CHECK_HEADERS(getopt.h soundcard.h unistd.h sys/select.h sys/soundcard.h alsa/asoundlib.h linux/joystick.h dev/ic/bt8xx.h machine/ioctl_bt848.h)
AC_CHECK_FUNCS(ftello fseeko getpt getnameinfo getopt_long strcasestr dlopen)
@@ -151,7 +154,7 @@ AC_SUBST(LIBALSA)
LIBALSA=""
if test "$enable_alsa" != "no"; then
AC_CHECK_LIB(asound, snd_seq_open,
- AC_DEFINE(HAVE_ALSA) FOUND_ALSA="yes"; LIBALSA="-lasound",,)
+ AC_DEFINE(HAVE_ALSA,1,"have alsa") FOUND_ALSA="yes"; LIBALSA="-lasound",,)
else
echo "*** alsa disabled"
fi
@@ -160,7 +163,7 @@ AC_SUBST(LIRC)
LIRC=""
if test "$enable_lirc" != "no"; then
AC_CHECK_LIB(lirc_client, lirc_init,
- AC_DEFINE(HAVE_LIBLIRC_CLIENT) LIRC="-llirc_client",,)
+ AC_DEFINE(HAVE_LIBLIRC_CLIENT,1,"have lirc") LIRC="-llirc_client",,)
else
echo "*** lirc disabled"
fi
@@ -169,7 +172,7 @@ AC_SUBST(LIBZVBI)
LIBZVBI=""
if test "$enable_zvbi" != "no"; then
AC_CHECK_LIB(zvbi, vbi_capture_fd,
- AC_DEFINE(HAVE_ZVBI) FOUND_ZVBI="yes"; LIBZVBI="-lzvbi",,)
+ AC_DEFINE(HAVE_ZVBI,1,"have zvbi") FOUND_ZVBI="yes"; LIBZVBI="-lzvbi",,)
else
echo "*** zvbi disabled"
fi
@@ -188,9 +191,18 @@ else
echo "*** aalib support disabled"
fi
+AC_SUBST(LIBDV)
+LIBDV=""
+if test "$enable_dv" != "no"; then
+ AC_CHECK_LIB(dv, dv_decoder_new,
+ AC_DEFINE(HAVE_DV,1,"have dv") FOUND_DV="yes"; LIBDV="-ldv",,)
+else
+ echo "*** DV disabled"
+fi
+
if test "$enable_quicktime" != "no"; then
AC_CHECK_LIB(quicktime, lqt_query_registry,
- FOUND_LQT="yes"; AC_DEFINE(HAVE_LIBQUICKTIME),,
+ FOUND_LQT="yes"; AC_DEFINE(HAVE_LIBQUICKTIME,1,"have libquicktime"),,
-ldl -lglib $LIBPTHREAD)
else
echo "*** quicktime disabled"
@@ -236,7 +248,7 @@ AC_SUBST(LIBGL)
LIBGL=""
if test "$enable_gl" != "no"; then
AC_CHECK_LIB(GL, glXChooseVisual,
- AC_DEFINE(HAVE_GL) FOUND_GL="yes"; LIBGL="-lGLU -lGL -lm",,
+ AC_DEFINE(HAVE_GL,1,"have opengl") FOUND_GL="yes"; LIBGL="-lGLU -lGL -lm",,
$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS -lm)
else
echo "*** OpenGL disabled"
@@ -264,13 +276,13 @@ AC_SUBST(resdir)
dnl ---------------------------------------------------------------------
dnl for screenlock
-AC_DEFINE(HAVE_XMU)
+AC_DEFINE(HAVE_XMU,1,"have xmu")
dnl ---------------------------------------------------------------------
AC_OUTPUT(Makefile xawtv.spec)
for dir in \
- common console debug fonts jwz \
- libng/plugins libvbi vbistuff x11
+ common console debug fonts jwz libvbi vbistuff x11 \
+ libng libng/plugins libng/contrib-plugins
do
test -d $dir && continue
mkdir -p $dir
diff --git a/console/Subdir.mk b/console/Subdir.mk
index b44b8c3..fb145d3 100644
--- a/console/Subdir.mk
+++ b/console/Subdir.mk
@@ -4,6 +4,7 @@ TARGETS-console := \
console/dump-mixers \
console/record \
console/showriff \
+ console/showqt \
console/streamer \
console/webcam
TARGETS-v4l-conf :=
@@ -58,6 +59,7 @@ console/webcam: \
console/dump-mixers: console/dump-mixers.o
console/showriff: console/showriff.o
+console/showqt: console/showqt.o
console/radio: console/radio.o
console/record: console/record.o
console/v4l-conf: console/v4l-conf.o
diff --git a/console/fbtv.c b/console/fbtv.c
index 5104246..0572328 100644
--- a/console/fbtv.c
+++ b/console/fbtv.c
@@ -674,7 +674,7 @@ main(int argc, char *argv[])
strcat(ng_v4l_conf," -y ");
grabber_init();
- read_config(NULL);
+ read_config(NULL,NULL,NULL);
if (0 != strlen(mixerdev)) {
struct ng_attribute *attr;
if (NULL != (attr = ng_mix_init(mixerdev,mixerctl)))
diff --git a/console/showqt.c b/console/showqt.c
new file mode 100644
index 0000000..07e0538
--- /dev/null
+++ b/console/showqt.c
@@ -0,0 +1,670 @@
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <ctype.h>
+#include <locale.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <time.h>
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+# define SWAP2(x) (((x>>8) & 0x00ff) |\
+ ((x<<8) & 0xff00))
+
+# define SWAP4(x) (((x>>24) & 0x000000ff) |\
+ ((x>>8) & 0x0000ff00) |\
+ ((x<<8) & 0x00ff0000) |\
+ ((x<<24) & 0xff000000))
+
+# define SWAP8(x) (((x>>56) & 0x00000000000000ff) |\
+ ((x>>40) & 0x000000000000ff00) |\
+ ((x>>24) & 0x0000000000ff0000) |\
+ ((x>> 8) & 0x00000000ff000000) |\
+ ((x<< 8) & 0x000000ff00000000) |\
+ ((x<<24) & 0x0000ff0000000000) |\
+ ((x<<40) & 0x00ff000000000000) |\
+ ((x<<56) & 0xff00000000000000))
+#else
+# define SWAP2(a) (a)
+# define SWAP4(a) (a)
+# define SWAP8(a) (a)
+#endif
+
+#define MAKEFOURCC(a,b,c,d) ((((uint32_t)a)<<24) | (((uint32_t)b)<<16) | \
+ (((uint32_t)c)<< 8) | ( (uint32_t)d) )
+
+#define a_clip MAKEFOURCC('c','l','i','p')
+#define a_co64 MAKEFOURCC('c','o','6','4')
+#define a_dinf MAKEFOURCC('d','i','n','f')
+#define a_dref MAKEFOURCC('d','r','e','f')
+#define a_free MAKEFOURCC('f','r','e','e')
+#define a_edts MAKEFOURCC('e','d','t','s')
+#define a_elst MAKEFOURCC('e','l','s','t')
+#define a_hdlr MAKEFOURCC('h','d','l','r')
+#define a_mdat MAKEFOURCC('m','d','a','t')
+#define a_mdhd MAKEFOURCC('m','d','h','d')
+#define a_mdia MAKEFOURCC('m','d','i','a')
+#define a_minf MAKEFOURCC('m','i','n','f')
+#define a_moov MAKEFOURCC('m','o','o','v')
+#define a_mvhd MAKEFOURCC('m','v','h','d')
+#define a_skip MAKEFOURCC('s','k','i','p')
+#define a_smhd MAKEFOURCC('s','m','h','d')
+#define a_stbl MAKEFOURCC('s','t','b','l')
+#define a_stco MAKEFOURCC('s','t','c','o')
+#define a_stsc MAKEFOURCC('s','t','s','c')
+#define a_stsd MAKEFOURCC('s','t','s','d')
+#define a_stsh MAKEFOURCC('s','t','s','h')
+#define a_stss MAKEFOURCC('s','t','s','s')
+#define a_stsz MAKEFOURCC('s','t','s','z')
+#define a_stts MAKEFOURCC('s','t','t','s')
+#define a_tkhd MAKEFOURCC('t','k','h','d')
+#define a_trak MAKEFOURCC('t','r','a','k')
+#define a_udta MAKEFOURCC('u','d','t','a')
+#define a_vmhd MAKEFOURCC('v','m','h','d')
+#define a_wide MAKEFOURCC('w','i','d','e')
+
+/* ------------------------------------------------------------------ */
+
+struct classic_atom {
+ uint32_t size;
+ uint32_t type;
+ uint64_t extsize;
+};
+
+struct qt_atom {
+ uint32_t size;
+ uint32_t type;
+ uint64_t extsize;
+};
+
+enum field_type {
+ END_OF_LIST = 0,
+ INT16,
+ INT32,
+ INT64,
+ FIX16,
+ FIX32,
+ FOURCC,
+ VER,
+ FLAGS3,
+ TIME,
+ LANG,
+ COLOR,
+ COUNT,
+ RES2,
+ RES4,
+ RES6,
+ RES8,
+ RES10,
+ MATRIX,
+};
+
+struct field_list {
+ enum field_type type;
+ char *name;
+};
+
+struct atom_list {
+ uint32_t type;
+ struct field_list *fields;
+};
+
+struct fcc_names {
+ uint32_t type;
+ char *name;
+};
+
+static int handle_classic_atom(int fh, off_t pos, off_t size, int depth);
+#if 0
+static int handle_qt_atom(int fh, off_t pos, off_t size, int depth);
+#endif
+
+/* ------------------------------------------------------------------ */
+
+static struct field_list l_co64[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { COUNT, "number of entries" },
+ /* FIXME: loop */
+ { INT64, "offset64" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_dref[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { INT32, "number of entries" },
+ /* FIXME: loop */
+ { INT32, "size" },
+ { FOURCC, "type" },
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_elst[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { COUNT, "number of entries" },
+ /* FIXME: loop */
+ { INT32, "track duration" },
+ { INT32, "media time" },
+ { FIX32, "media rate" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_hdlr[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { FOURCC, "component type" },
+ { FOURCC, "component subtype" },
+ { RES4, "component manufacturer" },
+ { RES4, "component flags" },
+ { RES4, "component flags mask" },
+ /* FIXME: name */
+ { END_OF_LIST }
+};
+
+static struct field_list l_mdhd[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { TIME, "ctime" },
+ { TIME, "mtime" },
+ { INT32, "time scale" },
+ { INT32, "duration" },
+ { LANG, "language" },
+ { INT16, "quality" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_mvhd[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { TIME, "ctime" },
+ { TIME, "mtime" },
+ { INT32, "time scale" },
+ { INT32, "duration" },
+ { FIX32, "preferred rate" },
+ { FIX16, "preferred volume" },
+ { RES10, "reserved" },
+ { MATRIX, "matrix" },
+ { INT32, "preview time" },
+ { INT32, "preview duration" },
+ { INT32, "poster time" },
+ { INT32, "selection time" },
+ { INT32, "selection duration" },
+ { INT32, "current time" },
+ { INT32, "next track id" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_smhd[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { INT16, "balance" },
+ { RES2, "reserved" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_stco[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { COUNT, "number of entries" },
+ /* FIXME: loop */
+ { INT32, "offset" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_stsc[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { COUNT, "number of entries" },
+ /* FIXME: loop */
+ { INT32, "first chunk" },
+ { INT32, "samples per chunk" },
+ { INT32, "sample description id" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_stsd[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { COUNT, "number of entries" },
+ /* FIXME: loop */
+ { INT32, "size" },
+ { FOURCC, "format" },
+ { RES6, "reserved" },
+ { INT16, "data reference index" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_stts[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { COUNT, "number of entries" },
+ /* FIXME: loop */
+ { INT32, "sample count" },
+ { INT32, "sample duration" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_stsz[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { INT32, "sample size" },
+ { COUNT, "number of entries" },
+ /* FIXME: loop if "sample size is 0" */
+#if 0
+ { INT32, "sample size" },
+#endif
+ { END_OF_LIST }
+};
+
+static struct field_list l_tkhd[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { TIME, "ctime" },
+ { TIME, "mtime" },
+ { INT32, "track id" },
+ { RES4, "reserved" },
+ { INT32, "duration" },
+ { RES8, "reserved" },
+ { INT16, "layer" },
+ { INT16, "alternate group" },
+ { INT16, "volume" },
+ { RES2, "reserved" },
+ { MATRIX, "matrix" },
+ { FIX32, "width" },
+ { FIX32, "height" },
+ { END_OF_LIST }
+};
+
+static struct field_list l_vmhd[] = {
+ { VER, "version" },
+ { FLAGS3, "flags" },
+ { INT16, "graphics mode" },
+ { COLOR, "opcolor" },
+ { END_OF_LIST }
+};
+
+static struct atom_list alist[] = {
+ { a_co64, l_co64 },
+ { a_dref, l_dref },
+ { a_elst, l_elst },
+ { a_hdlr, l_hdlr },
+ { a_mdhd, l_mdhd },
+ { a_mvhd, l_mvhd },
+ { a_smhd, l_smhd },
+ { a_stco, l_stco },
+ { a_stsc, l_stsc },
+ { a_stsd, l_stsd },
+ { a_stsz, l_stsz },
+ { a_stts, l_stts },
+ { a_tkhd, l_tkhd },
+ { a_vmhd, l_vmhd },
+ { /* end of list */}
+};
+
+/* ------------------------------------------------------------------ */
+
+static struct fcc_names flist[] = {
+ { a_co64, "chunk offset64 atom" },
+ { a_clip, "movie clipping atom" },
+ { a_dinf, "data information atom" },
+ { a_dref, "data reference atom" },
+ { a_edts, "edit atom" },
+ { a_elst, "edit list atom" },
+ { a_free, "unused space" },
+ { a_hdlr, "handler reference atom" },
+ { a_mdat, "movie data atom" },
+ { a_mdhd, "media header atom" },
+ { a_mdia, "media atom" },
+ { a_minf, "media information atom" },
+ { a_moov, "movie atom" },
+ { a_mvhd, "movie header atom" },
+ { a_skip, "unused space" },
+ { a_smhd, "sound media information header atom" },
+ { a_stbl, "sample table atom" },
+ { a_stco, "chunk offset atom" },
+ { a_stsc, "sample-to-chunk atom" },
+ { a_stsd, "sample description atom" },
+ { a_stsz, "sample size atom" },
+ { a_stts, "time-to-sample atom" },
+ { a_tkhd, "track header atom" },
+ { a_trak, "track atom" },
+ { a_udta, "user data atom" },
+ { a_vmhd, "video media information header atom" },
+ { a_wide, "reserved space for extsize field" },
+ { /* end of list */}
+};
+
+/* ------------------------------------------------------------------ */
+
+static int verbose=0;
+
+static void swap_classic_atom(struct classic_atom *a)
+{
+ a->size = SWAP4(a->size);
+ a->type = SWAP4(a->type);
+ a->extsize = SWAP8(a->extsize);
+}
+
+#if 0
+static void swap_qt_atom(struct qt_atom *a)
+{
+}
+#endif
+
+static int xisprint(int c)
+{
+ switch (c) {
+ case 169: /* copyright */
+ return 1;
+ default:
+ return isprint(c);
+ }
+}
+
+static char* strfcc(uint32_t type)
+{
+ static char retval[64];
+ int i,l;
+
+ if (xisprint((type >> 24) & 0xff) &&
+ xisprint((type >> 16) & 0xff) &&
+ xisprint((type >> 8) & 0xff) &&
+ xisprint( type & 0xff)) {
+ l = sprintf(retval,"%c%c%c%c",
+ (type >> 24) & 0xff,
+ (type >> 16) & 0xff,
+ (type >> 8) & 0xff,
+ type & 0xff);
+ } else {
+ l = sprintf(retval,"0x%08x",type);
+ }
+ for (i = 0; flist[i].type != 0; i++)
+ if (flist[i].type == type)
+ break;
+ if (flist[i].type != 0)
+ sprintf(retval+l," [%s]",flist[i].name);
+ return retval;
+}
+
+#define FIELD_NAME "\t%s%-20s = "
+static void dump_fields(int fh, off_t pos, struct field_list *list)
+{
+ char dummy[64],si[8];
+ int i,loop,cpos;
+ int8_t int8;
+ int16_t int16;
+ int32_t int32, fcc, count;
+ int64_t int64;
+ uint16_t color[3];
+ uint32_t uint32;
+ time_t t;
+
+ if (0 == verbose)
+ return;
+ if (-1 == lseek(fh,pos,SEEK_SET)) {
+ perror("lseek");
+ exit(1);
+ }
+ si[0] = 0;
+ count = 0;
+ cpos = 0;
+ loop = 0;
+ for (i = 0; list[i].type != END_OF_LIST || loop < count-1; i++) {
+ switch (list[i].type) {
+ case FOURCC:
+ read(fh,&fcc,sizeof(fcc));
+ printf(FIELD_NAME "%s\n",si,list[i].name,strfcc(SWAP4(fcc)));
+ break;
+ case VER:
+ read(fh,&int8,sizeof(int8));
+ if (verbose > 1 || int8 > 0)
+ printf(FIELD_NAME "%d\n",si,list[i].name,(int)int8);
+ break;
+ case LANG:
+ case INT16:
+ read(fh,&int16,sizeof(int16));
+ printf(FIELD_NAME "%d\n",si,list[i].name,(int)SWAP2(int16));
+ break;
+ case INT32:
+ read(fh,&int32,sizeof(int32));
+ printf(FIELD_NAME "%d\n",si,list[i].name,SWAP4(int32));
+ break;
+ case INT64:
+ read(fh,&int64,sizeof(int64));
+ printf(FIELD_NAME "%lld\n",si,list[i].name,SWAP8(int64));
+ break;
+ case FIX16:
+ read(fh,&int16,sizeof(int16));
+ printf(FIELD_NAME "%f\n",si,list[i].name,
+ SWAP2(int16) / 256.0);
+ break;
+ case FIX32:
+ read(fh,&int32,sizeof(int32));
+ printf(FIELD_NAME "%f\n",si,list[i].name,
+ SWAP4(int32) / 65536.0);
+ break;
+ case FLAGS3:
+ read(fh,dummy,3);
+ int32 = dummy[0] << 16 | dummy[1] << 8 | dummy[2];
+ if (verbose > 1 || int32 > 0)
+ printf(FIELD_NAME "0x%06x\n",si,list[i].name,int32);
+ break;
+ case TIME:
+ read(fh,&uint32,sizeof(uint32));
+ t = SWAP4(uint32) - 2082848400;
+ strftime(dummy,sizeof(dummy),"%d. %b %Y - %H:%M:%S",localtime(&t));
+ printf(FIELD_NAME "%s\n",si,list[i].name,dummy);
+ break;
+ case COLOR:
+ read(fh,&color,sizeof(color));
+ printf(FIELD_NAME "%d/%d/%d (rgb)\n",si,list[i].name,
+ (int)SWAP2(color[0]),
+ (int)SWAP2(color[0]),
+ (int)SWAP2(color[0]));
+ break;
+ case RES2:
+ read(fh,dummy,2);
+ break;
+ case RES4:
+ read(fh,dummy,4);
+ break;
+ case RES6:
+ read(fh,dummy,6);
+ break;
+ case RES8:
+ read(fh,dummy,8);
+ break;
+ case RES10:
+ read(fh,dummy,10);
+ break;
+ case MATRIX:
+ read(fh,dummy,36);
+ break;
+ case COUNT:
+ read(fh,&count,sizeof(count));
+ count = SWAP4(count);
+ cpos = i;
+ if (verbose < 2) {
+ printf("\t[list follows]\n");
+ return;
+ }
+ printf(FIELD_NAME "%d\n",si,list[i].name,count);
+ sprintf(si,"[%d] ",loop);
+ break;
+ case END_OF_LIST:
+ i = cpos;
+ loop++;
+ sprintf(si,"[%d] ",loop);
+ break;
+ }
+ }
+}
+
+static void dump_string(int fh, off_t pos, off_t size)
+{
+ off_t off;
+ uint16_t ssize,stype;
+ char *str;
+
+ if (0 == verbose)
+ return;
+ if (-1 == lseek(fh,pos,SEEK_SET)) {
+ perror("lseek");
+ exit(1);
+ }
+ /* FIXME: specs say size is _including_ size+type */
+ for (off = 0; off < size; off += ssize+4) {
+ read(fh,&ssize,sizeof(ssize));
+ read(fh,&stype,sizeof(stype));
+ ssize = SWAP2(ssize);
+ stype = SWAP2(stype);
+ str = malloc(ssize+1);
+ read(fh,str,ssize);
+ str[ssize] = 0;
+ printf("\t%d[%d] = %s\n",(int)stype,(int)ssize,str);
+ free(str);
+ }
+ if (off != size) {
+ fprintf(stderr,"Huh? string size mismatch!\n");
+ exit(1);
+ }
+}
+
+static int handle_classic_atom(int fh, off_t pos, off_t size, int depth)
+{
+ struct classic_atom a;
+ uint64_t asize;
+ off_t off;
+ int i;
+
+ if (-1 == lseek(fh,pos,SEEK_SET)) {
+ perror("lseek");
+ exit(1);
+ }
+ if (sizeof(a) != read(fh,&a,sizeof(a))) {
+ perror("read");
+ exit(1);
+ }
+ swap_classic_atom(&a);
+ switch (a.size) {
+ case 0:
+ asize = size;
+ off = 8;
+ break;
+ case 1:
+ asize = a.extsize;
+ off = 16;
+ break;
+ default:
+ asize = a.size;
+ off = 8;
+ }
+ printf("0x%08llx 0x%08llx %*s%s\n",
+ pos,asize,depth,"",strfcc(a.type));
+ switch (a.type) {
+ case a_dinf:
+ case a_edts:
+ case a_mdia:
+ case a_minf:
+ case a_moov:
+ case a_stbl:
+ case a_trak:
+ case a_udta:
+ while (off < asize)
+ off += handle_classic_atom(fh,pos+off,asize-off,depth+3);
+ if (off != asize) {
+ fprintf(stderr,"Huh? atom size mismatch!\n");
+ exit(1);
+ }
+ break;
+ default:
+ if (169 == ((a.type >> 24) & 0xff)) {
+ dump_string(fh,pos+off,asize-off);
+ } else {
+ for (i = 0; alist[i].type != 0; i++)
+ if (alist[i].type == a.type)
+ break;
+ if (alist[i].type != 0)
+ dump_fields(fh,pos+off,alist[i].fields);
+ }
+ }
+ return asize;
+}
+
+#if 0
+static int handle_qt_atom(int fh, off_t pos, off_t size, int depth)
+{
+ return 0;
+}
+#endif
+
+/* ------------------------------------------------------------------ */
+
+static void
+usage(char *prog)
+{
+ char *h;
+
+ if (NULL != (h = strrchr(prog,'/')))
+ prog = h+1;
+ fprintf(stderr,
+ "%s - dump structure of quicktime files\n"
+ "\n"
+ "usage: %s [ -j ] [ -e ] filename\n"
+ "options:\n"
+ " -h this text\n"
+ " -v increase verbose level\n"
+ "\n",
+ prog,prog);
+}
+
+int main(int argc, char *argv[])
+{
+ int fh;
+ off_t off,size;
+
+ int c;
+
+ /* parse options */
+ for (;;) {
+ if (-1 == (c = getopt(argc, argv, "hv")))
+ break;
+ switch (c) {
+ case 'v':
+ verbose++;
+ break;
+ case 'h':
+ default:
+ usage(argv[0]);
+ exit(1);
+ }
+ }
+
+ if (optind == argc) {
+ usage(argv[0]);
+ exit(1);
+ }
+
+ setlocale(LC_ALL,NULL);
+ fh = open(argv[optind],O_RDONLY);
+ if (-1 == fh) {
+ fprintf(stderr,"open %s: %s\n",argv[optind],strerror(errno));
+ exit(1);
+ }
+ size = lseek(fh,0,SEEK_END);
+ for (off = 0; off < size;)
+ off += handle_classic_atom(fh,off,size,0);
+ if (off != size) {
+ fprintf(stderr,"Huh? File size mismatch!\n");
+ exit(1);
+ }
+ return 0;
+}
diff --git a/console/streamer.c b/console/streamer.c
index 601833f..1bb19e8 100644
--- a/console/streamer.c
+++ b/console/streamer.c
@@ -122,6 +122,7 @@ usage(FILE *out)
" -j quality quality for mjpeg or jpeg [%d]\n"
" -n tvnorm set pal/ntsc/secam\n"
" -i input set video source\n"
+ " -a don't unmute/mute v4l device.\n"
"\n"
"audio options:\n"
" -O file wav file name\n"
@@ -310,20 +311,23 @@ ctrlc(int signal)
int
main(int argc, char **argv)
{
- int c,queued=0;
+ int c,queued=0,noaudio=0;
char *raw_length=NULL;
/* parse options */
ng_init();
for (;;) {
- if (-1 == (c = getopt(argc, argv,
- "hqdp:w:" "o:c:f:r:s:t:n:i:b:j:" "O:C:F:R:")))
+ if (-1 == (c = getopt(argc, argv, "haqdp:w:"
+ "o:c:f:r:s:t:n:i:b:j:" "O:C:F:R:")))
break;
switch (c) {
/* general options */
case 'q':
quiet = 1;
break;
+ case 'a':
+ noaudio = 1;
+ break;
case 'd':
debug++;
ng_debug++;
@@ -430,7 +434,8 @@ main(int argc, char **argv)
fprintf(stderr,"%s: capture not supported\n",drv->name);
exit(1);
}
- audio_on();
+ if (!noaudio)
+ audio_on();
audio_init();
/* modify settings */
@@ -479,7 +484,8 @@ main(int argc, char **argv)
/* done */
if (video.fmtid != VIDEO_NONE) {
- audio_off();
+ if (!noaudio)
+ audio_off();
drv->close(h_drv);
}
return 0;
diff --git a/console/ttv.c b/console/ttv.c
index 4c1e86f..f4d5c8d 100644
--- a/console/ttv.c
+++ b/console/ttv.c
@@ -208,7 +208,7 @@ main(int argc, char **argv)
/* init v4l */
grabber_init();
- read_config(NULL);
+ read_config(NULL,NULL,NULL);
ng_ratio_x = 0;
ng_ratio_y = 0;
diff --git a/console/v4l-conf.c b/console/v4l-conf.c
index 1012d29..2801da2 100644
--- a/console/v4l-conf.c
+++ b/console/v4l-conf.c
@@ -258,8 +258,8 @@ displayinfo_fbdev(struct DISPLAYINFO *d)
int fd;
if (NULL == fbdev) {
- if (-1 == (fd = open("/dev/tty0",O_RDWR,0))) {
- fprintf(stderr,"open /dev/tty0: %s\n",strerror(errno));
+ if (-1 == (fd = open("/dev/tty",O_RDWR,0))) {
+ fprintf(stderr,"open /dev/tty: %s\n",strerror(errno));
exit(1);
}
if (-1 == ioctl(fd, VT_GETSTATE, &vstat)) {
@@ -325,7 +325,7 @@ displayinfo_v4l2(int fd, struct DISPLAYINFO *d)
videodev,strerror(errno));
return -1;
}
- if (!(cap.flags & V4L2_FLAG_PREVIEW)) {
+ if (!(cap.capabilities & V4L2_CAP_VIDEO_OVERLAY)) {
fprintf(stderr,"%s [v4l2]: no overlay support\n",videodev);
exit(1);
}
@@ -340,8 +340,7 @@ displayinfo_v4l2(int fd, struct DISPLAYINFO *d)
/* set values */
fb.fmt.width = d->width;
fb.fmt.height = d->height;
- fb.fmt.depth = d->bpp;
- switch (fb.fmt.depth) {
+ switch (d->bpp) {
case 8: fb.fmt.pixelformat = V4L2_PIX_FMT_HI240; break;
#if BYTE_ORDER == BIG_ENDIAN
case 15: fb.fmt.pixelformat = V4L2_PIX_FMT_RGB555X; break;
@@ -360,8 +359,8 @@ displayinfo_v4l2(int fd, struct DISPLAYINFO *d)
fb.fmt.bytesperline = d->bpl;
fb.fmt.sizeimage = fb.fmt.height * fb.fmt.bytesperline;
if (NULL != d->base)
- fb.base[0] = d->base;
- if (NULL == fb.base[0])
+ fb.base = d->base;
+ if (NULL == fb.base)
fprintf(stderr,
"WARNING: couldn't find framebuffer base address, try manual\n"
" configuration (\"v4l-conf -a <addr>\")\n");
diff --git a/console/webcam.c b/console/webcam.c
index 2d8b3a6..d261d12 100644
--- a/console/webcam.c
+++ b/console/webcam.c
@@ -18,6 +18,7 @@
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
+#include <sys/stat.h>
#include "grab-ng.h"
#include "jpeglib.h"
@@ -611,6 +612,29 @@ rotate_image(unsigned char * in, int *wp, int *hp, int rot,
/* ---------------------------------------------------------------------- */
+static int make_dirs(char *filename)
+{
+ char *dirname,*h;
+ int retval = -1;
+
+ dirname = strdup(filename);
+ if (NULL == dirname)
+ goto done;
+ h = strrchr(dirname,'/');
+ if (NULL == h)
+ goto done;
+ *h = 0;
+
+ if (-1 == (retval = mkdir(dirname,0777)))
+ if (ENOENT == errno)
+ if (0 == make_dirs(dirname))
+ retval = mkdir(dirname,0777);
+
+ done:
+ free(dirname);
+ return retval;
+}
+
int
main(int argc, char *argv[])
{
@@ -846,7 +870,12 @@ main(int argc, char *argv[])
time(&t);
tm = localtime(&t);
strftime(filename,sizeof(filename)-1,archive,tm);
+ again:
if (-1 == (fh = open(filename,O_CREAT|O_WRONLY|O_TRUNC,0666))) {
+ if (ENOENT == errno) {
+ if (0 == make_dirs(filename))
+ goto again;
+ }
fprintf(stderr,"open %s: %s\n",filename,strerror(errno));
exit(1);
}
diff --git a/contrib/xawtvsort.pl b/contrib/xawtvsort.pl
new file mode 100644
index 0000000..1ac1e43
--- /dev/null
+++ b/contrib/xawtvsort.pl
@@ -0,0 +1,459 @@
+#!/usr/bin/perl
+# Autor : D. Landolt
+# Date : 26.8.2002
+# Version : 0.9
+# Name : xawtvsort.pl
+# Description : Utility to sort the xawtv frequency table
+# Changers :
+# 27.8.2002
+# Marks works now. Some correction to handel correct.
+# 30.8.2002
+# Version 0.10 made
+# Tool is now with menu and supports keystrokens for sortings.
+# 30.8.2002
+# Version 0.11 made
+# You cann now chose tv canels with return key it needs v4lctl program
+# 31.8.2002
+# Version 0.12 made
+# Scrolling when moving down is now working
+
+use Tk;
+use Tk::Table;
+use Tk::Frame;
+use Tk::FileSelect;
+use Tk::Dialog;
+
+$maxentry=0;
+$minentry=3; # Marks the first entry witch is a station
+$version = "0.12";
+$xawtvfile=$ENV{HOME}."/.xawtv";
+
+
+@stations = ();
+
+$top= new MainWindow;
+# Menu erstellen
+$Menuleiste = $top->Frame()->pack(-side => top, -fill => x);
+$DateiMenu = $Menuleiste->Menubutton(-text => "File", -underline => 0)->pack(-side => left, -padx => 2);
+$HelpMenu = $Menuleiste->Menubutton(-text => "Help", -underline => 0)->pack(-side => right, -padx => 2);
+
+$DateiMenu->command(-label => "Open",
+ -underline => 1,
+ -command => sub{ &OpenFile(); });
+$DateiMenu->command(-label => "Save",
+ -underline => 1,
+ -command => sub{ SaveXawtv($xawtvfile) });
+$DateiMenu->command(-label => "Save as",
+ -underline => 6,
+ -command => sub { $top->Dialog(-text => "Sorry Save as not jet implemented",
+ -title => "Sorry")->Show; } );
+$DateiMenu->separator();
+$DateiMenu->command(-label => "Exit",
+ -underline => 1,
+ -command => [ $top => 'destroy' ] );
+
+$HelpMenu->command(-label => "keyboard",
+ -underline => 0,
+ -command => sub { $top->Dialog(-text =>
+ "up\t\t= go up\n".
+ "down\t\t= go down\n".
+ "shift-up\t\t= move up\n".
+ "shift-down\t= move down\n".
+ "ctrl-up\t\t= move at top\n".
+ "ctrl-down\t= move to bottom\n".
+ "home\t\t= go to first entry\n".
+ "end\t\t= go to last entry\n".
+ "ctrl-l\t\t= (un)locks entry\n".
+ "ctrl-m\t\t= (un)marks entry\n".
+ "ctrl-u\t\t= unmarks all\n".
+ "ctrl-s\t\t= sorts stations\n".
+ "ctrl-n\t\t= sorts numbers\n".
+ "return\t\t= sets the sender\n",
+ -buttons => [qw/Close/] ,
+ -title => "Keyboard Help"
+ )->Show; } ) ;
+$HelpMenu->separator();
+$HelpMenu->command(-label => "about",
+ -underline => 0,
+ -command => sub { $hd = $top->Dialog(-text =>
+ "Autor D. Landolt\n".
+ "Version $version\n\n".
+ "perl/tk programm for sorting .xawtv file",
+ -buttons => [qw/Close/] ,
+ -title => "Help about"
+ );
+ $hd->Show; } ) ;
+
+
+# Add a Table for Sorting
+
+$hframe = $top->Frame->pack;
+
+$table = $top->Table(-rows => 15,
+ -columns => 8,
+ -fixedrows => 1,
+ -takefocus => 0,
+ -scrollbars => e
+ );
+
+$Statusleiste = $top->Frame()->pack(-side => bottom, -fill => x)->pack;
+$StatusLabel = $Statusleiste->Label(-text => "File : ")->pack(side => left, padx => 2);
+$StatusText = $Statusleiste->Label(-text => $xawtvfile )->pack(side => left, padx => 2);
+$StatusVersion = $Statusleiste->Label(-text => $version )->pack(side => right, padx => 2);
+
+ReadXawtv($xawtvfile);
+$table->pack;
+
+
+MainLoop;
+
+sub OpenFile {
+ my $FileDialog = $top->FileSelect(-directory => ".");
+ my $file = $FileDialog->Show;
+ if ($file ne "" ) {
+ foreach $x ( 1..$table->totalRows ) {
+ foreach $y ( 1..$table->totalColumns) {
+ $table->put($x,$y,"");
+ }
+ }
+ $StatusText->configure(-text => "Reading : ".$xawtvfile );
+ $top->update;
+ ReadXawtv($file);
+ $xawtvfile = $file;
+ }
+}
+
+sub ReadXawtv {
+ ($filename) = @_;
+ my $nr=1;
+ @stations = ();
+ $maxentry = 0;
+
+
+ $table->put(0,1,$table->Button(-text => "Station",
+ -underline => 0,
+ -command => sub{ tablesortstation() } ));
+ $table->bind(Tk::Entry, '<Control-s>', sub { tablesortstation() } );
+ $table->put(0,2,$table->Button(-text => "Nr",
+ -underline => 0,
+ -command => sub{ tablesortnr() } ));
+ $table->bind(Tk::Entry, '<Control-n>', sub { tablesortnr() } );
+ $table->put(0,3,$table->Button(-text => "UnMark",
+ -underline => 0,
+ -command => sub{ unmarkall() } ));
+ $table->bind(Tk::Entry, '<Control-u>', sub { unmarkall() } );
+ $table->put(0,4,"Lock\nmove");
+ $table->put(0,5,"1\nUp");
+ $table->put(0,6,"1\nDown");
+ $table->put(0,7,"all\nUp");
+ $table->put(0,8,"all\nDown");
+ open(XA,"$filename") || die ".xawtv nicht gefunden";
+ while (<XA>) {
+ chomp;
+ if(/^\[(.*)\]/) {
+ $StationName = $1;
+ push(@stations,$StationName); # In den Zwischenspeicher mit dem Originalname
+ $table->put($nr,1, $table->Entry());
+ $widget = $table->get($nr,1);
+ $widget->insert(0,$StationName);
+ $table->put($nr,2,$nr);
+ my $nr_nr=$nr;
+ my @command = ();
+ if($StationName ne "global" && $StationName ne "defaults") {
+ $table->put($nr,3, $table->Checkbutton());
+ $table->get($nr,3)->deselect();
+ $table->put($nr,4, $table->Checkbutton());
+ $table->get($nr,4)->deselect();
+ $table->put($nr,5, $table->Button(-text => "^",
+ -command => sub{ movecolumn($nr_nr,"up")} ));
+ $table->put($nr,6, $table->Button(-text => "v",
+ -command => sub{ movecolumn($nr_nr,"down")} ));
+ $table->put($nr,7, $table->Button(-text => "^^",
+ -command => sub{ moveallcolumn($nr_nr,"up")} ));
+ $table->put($nr,8, $table->Button(-text => "vv",
+ -command => sub{ moveallcolumn($nr_nr,"down")} ));
+ $table->get($nr,1)->bind(Tk::Entry , '<Down>', sub{ settablefocus('down') } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Up>', sub{ settablefocus('up') } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Shift-Tab>', sub{ settablefocus('left') } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Tab>', sub{ settablefocus('right') } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Shift-Up>', sub{ invokebutton(5); } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Shift-Down>', sub{ invokebutton(6); } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Control-Up>', sub{ invokebutton(7); } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Control-Down>', sub{ invokebutton(8); } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Control-m>', sub{ invokebutton(3); } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Control-l>', sub{ invokebutton(4); } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Return>', sub{ choseTv(); } );
+ $table->get($nr,1)->bind(Tk::Entry , '<Home>', sub{ settablefocus('home'); } );
+ $table->get($nr,1)->bind(Tk::Entry , '<End>', sub{ settablefocus('end');} );
+ } else {
+ $widget->configure(-state => "disabled");
+ $table->put($nr,3, $table->Checkbutton());
+ $table->get($nr,3)->deselect();
+ $table->get($nr,3)->configure(-state => "disabled");
+ $table->put($nr,4, $table->Checkbutton());
+ $table->get($nr,4)->deselect();
+ $table->get($nr,4)->configure(-state => "disabled");
+ $table->get($nr,1)->configure(-bg => "gray");
+ }
+ $nr++;
+ } else {
+ $Stations{$nr -1} .= $_."\n";
+ }
+ }
+ close XA;
+ $StatusText->configure(-text => $xawtvfile);
+ $table->get($minentry,1)->focus();
+ $maxentry=$nr -1;
+}
+
+sub choseTv {
+ my ($x, $y) = $table->Posn($top->focusCurrent);
+ my $sn = $table->get($x,2)->cget(-text);
+ system("v4lctl setstation \"".$stations[$sn - 1].'"');
+ print "v4lctl setstation ".$stations[$sn - 1]."\n";
+}
+
+sub invokebutton {
+ my ($bnr) = @_;
+ ($x, $y) = $table->Posn($top->focusCurrent);
+ # print "Invokebutton\n";
+ my $entry = $table->get($x,2)->cget(-text);
+
+ $table->get($x,$bnr)->invoke;
+
+ if ( $bnr > 4) {
+ settablefocus("up",$entry) if($bnr == 5);
+ settablefocus("down",$entry) if($bnr == 6);
+ settablefocus("up",$entry) if($bnr == 7);
+ settablefocus("down",$entry) if($bnr == 8);
+ }
+
+}
+
+sub settablefocus {
+ my ($direct,$entry) = @_;
+ my ($x, $y) = $table->Posn($top->focusCurrent);
+
+ if ( $entry ne '' ) {
+ my $loop = $x;
+ my $pm = 0;
+ $pm = 1 if($direct eq 'down');
+ $pm = -1 if($direct eq 'up');
+ while( $entry ne $table->get($loop, 2)->cget(-text) ) {
+ # print "x = $x Loop = $loop pm = $pm\n";
+ $loop += $pm;
+ $loop = $minentry if($loop > $maxentry);
+ $loop = $maxentry if($loop > $maxentry);
+ break if($loop eq $x); # Notbremse
+ }
+ # print "Found : x = $x Loop = $loop pm = $pm\n";
+ # $loop -= $pm;
+ $pm = ( $loop > $x) ? 1 : -1; # Neue Richtung festlegen für Scrolling
+ my $loop2 = $x;
+ while ($loop2 != $loop) {
+ # print "Visible : x = $x Loop = $loop pm = $pm \$_ = $_\n";
+ $loop2 += $pm;
+ $table->yview(scroll,$pm) if (! $table->get($loop2, $y)->viewable);
+ }
+ $table->get($loop, $y)->focus;
+ } else {
+
+ if ($direct eq 'down') {
+ if ( $x >= $maxentry) {
+ settablefocus("home");
+ } else {
+ $table->yview(scroll,1) if (! $table->get($x+1, $y)->viewable);
+ $table->get($x +1 , $y)->focus;
+ }
+ }
+ if ($direct eq 'up') {
+ if ( $x == $minentry) {
+ settablefocus("end");
+ } else {
+ $table->yview(scroll,-1) if (! $table->get($x-1, $y)->viewable);
+ $table->get($x -1 , $y)->focus;
+ }
+ }
+ if ($direct eq 'end') {
+ $table->yview(moveto, 1);
+ $table->get($maxentry, $y)->focus;
+ }
+ if ($direct eq 'home') {
+ $table->yview(moveto, 0);
+ $table->get($minentry, $y)->focus;
+ }
+ }
+
+}
+
+sub SaveXawtv {
+ my ($filename) = @_;
+ open(XA,">$filename");
+ # XA= STDOUT;
+
+ my $oldtext = $StatusText->cget(-text);
+ $StatusText->configure(-text => "Saveing : ".$filename );
+ $top->update;
+
+ @stations = (); # Initialize Aerea
+ print XA "[".$table->get(1,1)->get."]\n".$Stations{1};
+ push(@stations,$table->get(1,1)->get);
+ print XA "[".$table->get(2,1)->get."]\n".$Stations{2};
+ push(@stations,$table->get(2,1)->get);
+ for $i ($minentry..$maxentry) {
+ print XA "[".$table->get($i,1)->get."]\n".$Stations{$table->get($i,2)->cget(-text)};
+ push(@stations,$table->get($i,1)->get);
+ }
+ close XA;
+ $StatusText->configure(-text => $oldtext );
+}
+
+
+sub moveallcolumn() {
+ my ($nr,$direct) = @_;
+ my $laufnr=$nr;
+
+ my ( $marks, @allMarks ) = getmarked();
+
+ if ($marks < 1) {
+ while ( $laufnr > 2 && $laufnr <= $maxentry ) {
+ $laufnr = movecolumn($laufnr,$direct);
+ }
+ } else {
+ if($direct eq "down" ) { @allMarks = sort { $b cmp $a } @allMarks; }
+ my $mnr=0;
+ foreach(@allMarks) {
+ # print "Move $_ nach $direct\n";
+ $laufnr = $_;
+ $mnr++;
+ while ( ( $laufnr > 2 + $mnr && $direct eq "up" ) || ( $laufnr <= ( $maxentry - $mnr) && $direct eq "down") ) {
+ $laufnr = movesinglecolumn($laufnr,$direct);
+ }
+ }
+ }
+}
+
+sub movecolumn {
+ my ($nr,$direct) = @_;
+ my $dest;
+ my ( $marks, @allMarks ) = getmarked();
+ # print "$#allMarks -> Anzahl im Array\n";
+ if ($marks < 1) {
+ return movesinglecolumn($nr,$direct);
+ } else {
+ # print "Marked sind $marks Nr\n";
+ if($direct eq "down" ) { @allMarks = sort { $b cmp $a } @allMarks; }
+
+ foreach(@allMarks) {
+ # print "Move $_ nach $direct\n";
+ $dest = movesinglecolumn($_,$direct);
+ }
+ return $dest;
+ }
+}
+
+sub movesinglecolumn {
+ my ($nr,$direct) = @_;
+ my $plmi=0; # verschiebeindex -1 = auf +1 = ab;
+ my $spreiz=1; # Spreizung bei gesperrten Einträgen;
+ my $dest=$nr; # Startindex
+ if($direct eq "up") {
+ $plmi=-1;
+ } else {
+ $plmi=+1;
+ }
+
+ # Sperrung überspringen
+ while(($dest = $nr + $plmi * $spreiz) <= $maxentry && $table->get($dest = $nr + $plmi * $spreiz,4)->{'Value'} == 1) {
+ $spreiz++;
+ }
+
+ if ( $dest > 2 && $dest <= $maxentry ) {
+ exchangevalue($nr,$dest);
+ }
+ return $dest;
+}
+
+sub getmarked {
+ # Zurückbringen der Markierten Einträge
+ my $i ;
+ @nrArray = ();
+ my $hasmarks=0;
+ # print "getmarkde\n";
+ for $i ( $minentry..$maxentry ) {
+ if($table->get($i, 3)->{'Value'} == 1) {
+ push(@nrArray,$i);
+ $hasmarks++;
+ }
+ }
+ return($hasmarks, @nrArray );
+}
+
+sub exchangevalue {
+ my ($source,$dest) = @_;
+ my $indexex = $index = $table->get($source,2)->cget(-text);
+ my $stringex = $string = $table->get($source,1)->get;
+ my $markex = $mark = $table->get($source,3)->{'Value'};
+ # Zielnummer und String holen
+ my $indexex = $table->get($dest ,2)->cget(-text);
+ my $stringex = $table->get($dest, 1)->get;
+ my $markex = $table->get($dest, 3)->{'Value'};
+ # print "$nr / $dest / $indexex / $stringex \n";
+ # String Verschieben
+ $table->get($source, 1)->delete(0,length($string));
+ $table->get($source, 1)->insert(0,$stringex);
+ $table->get($dest,1)->delete(0,length($stringex));
+ $table->get($dest,1)->insert(0,$string);
+ # Nummer verschieben
+ $table->get($source, 2)->configure(-text => $indexex);
+ $table->get($dest,2)->configure(-text => $index);
+ # Marker Verschieben
+ if($markex == 1) {
+ $table->get($source, 3)->select;
+ } else {
+ $table->get($source, 3)->deselect;
+ }
+ if($mark == 1) {
+ $table->get($dest,3)->select;
+ } else {
+ $table->get($dest,3)->deselect;
+ }
+
+}
+
+sub tablesortstation {
+ my $i;
+ # print "Tablesort\n";
+ my $oldtext = $StatusText->cget(-text);
+ $StatusText->configure(-text => "sorting Stations");
+ $top->update;
+ foreach $i ($minentry .. $maxentry-1) {
+ # print " Sort $i\n";
+ if ( $table->get($i,1)->get gt $table->get($i+1 ,1)->get ) {
+ exchangevalue($i,$i + 1);
+ tablesortstation();
+ }
+ }
+ $StatusText->configure(-text => $oldtext);
+}
+sub tablesortnr {
+ # print "Tablesort Nr\n";
+ my $oldtext = $StatusText->cget(-text);
+ $StatusText->configure(-text => "sorting Nr");
+ $top->update;
+ foreach $i ($minentry .. $maxentry-1) {
+ # print " Sort $i\n";
+ if ( $table->get($i,2)->cget(-text) > $table->get($i+1 ,2)->cget(-text) ) {
+ exchangevalue($i,$i + 1);
+ tablesortnr();
+ }
+ }
+ $StatusText->configure(-text => $oldtext);
+}
+
+sub unmarkall {
+ foreach $i ( 3..$maxentry) {
+ $table->get($i,3)->deselect;
+ }
+}
+
diff --git a/libng/Subdir.mk b/libng/Subdir.mk
index d9dbf79..bb85b1d 100644
--- a/libng/Subdir.mk
+++ b/libng/Subdir.mk
@@ -9,9 +9,8 @@ OBJS-libng := \
libng/convert.o
libng/libng.a: $(OBJS-libng)
- rm -f $@
- ar -r $@ $(OBJS-libng)
- ranlib $@
+ @$(echo_ar_lib)
+ @$(ar_lib)
clean::
rm -f libng.a
diff --git a/libng/contrib-plugins/Makefile b/libng/contrib-plugins/Makefile
new file mode 100644
index 0000000..2a57478
--- /dev/null
+++ b/libng/contrib-plugins/Makefile
@@ -0,0 +1,2 @@
+default:
+ cd ../..; $(MAKE)
diff --git a/libng/contrib-plugins/Subdir.mk b/libng/contrib-plugins/Subdir.mk
new file mode 100644
index 0000000..2841fc8
--- /dev/null
+++ b/libng/contrib-plugins/Subdir.mk
@@ -0,0 +1,21 @@
+
+# targets to build
+TARGETS-contrib-plugins := \
+ libng/contrib-plugins/flt-smooth.so
+ifeq ($(FOUND_ALSA),yes)
+TARGETS-contrib-plugins += \
+ libng/contrib-plugins/snd-alsa.so
+endif
+
+# global targets
+all:: $(TARGETS-contrib-plugins)
+
+install::
+ $(INSTALL_DIR) $(libdir)
+ $(INSTALL_PROGRAM) -s $(TARGETS-contrib-plugins) $(libdir)
+
+clean::
+ rm -f $(TARGETS-contrib-plugins)
+
+libng/contrib-plugins/flt-smooth.so: libng/contrib-plugins/flt-smooth.o
+libng/contrib-plugins/snd-alsa.so: libng/contrib-plugins/snd-alsa.o
diff --git a/libng/plugins/flt-smooth.c b/libng/contrib-plugins/flt-smooth.c
index 1b3d9aa..ee513e4 100644
--- a/libng/plugins/flt-smooth.c
+++ b/libng/contrib-plugins/flt-smooth.c
@@ -560,14 +560,14 @@ static void write_attr(struct ng_attribute *attr, int value)
static struct ng_attribute attrs[] = {
{
id: 0,
- name: "Smooth over time",
+ name: "smooth over time",
type: ATTR_TYPE_BOOL,
defval: 1,
read: read_attr,
write: write_attr,
- },
- { id: 1,
- name: "Smooth horizontally",
+ },{
+ id: 1,
+ name: "smooth horizontally",
type: ATTR_TYPE_BOOL,
defval: 1,
read: read_attr,
@@ -579,7 +579,7 @@ static struct ng_attribute attrs[] = {
static struct ng_filter filter = {
- name: "Smooth",
+ name: "smooth",
attrs: attrs,
fmts:
(1 << VIDEO_GRAY) |
@@ -598,5 +598,5 @@ static struct ng_filter filter = {
extern void ng_plugin_init(void);
void ng_plugin_init(void)
{
- ng_filter_register(NG_PLUGIN_MAGIC,__FILE__,&filter);
+ ng_filter_register(NG_PLUGIN_MAGIC,__FILE__,&filter);
}
diff --git a/libng/contrib-plugins/snd-alsa.cc b/libng/contrib-plugins/snd-alsa.cc
new file mode 100644
index 0000000..f84566d
--- /dev/null
+++ b/libng/contrib-plugins/snd-alsa.cc
@@ -0,0 +1,237 @@
+/*
+ Copyright (c) 2002 Malte Starostik <malte.starostik@t-online.de>
+
+ 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; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <cstring>
+#include <iostream>
+#include <vector>
+
+#include <alsa/mixer.h>
+
+extern "C"
+{
+# include "grab-ng.h"
+}
+
+class alsa_mixer;
+
+class attr_proxy : public ng_attribute
+{
+public:
+ typedef int ( alsa_mixer::*accessor )();
+ typedef void ( alsa_mixer::*mutator )( int );
+ attr_proxy() { std::memset( this, 0, sizeof( ng_attribute ) ); }
+ attr_proxy( int type, int id, const char* name, alsa_mixer* instance, accessor read, mutator write )
+ {
+ this->id = id;
+ this->name = name;
+ this->type = type;
+ this->read = &read_proxy;
+ this->write = &write_proxy;
+
+ handle_data* d = new handle_data;
+ d->instance = instance;
+ d->read = read;
+ d->write = write;
+ this->handle = d;
+ }
+ attr_proxy( const attr_proxy& other )
+ {
+ handle = 0;
+ *this = other;
+ }
+ attr_proxy& operator =( const attr_proxy& rhs )
+ {
+ if ( &rhs != this )
+ {
+ deref();
+ std::memcpy( this, &rhs, sizeof( ng_attribute ) );
+ ref();
+ }
+ return *this;
+ }
+ ~attr_proxy() { deref(); }
+
+private:
+ struct handle_data
+ {
+ handle_data() : ref_count( 1 ) {}
+
+ alsa_mixer* instance;
+ accessor read;
+ mutator write;
+ int ref_count;
+ };
+
+ handle_data* data() const { return reinterpret_cast< handle_data* >( handle ); }
+ void ref() { if ( data() ) data()->ref_count++; }
+ void deref()
+ {
+ if ( data() && !--data()->ref_count )
+ {
+ delete data();
+ handle = 0;
+ }
+ }
+
+ static int read_proxy( ng_attribute* attr )
+ {
+ handle_data* d = reinterpret_cast< handle_data* >( attr->handle );
+ return ( d->instance->*d->read )();
+ }
+ static void write_proxy( ng_attribute* attr, int val )
+ {
+ handle_data* d = reinterpret_cast< handle_data* >( attr->handle );
+ ( d->instance->*d->write )( val );
+ }
+};
+
+class alsa_mixer
+{
+public:
+ alsa_mixer();
+ ~alsa_mixer();
+
+ bool init( const char* channel );
+
+ int mute();
+ void mute( int val );
+
+ int volume();
+ void volume( int val );
+
+ static void* open( char* );
+ static void close( void* inst );
+
+ static ng_devinfo* probe();
+ static ng_devinfo* channels( char* device );
+
+ static ng_attribute* volctl( void* inst, char* channel );
+
+private:
+ std::vector< attr_proxy > attrs;
+ snd_mixer_t* handle;
+ snd_mixer_elem_t* elem;
+ bool muted;
+};
+
+alsa_mixer::alsa_mixer()
+ : attrs( 3 )
+{
+ snd_mixer_open( &handle, 0 );
+ snd_mixer_attach( handle, "default" );
+ snd_mixer_selem_register( handle, 0, 0 );
+ snd_mixer_load( handle );
+
+ attrs[ 0 ] = attr_proxy( ATTR_TYPE_BOOL, ATTR_ID_MUTE, "mute",
+ this, &alsa_mixer::mute, &alsa_mixer::mute );
+ attrs[ 1 ] = attr_proxy( ATTR_TYPE_INTEGER, ATTR_ID_VOLUME, "volume",
+ this, &alsa_mixer::volume, &alsa_mixer::volume );
+}
+
+alsa_mixer::~alsa_mixer()
+{
+ if ( handle ) snd_mixer_close( handle );
+}
+
+bool alsa_mixer::init( const char* channel )
+{
+ for ( elem = snd_mixer_first_elem( handle ); elem; elem = snd_mixer_elem_next( elem ) )
+ if ( strcasecmp( channel, snd_mixer_selem_get_name( elem ) ) == 0 )
+ {
+ long min, max;
+ snd_mixer_selem_get_playback_volume_range( elem, &min, &max );
+ attrs[ 1 ].min = min;
+ attrs[ 1 ].max = max;
+ return true;
+ }
+ return false;
+}
+
+int alsa_mixer::mute()
+{
+ int left, right;
+ snd_mixer_selem_get_playback_switch( elem, SND_MIXER_SCHN_FRONT_LEFT, &left );
+ snd_mixer_selem_get_playback_switch( elem, SND_MIXER_SCHN_FRONT_RIGHT, &right );
+ return !left && !right;
+}
+
+void alsa_mixer::mute( int val )
+{
+ snd_mixer_selem_set_playback_switch( elem, SND_MIXER_SCHN_FRONT_LEFT, !val );
+ snd_mixer_selem_set_playback_switch( elem, SND_MIXER_SCHN_FRONT_RIGHT, !val );
+}
+
+int alsa_mixer::volume()
+{
+ long left, right;
+ snd_mixer_selem_get_playback_volume( elem, SND_MIXER_SCHN_FRONT_LEFT, &left );
+ snd_mixer_selem_get_playback_volume( elem, SND_MIXER_SCHN_FRONT_RIGHT, &right );
+ return ( left + right ) / 2;
+}
+
+void alsa_mixer::volume( int val )
+{
+ snd_mixer_selem_set_playback_volume( elem, SND_MIXER_SCHN_FRONT_LEFT, val );
+ snd_mixer_selem_set_playback_volume( elem, SND_MIXER_SCHN_FRONT_RIGHT, val );
+}
+
+void* alsa_mixer::open( char* )
+{
+ return new alsa_mixer();
+}
+
+void alsa_mixer::close( void* inst )
+{
+ delete reinterpret_cast< alsa_mixer* >( inst );
+}
+
+ng_devinfo* alsa_mixer::probe()
+{
+ std::cerr << "alsa_mixer::probe not implemented" << std::endl;
+ return 0;
+}
+
+ng_devinfo* alsa_mixer::channels( char* device )
+{
+ std::cerr << "alsa_mixer::channels not implemented" << std::endl;
+ return 0;
+}
+
+ng_attribute* alsa_mixer::volctl( void* instance, char* channel )
+{
+ alsa_mixer* mixer = reinterpret_cast< alsa_mixer* >( instance );
+ return mixer->init( channel ) ? &mixer->attrs[ 0 ] : 0;
+}
+
+extern "C" void ng_plugin_init( void )
+{
+ static struct ng_mix_driver mixer_info =
+ {
+ name: "alsa",
+ probe: alsa_mixer::probe,
+ channels: alsa_mixer::channels,
+ open: alsa_mixer::open,
+ volctl: alsa_mixer::volctl,
+ close: alsa_mixer::close,
+ };
+
+ ng_mix_driver_register( NG_PLUGIN_MAGIC, __FILE__, &mixer_info );
+}
+
+// vim: ts=4 sw=4 noet
diff --git a/libng/grab-ng.c b/libng/grab-ng.c
index 1b95ab5..73f968a 100644
--- a/libng/grab-ng.c
+++ b/libng/grab-ng.c
@@ -17,6 +17,7 @@
#include <fnmatch.h>
#include <errno.h>
#include <ctype.h>
+#include <inttypes.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -651,20 +652,27 @@ struct ng_reader* ng_find_reader(char *filename)
return NULL;
}
-long long
-ng_get_timestamp()
+int64_t
+ng_tofday_to_timestamp(struct timeval *tv)
{
- struct timeval tv;
long long ts;
- gettimeofday(&tv,NULL);
- ts = tv.tv_sec;
+ ts = tv->tv_sec;
ts *= 1000000;
- ts += tv.tv_usec;
+ ts += tv->tv_usec;
ts *= 1000;
return ts;
}
+int64_t
+ng_get_timestamp()
+{
+ struct timeval tv;
+
+ gettimeofday(&tv,NULL);
+ return ng_tofday_to_timestamp(&tv);
+}
+
struct ng_video_buf*
ng_filter_single(struct ng_filter *filter, struct ng_video_buf *in)
{
diff --git a/libng/grab-ng.h b/libng/grab-ng.h
index 22bdd9a..8569c60 100644
--- a/libng/grab-ng.h
+++ b/libng/grab-ng.h
@@ -17,6 +17,11 @@ extern int ng_ratio_x;
extern int ng_ratio_y;
extern char ng_v4l_conf[256];
+#define BUG_ON(condition,message) if (condition) {\
+ fprintf(stderr,"BUG: %s [%s:%d]\n",\
+ message,__FILE__,__LINE__);\
+ exit(1);}
+
/* --------------------------------------------------------------------- */
/* defines */
@@ -121,7 +126,7 @@ struct ng_video_buf {
/* meta info for frame */
struct {
- long long ts; /* time stamp */
+ int64_t ts; /* time stamp */
int seq;
int twice;
} info;
@@ -162,7 +167,7 @@ struct ng_audio_buf {
char *data;
struct {
- long long ts;
+ int64_t ts;
} info;
};
@@ -204,12 +209,12 @@ struct ng_reader {
int moff[4];
int mlen[4];
- void* (*rd_open)(char *moviename, int *vfmt, int vn);
- struct ng_video_fmt* (*rd_vfmt)(void *handle);
+ void* (*rd_open)(char *moviename);
+ struct ng_video_fmt* (*rd_vfmt)(void *handle, int *vfmt, int vn);
struct ng_audio_fmt* (*rd_afmt)(void *handle);
struct ng_video_buf* (*rd_vdata)(void *handle, int drop);
struct ng_audio_buf* (*rd_adata)(void *handle);
- long long (*frame_time)(void *handle);
+ int64_t (*frame_time)(void *handle);
int (*rd_close)(void *handle);
};
@@ -299,9 +304,9 @@ struct ng_dsp_driver {
void (*close)(void *handle);
int (*fd)(void *handle);
int (*startrec)(void *handle);
- struct ng_audio_buf* (*read)(void *handle, long long stopby);
+ struct ng_audio_buf* (*read)(void *handle, int64_t stopby);
struct ng_audio_buf* (*write)(void *handle, struct ng_audio_buf *buf);
- long long (*latency)(void *handle);
+ int64_t (*latency)(void *handle);
};
struct ng_mix_driver {
@@ -365,7 +370,7 @@ struct ng_filter {
/* --------------------------------------------------------------------- */
/* must be changed if we break compatibility */
-#define NG_PLUGIN_MAGIC 0x20020701
+#define NG_PLUGIN_MAGIC 0x20020910
extern struct ng_video_conv **ng_conv;
extern struct ng_filter **ng_filters;
@@ -402,7 +407,8 @@ const struct ng_dsp_driver* ng_dsp_open(char *device, struct ng_audio_fmt *fmt,
struct ng_attribute* ng_mix_init(char *device, char *channel);
struct ng_reader* ng_find_reader(char *filename);
-long long ng_get_timestamp(void);
+int64_t ng_tofday_to_timestamp(struct timeval *tv);
+int64_t ng_get_timestamp(void);
void ng_check_clipping(int width, int height, int xadjust, int yadjust,
struct OVERLAY_CLIP *oc, int *count);
struct ng_video_buf* ng_filter_single(struct ng_filter *filter,
diff --git a/libng/plugins/Subdir.mk b/libng/plugins/Subdir.mk
index 3d285a5..a37751e 100644
--- a/libng/plugins/Subdir.mk
+++ b/libng/plugins/Subdir.mk
@@ -3,7 +3,6 @@
TARGETS-plugins := \
libng/plugins/flt-gamma.so \
libng/plugins/flt-invert.so \
- libng/plugins/flt-smooth.so \
libng/plugins/flt-disor.so \
libng/plugins/conv-mjpeg.so \
libng/plugins/read-avi.so \
@@ -13,9 +12,15 @@ TARGETS-plugins += \
libng/plugins/read-qt.so \
libng/plugins/write-qt.so
endif
+ifeq ($(FOUND_DV),yes)
+TARGETS-plugins += \
+ libng/plugins/read-dv.so \
+ libng/plugins/write-dv.so
+endif
ifeq ($(FOUND_OS),linux)
TARGETS-plugins += \
libng/plugins/drv0-v4l2.so \
+ libng/plugins/drv0-v4l2-old.so \
libng/plugins/drv1-v4l.so \
libng/plugins/snd-oss.so
endif
@@ -33,6 +38,8 @@ GONE-plugins := \
# libraries to link
libng/plugins/read-qt.so : LDLIBS := $(QT_LIBS)
libng/plugins/write-qt.so : LDLIBS := $(QT_LIBS)
+libng/plugins/read-dv.so : LDLIBS := $(DV_LIBS)
+libng/plugins/write-dv.so : LDLIBS := $(DV_LIBS)
# global targets
all:: $(TARGETS-plugins)
@@ -44,3 +51,20 @@ install::
clean::
rm -f $(TARGETS-plugins)
+
+libng/plugins/conv-mjpeg.so: libng/plugins/conv-mjpeg.o
+libng/plugins/drv0-bsd.so: libng/plugins/drv0-bsd.o
+libng/plugins/drv0-v4l2-new.so: libng/plugins/drv0-v4l2-new.o
+libng/plugins/drv0-v4l2.so: libng/plugins/drv0-v4l2.o
+libng/plugins/drv1-v4l.so: libng/plugins/drv1-v4l.o
+libng/plugins/flt-debug.so: libng/plugins/flt-debug.o
+libng/plugins/flt-disor.so: libng/plugins/flt-disor.o
+libng/plugins/flt-gamma.so: libng/plugins/flt-gamma.o
+libng/plugins/flt-invert.so: libng/plugins/flt-invert.o
+libng/plugins/read-avi.so: libng/plugins/read-avi.o
+libng/plugins/read-dv.so: libng/plugins/read-dv.o
+libng/plugins/read-qt.so: libng/plugins/read-qt.o
+libng/plugins/snd-oss.so: libng/plugins/snd-oss.o
+libng/plugins/write-avi.so: libng/plugins/write-avi.o
+libng/plugins/write-dv.so: libng/plugins/write-dv.o
+libng/plugins/write-qt.so: libng/plugins/write-qt.o
diff --git a/libng/plugins/drv0-v4l2-old.c b/libng/plugins/drv0-v4l2-old.c
new file mode 100644
index 0000000..3129a42
--- /dev/null
+++ b/libng/plugins/drv0-v4l2-old.c
@@ -0,0 +1,1263 @@
+/*
+ * interface to the v4l2 driver
+ *
+ * (c) 1998-2002 Gerd Knorr <kraxel@bytesex.org>
+ *
+ */
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <math.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <pthread.h>
+
+#include <asm/types.h> /* XXX glibc */
+#include "videodev2-old.h"
+
+#include "grab-ng.h"
+
+/* ---------------------------------------------------------------------- */
+
+/* open+close */
+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(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);
+static int v4l2_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
+ struct OVERLAY_CLIP *oc, int count, int aspect);
+
+/* capture video */
+static int v4l2_setformat(void *handle, struct ng_video_fmt *fmt);
+static int v4l2_startvideo(void *handle, int fps, int buffers);
+static void v4l2_stopvideo(void *handle);
+static struct ng_video_buf* v4l2_nextframe(void *handle);
+static struct ng_video_buf* v4l2_getimage(void *handle);
+
+/* tuner */
+static unsigned long v4l2_getfreq(void *handle);
+static void v4l2_setfreq(void *handle, unsigned long freq);
+static int v4l2_tuned(void *handle);
+
+/* ---------------------------------------------------------------------- */
+
+#define WANTED_BUFFERS 32
+
+#define MAX_INPUT 16
+#define MAX_NORM 16
+#define MAX_FORMAT 32
+#define MAX_CTRL 32
+
+struct v4l2_handle {
+ int fd;
+
+ /* device descriptions */
+ int ninputs,nstds,nfmts;
+ struct v4l2_capability cap;
+ struct v4l2_streamparm streamparm;
+ struct v4l2_input inp[MAX_INPUT];
+ struct v4l2_enumstd std[MAX_NORM];
+ struct v4l2_fmtdesc fmt[MAX_FORMAT];
+ struct v4l2_queryctrl ctl[MAX_CTRL*2];
+
+ /* attributes */
+ int nattr;
+ struct ng_attribute *attr;
+
+ /* capture */
+ int fps,first;
+ long long start;
+ struct v4l2_format fmt_v4l2;
+ struct ng_video_fmt fmt_me;
+ struct v4l2_requestbuffers reqbufs;
+ struct v4l2_buffer buf_v4l2[WANTED_BUFFERS];
+ struct ng_video_buf buf_me[WANTED_BUFFERS];
+ int queue,waiton;
+
+ /* overlay */
+ struct v4l2_framebuffer ov_fb;
+ struct v4l2_window ov_win;
+ struct v4l2_clip ov_clips[256];
+ int ov_error;
+ int ov_enabled;
+ int ov_on;
+};
+
+/* ---------------------------------------------------------------------- */
+
+struct ng_vid_driver v4l2_driver = {
+ name: "v4l2",
+ open: v4l2_open,
+ close: v4l2_close,
+
+ get_devname: v4l2_devname,
+ capabilities: v4l2_flags,
+ list_attrs: v4l2_attrs,
+
+ setupfb: v4l2_setupfb,
+ overlay: v4l2_overlay,
+
+ setformat: v4l2_setformat,
+ startvideo: v4l2_startvideo,
+ stopvideo: v4l2_stopvideo,
+ nextframe: v4l2_nextframe,
+ getimage: v4l2_getimage,
+
+ getfreq: v4l2_getfreq,
+ setfreq: v4l2_setfreq,
+ is_tuned: v4l2_tuned,
+};
+
+static __u32 xawtv_pixelformat[VIDEO_FMT_COUNT] = {
+ 0, /* unused */
+ V4L2_PIX_FMT_HI240, /* RGB8 */
+ V4L2_PIX_FMT_GREY, /* GRAY8 */
+ V4L2_PIX_FMT_RGB555, /* RGB15_LE */
+ V4L2_PIX_FMT_RGB565, /* RGB16_LE */
+ 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 */
+ 0, /* RGB32 */
+ 0, /* LUT 2 */
+ 0, /* LUT 4 */
+ V4L2_PIX_FMT_YUYV, /* YUV422 */
+ V4L2_PIX_FMT_YUV422P, /* YUV422P */
+ 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 */
+
+#define PREFIX "ioctl: "
+
+static const char *io_names[] = {
+ "QUERYCAP", "1", "ENUM_PIXFMT", "ENUM_FBUFFMT", "G_FMT", "S_FMT",
+ "G_COMP", "S_COMP", "REQBUFS", "QUERYBUF", "G_FBUF", "S_FBUF",
+ "G_WIN", "S_WIN", "PREVIEW", "QBUF", "16", "DQBUF", "STREAMON",
+ "STREAMOFF", "G_PERF", "G_PARM", "S_PARM", "G_STD", "S_STD",
+ "ENUMSTD", "ENUMINPUT", "G_CTRL", "S_CTRL", "G_TUNER", "S_TUNER",
+ "G_FREQ", "S_FREQ", "G_AUDIO", "S_AUDIO", "35", "QUERYCTRL",
+ "QUERYMENU", "G_INPUT", "S_INPUT", "ENUMCVT", "41", "42", "43",
+ "44", "45", "G_OUTPUT", "S_OUTPUT", "ENUMOUTPUT", "G_AUDOUT",
+ "S_AUDOUT", "ENUMFX", "G_EFFECT", "S_EFFECT", "G_MODULATOR",
+ "S_MODULATOR"
+};
+static const int io_count = (sizeof(io_names)/sizeof(char*));
+#define IONAME(cmd) ((cmd & 0xff) < io_count ? \
+ io_names[cmd & 0xff] : "UNKNOWN")
+
+static int
+xioctl(int fd, int cmd, void *arg, int mayfail)
+{
+ int rc;
+
+ rc = ioctl(fd,cmd,arg);
+ if (0 == rc && ng_debug < 2)
+ return rc;
+ if (mayfail && errno == mayfail && ng_debug < 2)
+ return rc;
+ switch (cmd) {
+ case VIDIOC_QUERYCAP:
+ {
+ struct v4l2_capability *a = arg;
+ fprintf(stderr,PREFIX "VIDIOC_QUERYCAP(%s,type=0x%x,in=%d,out=%d,"
+ "audio=%d,size=%dx%d-%dx%d,fps=%d,flags=0x%x)",
+ a->name,a->type,a->inputs,a->outputs,a->audios,
+ a->minwidth,a->minheight,a->maxwidth,a->maxheight,
+ a->maxframerate,a->flags);
+ break;
+ }
+
+ case VIDIOC_G_FMT:
+ case VIDIOC_S_FMT:
+ {
+ struct v4l2_format *a = arg;
+
+ fprintf(stderr,PREFIX "VIDIOC_%s(type=%d,",IONAME(cmd),a->type);
+ switch (a->type) {
+ case V4L2_BUF_TYPE_CAPTURE:
+ fprintf(stderr,
+ "%dx%d,depth=%d,%c%c%c%c,flags=0x%x,bpl=%d,size=%d)",
+ a->fmt.pix.width,a->fmt.pix.height,a->fmt.pix.depth,
+ a->fmt.pix.pixelformat & 0xff,
+ (a->fmt.pix.pixelformat >> 8) & 0xff,
+ (a->fmt.pix.pixelformat >> 16) & 0xff,
+ (a->fmt.pix.pixelformat >> 24) & 0xff,
+ a->fmt.pix.depth,a->fmt.pix.bytesperline,
+ a->fmt.pix.sizeimage);
+ break;
+ default:
+ fprintf(stderr,"??" "?)"); /* break trigraph */
+ break;
+ }
+ break;
+ }
+ case VIDIOC_REQBUFS:
+ {
+ struct v4l2_requestbuffers *a = arg;
+
+ fprintf(stderr,PREFIX "VIDIOC_REQBUFS(count=%d,type=%d)",
+ a->count,a->type);
+ break;
+ }
+ case VIDIOC_QBUF:
+ case VIDIOC_DQBUF:
+ {
+ struct v4l2_buffer *a = arg;
+
+ fprintf(stderr,PREFIX "VIDIOC_%s(%d,type=%d,off=%d,len=%d,used=%d,"
+ "flags=0x%x,ts=%Ld,seq=%d)",
+ IONAME(cmd),a->index,a->type,a->offset,a->length,
+ a->bytesused,a->flags,a->timestamp,a->sequence);
+ break;
+ }
+
+ case VIDIOC_G_WIN:
+ case VIDIOC_S_WIN:
+ {
+ struct v4l2_window *a = arg;
+
+ fprintf(stderr,PREFIX "VIDIOC_%s(%dx%d+%d+%d,key=0x%x,clips=%d)",
+ IONAME(cmd), a->width, a->height, a->x, a->y,
+ a->chromakey,a->clipcount);
+ break;
+ }
+ case VIDIOC_PREVIEW:
+ {
+ int *a = arg;
+
+ fprintf(stderr,PREFIX "VIDIOC_PREVIEW(%s)",*a ? "on" : "off");
+ break;
+ }
+
+ case VIDIOC_QUERYCTRL:
+ {
+ struct v4l2_queryctrl *a = arg;
+
+ fprintf(stderr,PREFIX "VIDIOC_QUERYCTRL(id=%d,%s,%d-%d/%d,def=%d,"
+ "type=%d,flags=0x%x)",
+ a->id,a->name,a->minimum,a->maximum,a->step,
+ a->default_value,a->type,a->flags);
+ break;
+ }
+ case VIDIOC_QUERYMENU:
+ {
+ struct v4l2_querymenu *a = arg;
+
+ fprintf(stderr,PREFIX "VIDIOC_QUERYMENU(id=%d,index=%d,%s)",
+ a->id,a->index,a->name);
+ break;
+ }
+ case VIDIOC_G_CTRL:
+ case VIDIOC_S_CTRL:
+ {
+ struct v4l2_control *a = arg;
+
+ fprintf(stderr,PREFIX "VIDIOC_%s(id=%d,value=%d)",
+ IONAME(cmd),a->id,a->value);
+ break;
+ }
+
+ default:
+ fprintf(stderr,PREFIX "VIDIOC_%s(cmd=0x%x)",IONAME(cmd),cmd);
+ break;
+ }
+ fprintf(stderr,": %s\n",(rc == 0) ? "ok" : strerror(errno));
+ return rc;
+}
+
+static void
+print_bits(char *title, char **names, int count, int value)
+{
+ int i;
+
+ fprintf(stderr,"%s: ",title);
+ for (i = 0; i < count; i++) {
+ if (value & (1 << i))
+ fprintf(stderr,"%s ",names[i]);
+ }
+ fprintf(stderr,"\n");
+}
+
+static void
+print_device_capabilities(struct v4l2_handle *h)
+{
+ static char *cap_type[] = {
+ "capture",
+ "codec",
+ "output",
+ "fx",
+ "vbi",
+ "vtr",
+ "vtx",
+ "radio",
+ };
+ static char *cap_flags[] = {
+ "read",
+ "write",
+ "streaming",
+ "preview",
+ "select",
+ "tuner",
+ "monochrome",
+ "teletext"
+ };
+ static char *ctl_type[] = {
+ "integer",
+ "boolean",
+ "menu"
+ };
+ static char *cap_parm[] = {
+ "highquality",
+ "vflip",
+ "hflip"
+ };
+
+ int i;
+
+ fprintf(stderr,"\n*** v4l2: video device capabilities ***\n");
+
+ /* capabilities */
+ fprintf(stderr,"type: %s\n",
+ h->cap.type < sizeof(cap_type)/sizeof(char*) ?
+ cap_type[h->cap.type] : "unknown");
+ print_bits("flags",cap_flags,sizeof(cap_flags)/sizeof(char*),h->cap.flags);
+ fprintf(stderr,"\n");
+ fprintf(stderr,"inputs: %d\naudios: %d\n",h->cap.inputs,h->cap.audios);
+ fprintf(stderr,"size: %dx%d => %dx%d\n",
+ h->cap.minwidth,h->cap.minheight,h->cap.maxwidth,h->cap.maxheight);
+ fprintf(stderr,"fps: %d max\n",h->cap.maxframerate);
+
+ /* inputs */
+ fprintf(stderr,"video inputs:\n");
+ for (i = 0; i < h->ninputs; i++) {
+ printf(" %d: \"%s\", tuner: %s, audio: %s\n", i, h->inp[i].name,
+ (h->inp[i].type == V4L2_INPUT_TYPE_TUNER) ? "yes" : "no",
+ (h->inp[i].capability & V4L2_INPUT_CAP_AUDIO) ? "yes" : "no");
+ }
+
+ /* video standards */
+ fprintf(stderr,"video standards:\n");
+ for (i = 0; i < h->nstds; i++) {
+ printf(" %d: \"%s\"\n", i, h->std[i].std.name);
+ }
+
+ /* capture formats */
+ fprintf(stderr,"capture formats:\n");
+ for (i = 0; i < h->nfmts; i++) {
+ 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 */
+ fprintf(stderr,"capture parameters:\n");
+ print_bits(" cap",cap_parm,sizeof(cap_parm)/sizeof(char*),
+ h->streamparm.parm.capture.capability);
+ print_bits(" cur",cap_parm,sizeof(cap_parm)/sizeof(char*),
+ h->streamparm.parm.capture.capturemode);
+ fprintf(stderr," timeperframe=%ld\n",
+ h->streamparm.parm.capture.timeperframe);
+
+ /* controls */
+ fprintf(stderr,"supported controls:\n");
+ for (i = 0; i < MAX_CTRL*2; i++) {
+ if (h->ctl[i].id == -1)
+ continue;
+ fprintf(stderr," %2d: \"%s\", [%d .. %d], step=%d, def=%d, type=%s\n",
+ i, h->ctl[i].name,
+ h->ctl[i].minimum,h->ctl[i].maximum,
+ h->ctl[i].step,h->ctl[i].default_value,
+ ctl_type[h->ctl[i].type]);
+ }
+ fprintf(stderr,"\n");
+}
+
+static void
+print_bufinfo(struct v4l2_buffer *buf)
+{
+ static char *type[] = {
+ "",
+ "capture",
+ "codec in",
+ "codec out",
+ "effects in1",
+ "effects in2",
+ "effects out",
+ "video out"
+ };
+
+ fprintf(stderr,"v4l2: buf %d: %s 0x%x+%d, used %d\n",
+ buf->index,
+ buf->type < sizeof(type)/sizeof(char*) ?
+ type[buf->type] : "unknown",
+ buf->offset,buf->length,buf->bytesused);
+}
+
+static void
+print_fbinfo(struct v4l2_framebuffer *fb)
+{
+ static char *fb_cap[] = {
+ "extern",
+ "chromakey",
+ "clipping",
+ "scale-up",
+ "scale-down"
+ };
+ static char *fb_flags[] = {
+ "primary",
+ "overlay",
+ "chromakey"
+ };
+
+ /* capabilities */
+ fprintf(stderr,"v4l2: framebuffer info\n");
+ print_bits(" cap",fb_cap,sizeof(fb_cap)/sizeof(char*),fb->capability);
+ print_bits(" flags",fb_cap,sizeof(fb_flags)/sizeof(char*),fb->flags);
+ fprintf(stderr," base: %p %p %p\n",fb->base[0],fb->base[1],fb->base[2]);
+ fprintf(stderr," format: %dx%d, %c%c%c%c, %d byte\n",
+ fb->fmt.width, fb->fmt.height,
+ fb->fmt.pixelformat & 0xff,
+ (fb->fmt.pixelformat >> 8) & 0xff,
+ (fb->fmt.pixelformat >> 16) & 0xff,
+ (fb->fmt.pixelformat >> 24) & 0xff,
+ fb->fmt.sizeimage);
+}
+
+/* ---------------------------------------------------------------------- */
+/* helpers */
+
+static void
+get_device_capabilities(struct v4l2_handle *h)
+{
+ int i;
+
+ for (h->ninputs = 0; h->ninputs < h->cap.inputs; h->ninputs++) {
+ h->inp[h->ninputs].index = h->ninputs;
+ if (-1 == xioctl(h->fd, VIDIOC_ENUMINPUT, &h->inp[h->ninputs], 0))
+ break;
+ }
+ for (h->nstds = 0; h->nstds < MAX_NORM; h->nstds++) {
+ h->std[h->nstds].index = h->nstds;
+ if (-1 == xioctl(h->fd, VIDIOC_ENUMSTD, &h->std[h->nstds], EINVAL))
+ break;
+ }
+ for (h->nfmts = 0; h->nfmts < MAX_FORMAT; h->nfmts++) {
+ h->fmt[h->nfmts].index = h->nfmts;
+ if (-1 == xioctl(h->fd, VIDIOC_ENUM_PIXFMT, &h->fmt[h->nfmts], EINVAL))
+ break;
+ }
+
+ h->streamparm.type = V4L2_BUF_TYPE_CAPTURE;
+ ioctl(h->fd,VIDIOC_G_PARM,&h->streamparm);
+
+ /* controls */
+ for (i = 0; i < MAX_CTRL; i++) {
+ h->ctl[i].id = V4L2_CID_BASE+i;
+ if (-1 == xioctl(h->fd, VIDIOC_QUERYCTRL, &h->ctl[i], EINVAL) ||
+ (h->ctl[i].flags & V4L2_CTRL_FLAG_DISABLED))
+ h->ctl[i].id = -1;
+ }
+ for (i = 0; i < MAX_CTRL; i++) {
+ h->ctl[i+MAX_CTRL].id = V4L2_CID_PRIVATE_BASE+i;
+ if (-1 == xioctl(h->fd, VIDIOC_QUERYCTRL, &h->ctl[i+MAX_CTRL], EINVAL) ||
+ (h->ctl[i+MAX_CTRL].flags & V4L2_CTRL_FLAG_DISABLED))
+ h->ctl[i+MAX_CTRL].id = -1;
+ }
+}
+
+static struct STRTAB *
+build_norms(struct v4l2_handle *h)
+{
+ struct STRTAB *norms;
+ int i;
+
+ norms = malloc(sizeof(struct STRTAB) * (h->nstds+1));
+ for (i = 0; i < h->nstds; i++) {
+ norms[i].nr = i;
+ norms[i].str = h->std[i].std.name;
+ }
+ norms[i].nr = -1;
+ norms[i].str = NULL;
+ return norms;
+}
+
+static struct STRTAB *
+build_inputs(struct v4l2_handle *h)
+{
+ struct STRTAB *inputs;
+ int i;
+
+ inputs = malloc(sizeof(struct STRTAB) * (h->ninputs+1));
+ for (i = 0; i < h->ninputs; i++) {
+ inputs[i].nr = i;
+ inputs[i].str = h->inp[i].name;
+ }
+ inputs[i].nr = -1;
+ inputs[i].str = NULL;
+ return inputs;
+}
+
+/* ---------------------------------------------------------------------- */
+
+static struct V4L2_ATTR {
+ int id;
+ int v4l2;
+} v4l2_attr[] = {
+ { ATTR_ID_VOLUME, V4L2_CID_AUDIO_VOLUME },
+ { ATTR_ID_MUTE, V4L2_CID_AUDIO_MUTE },
+ { ATTR_ID_COLOR, V4L2_CID_SATURATION },
+ { ATTR_ID_BRIGHT, V4L2_CID_BRIGHTNESS },
+ { ATTR_ID_HUE, V4L2_CID_HUE },
+ { ATTR_ID_CONTRAST, V4L2_CID_CONTRAST },
+};
+#define NUM_ATTR (sizeof(v4l2_attr)/sizeof(struct V4L2_ATTR))
+
+static struct STRTAB*
+v4l2_menu(int fd, const struct v4l2_queryctrl *ctl)
+{
+ struct STRTAB *menu;
+ struct v4l2_querymenu item;
+ int i;
+
+ menu = malloc(sizeof(struct STRTAB) * (ctl->maximum-ctl->minimum+2));
+ for (i = ctl->minimum; i <= ctl->maximum; i++) {
+ item.id = ctl->id;
+ item.index = i;
+ if (-1 == xioctl(fd, VIDIOC_QUERYMENU, &item, 0)) {
+ free(menu);
+ return NULL;
+ }
+ menu[i-ctl->minimum].nr = i;
+ menu[i-ctl->minimum].str = strdup(item.name);
+ }
+ menu[i-ctl->minimum].nr = -1;
+ menu[i-ctl->minimum].str = NULL;
+ return menu;
+}
+
+static void
+v4l2_add_attr(struct v4l2_handle *h, struct v4l2_queryctrl *ctl,
+ int id, struct STRTAB *choices)
+{
+ static int private_ids = ATTR_ID_COUNT;
+ int i;
+
+ h->attr = realloc(h->attr,(h->nattr+2) * sizeof(struct ng_attribute));
+ memset(h->attr+h->nattr,0,sizeof(struct ng_attribute)*2);
+ if (ctl) {
+ for (i = 0; i < NUM_ATTR; i++)
+ if (v4l2_attr[i].v4l2 == ctl->id)
+ break;
+ if (i != NUM_ATTR) {
+ h->attr[h->nattr].id = v4l2_attr[i].id;
+ } else {
+ h->attr[h->nattr].id = private_ids++;
+ }
+ h->attr[h->nattr].name = ctl->name;
+ h->attr[h->nattr].priv = ctl;
+ h->attr[h->nattr].defval = ctl->default_value;
+ switch (ctl->type) {
+ case V4L2_CTRL_TYPE_INTEGER:
+ h->attr[h->nattr].type = ATTR_TYPE_INTEGER;
+ h->attr[h->nattr].defval = ctl->default_value;
+ h->attr[h->nattr].min = ctl->minimum;
+ h->attr[h->nattr].max = ctl->maximum;
+ break;
+ case V4L2_CTRL_TYPE_BOOLEAN:
+ h->attr[h->nattr].type = ATTR_TYPE_BOOL;
+ break;
+ case V4L2_CTRL_TYPE_MENU:
+ h->attr[h->nattr].type = ATTR_TYPE_CHOICE;
+ h->attr[h->nattr].choices = v4l2_menu(h->fd, ctl);
+ break;
+ default:
+ return;
+ }
+ } else {
+ /* for norms + inputs */
+ h->attr[h->nattr].id = id;
+ h->attr[h->nattr].defval = 0;
+ h->attr[h->nattr].type = ATTR_TYPE_CHOICE;
+ h->attr[h->nattr].choices = choices;
+ }
+ 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(struct ng_attribute *attr)
+{
+ 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) {
+ c.id = ctl->id;
+ xioctl(h->fd,VIDIOC_G_CTRL,&c,0);
+ value = c.value;
+
+ } else if (attr->id == ATTR_ID_NORM) {
+ value = -1; /* FIXME */
+
+ } 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;
+#if 1
+ if (ng_debug) {
+ fprintf(stderr,"v4l2: tuner cap:%s%s%s\n",
+ (tuner.capability&V4L2_TUNER_CAP_STEREO) ? " STEREO" : "",
+ (tuner.capability&V4L2_TUNER_CAP_LANG1) ? " LANG1" : "",
+ (tuner.capability&V4L2_TUNER_CAP_LANG2) ? " LANG2" : "");
+ fprintf(stderr,"v4l2: tuner rxs:%s%s%s%s\n",
+ (tuner.rxsubchans&V4L2_TUNER_SUB_MONO) ? " MONO" : "",
+ (tuner.rxsubchans&V4L2_TUNER_SUB_STEREO) ? " STEREO" : "",
+ (tuner.rxsubchans&V4L2_TUNER_SUB_LANG1) ? " LANG1" : "",
+ (tuner.rxsubchans&V4L2_TUNER_SUB_LANG2) ? " LANG2" : "");
+ fprintf(stderr,"v4l2: tuner cur:%s%s%s%s\n",
+ (tuner.audmode==V4L2_TUNER_MODE_MONO) ? " MONO" : "",
+ (tuner.audmode==V4L2_TUNER_MODE_STEREO) ? " STEREO" : "",
+ (tuner.audmode==V4L2_TUNER_MODE_LANG1) ? " LANG1" : "",
+ (tuner.audmode==V4L2_TUNER_MODE_LANG2) ? " LANG2" : "");
+ }
+#endif
+ }
+ return value;
+}
+
+static void v4l2_write_attr(struct ng_attribute *attr, int value)
+{
+ 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;
+ c.value = value;
+ xioctl(h->fd,VIDIOC_S_CTRL,&c,0);
+
+ } else if (attr->id == ATTR_ID_NORM) {
+ xioctl(h->fd,VIDIOC_S_STD,&h->std[value].std,0);
+
+ } 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);
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+static void*
+v4l2_open(char *device)
+{
+ struct v4l2_handle *h;
+ int i;
+
+ h = malloc(sizeof(*h));
+ if (NULL == h)
+ return NULL;
+ memset(h,0,sizeof(*h));
+
+ if (-1 == (h->fd = open(device, O_RDWR))) {
+ fprintf(stderr,"v4l2: open %s: %s\n",device,strerror(errno));
+ goto err;
+ }
+
+ if (-1 == ioctl(h->fd,VIDIOC_QUERYCAP,&h->cap))
+ goto err;
+ if (ng_debug)
+ fprintf(stderr, "v4l2: open\n");
+ fcntl(h->fd,F_SETFD,FD_CLOEXEC);
+ if (ng_debug)
+ fprintf(stderr,"v4l2: device is %s\n",h->cap.name);
+
+ get_device_capabilities(h);
+ if (ng_debug)
+ print_device_capabilities(h);
+
+ /* 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;
+ v4l2_add_attr(h, &h->ctl[i], 0, NULL);
+ }
+
+ /* capture buffers */
+ for (i = 0; i < WANTED_BUFFERS; i++) {
+ ng_init_video_buf(h->buf_me+i);
+ h->buf_me[i].release = ng_wakeup_video_buf;
+ }
+
+ return h;
+
+ err:
+ if (h->fd != -1)
+ close(h->fd);
+ if (h)
+ free(h);
+ return NULL;
+}
+
+static int
+v4l2_close(void *handle)
+{
+ struct v4l2_handle *h = handle;
+
+ if (ng_debug)
+ fprintf(stderr, "v4l2: close\n");
+
+ close(h->fd);
+ free(h);
+ 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)
+ ret |= CAN_OVERLAY;
+ 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;
+ return ret;
+}
+
+static struct ng_attribute* v4l2_attrs(void *handle)
+{
+ struct v4l2_handle *h = handle;
+ return h->attr;
+}
+
+/* ---------------------------------------------------------------------- */
+
+static unsigned long
+v4l2_getfreq(void *handle)
+{
+ struct v4l2_handle *h = handle;
+ unsigned long freq;
+
+ xioctl(h->fd, VIDIOC_G_FREQ, &freq, 0);
+ return freq;
+}
+
+static void
+v4l2_setfreq(void *handle, unsigned long freq)
+{
+ struct v4l2_handle *h = handle;
+
+ if (ng_debug)
+ fprintf(stderr,"v4l2: freq: %.3f\n",(float)freq/16);
+ xioctl(h->fd, VIDIOC_S_FREQ, &freq, 0);
+}
+
+static int
+v4l2_tuned(void *handle)
+{
+ struct v4l2_handle *h = handle;
+ struct v4l2_tuner tuner;
+
+ usleep(10000);
+ if (-1 == xioctl(h->fd,VIDIOC_G_TUNER,&tuner,0))
+ return 0;
+ return tuner.signal ? 1 : 0;
+}
+
+/* ---------------------------------------------------------------------- */
+/* overlay */
+
+static int
+v4l2_setupfb(void *handle, struct ng_video_fmt *fmt, void *base)
+{
+ struct v4l2_handle *h = handle;
+
+ if (-1 == xioctl(h->fd, VIDIOC_G_FBUF, &h->ov_fb, 0))
+ return -1;
+
+ 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: 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;
+ }
+ if ((h->ov_fb.fmt.flags & V4L2_FMT_FLAG_BYTESPERLINE) &&
+ 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;
+}
+
+static int
+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 rc,i;
+
+ if (h->ov_error)
+ return -1;
+
+ if (NULL == fmt) {
+ if (ng_debug)
+ fprintf(stderr,"v4l2: overlay off\n");
+ if (h->ov_enabled) {
+ h->ov_enabled = 0;
+ h->ov_on = 0;
+ xioctl(h->fd, VIDIOC_PREVIEW, &h->ov_on, 0);
+ }
+ return 0;
+ }
+
+ if (ng_debug)
+ fprintf(stderr,"v4l2: overlay win=%dx%d+%d+%d, %d clips\n",
+ fmt->width,fmt->height,x,y,count);
+ h->ov_win.x = x;
+ h->ov_win.y = y;
+ h->ov_win.width = fmt->width;
+ h->ov_win.height = fmt->height;
+
+ /* check against max. size */
+ ioctl(h->fd,VIDIOC_QUERYCAP,&h->cap);
+ if (h->ov_win.width > h->cap.maxwidth) {
+ h->ov_win.width = h->cap.maxwidth;
+ h->ov_win.x += (fmt->width - h->ov_win.width)/2;
+ }
+ if (h->ov_win.height > h->cap.maxheight) {
+ h->ov_win.height = h->cap.maxheight;
+ h->ov_win.y += (fmt->height - h->ov_win.height)/2;
+ }
+ if (aspect)
+ ng_ratio_fixup(&h->ov_win.width,&h->ov_win.height,
+ &h->ov_win.x,&h->ov_win.y);
+
+ /* fixups */
+ 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;
+ h->ov_win.clipcount = count;
+
+ 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;
+ 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 0
+ if (h->ov_fb.flags & V4L2_FBUF_FLAG_CHROMAKEY) {
+ h->ov_win.chromakey = 0; /* FIXME */
+ }
+#endif
+ rc = xioctl(h->fd, VIDIOC_S_WIN, &h->ov_win, 0);
+
+ 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;
+}
+
+/* ---------------------------------------------------------------------- */
+/* capture helpers */
+
+static int
+v4l2_queue_buffer(struct v4l2_handle *h)
+{
+ int frame = h->queue % h->reqbufs.count;
+ int rc;
+
+ if (0 != h->buf_me[frame].refcount) {
+ if (0 != h->queue - h->waiton)
+ return -1;
+ fprintf(stderr,"v4l2: waiting for a free buffer\n");
+ ng_waiton_video_buf(h->buf_me+frame);
+ }
+
+ rc = xioctl(h->fd,VIDIOC_QBUF,&h->buf_v4l2[frame], 0);
+ if (0 == rc)
+ h->queue++;
+ return rc;
+}
+
+static void
+v4l2_queue_all(struct v4l2_handle *h)
+{
+ for (;;) {
+ if (h->queue - h->waiton >= h->reqbufs.count)
+ return;
+ if (0 != v4l2_queue_buffer(h))
+ return;
+ }
+}
+
+static int
+v4l2_waiton(struct v4l2_handle *h)
+{
+ struct v4l2_buffer buf;
+ struct timeval tv;
+ fd_set rdset;
+
+ /* wait for the next frame */
+ again:
+ tv.tv_sec = 5;
+ 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:
+ fprintf(stderr,"v4l2: oops: select timeout\n");
+ return -1;
+ }
+
+ /* get it */
+ memset(&buf,0,sizeof(buf));
+ buf.type = V4L2_BUF_TYPE_CAPTURE;
+ if (-1 == xioctl(h->fd,VIDIOC_DQBUF,&buf, 0))
+ return -1;
+ h->waiton++;
+ h->buf_v4l2[buf.index] = buf;
+ return buf.index;
+}
+
+static int
+v4l2_start_streaming(struct v4l2_handle *h, int buffers)
+{
+ int disable_overlay = 0;
+ int i;
+
+ /* setup buffers */
+ h->reqbufs.count = buffers;
+ h->reqbufs.type = V4L2_BUF_TYPE_CAPTURE;
+ if (-1 == xioctl(h->fd, VIDIOC_REQBUFS, &h->reqbufs, 0))
+ return -1;
+ for (i = 0; i < h->reqbufs.count; i++) {
+ h->buf_v4l2[i].index = i;
+ h->buf_v4l2[i].type = V4L2_BUF_TYPE_CAPTURE;
+ 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_me[i].fmt.bytesperline *
+ h->buf_me[i].fmt.height;
+ h->buf_me[i].data = mmap(NULL, h->buf_v4l2[i].length,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ h->fd, h->buf_v4l2[i].offset);
+ if ((void*)-1 == h->buf_me[i].data) {
+ perror("mmap");
+ return -1;
+ }
+ if (ng_debug)
+ print_bufinfo(&h->buf_v4l2[i]);
+ }
+
+ /* queue up all buffers */
+ v4l2_queue_all(h);
+
+ try_again:
+ /* turn off preview (if needed) */
+ if (disable_overlay) {
+ h->ov_on = 0;
+ xioctl(h->fd, VIDIOC_PREVIEW, &h->ov_on, 0);
+ if (ng_debug)
+ fprintf(stderr,"v4l2: overlay off (start_streaming)\n");
+ }
+
+ /* start capture */
+ if (-1 == xioctl(h->fd,VIDIOC_STREAMON,&h->fmt_v4l2.type,
+ h->ov_on ? EBUSY : 0)) {
+ if (h->ov_on && errno == EBUSY) {
+ disable_overlay = 1;
+ goto try_again;
+ }
+ return -1;
+ }
+ return 0;
+}
+
+static void
+v4l2_stop_streaming(struct v4l2_handle *h)
+{
+ int i;
+
+ /* stop capture */
+ if (-1 == ioctl(h->fd,VIDIOC_STREAMOFF,&h->fmt_v4l2.type))
+ perror("ioctl VIDIOC_STREAMOFF");
+
+ /* 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");
+ }
+ h->queue = 0;
+ h->waiton = 0;
+
+ /* turn on preview (if needed) */
+ if (h->ov_on != h->ov_enabled) {
+ h->ov_on = h->ov_enabled;
+ xioctl(h->fd, VIDIOC_PREVIEW, &h->ov_on, 0);
+ if (ng_debug)
+ fprintf(stderr,"v4l2: overlay on (stop_streaming)\n");
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+/* capture interface */
+
+/* set capture parameters */
+static int
+v4l2_setformat(void *handle, struct ng_video_fmt *fmt)
+{
+ struct v4l2_handle *h = handle;
+
+ h->fmt_v4l2.type = V4L2_BUF_TYPE_CAPTURE;
+ h->fmt_v4l2.fmt.pix.pixelformat = xawtv_pixelformat[fmt->fmtid];
+ h->fmt_v4l2.fmt.pix.flags = V4L2_FMT_FLAG_INTERLACED;
+ h->fmt_v4l2.fmt.pix.depth = ng_vfmt_to_depth[fmt->fmtid];
+ h->fmt_v4l2.fmt.pix.width = fmt->width;
+ h->fmt_v4l2.fmt.pix.height = fmt->height;
+ h->fmt_v4l2.fmt.pix.bytesperline = fmt->bytesperline;
+
+ if (-1 == xioctl(h->fd, VIDIOC_S_FMT, &h->fmt_v4l2, EINVAL))
+ return -1;
+ if (h->fmt_v4l2.fmt.pix.pixelformat != xawtv_pixelformat[fmt->fmtid])
+ return -1;
+ fmt->width = h->fmt_v4l2.fmt.pix.width;
+ fmt->height = h->fmt_v4l2.fmt.pix.height;
+ fmt->bytesperline = h->fmt_v4l2.fmt.pix.bytesperline;
+ if (0 == fmt->bytesperline)
+ fmt->bytesperline = fmt->width * ng_vfmt_to_depth[fmt->fmtid] / 8;
+ h->fmt_me = *fmt;
+ if (ng_debug)
+ fprintf(stderr,"v4l2: new capture params (%dx%d, %c%c%c%c, %d byte)\n",
+ fmt->width,fmt->height,
+ h->fmt_v4l2.fmt.pix.pixelformat & 0xff,
+ (h->fmt_v4l2.fmt.pix.pixelformat >> 8) & 0xff,
+ (h->fmt_v4l2.fmt.pix.pixelformat >> 16) & 0xff,
+ (h->fmt_v4l2.fmt.pix.pixelformat >> 24) & 0xff,
+ h->fmt_v4l2.fmt.pix.sizeimage);
+ return 0;
+}
+
+/* start/stop video */
+static int
+v4l2_startvideo(void *handle, int fps, int buffers)
+{
+ struct v4l2_handle *h = handle;
+
+ if (0 != h->fps)
+ fprintf(stderr,"v4l2_startvideo: oops: fps!=0\n");
+ h->fps = fps;
+ h->first = 1;
+ h->start = 0;
+
+ if (h->cap.flags & V4L2_FLAG_STREAMING)
+ return v4l2_start_streaming(h,buffers);
+ return 0;
+}
+
+static void
+v4l2_stopvideo(void *handle)
+{
+ struct v4l2_handle *h = handle;
+
+ if (0 == h->fps)
+ fprintf(stderr,"v4l2_stopvideo: oops: fps==0\n");
+ h->fps = 0;
+
+ if (h->cap.flags & V4L2_FLAG_STREAMING)
+ v4l2_stop_streaming(h);
+}
+
+/* read images */
+static struct ng_video_buf*
+v4l2_nextframe(void *handle)
+{
+ struct v4l2_handle *h = handle;
+ struct ng_video_buf *buf = NULL;
+ int rc,size,frame = 0;
+
+ if (h->cap.flags & V4L2_FLAG_STREAMING) {
+ v4l2_queue_all(h);
+ frame = v4l2_waiton(h);
+ if (-1 == frame)
+ return NULL;
+ h->buf_me[frame].refcount++;
+ buf = &h->buf_me[frame];
+ 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);
+ 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;
+ }
+ memset(&buf->info,0,sizeof(buf->info));
+ buf->info.ts = ng_get_timestamp();
+ }
+
+ if (h->first) {
+ h->first = 0;
+ h->start = buf->info.ts;
+ if (ng_debug)
+ fprintf(stderr,"v4l2: start ts=%lld\n",h->start);
+ }
+ buf->info.ts -= h->start;
+ return buf;
+}
+
+static struct ng_video_buf*
+v4l2_getimage(void *handle)
+{
+ struct v4l2_handle *h = handle;
+ struct ng_video_buf *buf;
+ 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) {
+ 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 {
+ if (-1 == v4l2_start_streaming(h,1)) {
+ v4l2_stop_streaming(h);
+ return NULL;
+ }
+ frame = v4l2_waiton(h);
+ if (-1 == frame) {
+ v4l2_stop_streaming(h);
+ return NULL;
+ }
+ memcpy(buf->data,h->buf_me[0].data,size);
+ v4l2_stop_streaming(h);
+ }
+ return buf;
+}
+
+/* ---------------------------------------------------------------------- */
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_vid_driver_register(NG_PLUGIN_MAGIC,__FILE__,&v4l2_driver);
+}
diff --git a/libng/plugins/drv0-v4l2.c b/libng/plugins/drv0-v4l2.c
index 5313012..cd2bab3 100644
--- a/libng/plugins/drv0-v4l2.c
+++ b/libng/plugins/drv0-v4l2.c
@@ -73,7 +73,7 @@ struct v4l2_handle {
struct v4l2_capability cap;
struct v4l2_streamparm streamparm;
struct v4l2_input inp[MAX_INPUT];
- struct v4l2_enumstd std[MAX_NORM];
+ struct v4l2_standard std[MAX_NORM];
struct v4l2_fmtdesc fmt[MAX_FORMAT];
struct v4l2_queryctrl ctl[MAX_CTRL*2];
@@ -93,7 +93,7 @@ struct v4l2_handle {
/* overlay */
struct v4l2_framebuffer ov_fb;
- struct v4l2_window ov_win;
+ struct v4l2_format ov_win;
struct v4l2_clip ov_clips[256];
int ov_error;
int ov_enabled;
@@ -103,7 +103,7 @@ struct v4l2_handle {
/* ---------------------------------------------------------------------- */
struct ng_vid_driver v4l2_driver = {
- name: "v4l2",
+ name: "v4l2-new",
open: v4l2_open,
close: v4l2_close,
@@ -158,16 +158,46 @@ static struct STRTAB stereo[] = {
#define PREFIX "ioctl: "
static const char *io_names[] = {
- "QUERYCAP", "1", "ENUM_PIXFMT", "ENUM_FBUFFMT", "G_FMT", "S_FMT",
- "G_COMP", "S_COMP", "REQBUFS", "QUERYBUF", "G_FBUF", "S_FBUF",
- "G_WIN", "S_WIN", "PREVIEW", "QBUF", "16", "DQBUF", "STREAMON",
- "STREAMOFF", "G_PERF", "G_PARM", "S_PARM", "G_STD", "S_STD",
- "ENUMSTD", "ENUMINPUT", "G_CTRL", "S_CTRL", "G_TUNER", "S_TUNER",
- "G_FREQ", "S_FREQ", "G_AUDIO", "S_AUDIO", "35", "QUERYCTRL",
- "QUERYMENU", "G_INPUT", "S_INPUT", "ENUMCVT", "41", "42", "43",
- "44", "45", "G_OUTPUT", "S_OUTPUT", "ENUMOUTPUT", "G_AUDOUT",
- "S_AUDOUT", "ENUMFX", "G_EFFECT", "S_EFFECT", "G_MODULATOR",
- "S_MODULATOR"
+ [VIDIOC_QUERYCAP & 0xff] = "QUERYCAP",
+ [VIDIOC_ENUM_FMT & 0xff] = "ENUM_FMT",
+ [VIDIOC_G_FMT & 0xff] = "G_FMT",
+ [VIDIOC_S_FMT & 0xff] = "S_FMT",
+ [VIDIOC_REQBUFS & 0xff] = "REQBUFS",
+ [VIDIOC_QUERYBUF & 0xff] = "QUERYBUF",
+ [VIDIOC_G_FBUF & 0xff] = "G_FBUF",
+ [VIDIOC_S_FBUF & 0xff] = "S_FBUF",
+ [VIDIOC_OVERLAY & 0xff] = "OVERLAY",
+ [VIDIOC_QBUF & 0xff] = "QBUF",
+ [VIDIOC_DQBUF & 0xff] = "DQBUF",
+ [VIDIOC_STREAMON & 0xff] = "STREAMON",
+ [VIDIOC_STREAMOFF & 0xff] = "STREAMOFF",
+ [VIDIOC_G_PARM & 0xff] = "G_PARM",
+ [VIDIOC_S_PARM & 0xff] = "S_PARM",
+ [VIDIOC_G_STD & 0xff] = "G_STD",
+ [VIDIOC_S_STD & 0xff] = "S_STD",
+ [VIDIOC_ENUMSTD & 0xff] = "ENUMSTD",
+ [VIDIOC_ENUMINPUT & 0xff] = "ENUMINPUT",
+ [VIDIOC_G_CTRL & 0xff] = "G_CTRL",
+ [VIDIOC_S_CTRL & 0xff] = "S_CTRL",
+ [VIDIOC_G_TUNER & 0xff] = "G_TUNER",
+ [VIDIOC_S_TUNER & 0xff] = "S_TUNER",
+ [VIDIOC_G_AUDIO & 0xff] = "G_AUDIO",
+ [VIDIOC_S_AUDIO & 0xff] = "S_AUDIO",
+ [VIDIOC_QUERYCTRL & 0xff] = "QUERYCTRL",
+ [VIDIOC_QUERYMENU & 0xff] = "QUERYMENU",
+ [VIDIOC_G_INPUT & 0xff] = "G_INPUT",
+ [VIDIOC_S_INPUT & 0xff] = "S_INPUT",
+ [VIDIOC_G_OUTPUT & 0xff] = "G_OUTPUT",
+ [VIDIOC_S_OUTPUT & 0xff] = "S_OUTPUT",
+ [VIDIOC_ENUMOUTPUT & 0xff] = "ENUMOUTPUT",
+ [VIDIOC_ENUMOUTPUT & 0xff] = "ENUMOUTPUT",
+ [VIDIOC_G_AUDOUT & 0xff] = "G_AUDOUT",
+ [VIDIOC_S_AUDOUT & 0xff] = "S_AUDOUT",
+ [VIDIOC_G_MODULATOR & 0xff] = "G_MODULATOR",
+ [VIDIOC_S_MODULATOR & 0xff] = "S_MODULATOR",
+ [VIDIOC_TRY_FMT & 0xff] = "TRY_FMT",
+ [VIDIOC_G_FREQUENCY & 0xff] = "G_FREQUENCY",
+ [VIDIOC_S_FREQUENCY & 0xff] = "S_FREQUENCY",
};
static const int io_count = (sizeof(io_names)/sizeof(char*));
#define IONAME(cmd) ((cmd & 0xff) < io_count ? \
@@ -187,32 +217,40 @@ xioctl(int fd, int cmd, void *arg, int mayfail)
case VIDIOC_QUERYCAP:
{
struct v4l2_capability *a = arg;
- fprintf(stderr,PREFIX "VIDIOC_QUERYCAP(%s,type=0x%x,in=%d,out=%d,"
- "audio=%d,size=%dx%d-%dx%d,fps=%d,flags=0x%x)",
- a->name,a->type,a->inputs,a->outputs,a->audios,
- a->minwidth,a->minheight,a->maxwidth,a->maxheight,
- a->maxframerate,a->flags);
+ fprintf(stderr,PREFIX "VIDIOC_QUERYCAP(%s,ver=%d.%d.%d,"
+ "cap=0x%x,flags=0x%x)", a->name,
+ (a->version >> 16) & 0xff,
+ (a->version >> 8) & 0xff,
+ a->version & 0xff,
+ a->capabilities, a->flags);
break;
}
case VIDIOC_G_FMT:
case VIDIOC_S_FMT:
+ case VIDIOC_TRY_FMT:
{
struct v4l2_format *a = arg;
fprintf(stderr,PREFIX "VIDIOC_%s(type=%d,",IONAME(cmd),a->type);
switch (a->type) {
- case V4L2_BUF_TYPE_CAPTURE:
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE:
fprintf(stderr,
- "%dx%d,depth=%d,%c%c%c%c,flags=0x%x,bpl=%d,size=%d)",
- a->fmt.pix.width,a->fmt.pix.height,a->fmt.pix.depth,
+ "%dx%d,%c%c%c%c,bpl=%d,size=%d)",
+ a->fmt.pix.width,a->fmt.pix.height,
a->fmt.pix.pixelformat & 0xff,
(a->fmt.pix.pixelformat >> 8) & 0xff,
(a->fmt.pix.pixelformat >> 16) & 0xff,
(a->fmt.pix.pixelformat >> 24) & 0xff,
- a->fmt.pix.depth,a->fmt.pix.bytesperline,
+ a->fmt.pix.bytesperline,
a->fmt.pix.sizeimage);
break;
+ case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+ fprintf(stderr,"%dx%d+%d+%d,key=0x%x,clips=%d)",
+ a->fmt.win.w.width, a->fmt.win.w.height,
+ a->fmt.win.w.left, a->fmt.win.w.top,
+ a->fmt.win.chromakey,a->fmt.win.clipcount);
+ break;
default:
fprintf(stderr,"??" "?)"); /* break trigraph */
break;
@@ -233,27 +271,18 @@ xioctl(int fd, int cmd, void *arg, int mayfail)
struct v4l2_buffer *a = arg;
fprintf(stderr,PREFIX "VIDIOC_%s(%d,type=%d,off=%d,len=%d,used=%d,"
- "flags=0x%x,ts=%Ld,seq=%d)",
- IONAME(cmd),a->index,a->type,a->offset,a->length,
- a->bytesused,a->flags,a->timestamp,a->sequence);
+ "flags=0x%x,ts=%ld.%ld,seq=%d)",
+ IONAME(cmd),a->index,a->type,a->m.offset,a->length,
+ a->bytesused,a->flags,
+ a->timestamp.tv_sec,a->timestamp.tv_usec,a->sequence);
break;
}
- case VIDIOC_G_WIN:
- case VIDIOC_S_WIN:
- {
- struct v4l2_window *a = arg;
-
- fprintf(stderr,PREFIX "VIDIOC_%s(%dx%d+%d+%d,key=0x%x,clips=%d)",
- IONAME(cmd), a->width, a->height, a->x, a->y,
- a->chromakey,a->clipcount);
- break;
- }
- case VIDIOC_PREVIEW:
+ case VIDIOC_OVERLAY:
{
int *a = arg;
- fprintf(stderr,PREFIX "VIDIOC_PREVIEW(%s)",*a ? "on" : "off");
+ fprintf(stderr,PREFIX "VIDIOC_OVERLAY(%s)",*a ? "on" : "off");
break;
}
@@ -309,25 +338,14 @@ print_bits(char *title, char **names, int count, int value)
static void
print_device_capabilities(struct v4l2_handle *h)
{
- static char *cap_type[] = {
- "capture",
- "codec",
- "output",
- "fx",
- "vbi",
- "vtr",
- "vtx",
- "radio",
- };
- static char *cap_flags[] = {
- "read",
- "write",
- "streaming",
- "preview",
- "select",
- "tuner",
- "monochrome",
- "teletext"
+ static char *caps[] = {
+ "video-cap", "video-out", "video-over", "",
+ "vbi-cap", "vbi-out", "?","?",
+ "rds-cap", "?", "?", "?",
+ "?", "?", "?", "?",
+ "tuner", "audio", "?", "?",
+ "?", "?", "?", "?",
+ "read/write", "async-i/o", "streaming", "?",
};
static char *ctl_type[] = {
"integer",
@@ -345,39 +363,30 @@ print_device_capabilities(struct v4l2_handle *h)
fprintf(stderr,"\n*** v4l2: video device capabilities ***\n");
/* capabilities */
- fprintf(stderr,"type: %s\n",
- h->cap.type < sizeof(cap_type)/sizeof(char*) ?
- cap_type[h->cap.type] : "unknown");
- print_bits("flags",cap_flags,sizeof(cap_flags)/sizeof(char*),h->cap.flags);
+ print_bits("caps",caps,sizeof(caps)/sizeof(char*),h->cap.capabilities);
fprintf(stderr,"\n");
- fprintf(stderr,"inputs: %d\naudios: %d\n",h->cap.inputs,h->cap.audios);
- fprintf(stderr,"size: %dx%d => %dx%d\n",
- h->cap.minwidth,h->cap.minheight,h->cap.maxwidth,h->cap.maxheight);
- fprintf(stderr,"fps: %d max\n",h->cap.maxframerate);
/* inputs */
fprintf(stderr,"video inputs:\n");
for (i = 0; i < h->ninputs; i++) {
- printf(" %d: \"%s\", tuner: %s, audio: %s\n", i, h->inp[i].name,
- (h->inp[i].type == V4L2_INPUT_TYPE_TUNER) ? "yes" : "no",
- (h->inp[i].capability & V4L2_INPUT_CAP_AUDIO) ? "yes" : "no");
+ printf(" %d: \"%s\", tuner: %s\n", i, h->inp[i].name,
+ (h->inp[i].type == V4L2_INPUT_TYPE_TUNER) ? "yes" : "no");
}
/* video standards */
fprintf(stderr,"video standards:\n");
for (i = 0; i < h->nstds; i++) {
- printf(" %d: \"%s\"\n", i, h->std[i].std.name);
+ printf(" %d: \"%s\"\n", i, h->std[i].name);
}
/* capture formats */
fprintf(stderr,"capture formats:\n");
for (i = 0; i < h->nfmts; i++) {
- fprintf(stderr," %d: %c%c%c%c, depth=%d,%s \"%s\"\n", i,
+ fprintf(stderr," %d: %c%c%c%c, %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);
}
@@ -388,8 +397,6 @@ print_device_capabilities(struct v4l2_handle *h)
h->streamparm.parm.capture.capability);
print_bits(" cur",cap_parm,sizeof(cap_parm)/sizeof(char*),
h->streamparm.parm.capture.capturemode);
- fprintf(stderr," timeperframe=%ld\n",
- h->streamparm.parm.capture.timeperframe);
/* controls */
fprintf(stderr,"supported controls:\n");
@@ -409,21 +416,18 @@ static void
print_bufinfo(struct v4l2_buffer *buf)
{
static char *type[] = {
- "",
- "capture",
- "codec in",
- "codec out",
- "effects in1",
- "effects in2",
- "effects out",
- "video out"
+ [V4L2_BUF_TYPE_VIDEO_CAPTURE] = "video-cap",
+ [V4L2_BUF_TYPE_VIDEO_OVERLAY] = "video-over",
+ [V4L2_BUF_TYPE_VIDEO_OUTPUT] = "video-out",
+ [V4L2_BUF_TYPE_VBI_CAPTURE] = "vbi-cap",
+ [V4L2_BUF_TYPE_VBI_OUTPUT] = "vbi-out",
};
fprintf(stderr,"v4l2: buf %d: %s 0x%x+%d, used %d\n",
- buf->index,
- buf->type < sizeof(type)/sizeof(char*) ?
- type[buf->type] : "unknown",
- buf->offset,buf->length,buf->bytesused);
+ buf->index,
+ buf->type < sizeof(type)/sizeof(char*)
+ ? type[buf->type] : "unknown",
+ buf->m.offset,buf->length,buf->bytesused);
}
static void
@@ -446,7 +450,7 @@ print_fbinfo(struct v4l2_framebuffer *fb)
fprintf(stderr,"v4l2: framebuffer info\n");
print_bits(" cap",fb_cap,sizeof(fb_cap)/sizeof(char*),fb->capability);
print_bits(" flags",fb_cap,sizeof(fb_flags)/sizeof(char*),fb->flags);
- fprintf(stderr," base: %p %p %p\n",fb->base[0],fb->base[1],fb->base[2]);
+ fprintf(stderr," base: %p\n",fb->base);
fprintf(stderr," format: %dx%d, %c%c%c%c, %d byte\n",
fb->fmt.width, fb->fmt.height,
fb->fmt.pixelformat & 0xff,
@@ -464,9 +468,9 @@ get_device_capabilities(struct v4l2_handle *h)
{
int i;
- for (h->ninputs = 0; h->ninputs < h->cap.inputs; h->ninputs++) {
+ for (h->ninputs = 0; h->ninputs < MAX_INPUT; h->ninputs++) {
h->inp[h->ninputs].index = h->ninputs;
- if (-1 == xioctl(h->fd, VIDIOC_ENUMINPUT, &h->inp[h->ninputs], 0))
+ if (-1 == xioctl(h->fd, VIDIOC_ENUMINPUT, &h->inp[h->ninputs], EINVAL))
break;
}
for (h->nstds = 0; h->nstds < MAX_NORM; h->nstds++) {
@@ -476,11 +480,12 @@ get_device_capabilities(struct v4l2_handle *h)
}
for (h->nfmts = 0; h->nfmts < MAX_FORMAT; h->nfmts++) {
h->fmt[h->nfmts].index = h->nfmts;
- if (-1 == xioctl(h->fd, VIDIOC_ENUM_PIXFMT, &h->fmt[h->nfmts], EINVAL))
+ h->fmt[h->nfmts].type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (-1 == xioctl(h->fd, VIDIOC_ENUM_FMT, &h->fmt[h->nfmts], EINVAL))
break;
}
- h->streamparm.type = V4L2_BUF_TYPE_CAPTURE;
+ h->streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
ioctl(h->fd,VIDIOC_G_PARM,&h->streamparm);
/* controls */
@@ -506,8 +511,8 @@ build_norms(struct v4l2_handle *h)
norms = malloc(sizeof(struct STRTAB) * (h->nstds+1));
for (i = 0; i < h->nstds; i++) {
- norms[i].nr = i;
- norms[i].str = h->std[i].std.name;
+ norms[i].nr = h->std[i].id;
+ norms[i].str = h->std[i].name;
}
norms[i].nr = -1;
norms[i].str = NULL;
@@ -680,7 +685,7 @@ static void v4l2_write_attr(struct ng_attribute *attr, int value)
xioctl(h->fd,VIDIOC_S_CTRL,&c,0);
} else if (attr->id == ATTR_ID_NORM) {
- xioctl(h->fd,VIDIOC_S_STD,&h->std[value].std,0);
+ xioctl(h->fd,VIDIOC_S_STD,&value,0);
} else if (attr->id == ATTR_ID_INPUT) {
xioctl(h->fd,VIDIOC_S_INPUT,&value,0);
@@ -706,7 +711,7 @@ v4l2_open(char *device)
return NULL;
memset(h,0,sizeof(*h));
- if (-1 == (h->fd = open(device,O_RDWR))) {
+ if (-1 == (h->fd = open(device, O_RDWR))) {
fprintf(stderr,"v4l2: open %s: %s\n",device,strerror(errno));
goto err;
}
@@ -726,7 +731,7 @@ 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)
+ if (h->cap.capabilities & V4L2_CAP_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)
@@ -775,12 +780,11 @@ 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.capabilities & V4L2_CAP_VIDEO_OVERLAY && !h->ov_error)
ret |= CAN_OVERLAY;
- if ((h->cap.flags & V4L2_FLAG_STREAMING) ||
- (h->cap.flags & V4L2_FLAG_READ))
+ if (h->cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)
ret |= CAN_CAPTURE;
- if (h->cap.flags & V4L2_FLAG_TUNER)
+ if (h->cap.capabilities & V4L2_CAP_TUNER)
ret |= CAN_TUNE;
return ret;
}
@@ -797,20 +801,25 @@ static unsigned long
v4l2_getfreq(void *handle)
{
struct v4l2_handle *h = handle;
- unsigned long freq;
+ struct v4l2_frequency f;
- xioctl(h->fd, VIDIOC_G_FREQ, &freq, 0);
- return freq;
+ memset(&f,0,sizeof(f));
+ xioctl(h->fd, VIDIOC_G_FREQUENCY, &f, 0);
+ return f.frequency;
}
static void
v4l2_setfreq(void *handle, unsigned long freq)
{
struct v4l2_handle *h = handle;
+ struct v4l2_frequency f;
if (ng_debug)
fprintf(stderr,"v4l2: freq: %.3f\n",(float)freq/16);
- xioctl(h->fd, VIDIOC_S_FREQ, &freq, 0);
+ memset(&f,0,sizeof(f));
+ f.type = V4L2_TUNER_ANALOG_TV;
+ f.frequency = freq;
+ xioctl(h->fd, VIDIOC_S_FREQUENCY, &f, 0);
}
static int
@@ -840,7 +849,7 @@ v4l2_setupfb(void *handle, struct ng_video_fmt *fmt, void *base)
print_fbinfo(&h->ov_fb);
/* double-check settings */
- if (NULL != base && h->ov_fb.base[0] != base) {
+ if (NULL != base && h->ov_fb.base != base) {
fprintf(stderr,"v4l2: WARNING: framebuffer base address mismatch\n");
fprintf(stderr,"v4l2: me=%p v4l=%p\n",base,h->ov_fb.base);
h->ov_error = 1;
@@ -854,8 +863,7 @@ v4l2_setupfb(void *handle, struct ng_video_fmt *fmt, void *base)
h->ov_error = 1;
return -1;
}
- if ((h->ov_fb.fmt.flags & V4L2_FMT_FLAG_BYTESPERLINE) &&
- fmt->bytesperline > 0 &&
+ if (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",
@@ -888,6 +896,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;
+ struct v4l2_format win;
int rc,i;
if (h->ov_error)
@@ -899,7 +908,7 @@ v4l2_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
if (h->ov_enabled) {
h->ov_enabled = 0;
h->ov_on = 0;
- xioctl(h->fd, VIDIOC_PREVIEW, &h->ov_on, 0);
+ xioctl(h->fd, VIDIOC_OVERLAY, &h->ov_on, 0);
}
return 0;
}
@@ -907,40 +916,38 @@ v4l2_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
if (ng_debug)
fprintf(stderr,"v4l2: overlay win=%dx%d+%d+%d, %d clips\n",
fmt->width,fmt->height,x,y,count);
- h->ov_win.x = x;
- h->ov_win.y = y;
- h->ov_win.width = fmt->width;
- h->ov_win.height = fmt->height;
+ win.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
+ win.fmt.win.w.left = x;
+ win.fmt.win.w.top = y;
+ win.fmt.win.w.width = fmt->width;
+ win.fmt.win.w.height = fmt->height;
/* check against max. size */
- ioctl(h->fd,VIDIOC_QUERYCAP,&h->cap);
- if (h->ov_win.width > h->cap.maxwidth) {
- h->ov_win.width = h->cap.maxwidth;
- h->ov_win.x += (fmt->width - h->ov_win.width)/2;
- }
- if (h->ov_win.height > h->cap.maxheight) {
- h->ov_win.height = h->cap.maxheight;
- h->ov_win.y += (fmt->height - h->ov_win.height)/2;
- }
+ xioctl(h->fd,VIDIOC_TRY_FMT,&win,0);
+ if (win.fmt.win.w.width != fmt->width)
+ win.fmt.win.w.left = x + (fmt->width - win.fmt.win.w.width);
+ if (win.fmt.win.w.height != fmt->height)
+ win.fmt.win.w.top = y + (fmt->height - win.fmt.win.w.height);
if (aspect)
- ng_ratio_fixup(&h->ov_win.width,&h->ov_win.height,
- &h->ov_win.x,&h->ov_win.y);
+ ng_ratio_fixup(&win.fmt.win.w.width,&win.fmt.win.w.height,
+ &win.fmt.win.w.left,&win.fmt.win.w.top);
/* fixups */
- ng_check_clipping(h->ov_win.width, h->ov_win.height,
- x - h->ov_win.x, y - h->ov_win.y,
+ ng_check_clipping(win.fmt.win.w.width, win.fmt.win.w.height,
+ x - win.fmt.win.w.left, y - win.fmt.win.w.top,
oc, &count);
- if (h->ov_fb.capability & V4L2_FBUF_CAP_CLIPPING) {
- h->ov_win.clips = h->ov_clips;
- h->ov_win.clipcount = count;
+ h->ov_win = win;
+ if (h->ov_fb.capability & V4L2_FBUF_CAP_LIST_CLIPPING) {
+ h->ov_win.fmt.win.clips = h->ov_clips;
+ h->ov_win.fmt.win.clipcount = count;
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;
- 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;
+ h->ov_clips[i].next = (i+1 == count) ? NULL : &h->ov_clips[i+1];
+ h->ov_clips[i].c.left = oc[i].x1;
+ h->ov_clips[i].c.top = oc[i].y1;
+ h->ov_clips[i].c.width = oc[i].x2-oc[i].x1;
+ h->ov_clips[i].c.height = oc[i].y2-oc[i].y1;
}
}
#if 0
@@ -948,11 +955,11 @@ v4l2_overlay(void *handle, struct ng_video_fmt *fmt, int x, int y,
h->ov_win.chromakey = 0; /* FIXME */
}
#endif
- rc = xioctl(h->fd, VIDIOC_S_WIN, &h->ov_win, 0);
+ rc = xioctl(h->fd, VIDIOC_S_FMT, &h->ov_win, 0);
h->ov_enabled = (0 == rc) ? 1 : 0;
h->ov_on = (0 == rc) ? 1 : 0;
- xioctl(h->fd, VIDIOC_PREVIEW, &h->ov_on, 0);
+ xioctl(h->fd, VIDIOC_OVERLAY, &h->ov_on, 0);
return 0;
}
@@ -1016,7 +1023,7 @@ v4l2_waiton(struct v4l2_handle *h)
/* get it */
memset(&buf,0,sizeof(buf));
- buf.type = V4L2_BUF_TYPE_CAPTURE;
+ buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (-1 == xioctl(h->fd,VIDIOC_DQBUF,&buf, 0))
return -1;
h->waiton++;
@@ -1032,21 +1039,21 @@ v4l2_start_streaming(struct v4l2_handle *h, int buffers)
/* setup buffers */
h->reqbufs.count = buffers;
- h->reqbufs.type = V4L2_BUF_TYPE_CAPTURE;
+ h->reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (-1 == xioctl(h->fd, VIDIOC_REQBUFS, &h->reqbufs, 0))
return -1;
for (i = 0; i < h->reqbufs.count; i++) {
h->buf_v4l2[i].index = i;
- h->buf_v4l2[i].type = V4L2_BUF_TYPE_CAPTURE;
- if (-1 == ioctl(h->fd, VIDIOC_QUERYBUF, &h->buf_v4l2[i]))
+ h->buf_v4l2[i].type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (-1 == xioctl(h->fd, VIDIOC_QUERYBUF, &h->buf_v4l2[i], 0))
return -1;
h->buf_me[i].fmt = h->fmt_me;
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_v4l2[i].length,
PROT_READ | PROT_WRITE, MAP_SHARED,
- h->fd, h->buf_v4l2[i].offset);
- if ((void*)-1 == h->buf_me[i].data) {
+ h->fd, h->buf_v4l2[i].m.offset);
+ if (MAP_FAILED == h->buf_me[i].data) {
perror("mmap");
return -1;
}
@@ -1061,7 +1068,7 @@ v4l2_start_streaming(struct v4l2_handle *h, int buffers)
/* turn off preview (if needed) */
if (disable_overlay) {
h->ov_on = 0;
- xioctl(h->fd, VIDIOC_PREVIEW, &h->ov_on, 0);
+ xioctl(h->fd, VIDIOC_OVERLAY, &h->ov_on, 0);
if (ng_debug)
fprintf(stderr,"v4l2: overlay off (start_streaming)\n");
}
@@ -1100,7 +1107,7 @@ v4l2_stop_streaming(struct v4l2_handle *h)
/* turn on preview (if needed) */
if (h->ov_on != h->ov_enabled) {
h->ov_on = h->ov_enabled;
- xioctl(h->fd, VIDIOC_PREVIEW, &h->ov_on, 0);
+ xioctl(h->fd, VIDIOC_OVERLAY, &h->ov_on, 0);
if (ng_debug)
fprintf(stderr,"v4l2: overlay on (stop_streaming)\n");
}
@@ -1115,10 +1122,8 @@ v4l2_setformat(void *handle, struct ng_video_fmt *fmt)
{
struct v4l2_handle *h = handle;
- h->fmt_v4l2.type = V4L2_BUF_TYPE_CAPTURE;
+ h->fmt_v4l2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
h->fmt_v4l2.fmt.pix.pixelformat = xawtv_pixelformat[fmt->fmtid];
- h->fmt_v4l2.fmt.pix.flags = V4L2_FMT_FLAG_INTERLACED;
- h->fmt_v4l2.fmt.pix.depth = ng_vfmt_to_depth[fmt->fmtid];
h->fmt_v4l2.fmt.pix.width = fmt->width;
h->fmt_v4l2.fmt.pix.height = fmt->height;
h->fmt_v4l2.fmt.pix.bytesperline = fmt->bytesperline;
@@ -1156,7 +1161,7 @@ v4l2_startvideo(void *handle, int fps, int buffers)
h->first = 1;
h->start = 0;
- if (h->cap.flags & V4L2_FLAG_STREAMING)
+ if (h->cap.capabilities & V4L2_CAP_STREAMING)
return v4l2_start_streaming(h,buffers);
return 0;
}
@@ -1170,7 +1175,7 @@ v4l2_stopvideo(void *handle)
fprintf(stderr,"v4l2_stopvideo: oops: fps==0\n");
h->fps = 0;
- if (h->cap.flags & V4L2_FLAG_STREAMING)
+ if (h->cap.capabilities & V4L2_CAP_STREAMING)
v4l2_stop_streaming(h);
}
@@ -1182,7 +1187,7 @@ v4l2_nextframe(void *handle)
struct ng_video_buf *buf = NULL;
int rc,size,frame = 0;
- if (h->cap.flags & V4L2_FLAG_STREAMING) {
+ if (h->cap.capabilities & V4L2_CAP_STREAMING) {
v4l2_queue_all(h);
frame = v4l2_waiton(h);
if (-1 == frame)
@@ -1190,7 +1195,7 @@ v4l2_nextframe(void *handle)
h->buf_me[frame].refcount++;
buf = &h->buf_me[frame];
memset(&buf->info,0,sizeof(buf->info));
- buf->info.ts = h->buf_v4l2[frame].timestamp;
+ buf->info.ts = ng_tofday_to_timestamp(&h->buf_v4l2[frame].timestamp);
} else {
size = h->fmt_me.bytesperline * h->fmt_me.height;
buf = ng_malloc_video_buf(&h->fmt_me,size);
@@ -1227,7 +1232,7 @@ v4l2_getimage(void *handle)
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 (h->cap.capabilities & V4L2_CAP_READWRITE) {
rc = read(h->fd,buf->data,size);
if (rc != size) {
if (-1 == rc) {
diff --git a/libng/plugins/flt-disor.c b/libng/plugins/flt-disor.c
index 9a5d22a..30ad723 100644
--- a/libng/plugins/flt-disor.c
+++ b/libng/plugins/flt-disor.c
@@ -92,11 +92,18 @@ frame(void *handle, struct ng_video_buf *in)
continue;
switch (in->fmt.fmtid) {
+ case VIDEO_RGB15_LE:
+ case VIDEO_RGB16_LE:
+ case VIDEO_RGB15_BE:
+ case VIDEO_RGB16_BE:
+ dst16[i] = src16[dj*in->fmt.width + di];
+ break;
case VIDEO_BGR24:
case VIDEO_RGB24:
dst8[3*i ] = src8[3*(dj*in->fmt.width + di) ];
dst8[3*i+1] = src8[3*(dj*in->fmt.width + di)+1];
- dst8[3*i+2] = src8[3*(dj*in->fmt.width + di)+2];
+ dst8[3*i+2] = src8[3*(dj*in->fmt.width + di)+2];
+ break;
}
}
dst8 += out->fmt.bytesperline;
@@ -156,7 +163,7 @@ static struct ng_attribute attrs[] = {
type: ATTR_TYPE_INTEGER,
defval: 700,
min: 1,
- max: 1000,
+ max: 2000,
read: read_attr,
write: write_attr,
},{
@@ -195,6 +202,10 @@ static struct ng_filter filter = {
name: "disortion correction",
attrs: attrs,
fmts:
+ (1 << VIDEO_RGB15_BE) |
+ (1 << VIDEO_RGB16_BE) |
+ (1 << VIDEO_RGB15_LE) |
+ (1 << VIDEO_RGB16_LE) |
(1 << VIDEO_BGR24) |
(1 << VIDEO_RGB24),
init: init,
diff --git a/libng/plugins/read-avi.c b/libng/plugins/read-avi.c
index 34641b0..139d234 100644
--- a/libng/plugins/read-avi.c
+++ b/libng/plugins/read-avi.c
@@ -222,7 +222,7 @@ static uint32_t avi_find_chunk(struct avi_handle *h, uint32_t id, off_t *pos)
/* ----------------------------------------------------------------------- */
-static void* avi_open(char *moviename, int *vfmt, int vn)
+static void* avi_open(char *moviename)
{
struct avi_handle *h;
off_t pos, size;
@@ -303,11 +303,11 @@ static void* avi_open(char *moviename, int *vfmt, int vn)
return NULL;
}
-static struct ng_video_fmt* avi_vfmt(void *handle)
+static struct ng_video_fmt* avi_vfmt(void *handle, int *vfmt, int vn)
{
struct avi_handle *h = handle;
- return VIDEO_NONE != h->vfmt.fmtid ? &h->vfmt : NULL;
+ return &h->vfmt;
}
static struct ng_audio_fmt* avi_afmt(void *handle)
diff --git a/libng/plugins/read-dv.c b/libng/plugins/read-dv.c
new file mode 100644
index 0000000..ff5fd87
--- /dev/null
+++ b/libng/plugins/read-dv.c
@@ -0,0 +1,325 @@
+#include "config.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#include <libdv/dv.h>
+
+#include "grab-ng.h"
+
+/* ----------------------------------------------------------------------- */
+
+struct dv_handle {
+ /* handles */
+ int fd;
+ dv_decoder_t *dec;
+
+ /* mmap()ed data */
+ unsigned char *map_start;
+ unsigned char *map_ptr;
+ off_t map_size;
+ int map_frame;
+
+ /* format */
+ struct ng_video_fmt vfmt;
+ struct ng_audio_fmt afmt;
+
+ /* misc video */
+ int rate,vframe,frames;
+
+ /* misc audio */
+ int aframe,samples;
+ int16_t *audiobuf[4];
+};
+
+/* ----------------------------------------------------------------------- */
+
+static enum color_space_e fmtid_to_colorspace[VIDEO_FMT_COUNT] = {
+ [ 0 ... VIDEO_FMT_COUNT-1 ] = -1,
+ [ VIDEO_YUV422 ] = e_dv_color_yuv,
+ [ VIDEO_RGB24 ] = e_dv_color_rgb,
+ [ VIDEO_BGR32 ] = e_dv_color_bgr0,
+};
+
+/* ----------------------------------------------------------------------- */
+
+static void dv_unmap(struct dv_handle *h)
+{
+ if (!h->map_ptr)
+ return;
+ munmap(h->map_start,h->map_size);
+ h->map_ptr = NULL;
+}
+
+static void dv_map(struct dv_handle *h, int frame)
+{
+ off_t map_offset;
+ off_t pgsize, size, offset;
+
+ size = h->dec->frame_size;
+ if (0 == size)
+ size = 120000; /* NTSC frame size */
+ offset = frame * size;
+
+ pgsize = getpagesize();
+ map_offset = offset & ~(pgsize-1);
+ h->map_size = offset - map_offset + size;
+ h->map_start = mmap(0, h->map_size, PROT_READ, MAP_SHARED,
+ h->fd, map_offset);
+ if (MAP_FAILED == h->map_start) {
+ perror("mmap");
+ exit(1);
+ }
+ h->map_ptr = h->map_start + (offset - map_offset);
+}
+
+static void dv_fmt(struct dv_handle *h, int *vfmt, int vn)
+{
+ off_t len;
+ int i;
+
+ /* video format */
+ for (i = 0; i < vn; i++) {
+ if (ng_debug)
+ fprintf(stderr,"dv: trying: %d [%s]\n",
+ vfmt[i],ng_vfmt_to_desc[vfmt[i]]);
+ if (-1 == fmtid_to_colorspace[vfmt[i]])
+ continue;
+ h->vfmt.fmtid = vfmt[i];
+ break;
+ }
+ h->vfmt.width = h->dec->width;
+ h->vfmt.height = h->dec->height;
+ h->vfmt.bytesperline = (h->vfmt.width*ng_vfmt_to_depth[h->vfmt.fmtid]) >> 3;
+ h->rate = (e_dv_system_625_50 == h->dec->system) ? 25 : 30;
+
+ /* audio fmt */
+ if (1 == h->dec->audio->num_channels ||
+ 2 == h->dec->audio->num_channels) {
+ h->afmt.fmtid = (16 == h->dec->audio->quantization) ?
+ AUDIO_S16_NATIVE_MONO : AUDIO_U8_MONO;
+ if (2 == h->dec->audio->num_channels)
+ h->afmt.fmtid++;
+ }
+ h->afmt.rate = h->dec->audio->frequency;
+
+ /* movie length (# of frames) */
+ len = lseek(h->fd,0,SEEK_END);
+ h->frames = len / h->dec->frame_size;
+
+ if (ng_debug) {
+ fprintf(stderr,"dv: len=%lld => %d frames [%lld]\n",len,h->frames,
+ len - (off_t)h->frames * h->dec->frame_size);
+ fprintf(stderr,
+ "dv: quality=%d system=%d std=%d sampling=%d num_dif_seqs=%d\n"
+ "dv: height=%d width=%d frame_size=%d\n",
+ h->dec->quality, h->dec->system, h->dec->std,
+ h->dec->sampling, h->dec->num_dif_seqs, h->dec->height,
+ h->dec->width, h->dec->frame_size);
+ fprintf(stderr, "dv: audio: %d Hz, %d bits, %d channels,"
+ " emphasis %s\n",
+ h->dec->audio->frequency,
+ h->dec->audio->quantization,
+ h->dec->audio->num_channels,
+ (h->dec->audio->emphasis ? "on" : "off"));
+ }
+}
+
+/* ----------------------------------------------------------------------- */
+
+static void* dv_open(char *moviename)
+{
+ struct dv_handle *h;
+
+ if (NULL == (h = malloc(sizeof(*h))))
+ goto oops;
+ memset(h,0,sizeof(*h));
+ h->map_frame = -1;
+
+ if (-1 == (h->fd = open(moviename,O_RDONLY))) {
+ fprintf(stderr,"dv: open %s: %s\n",moviename,strerror(errno));
+ goto oops;
+ }
+ if (NULL == (h->dec = dv_decoder_new(0,0,0))) {
+ fprintf(stderr,"dv: dv_decoder_new failed\n");
+ goto oops;
+ }
+ h->dec->quality = 3;
+
+ dv_map(h, 0);
+ if (dv_parse_header(h->dec, h->map_ptr) < 0) {
+ fprintf(stderr,"dv: dv_parse_header failed\n");
+ goto oops;
+ }
+ dv_fmt(h,NULL,0);
+
+ return h;
+
+ oops:
+ if (h->dec)
+ dv_decoder_free(h->dec);
+ if (-1 != h->fd)
+ close(h->fd);
+ if (h)
+ free(h);
+ return NULL;
+}
+
+static struct ng_video_fmt* dv_vfmt(void *handle, int *vfmt, int vn)
+{
+ struct dv_handle *h = handle;
+
+ dv_fmt(h,vfmt,vn);
+ return &h->vfmt;
+}
+
+static struct ng_audio_fmt* dv_afmt(void *handle)
+{
+ struct dv_handle *h = handle;
+
+ return h->afmt.fmtid ? &h->afmt : NULL;
+}
+
+static struct ng_video_buf* dv_vdata(void *handle, int drop)
+{
+ struct dv_handle *h = handle;
+ struct ng_video_buf *buf;
+ unsigned char *pixels[3];
+ int pitches[3];
+
+ h->vframe += drop;
+ if (h->vframe >= h->frames)
+ return NULL;
+ if (ng_debug > 1)
+ fprintf(stderr,"dv: frame %d [drop=%d]\n",h->vframe,drop);
+
+ dv_unmap(h); dv_map(h, h->vframe);
+ if (dv_parse_header(h->dec, h->map_ptr) < 0) {
+ fprintf(stderr,"dv: dv_parse_header failed\n");
+ return NULL;
+ }
+
+ buf = ng_malloc_video_buf(&h->vfmt,h->vfmt.bytesperline*h->vfmt.height);
+ switch (h->vfmt.fmtid) {
+ case VIDEO_YUV422:
+ pixels[0] = buf->data;
+ pitches[0] = buf->fmt.width*2;
+ break;
+ case VIDEO_RGB24:
+ pixels[0] = buf->data;
+ pitches[0] = buf->fmt.width*3;
+ break;
+ case VIDEO_BGR32:
+ pixels[0] = buf->data;
+ pitches[0] = buf->fmt.width*4;
+ break;
+ default:
+ BUG_ON(1,"unknown fmtid");
+ }
+
+ dv_parse_packs(h->dec, h->map_ptr);
+ dv_decode_full_frame(h->dec, h->map_ptr,
+ fmtid_to_colorspace[h->vfmt.fmtid],
+ pixels, pitches);
+ buf->info.seq = h->vframe;
+ buf->info.ts = (long long) buf->info.seq * 1000000000 / h->rate;
+ h->vframe++;
+ return buf;
+}
+
+static struct ng_audio_buf* dv_adata(void *handle)
+{
+ struct dv_handle *h = handle;
+ struct ng_audio_buf *buf;
+ int16_t *dest;
+ int asize, i;
+
+ if (h->aframe >= h->frames)
+ return NULL;
+
+ dv_unmap(h); dv_map(h, h->aframe);
+ if (dv_parse_header(h->dec, h->map_ptr) < 0) {
+ fprintf(stderr,"dv: dv_parse_header failed\n");
+ return NULL;
+ }
+
+ asize = h->dec->audio->samples_this_frame *
+ h->dec->audio->num_channels *
+ h->dec->audio->quantization >> 3;
+ if (ng_debug > 1)
+ fprintf(stderr,"dv: audio %d [samples=%d]\n",h->aframe,
+ h->dec->audio->samples_this_frame);
+
+ buf = ng_malloc_audio_buf(&h->afmt, asize);
+ dest = (int16_t*)buf->data;
+ if (2 == h->dec->audio->num_channels) {
+ if (NULL == h->audiobuf[0])
+ for (i = 0; i < 4; i++)
+ h->audiobuf[i] = malloc(DV_AUDIO_MAX_SAMPLES*sizeof(int16_t));
+ dv_decode_full_audio(h->dec, h->map_ptr, h->audiobuf);
+ for (i = 0; i < h->dec->audio->samples_this_frame; i++) {
+ dest[2*i+0] = h->audiobuf[0][i];
+ dest[2*i+1] = h->audiobuf[1][i];
+ }
+ }
+ if (1 == h->dec->audio->num_channels)
+ dv_decode_full_audio(h->dec, h->map_ptr, &dest);
+
+ buf->info.ts = (long long) h->samples * 1000000000 / h->afmt.rate;
+ h->samples += h->dec->audio->samples_this_frame;
+ h->aframe++;
+ return buf;
+}
+
+static long long dv_frame_time(void *handle)
+{
+ struct dv_handle *h = handle;
+
+ return 1000000000 / h->rate;
+}
+
+static int dv_close(void *handle)
+{
+ struct dv_handle *h = handle;
+ int i;
+
+ for (i = 0; i < 4; i++)
+ if (h->audiobuf[i])
+ free(h->audiobuf[i]);
+ dv_unmap(h);
+ dv_decoder_free(h->dec);
+ close(h->fd);
+ free(h);
+ return 0;
+}
+
+/* ----------------------------------------------------------------------- */
+
+struct ng_reader dv_reader = {
+ name: "dv",
+ desc: "Digital Video",
+
+ magic: { "\x1f\x07\x00", "\x3f\x07\x00" },
+ moff: { 0, 0x50 },
+ mlen: { 3, 3 },
+
+ rd_open: dv_open,
+ rd_vfmt: dv_vfmt,
+ rd_afmt: dv_afmt,
+ rd_vdata: dv_vdata,
+ rd_adata: dv_adata,
+ frame_time: dv_frame_time,
+ rd_close: dv_close,
+};
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_reader_register(NG_PLUGIN_MAGIC,__FILE__,&dv_reader);
+}
diff --git a/libng/plugins/read-qt.c b/libng/plugins/read-qt.c
index 244f9f6..66c0e2b 100644
--- a/libng/plugins/read-qt.c
+++ b/libng/plugins/read-qt.c
@@ -41,7 +41,7 @@ struct qt_handle {
long long bps;
};
-static void* qt_open(char *moviename, int *vfmt, int vn)
+static void* qt_open(char *moviename)
{
struct qt_handle *h;
char *str;
@@ -119,21 +119,8 @@ static void* qt_open(char *moviename, int *vfmt, int vn)
if (ng_debug)
fprintf(stderr,"qt: unsupported video codec\n");
} else {
- for (i = 0; i < vn; i++) {
- if (ng_debug)
- fprintf(stderr,"qt: trying: %d [%s]\n",
- vfmt[i],ng_vfmt_to_desc[vfmt[i]]);
- if (0 == fmtid_to_cmodel[vfmt[i]])
- continue;
- if (!quicktime_reads_cmodel(h->qt,fmtid_to_cmodel[vfmt[i]],0))
- continue;
- quicktime_set_cmodel(h->qt, fmtid_to_cmodel[vfmt[i]]);
- h->vfmt.fmtid = vfmt[i];
- break;
- }
h->vfmt.width = quicktime_video_width(h->qt,0);
h->vfmt.height = quicktime_video_height(h->qt,0);
- h->vfmt.bytesperline = (h->vfmt.width*ng_vfmt_to_depth[h->vfmt.fmtid]) >> 3;
h->rate = quicktime_frame_rate(h->qt,0);
}
@@ -154,11 +141,25 @@ static void* qt_open(char *moviename, int *vfmt, int vn)
return h;
}
-static struct ng_video_fmt* qt_vfmt(void *handle)
+static struct ng_video_fmt* qt_vfmt(void *handle, int *vfmt, int vn)
{
struct qt_handle *h = handle;
+ int i;
- return h->vfmt.fmtid ? &h->vfmt : NULL;
+ for (i = 0; i < vn; i++) {
+ if (ng_debug)
+ fprintf(stderr,"qt: trying: %d [%s]\n",
+ vfmt[i],ng_vfmt_to_desc[vfmt[i]]);
+ if (0 == fmtid_to_cmodel[vfmt[i]])
+ continue;
+ if (!quicktime_reads_cmodel(h->qt,fmtid_to_cmodel[vfmt[i]],0))
+ continue;
+ quicktime_set_cmodel(h->qt, fmtid_to_cmodel[vfmt[i]]);
+ h->vfmt.fmtid = vfmt[i];
+ break;
+ }
+ h->vfmt.bytesperline = (h->vfmt.width*ng_vfmt_to_depth[h->vfmt.fmtid]) >> 3;
+ return &h->vfmt;
}
static struct ng_audio_fmt* qt_afmt(void *handle)
@@ -196,9 +197,7 @@ static struct ng_video_buf* qt_vdata(void *handle, int drop)
h->rows[2] = buf->data + h->vfmt.width*h->vfmt.height*5/4;
break;
default:
- fprintf(stderr,"internal error at %s:%d\n",
- __FILE__,__LINE__);
- exit(1);
+ BUG_ON(1,"unknown cmodel");
}
/* drop frames */
diff --git a/libng/plugins/snd-oss.c b/libng/plugins/snd-oss.c
index 78b187a..1c626c6 100644
--- a/libng/plugins/snd-oss.c
+++ b/libng/plugins/snd-oss.c
@@ -532,8 +532,11 @@ oss_latency(void *handle)
if (-1 == ioctl(h->fd, SNDCTL_DSP_GETOSPACE, &info))
return 0;
bytes = info.fragsize * info.fragstotal;
- samples = bytes * 8 / ng_afmt_to_bits[h->ifmt.fmtid] * h->channels;
+ samples = bytes * 8 / ng_afmt_to_bits[h->ifmt.fmtid] / h->channels;
latency = (long long)samples * 1000000000 / h->rate;
+ if (ng_debug)
+ fprintf(stderr,"oss: bytes: %d / samples: %d => latency: %lld\n",
+ bytes,samples,latency);
return latency;
}
diff --git a/libng/plugins/write-dv.c b/libng/plugins/write-dv.c
new file mode 100644
index 0000000..b7936f0
--- /dev/null
+++ b/libng/plugins/write-dv.c
@@ -0,0 +1,226 @@
+#include "config.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <pthread.h>
+
+#include <libdv/dv.h>
+
+#include "grab-ng.h"
+#include "list.h"
+
+/* ----------------------------------------------------------------------- */
+
+struct dv_frame {
+ struct list_head list;
+ int seq;
+ int video,audio;
+ unsigned char obuf[];
+};
+
+struct dv_handle {
+ /* handles */
+ int fd;
+ dv_encoder_t *enc;
+
+ /* format */
+ struct ng_video_fmt video;
+ struct ng_audio_fmt audio;
+
+ /* misc */
+ int framesize, fvideo, faudio;
+ struct list_head frames;
+};
+
+/* ----------------------------------------------------------------------- */
+
+static struct dv_frame*
+dv_get_frame(struct dv_handle *h, int nr)
+{
+ struct dv_frame *frame = NULL;
+ struct list_head *item;
+
+ list_for_each(item,&h->frames) {
+ frame = list_entry(item,struct dv_frame,list);
+ if (frame->seq == nr)
+ break;
+ }
+ if (NULL == frame || frame->seq != nr) {
+ frame = malloc(sizeof(*frame) + h->framesize);
+ memset(frame,0,sizeof(*frame) + h->framesize);
+ frame->seq = nr;
+ list_add_tail(&frame->list,&h->frames);
+ }
+ return frame;
+}
+
+static int dv_put_frame(struct dv_handle *h, struct dv_frame *frame)
+{
+ int rc;
+
+ if (h->video.fmtid && !frame->video)
+ return 0;
+ if (h->audio.fmtid && !frame->audio)
+ return 0;
+
+ if (ng_debug)
+ fprintf(stderr,"dv: write frame #%d\n",frame->seq);
+ rc = write(h->fd, frame->obuf, h->framesize);
+ list_del(&frame->list);
+ free(frame);
+ return (rc == h->framesize) ? 0 : -1;
+}
+
+/* ----------------------------------------------------------------------- */
+
+static void*
+dv_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)
+{
+ struct dv_handle *h;
+
+ if (NULL == (h = malloc(sizeof(*h))))
+ return NULL;
+
+ memset(h,0,sizeof(*h));
+ h->video = *video;
+ h->audio = *audio;
+
+ if (-1 == (h->fd = open(filename,O_CREAT | O_RDWR | O_TRUNC, 0666))) {
+ fprintf(stderr,"open %s: %s\n",filename,strerror(errno));
+ goto fail;
+ }
+ h->enc = dv_encoder_new(0,0,0);
+ if (NULL == h->enc) {
+ fprintf(stderr,"dv: dv_encoder_new failed\n");
+ goto fail;
+ }
+
+ if (h->audio.fmtid != AUDIO_NONE) {
+ }
+ if (h->video.fmtid != VIDEO_NONE) {
+ if (720 == h->video.width &&
+ 480 == h->video.height &&
+ 30000 == fps) {
+ /* NTSC */
+ h->enc->isPAL = 0;
+ h->framesize = 120000;
+ } else if (720 == h->video.width &&
+ 576 == h->video.height &&
+ 25000 == fps) {
+ /* PAL */
+ h->enc->isPAL = 1;
+ h->framesize = 144000;
+ } else {
+ fprintf(stderr,
+ "dv: %dx%d @ %d fps is not allowed for digital video\n"
+ "dv: use 720x480/30 (NTSC) or 720x576/25 (PAL)\n",
+ h->video.width, h->video.height, fps/1000);
+ goto fail;
+ }
+ }
+ INIT_LIST_HEAD(&h->frames);
+ return h;
+
+ fail:
+ if (h->enc)
+ dv_encoder_free(h->enc);
+ if (-1 != h->fd)
+ close(h->fd);
+ free(h);
+ return NULL;
+}
+
+static int
+dv_video(void *handle, struct ng_video_buf *buf)
+{
+ struct dv_handle *h = handle;
+ struct dv_frame *frame;
+ unsigned char *pixels[3];
+
+ frame = dv_get_frame(h,h->fvideo);
+ pixels[0] = buf->data;
+ switch (buf->fmt.fmtid) {
+ case VIDEO_YUV422:
+ dv_encode_full_frame(h->enc,pixels,e_dv_color_yuv,frame->obuf);
+ break;
+ case VIDEO_RGB24:
+ dv_encode_full_frame(h->enc,pixels,e_dv_color_rgb,frame->obuf);
+ break;
+ case VIDEO_BGR32:
+ dv_encode_full_frame(h->enc,pixels,e_dv_color_bgr0,frame->obuf);
+ break;
+ default:
+ BUG_ON(1,"unknown fmtid");
+ }
+ frame->video = 1;
+ dv_put_frame(h,frame);
+ h->fvideo++;
+ return 0;
+}
+
+static int
+dv_audio(void *handle, struct ng_audio_buf *buf)
+{
+ //struct dv_handle *h = handle;
+ //struct dv_frame *frame;
+
+ return -1;
+}
+
+static int
+dv_close(void *handle)
+{
+ struct dv_handle *h = handle;
+
+ dv_encoder_free(h->enc);
+ close(h->fd);
+ free(h);
+ return 0;
+}
+
+/* ----------------------------------------------------------------------- */
+
+static const struct ng_format_list dv_vformats[] = {
+ {
+ name: "dv",
+ ext: "dv",
+ desc: "digital video",
+ fmtid: VIDEO_YUV422,
+ },{
+ /* EOF */
+ }
+};
+
+static const struct ng_format_list dv_aformats[] = {
+ {
+ name: "stereo16",
+ ext: "dv",
+ fmtid: AUDIO_S16_NATIVE_STEREO,
+ },{
+ /* EOF */
+ }
+};
+
+struct ng_writer dv_writer = {
+ name: "dv",
+ desc: "Digital Video",
+ //combined: 1,
+ video: dv_vformats,
+ //audio: dv_aformats,
+ wr_open: dv_open,
+ wr_video: dv_video,
+ wr_audio: dv_audio,
+ wr_close: dv_close,
+};
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_writer_register(NG_PLUGIN_MAGIC,__FILE__,&dv_writer);
+}
diff --git a/libng/videodev2-old.h b/libng/videodev2-old.h
new file mode 100644
index 0000000..a40b207
--- /dev/null
+++ b/libng/videodev2-old.h
@@ -0,0 +1,918 @@
+#ifndef __LINUX_VIDEODEV2_H
+#define __LINUX_VIDEODEV2_H
+/*
+ * Video for Linux Two
+ *
+ * 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.
+ */
+
+#define V4L2_MAJOR_VERSION 0
+#define V4L2_MINOR_VERSION 20
+
+
+/*
+ * M I S C E L L A N E O U S
+ */
+
+/* Four-character-code (FOURCC) */
+#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, in nanoseconds */
+#ifndef STAMP_T
+#define STAMP_T
+typedef __s64 stamp_t;
+#endif
+
+/*
+ * D R I V E R C A P A B I L I T I E S
+ */
+struct v4l2_capability
+{
+ char name[32]; /* Descriptive, and unique */
+ int type; /* Device type, see below */
+ int inputs; /* Num video inputs */
+ int outputs; /* Num video outputs */
+ int audios; /* Num audio devices */
+ int maxwidth;
+ int maxheight;
+ int minwidth;
+ int minheight;
+ int maxframerate;
+ __u32 flags; /* Feature flags, see below */
+ __u32 reserved[4];
+};
+/* Values for 'type' field */
+#define V4L2_TYPE_CAPTURE 0 /* Is a video capture device */
+#define V4L2_TYPE_CODEC 1 /* Is a CODEC device */
+#define V4L2_TYPE_OUTPUT 2 /* Is a video output device */
+#define V4L2_TYPE_FX 3 /* Is a video effects device */
+#define V4L2_TYPE_VBI 4 /* Is a VBI capture device */
+#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 */
+#define V4L2_FLAG_WRITE 0x00002 /* Can accept data via write() */
+#define V4L2_FLAG_STREAMING 0x00004 /* Can capture streaming video */
+#define V4L2_FLAG_PREVIEW 0x00008 /* Can do automatic preview */
+#define V4L2_FLAG_SELECT 0x00010 /* Supports the select() call */
+#define V4L2_FLAG_TUNER 0x00020 /* Can tune */
+#define V4L2_FLAG_MONOCHROME 0x00040 /* Monochrome only */
+#define V4L2_FLAG_DATA_SERVICE 0x00080 /* Has a related data service dev. */
+
+
+/*
+ * V I D E O I M A G E F O R M A T
+ */
+struct v4l2_pix_format
+{
+ __u32 width;
+ __u32 height;
+ __u32 depth;
+ __u32 pixelformat;
+ __u32 flags;
+ __u32 bytesperline; /* only used when there are pad bytes */
+ __u32 sizeimage;
+ __u32 priv; /* private data, depends on pixelformat */
+};
+/* Pixel format FOURCC depth Description */
+#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_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
+#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
+
+/* two planes -- one Y, one Cr + Cb interleaved */
+#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */
+#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */
+
+/* The following formats are not defined in the V4L2 specification */
+#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. */
+/* SWCONVERSION indicates the format is not natively supported by the */
+/* driver and the driver uses software conversion to support it */
+
+
+/*
+ * F O R M A T E N U M E R A T I O N
+ */
+struct v4l2_fmtdesc
+{
+ int index; /* Format number */
+ char description[32]; /* Description string */
+ __u32 pixelformat; /* Format fourcc */
+ __u32 flags; /* Format flags */
+ __u32 depth; /* Bits per pixel */
+ __u32 reserved[2];
+};
+
+struct v4l2_cvtdesc
+{
+ int index;
+ struct
+ {
+ __u32 pixelformat;
+ __u32 flags;
+ __u32 depth;
+ __u32 reserved[2];
+ } in, out;
+};
+
+struct v4l2_fxdesc
+{
+ int index;
+ char name[32];
+ __u32 flags;
+ __u32 inputs;
+ __u32 controls;
+ __u32 reserved[2];
+};
+
+
+/*
+ * T I M E C O D E
+ */
+struct v4l2_timecode
+{
+ __u8 frames;
+ __u8 seconds;
+ __u8 minutes;
+ __u8 hours;
+ __u8 userbits[4];
+ __u32 flags;
+ __u32 type;
+};
+/* Type */
+#define V4L2_TC_TYPE_24FPS 1
+#define V4L2_TC_TYPE_25FPS 2
+#define V4L2_TC_TYPE_30FPS 3
+#define V4L2_TC_TYPE_50FPS 4
+#define V4L2_TC_TYPE_60FPS 5
+
+
+/* Flags */
+#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
+#define V4L2_TC_FLAG_COLORFRAME 0x0002
+#define V4L2_TC_USERBITS_field 0x000C
+#define V4L2_TC_USERBITS_USERDEFINED 0x0000
+#define V4L2_TC_USERBITS_8BITCHARS 0x0008
+/* The above is based on SMPTE timecodes */
+
+
+/*
+ * C O M P R E S S I O N P A R A M E T E R S
+ */
+struct v4l2_compression
+{
+ int quality;
+ int keyframerate;
+ int pframerate;
+ __u32 reserved[5];
+};
+
+
+/*
+ * M E M O R Y - M A P P I N G B U F F E R S
+ */
+struct v4l2_requestbuffers
+{
+ int count;
+ __u32 type;
+ __u32 reserved[2];
+};
+struct v4l2_buffer
+{
+ int index;
+ __u32 type;
+ __u32 offset;
+ __u32 length;
+ __u32 bytesused;
+ __u32 flags;
+ stamp_t timestamp;
+ struct v4l2_timecode timecode;
+ __u32 sequence;
+ __u32 reserved[3];
+};
+/* Buffer type codes and flags for 'type' field */
+#define V4L2_BUF_TYPE_field 0x00001FFF /* Type field mask */
+#define V4L2_BUF_TYPE_CAPTURE 0x00000001
+#define V4L2_BUF_TYPE_CODECIN 0x00000002
+#define V4L2_BUF_TYPE_CODECOUT 0x00000003
+#define V4L2_BUF_TYPE_EFFECTSIN 0x00000004
+#define V4L2_BUF_TYPE_EFFECTSIN2 0x00000005
+#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
+
+#define V4L2_BUF_ATTR_DEVICEMEM 0x00010000 /* Buffer is on device (flag) */
+
+/* Flags used only in VIDIOC_REQBUFS */
+#define V4L2_BUF_REQ_field 0xF0000000
+#define V4L2_BUF_REQ_CONTIG 0x10000000 /* Map all buffers in one
+ contiguous mmap(). This flag
+ only used in VIDIOC_REQBUFS */
+
+/* Flags for 'flags' field */
+#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
+#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
+#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
+#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
+#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
+#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
+#define V4L2_BUF_FLAG_TOPFIELD 0x0040 /* Image is a top field only */
+#define V4L2_BUF_FLAG_BOTFIELD 0x0080 /* Image is a bottom field only */
+#define V4L2_BUF_FLAG_ODDFIELD V4L2_BUF_FLAG_TOPFIELD
+#define V4L2_BUF_FLAG_EVENFIELD V4L2_BUF_FLAG_BOTFIELD
+#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
+
+/*
+ * O V E R L A Y P R E V I E W
+ */
+struct v4l2_framebuffer
+{
+ __u32 capability;
+ __u32 flags;
+ void *base[3];
+ struct v4l2_pix_format fmt;
+};
+/* Flags for the 'capability' field. Read only */
+#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
+#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
+#define V4L2_FBUF_CAP_CLIPPING 0x0004
+#define V4L2_FBUF_CAP_SCALEUP 0x0008
+#define V4L2_FBUF_CAP_SCALEDOWN 0x0010
+#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0020
+/* Flags for the 'flags' field. */
+#define V4L2_FBUF_FLAG_PRIMARY 0x0001
+#define V4L2_FBUF_FLAG_OVERLAY 0x0002
+#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
+
+struct v4l2_clip
+{
+ int x;
+ int y;
+ int width;
+ int height;
+ struct v4l2_clip *next;
+};
+struct v4l2_window
+{
+ int x;
+ int y;
+ int width;
+ int height;
+ __u32 chromakey;
+ struct v4l2_clip *clips;
+ int clipcount;
+ void *bitmap;
+};
+
+
+/*
+ * D E V I C E P E R F O R M A N C E
+ */
+struct v4l2_performance
+{
+ int frames;
+ int framesdropped;
+ __u64 bytesin;
+ __u64 bytesout;
+ __u32 reserved[4];
+};
+
+/*
+ * C A P T U R E P A R A M E T E R S
+ */
+struct v4l2_captureparm
+{
+ __u32 capability; /* Supported modes */
+ __u32 capturemode; /* Current mode */
+ unsigned long timeperframe; /* Time per frame in .1us units */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 reserved[4];
+};
+/* Flags for 'capability' and 'capturemode' fields */
+#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
+//#define V4L2_MODE_VFLIP 0x0002 /* Flip image vertically */
+//#define V4L2_MODE_HFLIP 0x0004 /* Flip image horizontally */
+#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
+
+struct v4l2_outputparm
+{
+ __u32 capability; /* Supported modes */
+ __u32 outputmode; /* Current mode */
+ unsigned long timeperframe; /* Time per frame in .1us units */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 reserved[4];
+};
+
+/*
+ * I N P U T I M A G E C R O P P I N G
+ */
+struct v4l2_cropcap
+{
+ __u32 capability;
+ int min_x;
+ int min_y;
+ int max_x;
+ int max_y;
+ int default_left;
+ int default_top;
+ int default_right;
+ int default_bottom;
+ __u32 reserved[2];
+};
+struct v4l2_crop
+{
+ int left;
+ int top;
+ int right;
+ int bottom;
+ __u32 reserved;
+};
+
+/*
+ * D I G I T A L Z O O M
+ */
+struct v4l2_zoomcap
+{
+ __u32 capability;
+ __u32 maxwidth;
+ __u32 maxheight;
+ __u32 minwidth;
+ __u32 minheight;
+ __u32 reserved[2];
+};
+/* Flags for the capability field */
+#define V4L2_ZOOM_NONCAP 0x0001
+#define V4L2_ZOOM_WHILESTREAMING 0x0002
+
+struct v4l2_zoom
+{
+ __u32 x;
+ __u32 y;
+ __u32 width;
+ __u32 height;
+ __u32 reserved;
+};
+
+
+/*
+ * A N A L O G V I D E O S T A N D A R D
+ */
+struct v4l2_standard
+{
+ __u8 name[24];
+ struct {
+ __u32 numerator;
+ __u32 denominator; /* >= 1 */
+ } framerate; /* Frames, not fields */
+ __u32 framelines;
+ __u32 reserved1;
+ __u32 colorstandard;
+ union {
+ struct {
+ __u32 colorsubcarrier; /* Hz */
+ } pal;
+ struct {
+ __u32 colorsubcarrier; /* Hz */
+ } ntsc;
+ struct {
+ __u32 f0b; /* Hz (blue) */
+ __u32 f0r; /* Hz (red) */
+ } secam;
+ __u8 reserved[12];
+ } colorstandard_data;
+ __u32 transmission; /* Bit field. Must be zero for
+ non-modulators/demodulators. */
+ __u32 reserved2; /* Must be set to zero */
+};
+
+/* Values for the 'colorstandard' field */
+#define V4L2_COLOR_STD_PAL 1
+#define V4L2_COLOR_STD_NTSC 2
+#define V4L2_COLOR_STD_SECAM 3
+
+/* Values for the color subcarrier fields */
+#define V4L2_COLOR_SUBC_PAL 4433619 /* PAL BGHI, NTSC-44 */
+#define V4L2_COLOR_SUBC_PAL_M 3575611 /* PAL M (Brazil) */
+#define V4L2_COLOR_SUBC_PAL_N 3582056 /* PAL N */
+#define V4L2_COLOR_SUBC_NTSC 3579545 /* NTSC M, NTSC-Japan */
+#define V4L2_COLOR_SUBC_SECAMB 4250000 /* SECAM B - Y carrier */
+#define V4L2_COLOR_SUBC_SECAMR 4406250 /* SECAM R - Y carrier */
+
+/* Flags for the 'transmission' field */
+#define V4L2_TRANSM_STD_B (1<<1)
+#define V4L2_TRANSM_STD_D (1<<3)
+#define V4L2_TRANSM_STD_G (1<<6)
+#define V4L2_TRANSM_STD_H (1<<7)
+#define V4L2_TRANSM_STD_I (1<<8)
+#define V4L2_TRANSM_STD_K (1<<10)
+#define V4L2_TRANSM_STD_K1 (1<<11)
+#define V4L2_TRANSM_STD_L (1<<12)
+#define V4L2_TRANSM_STD_M (1<<13)
+#define V4L2_TRANSM_STD_N (1<<14)
+
+
+/* Used in the VIDIOC_ENUMSTD ioctl for querying supported standards */
+struct v4l2_enumstd
+{
+ int index;
+ struct v4l2_standard std;
+ __u32 inputs; /* set of inputs that */
+ /* support this standard */
+ __u32 outputs; /* set of outputs that */
+ /* support this standard */
+ __u32 reserved[2];
+};
+
+
+/*
+ * V I D E O I N P U T S
+ */
+struct v4l2_input
+{
+ int index; /* Which input */
+ char name[32]; /* Label */
+ int type; /* Type of input */
+ __u32 capability; /* Capability flags */
+ int assoc_audio; /* Associated audio input */
+ __u32 reserved[4];
+};
+/* Values for the 'type' field */
+#define V4L2_INPUT_TYPE_TUNER 1
+#define V4L2_INPUT_TYPE_CAMERA 2
+
+/* Flags for the 'capability' field */
+#define V4L2_INPUT_CAP_AUDIO 0x0001 /* assoc_audio */
+
+
+/*
+ * V I D E O O U T P U T S
+ */
+struct v4l2_output
+{
+ int index; /* Which output */
+ char name[32]; /* Label */
+ int type; /* Type of output */
+ __u32 capability; /* Capability flags */
+ int assoc_audio; /* Associated audio */
+ __u32 reserved[4];
+};
+/* Values for the 'type' field */
+#define V4L2_OUTPUT_TYPE_MODULATOR 1
+#define V4L2_OUTPUT_TYPE_ANALOG 2
+#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
+
+/* Flags for the 'capability' field */
+#define V4L2_OUTPUT_CAP_AUDIO 0x0001 /* assoc_audio */
+
+
+/*
+ * C O N T R O L S
+ */
+struct v4l2_control
+{
+ __u32 id;
+ int value;
+};
+
+/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
+struct v4l2_queryctrl
+{
+ __u32 id;
+ __u8 name[32]; /* Whatever */
+ int minimum; /* Note signedness */
+ int maximum;
+ unsigned int step;
+ int default_value;
+ __u32 type;
+ __u32 flags;
+ __u32 category; /* Automatically filled in by V4L2 */
+ __u8 group[32]; /* for pre-defined controls */
+ __u32 reserved[2];
+};
+
+/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
+struct v4l2_querymenu
+{
+ __u32 id;
+ int index;
+ __u8 name[32]; /* Whatever */
+ int reserved;
+};
+
+/* Used in V4L2_BUF_TYPE_FXCONTROL buffers */
+struct v4l2_fxcontrol
+{
+ __u32 id;
+ __u32 value;
+};
+
+/* Control types */
+#define V4L2_CTRL_TYPE_INTEGER 0
+#define V4L2_CTRL_TYPE_BOOLEAN 1
+#define V4L2_CTRL_TYPE_MENU 2
+#define V4L2_CTRL_TYPE_BUTTON 3
+
+/* Control flags */
+#define V4L2_CTRL_FLAG_DISABLED 0x0001
+#define V4L2_CTRL_FLAG_GRABBED 0x0002
+
+/* Control categories */
+#define V4L2_CTRL_CAT_VIDEO 1 /* "Video" */
+#define V4L2_CTRL_CAT_AUDIO 2 /* "Audio" */
+#define V4L2_CTRL_CAT_EFFECT 3 /* "Effect" */
+
+/* Control IDs defined by V4L2 */
+#define V4L2_CID_BASE 0x00980900
+/* IDs reserved for driver specific controls */
+#define V4L2_CID_PRIVATE_BASE 0x08000000
+/* IDs reserved for effect-specific controls on effects devices */
+#define V4L2_CID_EFFECT_BASE 0x0A00B000
+
+#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
+#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
+#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
+#define V4L2_CID_HUE (V4L2_CID_BASE+3)
+#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
+#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
+#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
+#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
+#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_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)
+#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
+#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* ? Not sure */
+#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
+#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
+#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
+#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_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */
+/* Remember to change fill_ctrl_category() in videodev.c */
+
+/*
+ * T U N I N G
+ */
+struct v4l2_tuner
+{
+ int input;
+ char name[32];
+ struct v4l2_standard std;
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 rxsubchans;
+ __u32 audmode;
+ int signal;
+ int afc;
+ __u32 reserved[4];
+};
+struct v4l2_modulator
+{
+ int output;
+ char name[32];
+ struct v4l2_standard std;
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 txsubchans;
+ __u32 reserved[4];
+};
+/* Flags for the 'capability' field */
+#define V4L2_TUNER_CAP_LOW 0x0001
+#define V4L2_TUNER_CAP_NORM 0x0002
+#define V4L2_TUNER_CAP_STEREO 0x0010
+#define V4L2_TUNER_CAP_LANG2 0x0020
+#define V4L2_TUNER_CAP_SAP 0x0020
+#define V4L2_TUNER_CAP_LANG1 0x0040
+
+/* Flags for the 'rxsubchans' field */
+#define V4L2_TUNER_SUB_MONO 0x0001
+#define V4L2_TUNER_SUB_STEREO 0x0002
+#define V4L2_TUNER_SUB_LANG2 0x0004
+#define V4L2_TUNER_SUB_SAP 0x0004
+#define V4L2_TUNER_SUB_LANG1 0x0008
+
+/* Values for the 'audmode' field */
+#define V4L2_TUNER_MODE_MONO 0x0000
+#define V4L2_TUNER_MODE_STEREO 0x0001
+#define V4L2_TUNER_MODE_LANG2 0x0002
+#define V4L2_TUNER_MODE_SAP 0x0002
+#define V4L2_TUNER_MODE_LANG1 0x0003
+
+struct v4l2_frequency
+{
+ int input;
+ __u32 frequency;
+ __u32 reserved[2];
+};
+
+/*
+ * A U D I O
+ */
+struct v4l2_audio
+{
+ int audio;
+ char name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+/* Flags for the 'capability' field */
+#define V4L2_AUDCAP_EFFECTS 0x0020
+#define V4L2_AUDCAP_LOUDNESS 0x0040
+#define V4L2_AUDCAP_AVL 0x0080
+
+/* Flags for the 'mode' field */
+#define V4L2_AUDMODE_LOUDNESS 0x00002
+#define V4L2_AUDMODE_AVL 0x00004
+#define V4L2_AUDMODE_STEREO_field 0x0FF00
+#define V4L2_AUDMODE_STEREO_LINEAR 0x00100
+#define V4L2_AUDMODE_STEREO_PSEUDO 0x00200
+#define V4L2_AUDMODE_STEREO_SPATIAL30 0x00300
+#define V4L2_AUDMODE_STEREO_SPATIAL50 0x00400
+
+struct v4l2_audioout
+{
+ int audio;
+ char name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+
+/*
+ * 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 offset;
+ __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 */
+};
+
+/* VBI sampling formats */
+#define V4L2_VBI_SF_UBYTE 1
+
+/* VBI flags */
+#define V4L2_VBI_UNSYNC (1<< 0)
+#define V4L2_VBI_INTERLACED (1<< 1)
+
+
+/*
+ * A G G R E G A T E S T R U C T U R E S
+ */
+
+/* Stream data format
+ */
+struct v4l2_format
+{
+ __u32 type;
+ union
+ {
+ struct v4l2_pix_format pix; /* image format */
+ struct v4l2_vbi_format vbi; /* VBI data */
+ /* add more */
+ __u8 raw_data[200]; /* user-defined */
+ } fmt;
+};
+
+
+/* Stream type-dependent parameters
+ */
+struct v4l2_streamparm
+{
+ __u32 type;
+ union
+ {
+ struct v4l2_captureparm capture;
+ struct v4l2_outputparm output;
+ /* add more */
+ __u8 raw_data[200]; /* user-defined */
+ } parm;
+};
+
+
+
+/*
+ * I O C T L C O D E S F O R V I D E O D E V I C E S
+ *
+ */
+#define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability)
+#define VIDIOC_RESERVED _IO ('V', 1)
+#define VIDIOC_ENUM_PIXFMT _IOWR ('V', 2, struct v4l2_fmtdesc)
+#define VIDIOC_ENUM_FBUFFMT _IOWR ('V', 3, struct v4l2_fmtdesc)
+#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
+#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
+#define VIDIOC_G_COMP _IOR ('V', 6, struct v4l2_compression)
+#define VIDIOC_S_COMP _IOW ('V', 7, struct v4l2_compression)
+#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
+#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
+#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
+#define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer)
+#define VIDIOC_G_WIN _IOR ('V', 12, struct v4l2_window)
+#define VIDIOC_S_WIN _IOW ('V', 13, struct v4l2_window)
+#define VIDIOC_PREVIEW _IOWR ('V', 14, int)
+#define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer)
+#define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer)
+#define VIDIOC_STREAMON _IOW ('V', 18, int)
+#define VIDIOC_STREAMOFF _IOW ('V', 19, int)
+#define VIDIOC_G_PERF _IOR ('V', 20, struct v4l2_performance)
+#define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm)
+#define VIDIOC_S_PARM _IOW ('V', 22, struct v4l2_streamparm)
+#define VIDIOC_G_STD _IOR ('V', 23, struct v4l2_standard)
+#define VIDIOC_S_STD _IOW ('V', 24, struct v4l2_standard)
+#define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_enumstd)
+#define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input)
+#define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control)
+#define VIDIOC_S_CTRL _IOW ('V', 28, struct v4l2_control)
+#define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner)
+#define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner)
+#define VIDIOC_G_FREQ _IOR ('V', 31, int)
+#define VIDIOC_S_FREQ _IOWR ('V', 32, int)
+#define VIDIOC_G_AUDIO _IOWR ('V', 33, struct v4l2_audio)
+#define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio)
+#define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl)
+#define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu)
+#define VIDIOC_G_INPUT _IOR ('V', 38, int)
+#define VIDIOC_S_INPUT _IOWR ('V', 39, int)
+#define VIDIOC_ENUMCVT _IOWR ('V', 40, struct v4l2_cvtdesc)
+#define VIDIOC_G_OUTPUT _IOR ('V', 46, int)
+#define VIDIOC_S_OUTPUT _IOWR ('V', 47, int)
+#define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output)
+#define VIDIOC_G_AUDOUT _IOWR ('V', 49, struct v4l2_audioout)
+#define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout)
+#define VIDIOC_ENUMFX _IOWR ('V', 51, struct v4l2_fxdesc)
+#define VIDIOC_G_EFFECT _IOR ('V', 52, int)
+#define VIDIOC_S_EFFECT _IOWR ('V', 53, int)
+#define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator)
+#define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator)
+#define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency)
+#define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency)
+
+#define VIDIOC_ENUM_CAPFMT VIDIOC_ENUM_PIXFMT
+#define VIDIOC_ENUM_OUTFMT VIDIOC_ENUM_PIXFMT
+#define VIDIOC_ENUM_SRCFMT VIDIOC_ENUM_PIXFMT
+#define VIDIOC_ENUMFMT VIDIOC_ENUM_PIXFMT
+
+#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
+
+
+#ifdef __KERNEL__
+/*
+ *
+ * V 4 L 2 D R I V E R H E L P E R A P I
+ *
+ * Some commonly needed functions for drivers.
+ */
+
+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 struct page *v4l2_vmalloc_to_page(void *virt);
+
+/* Simple queue management */
+struct v4l2_q_node
+{
+ struct v4l2_q_node *forw, *back;
+};
+struct v4l2_queue
+{
+ struct v4l2_q_node *forw, *back;
+ rwlock_t qlock;
+};
+extern void v4l2_q_init(struct v4l2_queue *q);
+extern void v4l2_q_add_head(struct v4l2_queue *q, struct v4l2_q_node *node);
+extern void v4l2_q_add_tail(struct v4l2_queue *q, struct v4l2_q_node *node);
+extern void *v4l2_q_del_head(struct v4l2_queue *q);
+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);
+
+/* Time functions */
+extern unsigned long v4l2_timestamp_divide(stamp_t t,
+ unsigned long p_100ns);
+extern unsigned long v4l2_timestamp_correct(stamp_t *t,
+ unsigned long p_100ns);
+
+/* Master Clock functions */
+struct v4l2_clock
+{
+ void (*gettime)(stamp_t *);
+};
+extern int v4l2_masterclock_register(struct v4l2_clock *clock);
+extern void v4l2_masterclock_unregister(struct v4l2_clock *clock);
+extern void v4l2_masterclock_gettime(stamp_t *curr);
+
+/* Video standard functions */
+extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
+extern unsigned long v4l2_video_std_tpf(struct v4l2_standard *vs);
+extern int v4l2_video_std_confirm(struct v4l2_standard *vs);
+extern int v4l2_video_std_construct(struct v4l2_standard *vs,
+ int id, __u32 transmission);
+
+#define V4L2_STD_PAL 1 /* PAL B, G, H, I (...) */
+#define V4L2_STD_PAL_M 5 /* (Brazil) */
+#define V4L2_STD_PAL_N 6 /* (Argentina, Paraguay, Uruguay) */
+#define V4L2_STD_PAL_60 10 /* PAL/NTSC hybrid */
+#define V4L2_STD_NTSC 11 /* NTSC M (USA, ...) */
+#define V4L2_STD_NTSC_N 12 /* (Barbados, Bolivia, Colombia,
+ S. Korea) */
+#define V4L2_STD_NTSC_44 15 /* PAL/NTSC hybrid */
+#define V4L2_STD_SECAM 21 /* SECAM B, D, G, K, K1 (...) */
+//#define V4L2_STD_SECAM_H 27 /* (Greece, Iran, Morocco) */
+//#define V4L2_STD_SECAM_L 28 /* (France, Luxembourg, Monaco) */
+//#define V4L2_STD_SECAM_M 29 /* (Jamaica) */
+
+/* Size of kernel ioctl arg buffer used in ioctl handler */
+#define V4L2_MAX_IOCTL_SIZE 256
+
+/* Compatibility layer interface */
+typedef int (*v4l2_ioctl_compat)(struct inode *inode, struct file *file,
+ int cmd, void *arg);
+int v4l2_compat_register(v4l2_ioctl_compat hook);
+void v4l2_compat_unregister(v4l2_ioctl_compat hook);
+
+#endif /* __KERNEL__ */
+#endif /* __LINUX_VIDEODEV2_H */
diff --git a/libng/videodev2.h b/libng/videodev2.h
index a40b207..f85b5e7 100644
--- a/libng/videodev2.h
+++ b/libng/videodev2.h
@@ -14,10 +14,6 @@
* et al.
*/
-#define V4L2_MAJOR_VERSION 0
-#define V4L2_MINOR_VERSION 20
-
-
/*
* M I S C E L L A N E O U S
*/
@@ -26,71 +22,149 @@
#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, in nanoseconds */
-#ifndef STAMP_T
-#define STAMP_T
-typedef __s64 stamp_t;
-#endif
+/*
+ * E N U M S
+ */
+enum v4l2_field {
+ V4L2_FIELD_ANY = 0, /* driver can choose from none,
+ top, bottom, interlaced
+ depending on whatever it thinks
+ is approximate ... */
+ V4L2_FIELD_NONE = 1, /* this device has no fields ... */
+ V4L2_FIELD_TOP = 2, /* top field only */
+ V4L2_FIELD_BOTTOM = 3, /* bottom field only */
+ V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
+ V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
+ buffer, top-bottom order */
+ V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
+ V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
+ separate buffers */
+};
+#define V4L2_FIELD_HAS_TOP(field) \
+ ((field) == V4L2_FIELD_TOP ||\
+ (field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTTOM(field) \
+ ((field) == V4L2_FIELD_BOTTOM ||\
+ (field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTH(field) \
+ ((field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+
+enum v4l2_buf_type {
+ V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
+ V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
+ V4L2_BUF_TYPE_VBI_CAPTURE = 4,
+ V4L2_BUF_TYPE_VBI_OUTPUT = 5,
+ V4L2_BUF_TYPE_PRIVATE = 0x80,
+};
+
+enum v4l2_ctrl_type {
+ V4L2_CTRL_TYPE_INTEGER = 1,
+ V4L2_CTRL_TYPE_BOOLEAN = 2,
+ V4L2_CTRL_TYPE_MENU = 3,
+ V4L2_CTRL_TYPE_BUTTON = 4,
+};
+
+enum v4l2_tuner_type {
+ V4L2_TUNER_RADIO = 1,
+ V4L2_TUNER_ANALOG_TV = 2,
+};
+
+enum v4l2_memory {
+ V4L2_MEMORY_MMAP = 1,
+ V4L2_MEMORY_USERPTR = 2,
+ V4L2_MEMORY_OVERLAY = 3,
+};
+
+/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
+enum v4l2_colorspace {
+ /* ITU-R 601 -- broadcast NTSC/PAL */
+ V4L2_COLORSPACE_SMPTE170M = 1,
+
+ /* 1125-Line (US) HDTV */
+ V4L2_COLORSPACE_SMPTE240M = 2,
+
+ /* HD and modern captures. */
+ V4L2_COLORSPACE_REC709 = 3,
+
+ /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
+ V4L2_COLORSPACE_BT878 = 4,
+
+ /* These should be useful. Assume 601 extents. */
+ V4L2_COLORSPACE_470_SYSTEM_M = 5,
+ V4L2_COLORSPACE_470_SYSTEM_BG = 6,
+
+ /* I know there will be cameras that send this. So, this is
+ * unspecified chromaticities and full 0-255 on each of the
+ * Y'CbCr components
+ */
+ V4L2_COLORSPACE_JPEG = 7,
+
+ /* For RGB colourspaces, this is probably a good start. */
+ V4L2_COLORSPACE_SRGB = 8,
+};
+
+struct v4l2_rect {
+ __s32 left;
+ __s32 top;
+ __u32 width;
+ __u32 height;
+};
+
+struct v4l2_fract {
+ __u32 numerator;
+ __u32 denominator;
+};
/*
* D R I V E R C A P A B I L I T I E S
*/
struct v4l2_capability
{
- char name[32]; /* Descriptive, and unique */
- int type; /* Device type, see below */
- int inputs; /* Num video inputs */
- int outputs; /* Num video outputs */
- int audios; /* Num audio devices */
- int maxwidth;
- int maxheight;
- int minwidth;
- int minheight;
- int maxframerate;
+ __u8 name[32]; /* Descriptive, and unique */
+ __u32 version; /* use KERNEL_VERSION() macro here */
+ __u32 capabilities; /* Device capabilities */
__u32 flags; /* Feature flags, see below */
__u32 reserved[4];
};
-/* Values for 'type' field */
-#define V4L2_TYPE_CAPTURE 0 /* Is a video capture device */
-#define V4L2_TYPE_CODEC 1 /* Is a CODEC device */
-#define V4L2_TYPE_OUTPUT 2 /* Is a video output device */
-#define V4L2_TYPE_FX 3 /* Is a video effects device */
-#define V4L2_TYPE_VBI 4 /* Is a VBI capture device */
-#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 */
-#define V4L2_FLAG_WRITE 0x00002 /* Can accept data via write() */
-#define V4L2_FLAG_STREAMING 0x00004 /* Can capture streaming video */
-#define V4L2_FLAG_PREVIEW 0x00008 /* Can do automatic preview */
-#define V4L2_FLAG_SELECT 0x00010 /* Supports the select() call */
-#define V4L2_FLAG_TUNER 0x00020 /* Can tune */
-#define V4L2_FLAG_MONOCHROME 0x00040 /* Monochrome only */
-#define V4L2_FLAG_DATA_SERVICE 0x00080 /* Has a related data service dev. */
+/* Values for 'capabilities' field */
+#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
+#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
+#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
+#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a VBI capture device */
+#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a VBI output device */
+#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
+
+#define V4L2_CAP_TUNER 0x00010000 /* Has a tuner */
+#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
+
+#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
+#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
+#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
/*
* V I D E O I M A G E F O R M A T
*/
+
struct v4l2_pix_format
{
- __u32 width;
- __u32 height;
- __u32 depth;
- __u32 pixelformat;
- __u32 flags;
- __u32 bytesperline; /* only used when there are pad bytes */
- __u32 sizeimage;
- __u32 priv; /* private data, depends on pixelformat */
+ __u32 width;
+ __u32 height;
+ __u32 pixelformat;
+ enum v4l2_field field;
+ __u32 bytesperline; /* for padding, zero if unused */
+ __u32 sizeimage;
+ enum v4l2_colorspace colorspace;
+ __u32 priv; /* private data, depends on pixelformat */
};
+
/* Pixel format FOURCC depth Description */
#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 */
@@ -106,10 +180,6 @@ struct v4l2_pix_format
#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_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
@@ -124,62 +194,28 @@ struct v4l2_pix_format
#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 */
+/* compressed formats */
+#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
+#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */
+#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* digital video */
+
/* 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. */
-/* SWCONVERSION indicates the format is not natively supported by the */
-/* driver and the driver uses software conversion to support it */
-
-
/*
* F O R M A T E N U M E R A T I O N
*/
struct v4l2_fmtdesc
{
- int index; /* Format number */
- char description[32]; /* Description string */
- __u32 pixelformat; /* Format fourcc */
- __u32 flags; /* Format flags */
- __u32 depth; /* Bits per pixel */
- __u32 reserved[2];
+ __u32 index; /* Format number */
+ enum v4l2_buf_type type; /* buffer type */
+ __u32 flags;
+ __u8 description[32]; /* Description string */
+ __u32 pixelformat; /* Format fourcc */
+ __u32 reserved[4];
};
-struct v4l2_cvtdesc
-{
- int index;
- struct
- {
- __u32 pixelformat;
- __u32 flags;
- __u32 depth;
- __u32 reserved[2];
- } in, out;
-};
-
-struct v4l2_fxdesc
-{
- int index;
- char name[32];
- __u32 flags;
- __u32 inputs;
- __u32 controls;
- __u32 reserved[2];
-};
+#define V4L2_FMT_FLAG_COMPRESSED 0x0001
/*
@@ -187,14 +223,15 @@ struct v4l2_fxdesc
*/
struct v4l2_timecode
{
+ __u32 type;
+ __u32 flags;
__u8 frames;
__u8 seconds;
__u8 minutes;
__u8 hours;
__u8 userbits[4];
- __u32 flags;
- __u32 type;
};
+
/* Type */
#define V4L2_TC_TYPE_24FPS 1
#define V4L2_TC_TYPE_25FPS 2
@@ -202,7 +239,6 @@ struct v4l2_timecode
#define V4L2_TC_TYPE_50FPS 4
#define V4L2_TC_TYPE_60FPS 5
-
/* Flags */
#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
#define V4L2_TC_FLAG_COLORFRAME 0x0002
@@ -215,13 +251,48 @@ struct v4l2_timecode
/*
* C O M P R E S S I O N P A R A M E T E R S
*/
+#if 0
+/* ### generic compression settings don't work, there is too much
+ * ### codec-specific stuff. Maybe reuse that for MPEG codec settings
+ * ### later ... */
struct v4l2_compression
{
- int quality;
- int keyframerate;
- int pframerate;
+ __u32 quality;
+ __u32 keyframerate;
+ __u32 pframerate;
__u32 reserved[5];
};
+#endif
+
+struct v4l2_jpegcompression
+{
+ int quality;
+
+ int APPn; /* Number of APP segment to be written,
+ * must be 0..15 */
+ int APP_len; /* Length of data in JPEG APPn segment */
+ char APP_data[60]; /* Data in the JPEG APPn segment. */
+
+ int COM_len; /* Length of data in JPEG COM segment */
+ char COM_data[60]; /* Data in JPEG COM segment */
+
+ __u32 jpeg_markers; /* Which markers should go into the JPEG
+ * output. Unless you exactly know what
+ * you do, leave them untouched.
+ * Inluding less markers will make the
+ * resulting code smaller, but there will
+ * be fewer aplications which can read it.
+ * The presence of the APP and COM marker
+ * is influenced by APP_len and COM_len
+ * ONLY, not by this property! */
+
+#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
+#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
+#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
+#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
+#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
+ * allways use APP0 */
+};
/*
@@ -229,45 +300,33 @@ struct v4l2_compression
*/
struct v4l2_requestbuffers
{
- int count;
- __u32 type;
- __u32 reserved[2];
+ __u32 count;
+ enum v4l2_buf_type type;
+ enum v4l2_memory memory;
+ __u32 reserved[2];
};
+
struct v4l2_buffer
{
- int index;
- __u32 type;
- __u32 offset;
- __u32 length;
+ __u32 index;
+ enum v4l2_buf_type type;
__u32 bytesused;
__u32 flags;
- stamp_t timestamp;
+ enum v4l2_field field;
+ struct timeval timestamp;
struct v4l2_timecode timecode;
__u32 sequence;
- __u32 reserved[3];
-};
-/* Buffer type codes and flags for 'type' field */
-#define V4L2_BUF_TYPE_field 0x00001FFF /* Type field mask */
-#define V4L2_BUF_TYPE_CAPTURE 0x00000001
-#define V4L2_BUF_TYPE_CODECIN 0x00000002
-#define V4L2_BUF_TYPE_CODECOUT 0x00000003
-#define V4L2_BUF_TYPE_EFFECTSIN 0x00000004
-#define V4L2_BUF_TYPE_EFFECTSIN2 0x00000005
-#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
-
-#define V4L2_BUF_ATTR_DEVICEMEM 0x00010000 /* Buffer is on device (flag) */
-
-/* Flags used only in VIDIOC_REQBUFS */
-#define V4L2_BUF_REQ_field 0xF0000000
-#define V4L2_BUF_REQ_CONTIG 0x10000000 /* Map all buffers in one
- contiguous mmap(). This flag
- only used in VIDIOC_REQBUFS */
+
+ /* memory location */
+ enum v4l2_memory memory;
+ union {
+ off_t offset;
+ void* userptr;
+ } m;
+ __u32 length;
+
+ __u32 reserved[2];
+};
/* Flags for 'flags' field */
#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
@@ -276,10 +335,6 @@ struct v4l2_buffer
#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
-#define V4L2_BUF_FLAG_TOPFIELD 0x0040 /* Image is a top field only */
-#define V4L2_BUF_FLAG_BOTFIELD 0x0080 /* Image is a bottom field only */
-#define V4L2_BUF_FLAG_ODDFIELD V4L2_BUF_FLAG_TOPFIELD
-#define V4L2_BUF_FLAG_EVENFIELD V4L2_BUF_FLAG_BOTFIELD
#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
/*
@@ -289,16 +344,16 @@ struct v4l2_framebuffer
{
__u32 capability;
__u32 flags;
- void *base[3];
+/* FIXME: in theory we should pass something like PCI device + memory
+ * region + offset instead of some physical address */
+ void* base;
struct v4l2_pix_format fmt;
};
/* Flags for the 'capability' field. Read only */
#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
-#define V4L2_FBUF_CAP_CLIPPING 0x0004
-#define V4L2_FBUF_CAP_SCALEUP 0x0008
-#define V4L2_FBUF_CAP_SCALEDOWN 0x0010
-#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0020
+#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
+#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
/* Flags for the 'flags' field. */
#define V4L2_FBUF_FLAG_PRIMARY 0x0001
#define V4L2_FBUF_FLAG_OVERLAY 0x0002
@@ -306,181 +361,140 @@ struct v4l2_framebuffer
struct v4l2_clip
{
- int x;
- int y;
- int width;
- int height;
+ struct v4l2_rect c;
struct v4l2_clip *next;
};
+
struct v4l2_window
{
- int x;
- int y;
- int width;
- int height;
+ struct v4l2_rect w;
+ enum v4l2_field field;
__u32 chromakey;
struct v4l2_clip *clips;
- int clipcount;
+ __u32 clipcount;
void *bitmap;
};
/*
- * D E V I C E P E R F O R M A N C E
- */
-struct v4l2_performance
-{
- int frames;
- int framesdropped;
- __u64 bytesin;
- __u64 bytesout;
- __u32 reserved[4];
-};
-
-/*
* C A P T U R E P A R A M E T E R S
*/
struct v4l2_captureparm
{
- __u32 capability; /* Supported modes */
- __u32 capturemode; /* Current mode */
- unsigned long timeperframe; /* Time per frame in .1us units */
- __u32 extendedmode; /* Driver-specific extensions */
- __u32 reserved[4];
+ __u32 capability; /* Supported modes */
+ __u32 capturemode; /* Current mode */
+ struct v4l2_fract timeperframe; /* Time per frame in .1us units */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 readbuffers; /* # of buffers for read */
+ __u32 reserved[4];
};
/* Flags for 'capability' and 'capturemode' fields */
#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
-//#define V4L2_MODE_VFLIP 0x0002 /* Flip image vertically */
-//#define V4L2_MODE_HFLIP 0x0004 /* Flip image horizontally */
#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
struct v4l2_outputparm
{
- __u32 capability; /* Supported modes */
- __u32 outputmode; /* Current mode */
- unsigned long timeperframe; /* Time per frame in .1us units */
- __u32 extendedmode; /* Driver-specific extensions */
- __u32 reserved[4];
+ __u32 capability; /* Supported modes */
+ __u32 outputmode; /* Current mode */
+ struct v4l2_fract timeperframe; /* Time per frame in seconds */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 writebuffers; /* # of buffers for write */
+ __u32 reserved[4];
};
/*
* I N P U T I M A G E C R O P P I N G
*/
-struct v4l2_cropcap
-{
- __u32 capability;
- int min_x;
- int min_y;
- int max_x;
- int max_y;
- int default_left;
- int default_top;
- int default_right;
- int default_bottom;
- __u32 reserved[2];
-};
-struct v4l2_crop
-{
- int left;
- int top;
- int right;
- int bottom;
- __u32 reserved;
-};
-/*
- * D I G I T A L Z O O M
- */
-struct v4l2_zoomcap
-{
- __u32 capability;
- __u32 maxwidth;
- __u32 maxheight;
- __u32 minwidth;
- __u32 minheight;
- __u32 reserved[2];
+struct v4l2_cropcap {
+ enum v4l2_buf_type type;
+ struct v4l2_rect bounds;
+ struct v4l2_rect defrect;
+ struct v4l2_fract pixelaspect;
};
-/* Flags for the capability field */
-#define V4L2_ZOOM_NONCAP 0x0001
-#define V4L2_ZOOM_WHILESTREAMING 0x0002
-struct v4l2_zoom
-{
- __u32 x;
- __u32 y;
- __u32 width;
- __u32 height;
- __u32 reserved;
+struct v4l2_crop {
+ enum v4l2_buf_type type;
+ struct v4l2_rect c;
};
-
/*
* A N A L O G V I D E O S T A N D A R D
*/
+
+typedef __u64 v4l2_std_id;
+
+/* one bit for each */
+#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
+
+#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
+
+#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
+#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
+#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
+#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
+#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
+#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
+#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
+
+/* ATSC/HDTV */
+#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
+#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
+
+/* some common needed stuff */
+#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
+ V4L2_STD_PAL_B1 |\
+ V4L2_STD_PAL_G)
+#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
+ V4L2_STD_PAL_D1 |\
+ V4L2_STD_PAL_K)
+#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
+ V4L2_STD_PAL_DK |\
+ V4L2_STD_PAL_H |\
+ V4L2_STD_PAL_I)
+#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
+ V4L2_STD_NTSC_M_JP)
+#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
+ V4L2_STD_SECAM_D |\
+ V4L2_STD_SECAM_G |\
+ V4L2_STD_SECAM_H |\
+ V4L2_STD_SECAM_K |\
+ V4L2_STD_SECAM_K1 |\
+ V4L2_STD_SECAM_L)
+
+#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
+ V4L2_STD_PAL_60 |\
+ V4L2_STD_NTSC)
+#define V4L2_STD_625_50 (V4L2_STD_PAL |\
+ V4L2_STD_PAL_N |\
+ V4L2_STD_PAL_Nc |\
+ V4L2_STD_SECAM)
+
+#define V4L2_STD_UNKNOWN 0
+#define V4L2_STD_ALL (V4L2_STD_525_60 |\
+ V4L2_STD_625_50)
+
struct v4l2_standard
{
- __u8 name[24];
- struct {
- __u32 numerator;
- __u32 denominator; /* >= 1 */
- } framerate; /* Frames, not fields */
- __u32 framelines;
- __u32 reserved1;
- __u32 colorstandard;
- union {
- struct {
- __u32 colorsubcarrier; /* Hz */
- } pal;
- struct {
- __u32 colorsubcarrier; /* Hz */
- } ntsc;
- struct {
- __u32 f0b; /* Hz (blue) */
- __u32 f0r; /* Hz (red) */
- } secam;
- __u8 reserved[12];
- } colorstandard_data;
- __u32 transmission; /* Bit field. Must be zero for
- non-modulators/demodulators. */
- __u32 reserved2; /* Must be set to zero */
-};
-
-/* Values for the 'colorstandard' field */
-#define V4L2_COLOR_STD_PAL 1
-#define V4L2_COLOR_STD_NTSC 2
-#define V4L2_COLOR_STD_SECAM 3
-
-/* Values for the color subcarrier fields */
-#define V4L2_COLOR_SUBC_PAL 4433619 /* PAL BGHI, NTSC-44 */
-#define V4L2_COLOR_SUBC_PAL_M 3575611 /* PAL M (Brazil) */
-#define V4L2_COLOR_SUBC_PAL_N 3582056 /* PAL N */
-#define V4L2_COLOR_SUBC_NTSC 3579545 /* NTSC M, NTSC-Japan */
-#define V4L2_COLOR_SUBC_SECAMB 4250000 /* SECAM B - Y carrier */
-#define V4L2_COLOR_SUBC_SECAMR 4406250 /* SECAM R - Y carrier */
-
-/* Flags for the 'transmission' field */
-#define V4L2_TRANSM_STD_B (1<<1)
-#define V4L2_TRANSM_STD_D (1<<3)
-#define V4L2_TRANSM_STD_G (1<<6)
-#define V4L2_TRANSM_STD_H (1<<7)
-#define V4L2_TRANSM_STD_I (1<<8)
-#define V4L2_TRANSM_STD_K (1<<10)
-#define V4L2_TRANSM_STD_K1 (1<<11)
-#define V4L2_TRANSM_STD_L (1<<12)
-#define V4L2_TRANSM_STD_M (1<<13)
-#define V4L2_TRANSM_STD_N (1<<14)
-
-
-/* Used in the VIDIOC_ENUMSTD ioctl for querying supported standards */
-struct v4l2_enumstd
-{
- int index;
- struct v4l2_standard std;
- __u32 inputs; /* set of inputs that */
- /* support this standard */
- __u32 outputs; /* set of outputs that */
- /* support this standard */
- __u32 reserved[2];
+ __u32 index;
+ v4l2_std_id id;
+ __u8 name[24];
+ struct v4l2_fract frameperiod; /* Frames, not fields */
+ __u32 framelines;
+ __u32 reserved[4];
};
@@ -489,104 +503,96 @@ struct v4l2_enumstd
*/
struct v4l2_input
{
- int index; /* Which input */
- char name[32]; /* Label */
- int type; /* Type of input */
- __u32 capability; /* Capability flags */
- int assoc_audio; /* Associated audio input */
- __u32 reserved[4];
+ __u32 index; /* Which input */
+ __u8 name[32]; /* Label */
+ __u32 type; /* Type of input */
+ __u32 audioset; /* Associated audios (bitfield) */
+ __u32 tuner; /* Associated tuner */
+ v4l2_std_id std;
+ __u32 status;
+ __u32 reserved[4];
};
/* Values for the 'type' field */
#define V4L2_INPUT_TYPE_TUNER 1
#define V4L2_INPUT_TYPE_CAMERA 2
-/* Flags for the 'capability' field */
-#define V4L2_INPUT_CAP_AUDIO 0x0001 /* assoc_audio */
+/* field 'status' - general */
+#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
+#define V4L2_IN_ST_NO_SIGNAL 0x00000002
+#define V4L2_IN_ST_NO_COLOR 0x00000004
+/* field 'status' - analog */
+#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
+#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
+
+/* field 'status' - digital */
+#define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
+#define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
+#define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
+
+/* field 'status' - VCR and set-top box */
+#define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
+#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
+#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
/*
* V I D E O O U T P U T S
*/
struct v4l2_output
{
- int index; /* Which output */
- char name[32]; /* Label */
- int type; /* Type of output */
- __u32 capability; /* Capability flags */
- int assoc_audio; /* Associated audio */
- __u32 reserved[4];
+ __u32 index; /* Which output */
+ __u8 name[32]; /* Label */
+ __u32 type; /* Type of output */
+ __u32 audioset; /* Associated audios (bitfield) */
+ __u32 modulator; /* Associated modulator */
+ v4l2_std_id std;
+ __u32 reserved[4];
};
/* Values for the 'type' field */
#define V4L2_OUTPUT_TYPE_MODULATOR 1
#define V4L2_OUTPUT_TYPE_ANALOG 2
#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
-/* Flags for the 'capability' field */
-#define V4L2_OUTPUT_CAP_AUDIO 0x0001 /* assoc_audio */
-
-
/*
* C O N T R O L S
*/
struct v4l2_control
{
- __u32 id;
- int value;
+ __u32 id;
+ __s32 value;
};
/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
struct v4l2_queryctrl
{
- __u32 id;
- __u8 name[32]; /* Whatever */
- int minimum; /* Note signedness */
- int maximum;
- unsigned int step;
- int default_value;
- __u32 type;
- __u32 flags;
- __u32 category; /* Automatically filled in by V4L2 */
- __u8 group[32]; /* for pre-defined controls */
- __u32 reserved[2];
+ __u32 id;
+ enum v4l2_ctrl_type type;
+ __u8 name[32]; /* Whatever */
+ __s32 minimum; /* Note signedness */
+ __s32 maximum;
+ __s32 step;
+ __s32 default_value;
+ __u32 flags;
+ __u32 reserved[2];
};
/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
struct v4l2_querymenu
{
__u32 id;
- int index;
+ __u32 index;
__u8 name[32]; /* Whatever */
- int reserved;
+ __u32 reserved;
};
-/* Used in V4L2_BUF_TYPE_FXCONTROL buffers */
-struct v4l2_fxcontrol
-{
- __u32 id;
- __u32 value;
-};
-
-/* Control types */
-#define V4L2_CTRL_TYPE_INTEGER 0
-#define V4L2_CTRL_TYPE_BOOLEAN 1
-#define V4L2_CTRL_TYPE_MENU 2
-#define V4L2_CTRL_TYPE_BUTTON 3
-
/* Control flags */
#define V4L2_CTRL_FLAG_DISABLED 0x0001
#define V4L2_CTRL_FLAG_GRABBED 0x0002
-/* Control categories */
-#define V4L2_CTRL_CAT_VIDEO 1 /* "Video" */
-#define V4L2_CTRL_CAT_AUDIO 2 /* "Audio" */
-#define V4L2_CTRL_CAT_EFFECT 3 /* "Effect" */
-
/* Control IDs defined by V4L2 */
#define V4L2_CID_BASE 0x00980900
/* IDs reserved for driver specific controls */
#define V4L2_CID_PRIVATE_BASE 0x08000000
-/* IDs reserved for effect-specific controls on effects devices */
-#define V4L2_CID_EFFECT_BASE 0x0A00B000
#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
@@ -613,36 +619,36 @@ struct v4l2_fxcontrol
#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
#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 */
/*
* T U N I N G
*/
struct v4l2_tuner
{
- int input;
- char name[32];
- struct v4l2_standard std;
+ __u32 index;
+ __u8 name[32];
+ enum v4l2_tuner_type type;
__u32 capability;
__u32 rangelow;
__u32 rangehigh;
__u32 rxsubchans;
__u32 audmode;
- int signal;
- int afc;
+ __u32 signal;
+ __u32 afc;
__u32 reserved[4];
};
+
struct v4l2_modulator
{
- int output;
- char name[32];
- struct v4l2_standard std;
+ __u32 index;
+ __u8 name[32];
__u32 capability;
__u32 rangelow;
__u32 rangehigh;
__u32 txsubchans;
__u32 reserved[4];
};
+
/* Flags for the 'capability' field */
#define V4L2_TUNER_CAP_LOW 0x0001
#define V4L2_TUNER_CAP_NORM 0x0002
@@ -667,9 +673,10 @@ struct v4l2_modulator
struct v4l2_frequency
{
- int input;
- __u32 frequency;
- __u32 reserved[2];
+ __u32 tuner;
+ enum v4l2_tuner_type type;
+ __u32 frequency;
+ __u32 reserved[8];
};
/*
@@ -677,8 +684,8 @@ struct v4l2_frequency
*/
struct v4l2_audio
{
- int audio;
- char name[32];
+ __u32 index;
+ __u8 name[32];
__u32 capability;
__u32 mode;
__u32 reserved[2];
@@ -699,8 +706,8 @@ struct v4l2_audio
struct v4l2_audioout
{
- int audio;
- char name[32];
+ __u32 index;
+ __u8 name[32];
__u32 capability;
__u32 mode;
__u32 reserved[2];
@@ -717,16 +724,13 @@ struct v4l2_vbi_format
__u32 sampling_rate; /* in 1 Hz */
__u32 offset;
__u32 samples_per_line;
- __u32 sample_format; /* V4L2_VBI_SF_* */
+ __u32 sample_format; /* V4L2_PIX_FMT_* */
__s32 start[2];
__u32 count[2];
__u32 flags; /* V4L2_VBI_* */
- __u32 reserved2; /* must be zero */
+ __u32 reserved[2]; /* must be zero */
};
-/* VBI sampling formats */
-#define V4L2_VBI_SF_UBYTE 1
-
/* VBI flags */
#define V4L2_VBI_UNSYNC (1<< 0)
#define V4L2_VBI_INTERLACED (1<< 1)
@@ -740,13 +744,13 @@ struct v4l2_vbi_format
*/
struct v4l2_format
{
- __u32 type;
+ enum v4l2_buf_type type;
union
{
- struct v4l2_pix_format pix; /* image format */
- struct v4l2_vbi_format vbi; /* VBI data */
- /* add more */
- __u8 raw_data[200]; /* user-defined */
+ struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
+ struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
+ struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
+ __u8 raw_data[200]; // user-defined
} fmt;
};
@@ -755,12 +759,11 @@ struct v4l2_format
*/
struct v4l2_streamparm
{
- __u32 type;
+ enum v4l2_buf_type type;
union
{
struct v4l2_captureparm capture;
struct v4l2_outputparm output;
- /* add more */
__u8 raw_data[200]; /* user-defined */
} parm;
};
@@ -773,60 +776,54 @@ struct v4l2_streamparm
*/
#define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability)
#define VIDIOC_RESERVED _IO ('V', 1)
-#define VIDIOC_ENUM_PIXFMT _IOWR ('V', 2, struct v4l2_fmtdesc)
-#define VIDIOC_ENUM_FBUFFMT _IOWR ('V', 3, struct v4l2_fmtdesc)
+#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
+#if 0
#define VIDIOC_G_COMP _IOR ('V', 6, struct v4l2_compression)
#define VIDIOC_S_COMP _IOW ('V', 7, struct v4l2_compression)
+#endif
#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
#define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer)
-#define VIDIOC_G_WIN _IOR ('V', 12, struct v4l2_window)
-#define VIDIOC_S_WIN _IOW ('V', 13, struct v4l2_window)
-#define VIDIOC_PREVIEW _IOWR ('V', 14, int)
+#define VIDIOC_OVERLAY _IOWR ('V', 14, int)
#define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer)
#define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer)
#define VIDIOC_STREAMON _IOW ('V', 18, int)
#define VIDIOC_STREAMOFF _IOW ('V', 19, int)
-#define VIDIOC_G_PERF _IOR ('V', 20, struct v4l2_performance)
#define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm)
#define VIDIOC_S_PARM _IOW ('V', 22, struct v4l2_streamparm)
-#define VIDIOC_G_STD _IOR ('V', 23, struct v4l2_standard)
-#define VIDIOC_S_STD _IOW ('V', 24, struct v4l2_standard)
-#define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_enumstd)
+#define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id)
+#define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id)
+#define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard)
#define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input)
#define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control)
#define VIDIOC_S_CTRL _IOW ('V', 28, struct v4l2_control)
#define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner)
#define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner)
-#define VIDIOC_G_FREQ _IOR ('V', 31, int)
-#define VIDIOC_S_FREQ _IOWR ('V', 32, int)
#define VIDIOC_G_AUDIO _IOWR ('V', 33, struct v4l2_audio)
#define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio)
#define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl)
#define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu)
#define VIDIOC_G_INPUT _IOR ('V', 38, int)
#define VIDIOC_S_INPUT _IOWR ('V', 39, int)
-#define VIDIOC_ENUMCVT _IOWR ('V', 40, struct v4l2_cvtdesc)
#define VIDIOC_G_OUTPUT _IOR ('V', 46, int)
#define VIDIOC_S_OUTPUT _IOWR ('V', 47, int)
#define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output)
#define VIDIOC_G_AUDOUT _IOWR ('V', 49, struct v4l2_audioout)
#define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout)
-#define VIDIOC_ENUMFX _IOWR ('V', 51, struct v4l2_fxdesc)
-#define VIDIOC_G_EFFECT _IOR ('V', 52, int)
-#define VIDIOC_S_EFFECT _IOWR ('V', 53, int)
#define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator)
#define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator)
#define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency)
#define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency)
-
-#define VIDIOC_ENUM_CAPFMT VIDIOC_ENUM_PIXFMT
-#define VIDIOC_ENUM_OUTFMT VIDIOC_ENUM_PIXFMT
-#define VIDIOC_ENUM_SRCFMT VIDIOC_ENUM_PIXFMT
-#define VIDIOC_ENUMFMT VIDIOC_ENUM_PIXFMT
+#define VIDIOC_CROPCAP _IOR ('V', 58, struct v4l2_cropcap)
+#define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop)
+#define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop)
+#define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression)
+#define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression)
+#define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id)
+#define VIDIOC_TRY_FMT _IOWR ('V', 63, struct v4l2_format)
#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
@@ -836,83 +833,29 @@ struct v4l2_streamparm
*
* V 4 L 2 D R I V E R H E L P E R A P I
*
- * Some commonly needed functions for drivers.
+ * Some commonly needed functions for drivers (v4l2-common.o module)
*/
-
-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 struct page *v4l2_vmalloc_to_page(void *virt);
-
-/* Simple queue management */
-struct v4l2_q_node
-{
- struct v4l2_q_node *forw, *back;
-};
-struct v4l2_queue
-{
- struct v4l2_q_node *forw, *back;
- rwlock_t qlock;
-};
-extern void v4l2_q_init(struct v4l2_queue *q);
-extern void v4l2_q_add_head(struct v4l2_queue *q, struct v4l2_q_node *node);
-extern void v4l2_q_add_tail(struct v4l2_queue *q, struct v4l2_q_node *node);
-extern void *v4l2_q_del_head(struct v4l2_queue *q);
-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);
-
-/* Time functions */
-extern unsigned long v4l2_timestamp_divide(stamp_t t,
- unsigned long p_100ns);
-extern unsigned long v4l2_timestamp_correct(stamp_t *t,
- unsigned long p_100ns);
-
-/* Master Clock functions */
-struct v4l2_clock
-{
- void (*gettime)(stamp_t *);
-};
-extern int v4l2_masterclock_register(struct v4l2_clock *clock);
-extern void v4l2_masterclock_unregister(struct v4l2_clock *clock);
-extern void v4l2_masterclock_gettime(stamp_t *curr);
+#include <linux/fs.h>
/* Video standard functions */
extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
-extern unsigned long v4l2_video_std_tpf(struct v4l2_standard *vs);
-extern int v4l2_video_std_confirm(struct v4l2_standard *vs);
-extern int v4l2_video_std_construct(struct v4l2_standard *vs,
- int id, __u32 transmission);
-
-#define V4L2_STD_PAL 1 /* PAL B, G, H, I (...) */
-#define V4L2_STD_PAL_M 5 /* (Brazil) */
-#define V4L2_STD_PAL_N 6 /* (Argentina, Paraguay, Uruguay) */
-#define V4L2_STD_PAL_60 10 /* PAL/NTSC hybrid */
-#define V4L2_STD_NTSC 11 /* NTSC M (USA, ...) */
-#define V4L2_STD_NTSC_N 12 /* (Barbados, Bolivia, Colombia,
- S. Korea) */
-#define V4L2_STD_NTSC_44 15 /* PAL/NTSC hybrid */
-#define V4L2_STD_SECAM 21 /* SECAM B, D, G, K, K1 (...) */
-//#define V4L2_STD_SECAM_H 27 /* (Greece, Iran, Morocco) */
-//#define V4L2_STD_SECAM_L 28 /* (France, Luxembourg, Monaco) */
-//#define V4L2_STD_SECAM_M 29 /* (Jamaica) */
-
-/* Size of kernel ioctl arg buffer used in ioctl handler */
-#define V4L2_MAX_IOCTL_SIZE 256
+extern int v4l2_video_std_construct(struct v4l2_standard *vs, int id);
/* Compatibility layer interface */
-typedef int (*v4l2_ioctl_compat)(struct inode *inode, struct file *file,
- int cmd, void *arg);
-int v4l2_compat_register(v4l2_ioctl_compat hook);
-void v4l2_compat_unregister(v4l2_ioctl_compat hook);
+typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg);
+int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
+ int cmd, void *arg, v4l2_kioctl driver_ioctl);
+
+/* names for fancy debug output */
+extern char *v4l2_field_names[];
+extern char *v4l2_type_names[];
#endif /* __KERNEL__ */
#endif /* __LINUX_VIDEODEV2_H */
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/man/Subdir.mk b/man/Subdir.mk
index 7885a43..8f512b4 100644
--- a/man/Subdir.mk
+++ b/man/Subdir.mk
@@ -19,22 +19,20 @@ langs-1 := $(patsubst %/,inst1-%,$(sort $(dir $(lang-man1))))
langs-5 := $(patsubst %/,inst5-%,$(sort $(dir $(lang-man5))))
langs-8 := $(patsubst %/,inst8-%,$(sort $(dir $(lang-man8))))
+pages-1 = $(patsubst %,$(srcdir)/man/%,$(filter $*/%,$(lang-man1)))
+pages-5 = $(patsubst %,$(srcdir)/man/%,$(filter $*/%,$(lang-man5)))
+pages-8 = $(patsubst %,$(srcdir)/man/%,$(filter $*/%,$(lang-man8)))
+
install:: $(langs-1) $(langs-5) $(langs-8)
inst1-%:
$(INSTALL_DIR) $(mandir)/$*/man1
- $(INSTALL_DATA) \
- $(patsubst %,$(srcdir)/man/%,$(filter $*/%,$(lang-man1))) \
- $(mandir)/$*/man1
+ $(INSTALL_DATA) $(pages-1) $(mandir)/$*/man1
inst5-%:
$(INSTALL_DIR) $(mandir)/$*/man5
- $(INSTALL_DATA) \
- $(patsubst %,$(srcdir)/man/%,$(filter $*/%,$(lang-man5))) \
- $(mandir)/$*/man5
+ $(INSTALL_DATA) $(pages-5) $(mandir)/$*/man5
inst8-%:
$(INSTALL_DIR) $(mandir)/$*/man8
- $(INSTALL_DATA) \
- $(patsubst %,$(srcdir)/man/%,$(filter $*/%,$(lang-man8))) \
- $(mandir)/$*/man8
+ $(INSTALL_DATA) $(pages-8) $(mandir)/$*/man8
diff --git a/man/fbtv.1 b/man/fbtv.1
index 05eed38..e8aa92c 100644
--- a/man/fbtv.1
+++ b/man/fbtv.1
@@ -60,7 +60,7 @@ is useful too.
.TP
.B -q
quiet mode. Doesn't reserve space for the status line at the top,
-does'nt display the status messages and clock. You can toggle this
+doesn't display the status messages and clock. You can toggle this
at runtime too ('F').
.TP
.B -M
@@ -70,7 +70,7 @@ Matrox G200/G400 (with matroxfb) and ATI Mach64 VT/GT (with atyfb,
16bpp only). You'll need at least bttv-0.7.16 or kernel 2.3.50.
.SH USAGE
fbtv is supported to work much like xawtv from user's point of view.
-You might have noticed that xawtv has alot of keyboard shortcuts.
+You might have noticed that xawtv has a lot of keyboard shortcuts.
They work in fbtv too (if it useful). Here is the list:
.nf
diff --git a/man/motv.1 b/man/motv.1
index db7f6ca..455fe06 100644
--- a/man/motv.1
+++ b/man/motv.1
@@ -74,7 +74,7 @@ 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.
+might need this if xawtv fails to autodetect a remote X11 display.
.br
Resource: motv.remote (bool).
.TP
@@ -97,38 +97,38 @@ 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.
+(instead of the DGA extension). Yet another pass through argument.
.br
Resource: motv.fbdev (bool).
.TP
\fB-xv/-noxv \fP
-enable/disable the usage of the Xvideo extention altogether,
+enable/disable the usage of the Xvideo extension altogether,
i.e. -noxv has the same effect as both -noxv-video and -noxv-image
switches (see below).
.br
Resource: xawtv.xv (bool).
.TP
\fB-xv-video/-noxv-video \fP
-enable/disable the usage of the Xvideo extention for video overlay
+enable/disable the usage of the Xvideo extension for video overlay
(i.e. XvPutVideo). overlay mode uses this. default is on.
.br
Resource: xawtv.xvVideo (bool).
.TP
\fB-xv-image/-noxv-image \fP
-enable/disable the usage of the Xvideo extention for image scaling
+enable/disable the usage of the Xvideo extension for image scaling
(i.e. XvPutImage). grabdisplay mode uses this. default is on.
.br
Resource: xawtv.xvImage (bool).
.TP
\fB-vm/-novm\fP
-enable/disable the usage of the VidMode extention, default is off.
+enable/disable the usage of the VidMode extension, default is off.
If there is a fullscreen video mode configured in the config file,
-the vidmode extention will be enabled automatically.
+the vidmode extension 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.
+enable/disable the usage of the DGA extension, default is on.
.br
Resource: motv.dga (bool).
.TP
@@ -151,9 +151,9 @@ of v4l design bugs.
FreeBSD / OpenBSD driver for bt848/878 grabber cards.
.TP
.B Xvideo
-X11 Extention for video devices. Note that the Xvideo extention does
+X11 Extension for video devices. Note that the Xvideo extension 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
+extension 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.
diff --git a/man/pia.1 b/man/pia.1
index d5059fb..8e2170a 100644
--- a/man/pia.1
+++ b/man/pia.1
@@ -28,6 +28,16 @@ Disable Xvideo extention.
.TP
.B -nogl
Disable OpenGL.
+.TP
+.B -noaudio
+Don't play sound.
+.TP
+.B -novideo
+Don't play video.
+.TP
+.B -slow n
+Slowdown video playback by factor n. n=2 doubles playback time, ...
+This also turns off audio playback.
.SH SUPPORTED MOVIE FORMATS
Main purpose of this utility is to playback movie files recorded by
xawtv, motv and streamer. It should be able to playback every AVI or
diff --git a/man/propwatch.1 b/man/propwatch.1
index c524272..795c5a7 100644
--- a/man/propwatch.1
+++ b/man/propwatch.1
@@ -14,7 +14,7 @@ uses the Athena Widgets and accepts the usual toolkit options like
.P
All remaining command line arguments are assumed to be property names
which should be monitored. If no property names are specified, a
-buildin default set will be used.
+build in default set will be used.
.SH ENVIRONMENT
.TP
.B DISPLAY
diff --git a/man/streamer.1 b/man/streamer.1
index 0ad6b07..d450cd0 100644
--- a/man/streamer.1
+++ b/man/streamer.1
@@ -14,7 +14,7 @@ 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
+You can safely 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
diff --git a/man/v4l-conf.8 b/man/v4l-conf.8
index 7dedea4..09dacaa 100644
--- a/man/v4l-conf.8
+++ b/man/v4l-conf.8
@@ -8,7 +8,7 @@ v4l-conf - configure a video4linux driver
is a small helper tool. It figures out the video mode and framebuffer
base address of the graphics board and configures a video4linux driver
like bttv. This is needed for drivers which can DMA the video over PCI
-directly to the into the video memory.
+directly into the video memory.
.P
Usually it is not required to use v4l-conf manually, xawtv(1) and
fbtv(1) run it automatically at startup. It might be useful for
@@ -17,7 +17,7 @@ trouble-shooting.
must be installed suid-root.
.P
.B v4l-conf
-knows tree ways to get the informations:
+knows three ways to get the informations:
.TP 3
*
Query the X-Server using the XF86 DGA extention. This is the default
@@ -58,13 +58,13 @@ bytes.
.TP 4
\fB-a\fP adr
Set framebuffer address to \fBadr\fP. The value should be specified
-in hex. This option is allowd for root only. You can't overwrite the
-autodetected value, this switch is only useful if autodetect does'nt
+in hex. This option is allowed for root only. You can't overwrite the
+autodetected value, this switch is only useful if autodetect doesn't
work because the X-Server lacks DGA support. You can put this into
/etc/conf.modules, as "post-install bttv ..." for example.
.SH BUGS
-Hope I hav'nt any security flaws in there. If you find one, drop me a
-note. Mails with patches are prefeared :-)
+Hope I havn't any security flaws in there. If you find one, drop me a
+note. Mails with patches are preferred :-)
.SH SEE ALSO
xawtv(1), fbtv(1)
.SH AUTHOR
diff --git a/man/webcam.1 b/man/webcam.1
index 01f0ecd..9eb4c52 100644
--- a/man/webcam.1
+++ b/man/webcam.1
@@ -115,11 +115,11 @@ If
is set to 1 webcam will upload a single frame and quit.
.P
.B archive
-can be used to create a (local) archive of the webcam images.
-Just specify a the filename for the files as argument. The
-filename will be processed with strftime(3), so you can use
-the place the usual time format controls into the string to
-get unique filenames.
+can be used to create a (local) archive of the webcam images. Just
+specify the filename for the files as argument. The filename will be
+processed with strftime(3), so you can use the place the usual time
+format controls into the string to get unique filenames. Non-existing
+directories are created if needed.
.P
If
.B debug
diff --git a/man/xawtv-remote.1 b/man/xawtv-remote.1
index d800822..353ceeb 100644
--- a/man/xawtv-remote.1
+++ b/man/xawtv-remote.1
@@ -154,12 +154,15 @@ quit xawtv
enter digit 'n'. That's the two-digit channel selection, entering two
digits within 5 seconds switches to the selected station. Useful for
lirc.
+.TP
+.B vdr command
+send "command" to vdr (via connect on localhost:2001).
.SH SEE ALSO
xawtv(1), motv(1), xawtvrc(5)
.SH AUTHOR
Gerd Knorr <kraxel@bytesex.org>
.SH COPYRIGHT
-Copyright (C) 1997-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
+Copyright (C) 1997-2001 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/xawtv.1 b/man/xawtv.1
index 8442c06..d76cccc 100644
--- a/man/xawtv.1
+++ b/man/xawtv.1
@@ -85,7 +85,7 @@ Resource: xawtv.bpp (int).
\fB-shift\fP n
Shift the video display by
.B n
-bytes. Try this if your video display is'nt within the xawtv window,
+bytes. Try this if your video display isn't within the xawtv window,
some older matrox cards show this problem. This gets passed through
to v4l-conf(8) too.
.br
@@ -93,38 +93,38 @@ 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.
+(instead of the DGA extension). Yet another pass through argument.
.br
Resource: xawtv.fbdev (bool).
.TP
\fB-xv/-noxv \fP
-enable/disable the usage of the Xvideo extention altogether,
+enable/disable the usage of the Xvideo extension altogether,
i.e. -noxv has the same effect as both -noxv-video and -noxv-image
switches (see below).
.br
Resource: xawtv.xv (bool).
.TP
\fB-xv-video/-noxv-video \fP
-enable/disable the usage of the Xvideo extention for video overlay
+enable/disable the usage of the Xvideo extension for video overlay
(i.e. XvPutVideo). overlay mode uses this. default is on.
.br
Resource: xawtv.xvVideo (bool).
.TP
\fB-xv-image/-noxv-image \fP
-enable/disable the usage of the Xvideo extention for image scaling
+enable/disable the usage of the Xvideo extension for image scaling
(i.e. XvPutImage). grabdisplay mode uses this. default is on.
.br
Resource: xawtv.xvImage (bool).
.TP
\fB-vm/-novm\fP
-enable/disable the usage of the VidMode extention, default is off.
+enable/disable the usage of the VidMode extension, default is off.
If there is a fullscreen video mode configured in the config file,
-the vidmode extention will be enabled automatically.
+the vidmode extension 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.
+enable/disable the usage of the DGA extension, default is on.
.br
Resource: xawtv.dga (bool).
.TP
@@ -147,9 +147,9 @@ of v4l design bugs.
FreeBSD / OpenBSD driver for bt848/878 grabber cards.
.TP
.B Xvideo
-X11 Extention for video devices. Note that the Xvideo extention does
+X11 Extension for video devices. Note that the Xvideo extension 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
+extension 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.
@@ -172,7 +172,7 @@ 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
+right button brings up a window with a lot of options and control
functions.
.SS Keyboard Shortcuts
.nf
diff --git a/man/xawtvrc.5 b/man/xawtvrc.5
index 54846db..a7ab31a 100644
--- a/man/xawtvrc.5
+++ b/man/xawtvrc.5
@@ -9,7 +9,7 @@ $HOME/.xawtv
.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.
+read it too to get configuration information 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
@@ -124,14 +124,14 @@ 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
+XFree only, and of course you need a valid modeline for this mode in
+your XF86Config file. You also have to enable the VidMode extension
(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
+Some WM's handle static gravity incorrectly (I know mwm and
kwm). This is somewhat boring with fullscreen mode. With this
-options you can correct this with a displacement for moving
+option 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
@@ -148,7 +148,7 @@ feature.
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
+This allows volume control 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: +
@@ -195,6 +195,9 @@ from. If configured this way, you can program your midi keyboard keys
as station hotkeys and use midi controller events to control settings
like volume, bright etc. Check the [eventmap] description below for
details.
+.TP
+.B filter = name
+Enable the specified filter.
.SS The [launch] section
You can start other programs from within xawtv. This is configured
with entries in the "[launch]" section:
@@ -213,7 +216,7 @@ events for example have one. If present the argument is appended to
the action.
.P
There are default mappings for lirc and joystick input events, so you
-don't have to create a eventmap to use them. But if you don't like
+don't have to create an eventmap to use them. But if you don't like
the defaults you can change them easily.
.P
Here is a list of valid events:
@@ -236,7 +239,7 @@ midi controller message for control <n> was received. This event has
an argument (the current value of the control).
.TP
.B kbd-key-<name>
-Key <name> was pressed on the keyboard. Only fbtv supports this one.
+Key <name> was pressed on the keyboard.
.SS sample config file
.nf
# this is a comment
@@ -258,6 +261,7 @@ AleVT = Ctrl+A, alevt
[eventmap]
midi-ctrl-7 = volume
+kbd-key-h = msg "hello world"
[defaults]
input = television
diff --git a/scripts/html.pl b/scripts/html.pl
new file mode 100644
index 0000000..2f075d7
--- /dev/null
+++ b/scripts/html.pl
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+while (<>) {
+ chop;
+ s/([\\\"])/\\$1/g;
+ print "\"$_\\n\"\n";
+}
diff --git a/vbistuff/about.html.in b/vbistuff/about.html.in
index 1663ac6..88bf9e0 100644
--- a/vbistuff/about.html.in
+++ b/vbistuff/about.html.in
@@ -24,7 +24,7 @@ the vbi data. &nbsp; Source code of this daemon comes with
<a href="/800/00.html">800</a> &nbsp;
<hr noshade size=1>
<h2>teletext characters</h2>
-<pre style="font-family: teletext; font-size: 20px">
+<pre class=vt>
ETS 300 706 Table 36: Latin National Option Sub-sets
diff --git a/vbistuff/alevt.css.in b/vbistuff/alevt.css.in
index bd97f9b..e8c1b11 100644
--- a/vbistuff/alevt.css.in
+++ b/vbistuff/alevt.css.in
@@ -3,7 +3,7 @@ body { background-color: white; color: black }
pre.vt { border: 1pt solid black; padding: 12pt }
pre.vt { background-color: #c0c0c0; width: auto; float: left }
pre.vt { white-space: pre }
-pre.vt { font-family: "teletext"; font-size: 20px; line-height: 20px }
+pre.vt { font-family: "teletext, monospace"; font-size: 20px; line-height: 20px }
div.quick { clear: both }
diff --git a/vbistuff/request.c b/vbistuff/request.c
index 307095c..1c25406 100644
--- a/vbistuff/request.c
+++ b/vbistuff/request.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/vbistuff/response.c b/vbistuff/response.c
index cd961da..99f9d59 100644
--- a/vbistuff/response.c
+++ b/vbistuff/response.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/x11/Subdir.mk b/x11/Subdir.mk
index ed61631..687baac 100644
--- a/x11/Subdir.mk
+++ b/x11/Subdir.mk
@@ -107,20 +107,28 @@ x11/propwatch : LDLIBS += $(ATHENA_LIBS)
x11/xawtv : LDFLAGS := $(DLFLAGS)
x11/motv : LDFLAGS := $(DLFLAGS)
x11/v4lctl : LDFLAGS := $(DLFLAGS)
-x11/pia : LDFLAGS := $(DLFLAGS)
+x11/pia : LDFLAGS := $(DLFLAGS)
+
+# compile flags
+x11/complete-xaw.o : CFLAGS += -DATHENA=1
+x11/complete-motif.o : CFLAGS += -DMOTIF=1
+
# i18n
LANGUAGES := de it fr
MOTV-app := $(patsubst %,x11/MoTV.%.ad,$(LANGUAGES))
+
# local targets
x11/complete-xaw.o:: x11/complete.c
- $(CC) $(CFLAGS) -DATHENA=1 -Wp,-MD,$*.dep -c -o $@ $<
- @sed -e "s|.*\.o:|$@::|" < $*.dep > $*.d && rm -f $*.dep
+ @$(echo_compile_c)
+ @$(compile_c)
+ @$(fixup_deps)
x11/complete-motif.o:: x11/complete.c
- $(CC) $(CFLAGS) -DMOTIF=1 -Wp,-MD,$*.dep -c -o $@ $<
- @sed -e "s|.*\.o:|$@::|" < $*.dep > $*.d && rm -f $*.dep
+ @$(echo_compile_c)
+ @$(compile_c)
+ @$(fixup_deps)
# global targets
@@ -137,7 +145,7 @@ install::
endif
ifeq ($(FOUND_MOTIF),yes)
install::
- $(INSTALL_DATA) x11/mtt.ad $(resdir)/app-defaults/mtt
+ $(INSTALL_DATA) $(srcdir)/x11/mtt.ad $(resdir)/app-defaults/mtt
$(INSTALL_DATA) x11/MoTV.ad $(resdir)/app-defaults/MoTV
for lang in $(LANGUAGES); do \
$(INSTALL_DIR) $(resdir)/$$lang/app-defaults; \
diff --git a/x11/blit.c b/x11/blit.c
index 66dee10..f3f7855 100644
--- a/x11/blit.c
+++ b/x11/blit.c
@@ -507,7 +507,7 @@ struct {
fmt: GL_BGRA_EXT,
type: GL_UNSIGNED_BYTE,
ext: "GL_EXT_bgra",
- }
+ },
#endif
};
@@ -549,6 +549,8 @@ static int gl_ext(GLubyte *find)
GLubyte *pos;
ext = glGetString(GL_EXTENSIONS);
+ if (NULL == ext)
+ return 0;
if (NULL == (pos = strstr(ext,find)))
return 0;
if (pos != ext && pos[-1] != ' ')
@@ -556,7 +558,7 @@ static int gl_ext(GLubyte *find)
if (pos[len] != ' ' && pos[len] != '\0')
return 0;
if (debug)
- fprintf(stderr,"blit: gl: extention %s available\n",find);
+ fprintf(stderr,"blit: gl: extention %s is available\n",find);
return 1;
}
@@ -662,17 +664,41 @@ struct blit_state {
XvImage *xvimage;
#endif
#if HAVE_GL
- int gl;
GLint tex;
int tw,th;
#endif
};
-void blit_get_formats(int *fmtids, int max)
+struct blit_state*
+blit_init(Widget widget, XVisualInfo *vinfo, int use_gl)
+{
+ struct blit_state *st;
+
+ if (debug)
+ fprintf(stderr,"blit: init\n");
+ BUG_ON(0 == XtWindow(widget), "no blit window");
+
+ st = malloc(sizeof(*st));
+ memset(st,0,sizeof(*st));
+
+ st->widget = widget;
+ st->vinfo = vinfo;
+ st->gc = XCreateGC(XtDisplay(st->widget),XtWindow(st->widget),0,NULL);
+#ifdef HAVE_GL
+ if (use_gl)
+ gl_init(st->widget);
+#endif
+
+ return st;
+}
+
+void blit_get_formats(struct blit_state *st, int *fmtids, int max)
{
struct ng_video_conv *conv;
int i, n=0;
+ BUG_ON(NULL == st, "blit handle is NULL");
+
/* Xvideo extention */
#ifdef HAVE_LIBXV
for (i = 0; i < VIDEO_FMT_COUNT; i++) {
@@ -712,24 +738,6 @@ void blit_get_formats(int *fmtids, int max)
fmtids[n] = 0;
}
-struct blit_state*
-blit_init(Widget widget, XVisualInfo *vinfo, int enable_gl)
-{
- struct blit_state *st;
-
- if (debug)
- fprintf(stderr,"blit: init\n");
- st = malloc(sizeof(*st));
- memset(st,0,sizeof(*st));
-
- st->widget = widget;
- st->vinfo = vinfo;
-#ifdef HAVE_GL
- st->gl = enable_gl;
-#endif
- return st;
-}
-
void blit_resize(struct blit_state *st, Dimension width, Dimension height)
{
if (debug)
@@ -744,15 +752,6 @@ void blit_init_frame(struct blit_state *st, struct ng_video_fmt *fmt)
struct ng_video_conv *conv;
int i;
- /* delayed initialization stuff (needs mapped window) */
- if (!st->gc) {
- st->gc = XCreateGC(XtDisplay(st->widget),XtWindow(st->widget),0,NULL);
-#ifdef HAVE_GL
- if (st->gl)
- gl_init(st->widget);
-#endif
- }
-
/* Xvideo extention */
#ifdef HAVE_LIBXV
if (0 != im_formats[fmt->fmtid]) {
diff --git a/x11/blit.h b/x11/blit.h
index 87888a7..cf44aaf 100644
--- a/x11/blit.h
+++ b/x11/blit.h
@@ -24,8 +24,8 @@ void xv_blit(Display *dpy, Drawable dr, GC gc, XvImage *xi,
/* video frame blitter */
struct blit_state;
-void blit_get_formats(int *fmtids, int max);
-struct blit_state* blit_init(Widget widget, XVisualInfo *vinfo, int enable_gl);
+struct blit_state* blit_init(Widget widget, XVisualInfo *vinfo, int use_gl);
+void blit_get_formats(struct blit_state *st, int *fmtids, int max);
void blit_resize(struct blit_state *st, Dimension width, Dimension height);
void blit_init_frame(struct blit_state *st, struct ng_video_fmt *fmt);
void blit_fini_frame(struct blit_state *st);
diff --git a/x11/conf.c b/x11/conf.c
index c70d2c3..2fff538 100644
--- a/x11/conf.c
+++ b/x11/conf.c
@@ -80,8 +80,11 @@ static void add_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
channel->channel = cur_channel;
channel->input = cur_attrs[ATTR_ID_INPUT];
channel->fine = cur_fine;
+ fprintf(stderr,"add_cb #1: %d %s\n",channel->channel,channel->cname);
configure_channel(channel);
+ fprintf(stderr,"add_cb #2: %d %s\n",channel->channel,channel->cname);
channel_menu();
+ fprintf(stderr,"add_cb #3: %d %s\n",channel->channel,channel->cname);
}
static void del_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
diff --git a/x11/motv.c b/x11/motv.c
index 5b99fee..34522f0 100644
--- a/x11/motv.c
+++ b/x11/motv.c
@@ -117,6 +117,7 @@ static XtActionsRec actionTable[] = {
{ "Ipc", IpcAction },
{ "Filter", FilterAction },
{ "StayOnTop", ontop_ac },
+ { "Event", EventAction },
};
static String fallback_ressources[] = {
@@ -134,7 +135,9 @@ static Widget st_freq,st_chan,st_name,st_key;
static Widget scale_shell,filter_shell;
static Widget w_full;
static Widget b_ontop;
+#ifdef HAVE_ZVBI
static struct vbi_window *vtx;
+#endif
/* properties */
static Widget prop_dlg,prop_name,prop_key,prop_channel,prop_button;
@@ -324,15 +327,19 @@ ontop_ac(Widget widget, XEvent *event, String *params, Cardinal *num_params)
static void
resize_event(Widget widget, XtPointer client_data, XEvent *event, Boolean *d)
{
- static int width = 0, height = 0;
+ static int width = 0, height = 0, first = 1;
switch(event->type) {
case ConfigureNotify:
+ if (first) {
+ video_gd_init(tv,args.gl);
+ first = 0;
+ }
if (width != event->xconfigure.width ||
height != event->xconfigure.height) {
width = event->xconfigure.width;
height = event->xconfigure.height;
- video_gd_configure(width, height, args.gl);
+ video_gd_configure(width, height);
XClearWindow(XtDisplay(tv),XtWindow(tv));
}
break;
@@ -3232,7 +3239,8 @@ main(int argc, char *argv[])
if (debug)
fprintf(stderr,"main: init main window...\n");
- tv = video_init(app_shell,&vinfo,xmPrimitiveWidgetClass,args.bpp);
+ tv = video_init(app_shell,&vinfo,xmPrimitiveWidgetClass,
+ args.bpp,args.gl);
XtAddEventHandler(XtParent(tv),StructureNotifyMask, True,
resize_event, NULL);
if (debug)
@@ -3265,7 +3273,7 @@ main(int argc, char *argv[])
if (args.readconfig) {
if (debug)
fprintf(stderr,"main: read config file ...\n");
- read_config(args.conffile ? args.conffile : NULL);
+ read_config(args.conffile ? args.conffile : NULL, &argc, argv);
}
if (0 != strlen(mixerdev)) {
struct ng_attribute *attr;
@@ -3299,6 +3307,9 @@ main(int argc, char *argv[])
if (debug)
fprintf(stderr,"main: checking for midi ...\n");
xt_midi_init(midi);
+ if (debug)
+ fprintf(stderr,"main: adding kbd hooks ...\n");
+ xt_kbd_init(tv);
if (debug)
fprintf(stderr,"main: mapping main window ...\n");
@@ -3335,6 +3346,7 @@ main(int argc, char *argv[])
}
channel_menu();
+ xt_handle_pending(dpy);
do_va_cmd(2,"setfreqtab",chanlist_names[chantab].str);
cur_capture = 0;
do_va_cmd(2,"capture","overlay");
diff --git a/x11/pia.c b/x11/pia.c
index 7aec466..06220f3 100644
--- a/x11/pia.c
+++ b/x11/pia.c
@@ -72,12 +72,15 @@ static struct ng_audio_buf *abuf;
struct ARGS {
char *dsp;
+ int slow;
int help;
int verbose;
int debug;
int xv;
int gl;
int max;
+ int audio;
+ int video;
} args;
XtResource args_desc[] = {
@@ -105,6 +108,11 @@ XtResource args_desc[] = {
XtOffset(struct ARGS*,help),
XtRString, "0"
},{
+ "slow",
+ XtCValue, XtRInt, sizeof(int),
+ XtOffset(struct ARGS*,slow),
+ XtRString, "1"
+ },{
"xv",
XtCValue, XtRInt, sizeof(int),
XtOffset(struct ARGS*,xv),
@@ -119,12 +127,23 @@ XtResource args_desc[] = {
XtCValue, XtRInt, sizeof(int),
XtOffset(struct ARGS*,max),
XtRString, "0"
+ },{
+ "audio",
+ XtCValue, XtRInt, sizeof(int),
+ XtOffset(struct ARGS*,audio),
+ XtRString, "1"
+ },{
+ "video",
+ XtCValue, XtRInt, sizeof(int),
+ XtOffset(struct ARGS*,video),
+ XtRString, "1"
}
};
const int args_count = XtNumber(args_desc);
XrmOptionDescRec opt_desc[] = {
{ "-dsp", "dsp", XrmoptionSepArg, NULL },
+ { "-slow", "slow", XrmoptionSepArg, NULL },
{ "-h", "help", XrmoptionNoArg, "1" },
{ "-help", "help", XrmoptionNoArg, "1" },
@@ -139,6 +158,10 @@ XrmOptionDescRec opt_desc[] = {
{ "-noxv", "xv", XrmoptionNoArg, "0" },
{ "-gl", "gl", XrmoptionNoArg, "1" },
{ "-nogl", "gl", XrmoptionNoArg, "0" },
+ { "-audio", "audio", XrmoptionNoArg, "1" },
+ { "-noaudio", "audio", XrmoptionNoArg, "0" },
+ { "-video", "video", XrmoptionNoArg, "1" },
+ { "-novideo", "video", XrmoptionNoArg, "0" },
};
const int opt_count = (sizeof(opt_desc)/sizeof(XrmOptionDescRec));
@@ -153,9 +176,15 @@ static void quit_ac(Widget widget, XEvent *event,
static void resize_ev(Widget widget, XtPointer client_data,
XEvent *event, Boolean *d)
{
+ static int first = 1;
+
switch(event->type) {
case MapNotify:
case ConfigureNotify:
+ if (first) {
+ blit = blit_init(simple,&vinfo,args.gl);
+ first = 0;
+ }
XtVaGetValues(widget,XtNheight,&sheight,XtNwidth,&swidth,NULL);
if (vfmt)
blit_resize(blit,swidth,sheight);
@@ -168,6 +197,7 @@ static XtActionsRec action_table[] = {
};
static String res[] = {
+ "pia.winGravity: Static",
"pia.playback.translations: #override \\n"
" <Key>Q: Quit() \\n"
" <Key>Escape: Quit()",
@@ -200,17 +230,22 @@ static void usage(FILE *out, char *prog)
prog,prog);
}
-static void sync_info(long long drift, int drops)
+static void sync_info(long long drift, int drops, int frames)
{
- fprintf(stderr,"a/v sync: audio drift is %3d ms / %d frame(s) dropped\r",
- (int)((drift)/1000000),drops);
+ int total = drops + frames;
+
+ fprintf(stderr,"a/v sync: audio drift is %4d ms / "
+ "%d of %d frame(s) [%3.1f%%] dropped \r",
+ (int)((drift)/1000000),drops,total,
+ total ? (float)drops * 100 / total : 0);
}
int main(int argc, char *argv[])
{
long long start, now, delay, latency = 0, drift = 0;
struct timeval wait;
- int fmtids[2*VIDEO_FMT_COUNT], i, n, drop, droptotal, ww, wh;
+ int fmtids[2*VIDEO_FMT_COUNT], i, n, drop, droptotal, framecount, ww, wh;
+ XEvent event;
app_shell = XtVaAppInitialize(&app_context, "pia",
opt_desc, opt_count,
@@ -240,6 +275,30 @@ int main(int argc, char *argv[])
exit(1);
}
+ /* open file */
+ reader = ng_find_reader(argv[1]);
+ if (NULL == reader) {
+ fprintf(stderr,"can't handle %s\n",argv[1]);
+ exit(1);
+ }
+ rhandle = reader->rd_open(argv[1]);
+ if (NULL == rhandle) {
+ fprintf(stderr,"opening %s failed\n",argv[1]);
+ exit(1);
+ }
+ vfmt = reader->rd_vfmt(rhandle,NULL,0);
+ if (0 == vfmt->width || 0 == vfmt->height)
+ vfmt = NULL;
+ afmt = reader->rd_afmt(rhandle);
+
+ if (0 == args.video)
+ vfmt = NULL;
+ if (0 == args.audio)
+ afmt = NULL;
+ if (1 != args.slow)
+ /* no audio for slow motion, will not sync anyway ... */
+ afmt = NULL;
+
/* init x11 stuff */
dpy = XtDisplay(app_shell);
visual = x11_find_visual(XtDisplay(app_shell));
@@ -270,21 +329,6 @@ int main(int argc, char *argv[])
sizeof(action_table)/sizeof(XtActionsRec));
XtVaSetValues(app_shell, XtNtitle,argv[1],NULL);
- /* open file */
- blit_get_formats(fmtids,sizeof(fmtids)/sizeof(int));
- reader = ng_find_reader(argv[1]);
- if (NULL == reader) {
- fprintf(stderr,"can't handle %s\n",argv[1]);
- exit(1);
- }
- rhandle = reader->rd_open(argv[1],fmtids,sizeof(fmtids)/sizeof(int));
- if (NULL == rhandle) {
- fprintf(stderr,"opening %s failed\n",argv[1]);
- exit(1);
- }
- vfmt = reader->rd_vfmt(rhandle);
- afmt = reader->rd_afmt(rhandle);
-
/* show window */
ww = 320;
wh = 32;
@@ -305,8 +349,22 @@ int main(int argc, char *argv[])
}
simple = XtVaCreateManagedWidget("playback",simpleWidgetClass,app_shell,
XtNwidth,ww, XtNheight,wh, NULL);
+ XtAddEventHandler(simple, StructureNotifyMask, True, resize_ev, NULL);
+ XtRealizeWidget(app_shell);
+ while (NULL == blit) {
+ XFlush(dpy);
+ while (True == XCheckMaskEvent(dpy, ~0, &event))
+ XtDispatchEvent(&event);
+ }
+
+ /* video setup */
+ if (vfmt) {
+ blit_get_formats(blit,fmtids,sizeof(fmtids)/sizeof(int));
+ vfmt = reader->rd_vfmt(rhandle,fmtids,sizeof(fmtids)/sizeof(int));
+ if (0 == vfmt->width || 0 == vfmt->height || VIDEO_NONE == vfmt->fmtid)
+ vfmt = NULL;
+ }
if (vfmt) {
- blit = blit_init(simple,&vinfo,args.gl);
for (i = 0; i < sizeof(fmtids)/sizeof(int); i++)
if (fmtids[i] == vfmt->fmtid)
break;
@@ -328,6 +386,8 @@ int main(int argc, char *argv[])
}
}
}
+
+ /* audio setup */
if (afmt) {
struct ng_audio_fmt f = *afmt;
snd = ng_dsp_open(args.dsp ? args.dsp : "/dev/dsp", &f,0,&shandle);
@@ -336,11 +396,11 @@ int main(int argc, char *argv[])
else {
snd_fd = snd->fd(shandle);
latency = snd->latency(shandle);
+ if (debug)
+ fprintf(stderr,"a/v sync: audio latency is %lld ms\n",
+ latency/1000000);
}
}
- XtAddEventHandler(simple,StructureNotifyMask, True, resize_ev, NULL);
- XtRealizeWidget(app_shell);
- XSync(dpy,False);
/* enter main loop
*
@@ -348,7 +408,11 @@ int main(int argc, char *argv[])
* that doesn't give us usable event scheduling, thus we have our
* own main loop here ...
*/
- start = ng_get_timestamp();
+ drop = 0;
+ droptotal = 0;
+ framecount = 0;
+ start = 0;
+ drift = 0;
if (afmt) {
/* fill sound buffer */
fd_set wr;
@@ -365,19 +429,22 @@ int main(int argc, char *argv[])
abuf = reader->rd_adata(rhandle);
if (NULL == abuf)
break;
+ if (0 == start)
+ start = ng_get_timestamp();
drift = abuf->info.ts - (ng_get_timestamp() - start);
abuf = snd->write(shandle,abuf);
if (NULL != abuf)
break;
}
}
+ if (0 == start)
+ start = ng_get_timestamp();
- drop = 0;
- droptotal = 0;
+ if (debug)
+ fprintf(stderr,"a/v sync: audio buffer filled\n");
for (; vfmt || afmt;) {
int rc,max;
fd_set rd,wr;
- XEvent event;
/* handle X11 events */
if (True == XCheckMaskEvent(dpy, ~0, &event)) {
@@ -394,9 +461,13 @@ int main(int argc, char *argv[])
drift = abuf->info.ts - (ng_get_timestamp() - start);
}
if (vfmt && NULL == vbuf) {
+ droptotal += drop;
vbuf = reader->rd_vdata(rhandle,drop);
if (conv)
vbuf = ng_convert_frame(chandle,NULL,vbuf);
+ if (NULL != vbuf && 1 != args.slow)
+ /* ts fixup for slow motion */
+ vbuf->info.ts *= args.slow;
if (NULL == vbuf)
vfmt = NULL; /* EOF */
}
@@ -421,16 +492,14 @@ int main(int argc, char *argv[])
now += drift;
now -= latency;
if (args.verbose)
- sync_info(drift-latency,droptotal);
+ sync_info(drift-latency,droptotal,framecount);
}
delay = vbuf->info.ts - now;
if (delay < 0) {
- /* FIXME: drop frames if needed */
drop = -delay / reader->frame_time(rhandle);
if (drop) {
- droptotal += drop;
if (args.verbose)
- sync_info(drift-latency,droptotal);
+ sync_info(drift-latency,droptotal,framecount);
}
wait.tv_sec = 0;
wait.tv_usec = 0;
@@ -452,6 +521,7 @@ int main(int argc, char *argv[])
if (vfmt && 0 == rc) {
/* blit video frame */
blit_putframe(blit,vbuf);
+ framecount++;
vbuf = NULL;
}
}
diff --git a/x11/v4lctl.c b/x11/v4lctl.c
index 08a8b50..8100363 100644
--- a/x11/v4lctl.c
+++ b/x11/v4lctl.c
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
#endif
if (NULL == drv)
grabber_init();
- read_config(NULL);
+ read_config(NULL,NULL,NULL);
attr_init();
audio_init();
diff --git a/x11/videodev2-new.h b/x11/videodev2-new.h
new file mode 100644
index 0000000..1806b7d
--- /dev/null
+++ b/x11/videodev2-new.h
@@ -0,0 +1,862 @@
+#ifndef __LINUX_VIDEODEV2_H
+#define __LINUX_VIDEODEV2_H
+/*
+ * Video for Linux Two
+ *
+ * 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.
+ */
+
+/*
+ * M I S C E L L A N E O U S
+ */
+
+/* Four-character-code (FOURCC) */
+#define v4l2_fourcc(a,b,c,d)\
+ (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
+
+/*
+ * E N U M S
+ */
+enum v4l2_field {
+ V4L2_FIELD_ANY = 0, /* driver can choose from none,
+ top, bottom, interlaced
+ depending on whatever it thinks
+ is approximate ... */
+ V4L2_FIELD_NONE = 1, /* this device has no fields ... */
+ V4L2_FIELD_TOP = 2, /* top field only */
+ V4L2_FIELD_BOTTOM = 3, /* bottom field only */
+ V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
+ V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
+ buffer, top-bottom order */
+ V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
+ V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
+ separate buffers */
+};
+#define V4L2_FIELD_HAS_TOP(field) \
+ ((field) == V4L2_FIELD_TOP ||\
+ (field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTTOM(field) \
+ ((field) == V4L2_FIELD_BOTTOM ||\
+ (field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTH(field) \
+ ((field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+
+enum v4l2_buf_type {
+ V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
+ V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
+ V4L2_BUF_TYPE_VBI_CAPTURE = 4,
+ V4L2_BUF_TYPE_VBI_OUTPUT = 5,
+ V4L2_BUF_TYPE_PRIVATE = 0x80,
+};
+
+enum v4l2_ctrl_type {
+ V4L2_CTRL_TYPE_INTEGER = 1,
+ V4L2_CTRL_TYPE_BOOLEAN = 2,
+ V4L2_CTRL_TYPE_MENU = 3,
+ V4L2_CTRL_TYPE_BUTTON = 4,
+};
+
+enum v4l2_tuner_type {
+ V4L2_TUNER_RADIO = 1,
+ V4L2_TUNER_ANALOG_TV = 2,
+};
+
+enum v4l2_memory {
+ V4L2_MEMORY_MMAP = 1,
+ V4L2_MEMORY_USERPTR = 2,
+ V4L2_MEMORY_OVERLAY = 3,
+};
+
+/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
+enum v4l2_colorspace {
+ /* ITU-R 601 -- broadcast NTSC/PAL */
+ V4L2_COLORSPACE_SMPTE170M = 1,
+
+ /* 1125-Line (US) HDTV */
+ V4L2_COLORSPACE_SMPTE240M = 2,
+
+ /* HD and modern captures. */
+ V4L2_COLORSPACE_REC709 = 3,
+
+ /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
+ V4L2_COLORSPACE_BT878 = 4,
+
+ /* These should be useful. Assume 601 extents. */
+ V4L2_COLORSPACE_470_SYSTEM_M = 5,
+ V4L2_COLORSPACE_470_SYSTEM_BG = 6,
+
+ /* I know there will be cameras that send this. So, this is
+ * unspecified chromaticities and full 0-255 on each of the
+ * Y'CbCr components
+ */
+ V4L2_COLORSPACE_JPEG = 7,
+
+ /* For RGB colourspaces, this is probably a good start. */
+ V4L2_COLORSPACE_SRGB = 8,
+};
+
+struct v4l2_rect {
+ __s32 left;
+ __s32 top;
+ __u32 width;
+ __u32 height;
+};
+
+struct v4l2_fract {
+ __u32 numerator;
+ __u32 denominator;
+};
+
+/*
+ * D R I V E R C A P A B I L I T I E S
+ */
+struct v4l2_capability
+{
+ __u8 name[32]; /* Descriptive, and unique */
+ __u32 version; /* use KERNEL_VERSION() macro here */
+ __u32 capabilities; /* Device capabilities */
+ __u32 flags; /* Feature flags, see below */
+ __u32 reserved[4];
+};
+
+/* Values for 'capabilities' field */
+#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
+#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
+#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
+#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a VBI capture device */
+#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a VBI output device */
+#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
+
+#define V4L2_CAP_TUNER 0x00010000 /* Has a tuner */
+#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
+
+#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
+#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
+#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
+
+/*
+ * V I D E O I M A G E F O R M A T
+ */
+
+struct v4l2_pix_format
+{
+ __u32 width;
+ __u32 height;
+ __u32 pixelformat;
+ enum v4l2_field field;
+ __u32 bytesperline; /* for padding, zero if unused */
+ __u32 sizeimage;
+ enum v4l2_colorspace colorspace;
+ __u32 priv; /* private data, depends on pixelformat */
+};
+
+/* Pixel format FOURCC depth Description */
+#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 */
+#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
+#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
+
+/* two planes -- one Y, one Cr + Cb interleaved */
+#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */
+#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */
+
+/* The following formats are not defined in the V4L2 specification */
+#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 */
+
+/* compressed formats */
+#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
+#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */
+#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* digital video */
+
+/* Vendor-specific formats */
+#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compres */
+
+/*
+ * F O R M A T E N U M E R A T I O N
+ */
+struct v4l2_fmtdesc
+{
+ __u32 index; /* Format number */
+ enum v4l2_buf_type type; /* buffer type */
+ __u32 flags;
+ __u8 description[32]; /* Description string */
+ __u32 pixelformat; /* Format fourcc */
+ __u32 reserved[4];
+};
+
+#define V4L2_FMT_FLAG_COMPRESSED 0x0001
+
+
+/*
+ * T I M E C O D E
+ */
+struct v4l2_timecode
+{
+ __u32 type;
+ __u32 flags;
+ __u8 frames;
+ __u8 seconds;
+ __u8 minutes;
+ __u8 hours;
+ __u8 userbits[4];
+};
+
+/* Type */
+#define V4L2_TC_TYPE_24FPS 1
+#define V4L2_TC_TYPE_25FPS 2
+#define V4L2_TC_TYPE_30FPS 3
+#define V4L2_TC_TYPE_50FPS 4
+#define V4L2_TC_TYPE_60FPS 5
+
+/* Flags */
+#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
+#define V4L2_TC_FLAG_COLORFRAME 0x0002
+#define V4L2_TC_USERBITS_field 0x000C
+#define V4L2_TC_USERBITS_USERDEFINED 0x0000
+#define V4L2_TC_USERBITS_8BITCHARS 0x0008
+/* The above is based on SMPTE timecodes */
+
+
+/*
+ * C O M P R E S S I O N P A R A M E T E R S
+ */
+#if 0
+/* ### generic compression settings don't work, there is too much
+ * ### codec-specific stuff. Maybe reuse that for MPEG codec settings
+ * ### later ... */
+struct v4l2_compression
+{
+ __u32 quality;
+ __u32 keyframerate;
+ __u32 pframerate;
+ __u32 reserved[5];
+};
+#endif
+
+struct v4l2_jpegcompression
+{
+ int quality;
+
+ int APPn; /* Number of APP segment to be written,
+ * must be 0..15 */
+ int APP_len; /* Length of data in JPEG APPn segment */
+ char APP_data[60]; /* Data in the JPEG APPn segment. */
+
+ int COM_len; /* Length of data in JPEG COM segment */
+ char COM_data[60]; /* Data in JPEG COM segment */
+
+ __u32 jpeg_markers; /* Which markers should go into the JPEG
+ * output. Unless you exactly know what
+ * you do, leave them untouched.
+ * Inluding less markers will make the
+ * resulting code smaller, but there will
+ * be fewer aplications which can read it.
+ * The presence of the APP and COM marker
+ * is influenced by APP_len and COM_len
+ * ONLY, not by this property! */
+
+#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
+#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
+#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
+#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
+#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
+ * allways use APP0 */
+};
+
+
+/*
+ * M E M O R Y - M A P P I N G B U F F E R S
+ */
+struct v4l2_requestbuffers
+{
+ __u32 count;
+ enum v4l2_buf_type type;
+ enum v4l2_memory memory;
+ __u32 reserved[2];
+};
+
+struct v4l2_buffer
+{
+ __u32 index;
+ enum v4l2_buf_type type;
+ __u32 bytesused;
+ __u32 flags;
+ enum v4l2_field field;
+ struct timeval timestamp;
+ struct v4l2_timecode timecode;
+ __u32 sequence;
+
+ /* memory location */
+ enum v4l2_memory memory;
+ union {
+ __u32 offset;
+ unsigned long userptr;
+ } m;
+ __u32 length;
+
+ __u32 reserved[2];
+};
+
+/* Flags for 'flags' field */
+#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
+#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
+#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
+#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
+#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
+#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
+#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
+
+/*
+ * O V E R L A Y P R E V I E W
+ */
+struct v4l2_framebuffer
+{
+ __u32 capability;
+ __u32 flags;
+/* FIXME: in theory we should pass something like PCI device + memory
+ * region + offset instead of some physical address */
+ void* base;
+ struct v4l2_pix_format fmt;
+};
+/* Flags for the 'capability' field. Read only */
+#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
+#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
+#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
+#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
+/* Flags for the 'flags' field. */
+#define V4L2_FBUF_FLAG_PRIMARY 0x0001
+#define V4L2_FBUF_FLAG_OVERLAY 0x0002
+#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
+
+struct v4l2_clip
+{
+ struct v4l2_rect c;
+ struct v4l2_clip *next;
+};
+
+struct v4l2_window
+{
+ struct v4l2_rect w;
+ enum v4l2_field field;
+ __u32 chromakey;
+ struct v4l2_clip *clips;
+ __u32 clipcount;
+ void *bitmap;
+};
+
+
+/*
+ * C A P T U R E P A R A M E T E R S
+ */
+struct v4l2_captureparm
+{
+ __u32 capability; /* Supported modes */
+ __u32 capturemode; /* Current mode */
+ struct v4l2_fract timeperframe; /* Time per frame in .1us units */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 readbuffers; /* # of buffers for read */
+ __u32 reserved[4];
+};
+/* Flags for 'capability' and 'capturemode' fields */
+#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
+#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
+
+struct v4l2_outputparm
+{
+ __u32 capability; /* Supported modes */
+ __u32 outputmode; /* Current mode */
+ struct v4l2_fract timeperframe; /* Time per frame in seconds */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 writebuffers; /* # of buffers for write */
+ __u32 reserved[4];
+};
+
+/*
+ * I N P U T I M A G E C R O P P I N G
+ */
+
+struct v4l2_cropcap {
+ enum v4l2_buf_type type;
+ struct v4l2_rect bounds;
+ struct v4l2_rect defrect;
+ struct v4l2_fract pixelaspect;
+};
+
+struct v4l2_crop {
+ enum v4l2_buf_type type;
+ struct v4l2_rect c;
+};
+
+/*
+ * A N A L O G V I D E O S T A N D A R D
+ */
+
+typedef __u64 v4l2_std_id;
+
+/* one bit for each */
+#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
+
+#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
+
+#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
+#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
+#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
+#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
+#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
+#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
+#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
+
+/* ATSC/HDTV */
+#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
+#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
+
+/* some common needed stuff */
+#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
+ V4L2_STD_PAL_B1 |\
+ V4L2_STD_PAL_G)
+#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
+ V4L2_STD_PAL_D1 |\
+ V4L2_STD_PAL_K)
+#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
+ V4L2_STD_PAL_DK |\
+ V4L2_STD_PAL_H |\
+ V4L2_STD_PAL_I)
+#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
+ V4L2_STD_NTSC_M_JP)
+#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
+ V4L2_STD_SECAM_D |\
+ V4L2_STD_SECAM_G |\
+ V4L2_STD_SECAM_H |\
+ V4L2_STD_SECAM_K |\
+ V4L2_STD_SECAM_K1 |\
+ V4L2_STD_SECAM_L)
+
+#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
+ V4L2_STD_PAL_60 |\
+ V4L2_STD_NTSC)
+#define V4L2_STD_625_50 (V4L2_STD_PAL |\
+ V4L2_STD_PAL_N |\
+ V4L2_STD_PAL_Nc |\
+ V4L2_STD_SECAM)
+
+#define V4L2_STD_UNKNOWN 0
+#define V4L2_STD_ALL (V4L2_STD_525_60 |\
+ V4L2_STD_625_50)
+
+struct v4l2_standard
+{
+ __u32 index;
+ v4l2_std_id id;
+ __u8 name[24];
+ struct v4l2_fract frameperiod; /* Frames, not fields */
+ __u32 framelines;
+ __u32 reserved[4];
+};
+
+
+/*
+ * V I D E O I N P U T S
+ */
+struct v4l2_input
+{
+ __u32 index; /* Which input */
+ __u8 name[32]; /* Label */
+ __u32 type; /* Type of input */
+ __u32 audioset; /* Associated audios (bitfield) */
+ __u32 tuner; /* Associated tuner */
+ v4l2_std_id std;
+ __u32 status;
+ __u32 reserved[4];
+};
+/* Values for the 'type' field */
+#define V4L2_INPUT_TYPE_TUNER 1
+#define V4L2_INPUT_TYPE_CAMERA 2
+
+/* field 'status' - general */
+#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
+#define V4L2_IN_ST_NO_SIGNAL 0x00000002
+#define V4L2_IN_ST_NO_COLOR 0x00000004
+
+/* field 'status' - analog */
+#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
+#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
+
+/* field 'status' - digital */
+#define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
+#define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
+#define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
+
+/* field 'status' - VCR and set-top box */
+#define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
+#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
+#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
+
+/*
+ * V I D E O O U T P U T S
+ */
+struct v4l2_output
+{
+ __u32 index; /* Which output */
+ __u8 name[32]; /* Label */
+ __u32 type; /* Type of output */
+ __u32 audioset; /* Associated audios (bitfield) */
+ __u32 modulator; /* Associated modulator */
+ v4l2_std_id std;
+ __u32 reserved[4];
+};
+/* Values for the 'type' field */
+#define V4L2_OUTPUT_TYPE_MODULATOR 1
+#define V4L2_OUTPUT_TYPE_ANALOG 2
+#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
+
+/*
+ * C O N T R O L S
+ */
+struct v4l2_control
+{
+ __u32 id;
+ __s32 value;
+};
+
+/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
+struct v4l2_queryctrl
+{
+ __u32 id;
+ enum v4l2_ctrl_type type;
+ __u8 name[32]; /* Whatever */
+ __s32 minimum; /* Note signedness */
+ __s32 maximum;
+ __s32 step;
+ __s32 default_value;
+ __u32 flags;
+ __u32 reserved[2];
+};
+
+/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
+struct v4l2_querymenu
+{
+ __u32 id;
+ __u32 index;
+ __u8 name[32]; /* Whatever */
+ __u32 reserved;
+};
+
+/* Control flags */
+#define V4L2_CTRL_FLAG_DISABLED 0x0001
+#define V4L2_CTRL_FLAG_GRABBED 0x0002
+
+/* Control IDs defined by V4L2 */
+#define V4L2_CID_BASE 0x00980900
+/* IDs reserved for driver specific controls */
+#define V4L2_CID_PRIVATE_BASE 0x08000000
+
+#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
+#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
+#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
+#define V4L2_CID_HUE (V4L2_CID_BASE+3)
+#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
+#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
+#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
+#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
+#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_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)
+#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
+#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* ? Not sure */
+#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
+#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
+#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
+#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_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */
+
+/*
+ * T U N I N G
+ */
+struct v4l2_tuner
+{
+ __u32 index;
+ __u8 name[32];
+ enum v4l2_tuner_type type;
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 rxsubchans;
+ __u32 audmode;
+ __u32 signal;
+ __u32 afc;
+ __u32 reserved[4];
+};
+
+struct v4l2_modulator
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 txsubchans;
+ __u32 reserved[4];
+};
+
+/* Flags for the 'capability' field */
+#define V4L2_TUNER_CAP_LOW 0x0001
+#define V4L2_TUNER_CAP_NORM 0x0002
+#define V4L2_TUNER_CAP_STEREO 0x0010
+#define V4L2_TUNER_CAP_LANG2 0x0020
+#define V4L2_TUNER_CAP_SAP 0x0020
+#define V4L2_TUNER_CAP_LANG1 0x0040
+
+/* Flags for the 'rxsubchans' field */
+#define V4L2_TUNER_SUB_MONO 0x0001
+#define V4L2_TUNER_SUB_STEREO 0x0002
+#define V4L2_TUNER_SUB_LANG2 0x0004
+#define V4L2_TUNER_SUB_SAP 0x0004
+#define V4L2_TUNER_SUB_LANG1 0x0008
+
+/* Values for the 'audmode' field */
+#define V4L2_TUNER_MODE_MONO 0x0000
+#define V4L2_TUNER_MODE_STEREO 0x0001
+#define V4L2_TUNER_MODE_LANG2 0x0002
+#define V4L2_TUNER_MODE_SAP 0x0002
+#define V4L2_TUNER_MODE_LANG1 0x0003
+
+struct v4l2_frequency
+{
+ __u32 tuner;
+ enum v4l2_tuner_type type;
+ __u32 frequency;
+ __u32 reserved[8];
+};
+
+/*
+ * A U D I O
+ */
+struct v4l2_audio
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+/* Flags for the 'capability' field */
+#define V4L2_AUDCAP_EFFECTS 0x0020
+#define V4L2_AUDCAP_LOUDNESS 0x0040
+#define V4L2_AUDCAP_AVL 0x0080
+
+/* Flags for the 'mode' field */
+#define V4L2_AUDMODE_LOUDNESS 0x00002
+#define V4L2_AUDMODE_AVL 0x00004
+#define V4L2_AUDMODE_STEREO_field 0x0FF00
+#define V4L2_AUDMODE_STEREO_LINEAR 0x00100
+#define V4L2_AUDMODE_STEREO_PSEUDO 0x00200
+#define V4L2_AUDMODE_STEREO_SPATIAL30 0x00300
+#define V4L2_AUDMODE_STEREO_SPATIAL50 0x00400
+
+struct v4l2_audioout
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+
+/*
+ * 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 offset;
+ __u32 samples_per_line;
+ __u32 sample_format; /* V4L2_PIX_FMT_* */
+ __s32 start[2];
+ __u32 count[2];
+ __u32 flags; /* V4L2_VBI_* */
+ __u32 reserved[2]; /* must be zero */
+};
+
+/* VBI flags */
+#define V4L2_VBI_UNSYNC (1<< 0)
+#define V4L2_VBI_INTERLACED (1<< 1)
+
+
+/*
+ * A G G R E G A T E S T R U C T U R E S
+ */
+
+/* Stream data format
+ */
+struct v4l2_format
+{
+ enum v4l2_buf_type type;
+ union
+ {
+ struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
+ struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
+ struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
+ __u8 raw_data[200]; // user-defined
+ } fmt;
+};
+
+
+/* Stream type-dependent parameters
+ */
+struct v4l2_streamparm
+{
+ enum v4l2_buf_type type;
+ union
+ {
+ struct v4l2_captureparm capture;
+ struct v4l2_outputparm output;
+ __u8 raw_data[200]; /* user-defined */
+ } parm;
+};
+
+
+
+/*
+ * I O C T L C O D E S F O R V I D E O D E V I C E S
+ *
+ */
+#define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability)
+#define VIDIOC_RESERVED _IO ('V', 1)
+#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
+#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
+#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
+#if 0
+#define VIDIOC_G_COMP _IOR ('V', 6, struct v4l2_compression)
+#define VIDIOC_S_COMP _IOW ('V', 7, struct v4l2_compression)
+#endif
+#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
+#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
+#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
+#define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer)
+#define VIDIOC_OVERLAY _IOWR ('V', 14, int)
+#define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer)
+#define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer)
+#define VIDIOC_STREAMON _IOW ('V', 18, int)
+#define VIDIOC_STREAMOFF _IOW ('V', 19, int)
+#define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm)
+#define VIDIOC_S_PARM _IOW ('V', 22, struct v4l2_streamparm)
+#define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id)
+#define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id)
+#define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard)
+#define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input)
+#define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control)
+#define VIDIOC_S_CTRL _IOW ('V', 28, struct v4l2_control)
+#define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner)
+#define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner)
+#define VIDIOC_G_AUDIO _IOWR ('V', 33, struct v4l2_audio)
+#define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio)
+#define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl)
+#define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu)
+#define VIDIOC_G_INPUT _IOR ('V', 38, int)
+#define VIDIOC_S_INPUT _IOWR ('V', 39, int)
+#define VIDIOC_G_OUTPUT _IOR ('V', 46, int)
+#define VIDIOC_S_OUTPUT _IOWR ('V', 47, int)
+#define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output)
+#define VIDIOC_G_AUDOUT _IOWR ('V', 49, struct v4l2_audioout)
+#define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout)
+#define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator)
+#define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator)
+#define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency)
+#define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency)
+#define VIDIOC_CROPCAP _IOR ('V', 58, struct v4l2_cropcap)
+#define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop)
+#define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop)
+#define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression)
+#define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression)
+#define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id)
+#define VIDIOC_TRY_FMT _IOWR ('V', 63, struct v4l2_format)
+
+#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
+
+
+#ifdef __KERNEL__
+/*
+ *
+ * V 4 L 2 D R I V E R H E L P E R A P I
+ *
+ * Some commonly needed functions for drivers (v4l2-common.o module)
+ */
+#include <linux/fs.h>
+
+/* Video standard functions */
+extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
+extern int v4l2_video_std_construct(struct v4l2_standard *vs,
+ int id, char *name);
+
+/* Compatibility layer interface */
+typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg);
+int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
+ int cmd, void *arg, v4l2_kioctl driver_ioctl);
+
+/* names for fancy debug output */
+extern char *v4l2_field_names[];
+extern char *v4l2_type_names[];
+
+#endif /* __KERNEL__ */
+#endif /* __LINUX_VIDEODEV2_H */
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/x11/wmhooks.c b/x11/wmhooks.c
index 3d1e1af..1ca0356 100644
--- a/x11/wmhooks.c
+++ b/x11/wmhooks.c
@@ -88,6 +88,18 @@ wm_detect(Display *dpy)
unsigned char *args = NULL;
Window root = DefaultRootWindow(dpy);
+ /* netwm compliant */
+ if (Success == XGetWindowProperty
+ (dpy, root, _NET_SUPPORTED, 0, (65536 / sizeof(long)), False,
+ AnyPropertyType, &type, &format, &nitems, &bytesafter, &args) &&
+ nitems > 0) {
+ if (debug)
+ fprintf(stderr,"wmhooks: netwm\n");
+ wm_stay_on_top = net_wm_stay_on_top;
+ XFree(args);
+ return 0;
+ }
+
/* gnome-compilant */
if (Success == XGetWindowProperty
(dpy, root, _WIN_SUPPORTING_WM_CHECK, 0, (65536 / sizeof(long)), False,
@@ -101,18 +113,6 @@ wm_detect(Display *dpy)
return 0;
}
- /* netwm compliant */
- if (Success == XGetWindowProperty
- (dpy, root, _NET_SUPPORTED, 0, (65536 / sizeof(long)), False,
- AnyPropertyType, &type, &format, &nitems, &bytesafter, &args) &&
- nitems > 0) {
- if (debug)
- fprintf(stderr,"wmhooks: netwm\n");
- wm_stay_on_top = net_wm_stay_on_top;
- XFree(args);
- return 0;
- }
-
/* nothing found... */
return -1;
}
diff --git a/x11/x11.c b/x11/x11.c
index 2a8d2b6..89b6383 100644
--- a/x11/x11.c
+++ b/x11/x11.c
@@ -38,9 +38,6 @@
#include "commands.h"
#include "blit.h"
-#define DISPLAY XtDisplay
-#define SCREEN XtScreen
-#define WINDOW XtWindow
#define DEL_TIMER(proc) XtRemoveTimeOut(proc)
#define ADD_TIMER(proc) XtAppAddTimeOut(app_context,200,proc,NULL)
@@ -117,6 +114,16 @@ struct video_handle {
};
struct video_handle vh;
+void video_gd_init(Widget widget, int use_gl)
+{
+ struct video_handle *h = &vh;
+
+ if (debug)
+ fprintf(stderr,"gd: init\n");
+ h->win = widget;
+ h->blit = blit_init(h->win,&vinfo, use_gl);
+}
+
static struct ng_video_buf*
video_gd_filter(struct video_handle *h, struct ng_video_buf *buf)
{
@@ -197,10 +204,10 @@ video_gd_start(void)
{
struct video_handle *h = &vh;
+ if (debug)
+ fprintf(stderr,"gd: start [%d]\n",h->best.fmtid);
if (0 == h->best.fmtid)
return;
- if (debug)
- fprintf(stderr,"gd: start\n");
ng_grabber_setformat(&h->best,0);
drv->startvideo(h_drv,-1,2);
h->work_id = XtAppAddWorkProc(app_context, video_gd_idle, h);
@@ -241,7 +248,7 @@ video_gd_restart(void)
return;
h->suspend = 0;
if (h->nw && h->nh) {
- video_gd_configure(h->nw,h->nh,0);
+ video_gd_configure(h->nw,h->nh);
h->nw = 0;
h->nh = 0;
}
@@ -251,7 +258,7 @@ video_gd_restart(void)
}
void
-video_gd_configure(int width, int height, int gl)
+video_gd_configure(int width, int height)
{
struct video_handle *h = &vh;
int i,fmtids[2*VIDEO_FMT_COUNT];
@@ -259,8 +266,6 @@ video_gd_configure(int width, int height, int gl)
if (!(f_drv & CAN_CAPTURE))
return;
- if (NULL == h->blit)
- h->blit = blit_init(h->win,&vinfo, gl);
blit_resize(h->blit,width,height);
if (h->suspend) {
@@ -287,7 +292,7 @@ video_gd_configure(int width, int height, int gl)
ng_ratio_fixup(&h->best.width, &h->best.height, NULL, NULL);
if (0 == h->best.fmtid) {
- blit_get_formats(fmtids,sizeof(fmtids)/sizeof(int));
+ blit_get_formats(h->blit,fmtids,sizeof(fmtids)/sizeof(int));
for (i = 0; i < sizeof(fmtids)/sizeof(int); i++) {
h->best.fmtid = fmtids[i];
if (0 == ng_grabber_setformat(&h->best,0))
@@ -395,7 +400,7 @@ get_clips(void)
fprintf(stderr," getclips");
lastcount = oc_count;
oc_count = 0;
- dpy = DISPLAY(video);
+ dpy = XtDisplay(video);
if (wx<0)
add_clip(0, 0, (uint)(-wx), wfmt.height);
@@ -407,7 +412,7 @@ get_clips(void)
add_clip(0, sheight-wy, wfmt.width, wfmt.height);
root=DefaultRootWindow(dpy);
- me = WINDOW(video);
+ me = XtWindow(video);
for (;;) {
XQueryTree(dpy, me, &rroot, &parent, &children, &nchildren);
XFree((char *) children);
@@ -451,8 +456,8 @@ get_clips(void)
static void
refresh_timer(XtPointer clientData, XtIntervalId *id)
{
- Window win = RootWindowOfScreen(SCREEN(video));
- Display *dpy = DISPLAY(video);
+ Window win = RootWindowOfScreen(XtScreen(video));
+ Display *dpy = XtDisplay(video);
XSetWindowAttributes xswa;
unsigned long mask;
Window tmp;
@@ -605,7 +610,7 @@ video_event(Widget widget, XtPointer client_data, XEvent *event, Boolean *d)
/* TV widget (+root window) */
switch(event->type) {
case Expose:
- if (event->xvisibility.window == WINDOW(video)) {
+ if (event->xvisibility.window == XtWindow(video)) {
/* tv */
if (!event->xexpose.count) {
if (did_refresh) {
@@ -622,7 +627,7 @@ video_event(Widget widget, XtPointer client_data, XEvent *event, Boolean *d)
}
break;
case VisibilityNotify:
- if (event->xvisibility.window == WINDOW(video)) {
+ if (event->xvisibility.window == XtWindow(video)) {
/* tv */
visibility = event->xvisibility.state;
if (debug > 1)
@@ -645,7 +650,7 @@ video_event(Widget widget, XtPointer client_data, XEvent *event, Boolean *d)
case MapNotify:
case UnmapNotify:
case ConfigureNotify:
- if (event->xvisibility.window != WINDOW(video)) {
+ if (event->xvisibility.window != XtWindow(video)) {
if (debug > 1)
fprintf(stderr,"video: root: %s%s\n",
events[event->type],did_refresh?" (ignored)":"");
@@ -688,12 +693,13 @@ video_overlay(int state)
}
Widget
-video_init(Widget parent, XVisualInfo *vinfo, WidgetClass class, int args_bpp)
+video_init(Widget parent, XVisualInfo *vinfo, WidgetClass class,
+ int args_bpp, int args_gl)
{
- Window root = DefaultRootWindow(DISPLAY(parent));
+ Window root = DefaultRootWindow(XtDisplay(parent));
- swidth = SCREEN(parent)->width;
- sheight = SCREEN(parent)->height;
+ swidth = XtScreen(parent)->width;
+ sheight = XtScreen(parent)->height;
x11_overlay_fmtid = x11_dpy_fmtid;
if (ImageByteOrder(XtDisplay(parent)) == MSBFirst) {
@@ -718,7 +724,6 @@ video_init(Widget parent, XVisualInfo *vinfo, WidgetClass class, int args_bpp)
video_parent = parent;
video = XtVaCreateManagedWidget("tv",class,parent,NULL);
- vh.win = video;
/* Shell widget -- need map, unmap, configure */
XtAddEventHandler(parent,
@@ -733,12 +738,12 @@ video_init(Widget parent, XVisualInfo *vinfo, WidgetClass class, int args_bpp)
False, video_event, NULL);
/* root window -- need */
- XSelectInput(DISPLAY(video),root,
+ XSelectInput(XtDisplay(video),root,
VisibilityChangeMask |
SubstructureNotifyMask |
StructureNotifyMask);
- XtRegisterDrawable(DISPLAY(video),root,video);
+ XtRegisterDrawable(XtDisplay(video),root,video);
}
return video;
@@ -747,10 +752,10 @@ video_init(Widget parent, XVisualInfo *vinfo, WidgetClass class, int args_bpp)
void
video_close(void)
{
- Window root = DefaultRootWindow(DISPLAY(video));
+ Window root = DefaultRootWindow(XtDisplay(video));
if (overlay_refresh)
DEL_TIMER(overlay_refresh);
- XSelectInput(DISPLAY(video),root,0);
- XtUnregisterDrawable(DISPLAY(video),root);
+ XSelectInput(XtDisplay(video),root,0);
+ XtUnregisterDrawable(XtDisplay(video),root);
}
diff --git a/x11/x11.h b/x11/x11.h
index 83f5438..b20b915 100644
--- a/x11/x11.h
+++ b/x11/x11.h
@@ -8,15 +8,16 @@ Pixmap x11_capture_pixmap(Display *dpy, XVisualInfo *vinfo, Colormap colormap,
struct video_handle;
extern struct video_handle vh;
int video_gd_blitframe(struct video_handle *h, struct ng_video_buf *buf);
+void video_gd_init(Widget widget, int use_gl);
void video_gd_start(void);
void video_gd_stop(void);
void video_gd_suspend(void);
void video_gd_restart(void);
-void video_gd_configure(int width, int height, int gl);
+void video_gd_configure(int width, int height);
void video_new_size(void);
void video_overlay(int state);
Widget video_init(Widget parent, XVisualInfo *vinfo,
- WidgetClass class, int bpp);
+ WidgetClass class, int args_bpp, int args_gl);
void video_close(void);
diff --git a/x11/xawtv.c b/x11/xawtv.c
index 177986d..f4cf72b 100644
--- a/x11/xawtv.c
+++ b/x11/xawtv.c
@@ -229,6 +229,7 @@ static XtActionsRec actionTable[] = {
#ifdef HAVE_ZVBI
{ "Vtx", VtxAction },
#endif
+ { "Event", EventAction },
};
static struct STRTAB cap_list[] = {
@@ -478,16 +479,20 @@ display_subtitle(struct vbi_page *pg, struct vbi_rect *rect)
static void
resize_event(Widget widget, XtPointer client_data, XEvent *event, Boolean *d)
{
- static int width = 0, height = 0;
+ static int width = 0, height = 0, first = 1;
char label[64];
switch(event->type) {
case ConfigureNotify:
+ if (first) {
+ video_gd_init(tv,args.gl);
+ first = 0;
+ }
if (width != event->xconfigure.width ||
height != event->xconfigure.height) {
width = event->xconfigure.width;
height = event->xconfigure.height;
- video_gd_configure(width, height, args.gl);
+ video_gd_configure(width, height);
XClearWindow(XtDisplay(tv),XtWindow(tv));
sprintf(label,"%-" LABEL_WIDTH "s: %dx%d",MOVIE_SIZE,width,height);
if (w_movie_size)
@@ -1641,7 +1646,8 @@ main(int argc, char *argv[])
if (debug)
fprintf(stderr,"main: init main window...\n");
- tv = video_init(app_shell,&vinfo,simpleWidgetClass,args.bpp);
+ tv = video_init(app_shell, &vinfo, simpleWidgetClass,
+ args.bpp, args.gl);
XtAddEventHandler(XtParent(tv),StructureNotifyMask, True,
resize_event, NULL);
if (debug)
@@ -1672,7 +1678,7 @@ main(int argc, char *argv[])
if (args.readconfig) {
if (debug)
fprintf(stderr,"main: read config file ...\n");
- read_config(args.conffile ? args.conffile : NULL);
+ read_config(args.conffile ? args.conffile : NULL, &argc, argv);
}
if (0 != strlen(mixerdev)) {
struct ng_attribute *attr;
@@ -1704,6 +1710,9 @@ main(int argc, char *argv[])
if (debug)
fprintf(stderr,"main: checking for midi ...\n");
xt_midi_init(midi);
+ if (debug)
+ fprintf(stderr,"main: adding kbd hooks ...\n");
+ xt_kbd_init(tv);
if (debug)
fprintf(stderr,"main: mapping main window ...\n");
@@ -1743,6 +1752,7 @@ main(int argc, char *argv[])
}
channel_menu();
+ xt_handle_pending(dpy);
do_va_cmd(2,"setfreqtab",chanlist_names[chantab].str);
cur_capture = 0;
do_va_cmd(2,"capture","overlay");
diff --git a/x11/xt.c b/x11/xt.c
index decf4cd..fcc97cc 100644
--- a/x11/xt.c
+++ b/x11/xt.c
@@ -79,6 +79,8 @@ Status DPMSDisable(Display*);
#include "joystick.h"
#include "vbi-data.h"
#include "blit.h"
+#include "parseconfig.h"
+#include "event.h"
/* jwz */
#include "remote.h"
@@ -1876,6 +1878,31 @@ int xt_joystick_init(void)
return 0;
}
+/* ---------------------------------------------------------------------- */
+
+void xt_kbd_init(Widget tv)
+{
+ char **list,key[16],str[128];
+
+ list = cfg_list_entries("eventmap");
+ if (NULL == list)
+ return;
+
+ for (; *list != NULL; list++) {
+ if (1 != sscanf(*list,"kbd-key-%15s",key))
+ continue;
+ sprintf(str,"<Key>%s: Event(%s)",key,*list);
+ XtOverrideTranslations(tv,XtParseTranslationTable(str));
+ }
+}
+
+void
+EventAction(Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ if (0 != *num_params)
+ event_dispatch(params[0]);
+}
/* ---------------------------------------------------------------------- */
@@ -1935,3 +1962,19 @@ create_bitmaps(Widget app_shell)
&black, &black,
0, 0);
}
+
+/* ---------------------------------------------------------------------- */
+
+int xt_handle_pending(Display *dpy)
+{
+ XEvent event;
+
+ if (debug)
+ fprintf(stderr,"xt: handle_pending: start ...\n");
+ XFlush(dpy);
+ while (True == XCheckMaskEvent(dpy, ~0, &event))
+ XtDispatchEvent(&event);
+ if (debug)
+ fprintf(stderr,"xt: handle_pending: ... done\n");
+ return 0;
+}
diff --git a/x11/xt.h b/x11/xt.h
index 1ecdc89..46b9902 100644
--- a/x11/xt.h
+++ b/x11/xt.h
@@ -97,6 +97,7 @@ void RatioAction(Widget, XEvent*, String*, Cardinal*);
void LaunchAction(Widget, XEvent*, String*, Cardinal*);
void VtxAction(Widget, XEvent*, String*, Cardinal*);
void FilterAction(Widget, XEvent*, String*, Cardinal*);
+void EventAction(Widget, XEvent*, String*, Cardinal*);
Boolean MyResize(XtPointer client_data);
void do_fullscreen(void);
@@ -163,6 +164,7 @@ int xt_lirc_init(void);
int xt_midi_init(char *dev);
int xt_joystick_init(void);
void init_icon_window(Widget shell,WidgetClass class);
+void xt_kbd_init(Widget tv);
/*----------------------------------------------------------------------*/
@@ -177,3 +179,6 @@ extern Cursor no_ptr;
extern Pixmap bm_yes;
extern Pixmap bm_no;
+/*----------------------------------------------------------------------*/
+
+int xt_handle_pending(Display *dpy);
diff --git a/xawtv.spec b/xawtv.spec
index cbe7d00..add467d 100644
--- a/xawtv.spec
+++ b/xawtv.spec
@@ -2,7 +2,7 @@ Name: xawtv
Group: Applications/Multimedia
Requires: v4l-conf, tv-common
Autoreqprov: on
-Version: 3.76
+Version: 3.77
Release: 0
License: GPL
Summary: Video4Linux TV application (Athena)
@@ -27,9 +27,8 @@ webcams, ...). It's based on xawtv's code, but uses Motif to provide a
better GUI.
%package -n tv-common
-Summary: fonts, tools and some README's for motv and xawtv
+Summary: tools and some README's for motv and xawtv
Group: Applications/Multimedia
-Provides: xawtv:/usr/X11R6/lib/X11/fonts/misc/led-iso8859-1.bdf
%description -n tv-common
This package includes some X11 fonts used by motv and xawtv, some
@@ -69,10 +68,9 @@ via http, i.e. you can read the teletext pages with a web browser.
%setup -q
%build
-export CFLAGS="$RPM_OPT_FLAGS"
mkdir build
cd build
-../configure --prefix=/usr/X11R6
+CFLAGS="$RPM_OPT_FLAGS" ../configure --prefix=/usr/X11R6
make
%install
@@ -87,7 +85,7 @@ find %{buildroot} -name MoTV -print |\
%defattr(-,root,root)
%doc COPYING
%doc Changes TODO README README.*
-%doc contrib/dot.lircrc contrib/frequencies*
+%doc contrib/frequencies*
/usr/X11R6/bin/xawtv
/usr/X11R6/man/man1/xawtv.1.gz
/usr/X11R6/bin/rootv
@@ -110,7 +108,6 @@ find %{buildroot} -name MoTV -print |\
/usr/X11R6/bin/propwatch
/usr/X11R6/man/man1/propwatch.1.gz
/usr/X11R6/man/man5/xawtvrc.5.gz
-/usr/X11R6/lib/X11/fonts/misc/led*
/usr/X11R6/lib/xawtv/*.so
%files -n v4l-conf
diff --git a/xawtv.spec.in b/xawtv.spec.in
index 0a2d0e3..0155694 100644
--- a/xawtv.spec.in
+++ b/xawtv.spec.in
@@ -27,9 +27,8 @@ webcams, ...). It's based on xawtv's code, but uses Motif to provide a
better GUI.
%package -n tv-common
-Summary: fonts, tools and some README's for motv and xawtv
+Summary: tools and some README's for motv and xawtv
Group: Applications/Multimedia
-Provides: xawtv:/usr/X11R6/lib/X11/fonts/misc/led-iso8859-1.bdf
%description -n tv-common
This package includes some X11 fonts used by motv and xawtv, some
@@ -69,10 +68,9 @@ via http, i.e. you can read the teletext pages with a web browser.
%setup -q
%build
-export CFLAGS="$RPM_OPT_FLAGS"
mkdir build
cd build
-../configure --prefix=/usr/X11R6
+CFLAGS="$RPM_OPT_FLAGS" ../configure --prefix=/usr/X11R6
make
%install
@@ -87,7 +85,7 @@ find %{buildroot} -name MoTV -print |\
%defattr(-,root,root)
%doc COPYING
%doc Changes TODO README README.*
-%doc contrib/dot.lircrc contrib/frequencies*
+%doc contrib/frequencies*
/usr/X11R6/bin/xawtv
/usr/X11R6/man/man1/xawtv.1.gz
/usr/X11R6/bin/rootv
@@ -110,7 +108,6 @@ find %{buildroot} -name MoTV -print |\
/usr/X11R6/bin/propwatch
/usr/X11R6/man/man1/propwatch.1.gz
/usr/X11R6/man/man5/xawtvrc.5.gz
-/usr/X11R6/lib/X11/fonts/misc/led*
/usr/X11R6/lib/xawtv/*.so
%files -n v4l-conf

Privacy Policy