aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-04-01 11:24:37 +0200
committerGerd Hoffmann <kraxel@redhat.com>2010-04-01 11:24:37 +0200
commitfdd6d37352122375fe9521724cbdd397225812c9 (patch)
treeb6cea2ba59ec3bb2eedd2b5a55132e58123c411c
parent0a3b75898a27d0e526d2310832c8b409c9d5c5f0 (diff)
v3.67
-rw-r--r--Changes18
-rw-r--r--Make.config.in6
-rw-r--r--README.recording14
-rw-r--r--README.translate38
-rw-r--r--config.h.in9
-rwxr-xr-xconfigure370
-rw-r--r--configure.in52
-rw-r--r--debian/changelog6
-rw-r--r--debian/control12
-rw-r--r--http/about.html.in10
-rw-r--r--http/devices.c2
-rw-r--r--http/httpd.h1
-rw-r--r--http/main.c12
-rw-r--r--http/page.c93
-rw-r--r--libng/Makefile.in6
-rw-r--r--libng/clipping.c134
-rw-r--r--libng/devices.c2
-rw-r--r--libng/grab-ng.c347
-rw-r--r--libng/grab-ng.h54
-rw-r--r--libng/plugins/Makefile.in10
-rw-r--r--libng/plugins/conv-mjpeg.c (renamed from libng/mjpeg.c)4
-rw-r--r--libng/plugins/drv0-bsd.c (renamed from libng/grab-bsd.c)25
-rw-r--r--libng/plugins/drv0-v4l2.c (renamed from libng/grab-v4l2.c)23
-rw-r--r--libng/plugins/drv1-v4l.c (renamed from libng/grab-v4l.c)22
-rw-r--r--libng/plugins/flt-invert.c (renamed from libng/plugins/invert.c)2
-rw-r--r--libng/plugins/flt-nop.c (renamed from libng/plugins/nop.c)2
-rw-r--r--libng/plugins/snd-oss.c469
-rw-r--r--libng/plugins/write-avi.c (renamed from libng/writeavi.c)8
-rw-r--r--libng/plugins/write-qt.c (renamed from libng/writeqt.c)8
-rw-r--r--libng/writefile.c13
-rw-r--r--src/Makefile.in34
-rw-r--r--src/aa.c4
-rw-r--r--src/capture.c17
-rw-r--r--src/channel.c5
-rw-r--r--src/commands.c12
-rw-r--r--src/commands.h2
-rw-r--r--src/fbtv.c6
-rw-r--r--src/fs.c6
-rw-r--r--src/fs.h2
-rw-r--r--src/main.c6
-rw-r--r--src/midictrl.c4
-rw-r--r--src/motif.c24
-rw-r--r--src/scantv.c23
-rw-r--r--src/sound.c439
-rw-r--r--src/sound.h7
-rw-r--r--src/streamer.c2
-rw-r--r--src/v4lctl.c2
-rw-r--r--src/xt.c8
-rw-r--r--src/xv.c4
-rw-r--r--tools/record.c2
-rw-r--r--webcam/Makefile.in10
-rw-r--r--webcam/webcam.c115
-rw-r--r--webcam/webcam.man5
-rw-r--r--xawtv.spec2
54 files changed, 1472 insertions, 1041 deletions
diff --git a/Changes b/Changes
index 9f298fe..4cab447 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,22 @@
+3.66 => 3.67
+============
+
+ * NOTE: take this one a bit with care, it isn't tested that much and
+ rushed out (after x-max + newyear holidays) because it has various
+ build fixes. Also various patches from other people are integrated,
+ I don't have anything pending in my inbox now. If I missed / broke
+ something, please resend patches against this version.
+ * more plugin support in libng.
+ * some libng stuff is now implemented as plugin.
+ * build plugins with -fPIC.
+ * fixed FreeBSD build problems (due * to new plugins).
+ * fixed bugs in fbdev code.
+ * moved OSS code to libng.
+ * avevtd patches (Gerald Schnabel <etk20835@stud.uni-stuttgart.de>).
+ * ssh support for webcam.
+
+
3.65 => 3.66
============
diff --git a/Make.config.in b/Make.config.in
index 9ab7fdd..64d66a2 100644
--- a/Make.config.in
+++ b/Make.config.in
@@ -33,9 +33,11 @@ LIB_FLAGS=-I$(srcdir)/../libng -I$(srcdir)/../libvbi -L../libvbi -L../libng
ATHENA_LIBS=@X_LIBS@ @LIBS@ @ATHENA@
MOTIF_LIBS=@X_LIBS@ @LIBS@ -lXm -lXmu -lXt \
@X_PRE_LIBS@ -lXp -lXpm -lXext -lX11 @X_EXTRA_LIBS@
-GFX_LIBS=@GFXLIBS@ @LIBPTHREAD@
+THREAD_LIBS=@LIBPTHREAD@
CURSES_LIBS=@LIBCURSES@
LIRC_LIBS=@LIRC@
OSS_LIBS=@LIBOSS@
ALSA_LIBS=@LIBALSA@
-AA_LIBS=$(shell aalib-config --libs)
+AA_LIBS=@AALIBS@
+QT_LIBS=@QTLIBS@
+DLFLAGS=@DLFLAGS@
diff --git a/README.recording b/README.recording
index bb09642..017ff29 100644
--- a/README.recording
+++ b/README.recording
@@ -117,6 +117,17 @@ stuff using lav2yuv + mpeg2enc in a pipe. The streamer help text
(streamer -h) has a few examples.
+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
+[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
+read/write *.mov files, thus there are less compatibility issues.
+
+
Read, Convert, Edit + Playback stuff
====================================
@@ -128,7 +139,8 @@ avi format
* Windows Media Player plays the uncompressed formats fine.
mjpeg/jpeg work too if a codec is installed (/me has a very
old one from MainConcept).
- * avifile can't deal with the uncompressed video correctly.
+ * 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
stuff to /usr/lib/win32. Maybe it works with another
diff --git a/README.translate b/README.translate
index 97e5c92..84b859f 100644
--- a/README.translate
+++ b/README.translate
@@ -1,6 +1,6 @@
-translate motv
-==============
+translate motv app
+==================
The new motif-gui version has i18n support, it is handled by using
different application default files for the different languages. All
@@ -8,14 +8,34 @@ the strings are in the MoTV-<lang> files. MoTV-default is the english
version. MoTV-fixed has the other (language-independant) app-default
settings. The Makefile merges these into MoTV.<lang>.ad files.
-To add another language you just need to create a new MoTV-<lang> file
-and add the language to Makefile.in (+ rerun ./configure). "make i18n"
-builds the MoTV.<lang>.ad files. If you set the XUSERFILESEARCHPATH
-environment variable to "./%N.%l.ad:./%N.ad" you can test it without
-installing the app-defaults in /etc/X11.
+To add another language you just need to create a new MoTV-<lang> file,
+edit src/Makefile.in and add the language to the LANG= line. Then rerun
+the configure script. Now the make targets (in src/) include the new
+language. You can test the translations without "make install" this way
+(bash):
+once at start:
-other
-=====
+$ cd src
+$ export XUSERFILESEARCHPATH="./%N.%l.ad:./%N.ad"
+$ export LC_ALL=<lang>
+
+every time after editing MoTV-<lang>:
+
+$ make i18n
+$ ./motv
+
+
+translate documentation
+=======================
+
+The applications come with a manual page as documentation. Most manual
+pages are in the man/ subdirectory. Translated manual pages are very
+welcome, I can easily add them to the distribution tarball.
+
+
+other stuff
+===========
Currently I have no plans to localize xawtv and the command line tools.
+
diff --git a/config.h.in b/config.h.in
index f045469..8033dbf 100644
--- a/config.h.in
+++ b/config.h.in
@@ -18,6 +18,9 @@
/* ipv6 struct sockaddr_storage */
#undef HAVE_SOCKADDR_STORAGE
+/* Define if you have the dlopen function. */
+#undef HAVE_DLOPEN
+
/* Define if you have the fseeko function. */
#undef HAVE_FSEEKO
@@ -36,6 +39,9 @@
/* Define 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. */
+#undef HAVE_DEV_IC_BT8XX_H
+
/* Define if you have the <endian.h> header file. */
#undef HAVE_ENDIAN_H
@@ -45,6 +51,9 @@
/* Define 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. */
+#undef HAVE_MACHINE_IOCTL_BT848_H
+
/* Define if you have the <soundcard.h> header file. */
#undef HAVE_SOUNDCARD_H
diff --git a/configure b/configure
index 7a0718b..9b078f5 100755
--- a/configure
+++ b/configure
@@ -1009,23 +1009,23 @@ test -n "$DEPEND" || DEPEND="true"
-NG_GRAB=""
VBIFLAGS=""
PROGS=""
INST=""
RADIO=""
+PLUGINS=""
case "`uname -s`" in
Linux)
- NG_GRAB="grab-v4l.o grab-v4l2.o"
+ PLUGINS="drv0-v4l2.so drv1-v4l.so snd-oss.so"
PROGS="v4l-conf fbtv"
INST="install-v4l-conf install-fbtv"
RADIO="radio"
;;
- OpenBSD | FreeBSD)
+ OpenBSD | FreeBSD | NetBSD)
# *BSD has important stuff (from ports) in
# /usr/local ...
CFLAGS="$CFLAGS -I/usr/local/include -L/usr/local/lib"
- NG_GRAB="grab-bsd.o"
+ PLUGINS="drv0-bsd.so snd-oss.so"
VBIFLAGS="-DBSD"
;;
*)
@@ -1042,15 +1042,70 @@ esac
-for ac_func in ftello fseeko getpt getnameinfo getopt_long
+cat > conftest.$ac_ext <<EOF
+#line 1047 "configure"
+#include "confdefs.h"
+#include <sys/socket.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "sockaddr_storage" >/dev/null 2>&1; then
+ rm -rf conftest*
+ cat >> confdefs.h <<\EOF
+#define HAVE_SOCKADDR_STORAGE 1
+EOF
+
+fi
+rm -f conftest*
+
+for ac_hdr in endian.h getopt.h soundcard.h sys/soundcard.h alsa/asoundlib.h linux/joystick.h dev/ic/bt8xx.h machine/ioctl_bt848.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1065: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1070 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in ftello fseeko getpt getnameinfo getopt_long dlopen
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1049: checking for $ac_func" >&5
+echo "configure:1104: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1054 "configure"
+#line 1109 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1073,7 +1128,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1097,64 +1152,62 @@ else
fi
done
-cat > conftest.$ac_ext <<EOF
-#line 1102 "configure"
-#include "confdefs.h"
-#include <sys/socket.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "sockaddr_storage" >/dev/null 2>&1; then
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
-#define HAVE_SOCKADDR_STORAGE 1
-EOF
-fi
-rm -f conftest*
-for ac_hdr in endian.h getopt.h soundcard.h sys/soundcard.h alsa/asoundlib.h linux/joystick.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1120: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+DLFLAGS=""
+if test "$ac_cv_func_dlopen" = "no"; then
+ echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "configure:1161: checking for dlopen in -ldl" >&5
+ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1125 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-ldl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1169 "configure"
#include "confdefs.h"
-#include <$ac_hdr>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+dlopen()
+; return 0; }
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:1180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
+LIBS="$ac_save_LIBS"
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+ DLFLAGS="-ldl"
else
echo "$ac_t""no" 1>&6
fi
-done
+fi
+echo $ac_n "checking for ELF""... $ac_c" 1>&6
+echo "configure:1202: checking for ELF" >&5
+if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+ echo "$ac_t""yes" 1>&6
+ DLFLAGS="$DLFLAGS -Wl,-E"
+else
+ echo "$ac_t""no" 1>&6
+fi
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:1158: checking for pthread_create in -lpthread" >&5
+echo "configure:1211: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1162,7 +1215,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1166 "configure"
+#line 1219 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1173,7 +1226,7 @@ int main() {
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:1177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1195,7 +1248,7 @@ fi
if test "$LIBPTHREAD" = ""; then
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:1199: checking for pthread_create in -lc_r" >&5
+echo "configure:1252: checking for pthread_create in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1203,7 +1256,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1207 "configure"
+#line 1260 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1214,7 +1267,7 @@ int main() {
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:1218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1236,7 +1289,7 @@ fi
fi
echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6
-echo "configure:1240: checking for main in -lossaudio" >&5
+echo "configure:1293: checking for main in -lossaudio" >&5
ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1244,14 +1297,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lossaudio $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1248 "configure"
+#line 1301 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:1255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1272,7 +1325,7 @@ else
fi
echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:1276: checking for initscr in -lncurses" >&5
+echo "configure:1329: checking for initscr in -lncurses" >&5
ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1280,7 +1333,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1284 "configure"
+#line 1337 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1291,7 +1344,7 @@ int main() {
initscr()
; return 0; }
EOF
-if { (eval echo configure:1295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1313,7 +1366,7 @@ fi
if test "$LIBCURSES" = ""; then
echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:1317: checking for initscr in -lcurses" >&5
+echo "configure:1370: checking for initscr in -lcurses" >&5
ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1321,7 +1374,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1325 "configure"
+#line 1378 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1332,7 +1385,7 @@ int main() {
initscr()
; return 0; }
EOF
-if { (eval echo configure:1336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1370,7 +1423,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:1374: checking for X" >&5
+echo "configure:1427: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -1432,12 +1485,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 1436 "configure"
+#line 1489 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1506,14 +1559,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1510 "configure"
+#line 1563 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:1517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -1619,17 +1672,17 @@ else
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:1623: checking whether -R must be followed by a space" >&5
+echo "configure:1676: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 1626 "configure"
+#line 1679 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_nospace=yes
else
@@ -1645,14 +1698,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 1649 "configure"
+#line 1702 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_space=yes
else
@@ -1684,7 +1737,7 @@ rm -f conftest*
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:1688: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:1741: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1692,7 +1745,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1696 "configure"
+#line 1749 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1703,7 +1756,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:1707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1725,7 +1778,7 @@ fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:1729: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:1782: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1733,7 +1786,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1737 "configure"
+#line 1790 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1744,7 +1797,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:1748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1773,12 +1826,12 @@ fi
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1777: checking for gethostbyname" >&5
+echo "configure:1830: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1782 "configure"
+#line 1835 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -1801,7 +1854,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -1822,7 +1875,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1826: checking for gethostbyname in -lnsl" >&5
+echo "configure:1879: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1830,7 +1883,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1834 "configure"
+#line 1887 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1841,7 +1894,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:1845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1871,12 +1924,12 @@ fi
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:1875: checking for connect" >&5
+echo "configure:1928: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1880 "configure"
+#line 1933 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -1899,7 +1952,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:1903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@@ -1920,7 +1973,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:1924: checking for connect in -lsocket" >&5
+echo "configure:1977: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1928,7 +1981,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1932 "configure"
+#line 1985 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1939,7 +1992,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1963,12 +2016,12 @@ fi
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:1967: checking for remove" >&5
+echo "configure:2020: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1972 "configure"
+#line 2025 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@@ -1991,7 +2044,7 @@ remove();
; return 0; }
EOF
-if { (eval echo configure:1995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
@@ -2012,7 +2065,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:2016: checking for remove in -lposix" >&5
+echo "configure:2069: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2020,7 +2073,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2024 "configure"
+#line 2077 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2031,7 +2084,7 @@ int main() {
remove()
; return 0; }
EOF
-if { (eval echo configure:2035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2055,12 +2108,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:2059: checking for shmat" >&5
+echo "configure:2112: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2064 "configure"
+#line 2117 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@@ -2083,7 +2136,7 @@ shmat();
; return 0; }
EOF
-if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
@@ -2104,7 +2157,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:2108: checking for shmat in -lipc" >&5
+echo "configure:2161: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2112,7 +2165,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2116 "configure"
+#line 2169 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2123,7 +2176,7 @@ int main() {
shmat()
; return 0; }
EOF
-if { (eval echo configure:2127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2156,7 +2209,7 @@ fi
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:2160: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:2213: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2164,7 +2217,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2168 "configure"
+#line 2221 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2175,7 +2228,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2222,10 +2275,8 @@ fi
-
-GFXLIBS="";
echo $ac_n "checking for jpeg_start_compress in -ljpeg""... $ac_c" 1>&6
-echo "configure:2229: checking for jpeg_start_compress in -ljpeg" >&5
+echo "configure:2280: checking for jpeg_start_compress in -ljpeg" >&5
ac_lib_var=`echo jpeg'_'jpeg_start_compress | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2233,7 +2284,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ljpeg $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2237 "configure"
+#line 2288 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2244,7 +2295,7 @@ int main() {
jpeg_start_compress()
; return 0; }
EOF
-if { (eval echo configure:2248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2259,7 +2310,7 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- GFXLIBS="-ljpeg"; JPEG="found"
+ JPEG="found"
else
echo "$ac_t""no" 1>&6
fi
@@ -2275,7 +2326,7 @@ fi
LIBALSA=""
if test "$enable_alsa" != "no"; then
echo $ac_n "checking for snd_seq_open in -lasound""... $ac_c" 1>&6
-echo "configure:2279: checking for snd_seq_open in -lasound" >&5
+echo "configure:2330: checking for snd_seq_open in -lasound" >&5
ac_lib_var=`echo asound'_'snd_seq_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2283,7 +2334,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2287 "configure"
+#line 2338 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2294,7 +2345,7 @@ int main() {
snd_seq_open()
; return 0; }
EOF
-if { (eval echo configure:2298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2325,7 +2376,7 @@ fi
LIRC=""
if test "$enable_lirc" != "no"; then
echo $ac_n "checking for lirc_init in -llirc_client""... $ac_c" 1>&6
-echo "configure:2329: checking for lirc_init in -llirc_client" >&5
+echo "configure:2380: checking for lirc_init in -llirc_client" >&5
ac_lib_var=`echo lirc_client'_'lirc_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2333,7 +2384,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-llirc_client $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2337 "configure"
+#line 2388 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2344,7 +2395,7 @@ int main() {
lirc_init()
; return 0; }
EOF
-if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2371,9 +2422,11 @@ else
echo "*** lirc disabled"
fi
+
+AALIBS=""
if test "$enable_aa" != "no"; then
echo $ac_n "checking for aa_autoinit in -laa""... $ac_c" 1>&6
-echo "configure:2377: checking for aa_autoinit in -laa" >&5
+echo "configure:2430: checking for aa_autoinit in -laa" >&5
ac_lib_var=`echo aa'_'aa_autoinit | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2381,7 +2434,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-laa $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2385 "configure"
+#line 2438 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2392,7 +2445,7 @@ int main() {
aa_autoinit()
; return 0; }
EOF
-if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2407,18 +2460,24 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- PROGS="$PROGS ttv"; INST="$INST install-ttv"
+ PROGS="$PROGS ttv"; INST="$INST install-ttv"; AA="found"
else
echo "$ac_t""no" 1>&6
fi
+ if test "$AA" = "found"; then
+ AALIBS=-laa
+ if test -x "`which aalib-config 2>/dev/null`"; then
+ AALIBS=`aalib-config --libs`
+ fi
+ fi
else
echo "*** aalib support disabled"
fi
if test "$enable_quicktime" != "no"; then
echo $ac_n "checking for png_read_info in -lpng""... $ac_c" 1>&6
-echo "configure:2422: checking for png_read_info in -lpng" >&5
+echo "configure:2481: checking for png_read_info in -lpng" >&5
ac_lib_var=`echo png'_'png_read_info | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2426,7 +2485,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpng $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2430 "configure"
+#line 2489 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2437,7 +2496,7 @@ int main() {
png_read_info()
; return 0; }
EOF
-if { (eval echo configure:2441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2452,14 +2511,14 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- GFXLIBS="-lpng -lz -lm $GFXLIBS"; PNG="found"
+ PNG="found"
else
echo "$ac_t""no" 1>&6
fi
if test "$PNG" = "found"; then
echo $ac_n "checking for quicktime_open in -lquicktime""... $ac_c" 1>&6
-echo "configure:2463: checking for quicktime_open in -lquicktime" >&5
+echo "configure:2522: checking for quicktime_open in -lquicktime" >&5
ac_lib_var=`echo quicktime'_'quicktime_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2467,7 +2526,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lquicktime -ldl -lglib -ljpeg -lpng $LIBPTHREAD $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2471 "configure"
+#line 2530 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2478,7 +2537,7 @@ int main() {
quicktime_open()
; return 0; }
EOF
-if { (eval echo configure:2482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2493,7 +2552,7 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- GFXLIBS="-lquicktime -ldl -lglib $GFXLIBS";cat >> confdefs.h <<\EOF
+ QUICKTIME="found";cat >> confdefs.h <<\EOF
#define HAVE_LIBQUICKTIME 1
EOF
@@ -2507,10 +2566,17 @@ fi
else
echo "*** quicktime disabled"
fi
+if test "$QUICKTIME" = "found"; then
+ QTLIBS="-lquicktime -ldl -lglib -lpng -lz -lm"
+ PLUGINS="$PLUGINS write-qt.so"
+else
+ QTLIBS=""
+fi
+
if test "$enable_xfree_ext" != "no"; then
echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6
-echo "configure:2514: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
+echo "configure:2580: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2518,7 +2584,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXxf86dga $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2522 "configure"
+#line 2588 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2529,7 +2595,7 @@ int main() {
XF86DGAQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2557,7 +2623,7 @@ else
fi
echo $ac_n "checking for XF86VidModeQueryExtension in -lXxf86vm""... $ac_c" 1>&6
-echo "configure:2561: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5
+echo "configure:2627: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5
ac_lib_var=`echo Xxf86vm'_'XF86VidModeQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2565,7 +2631,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXxf86vm $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2569 "configure"
+#line 2635 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2576,7 +2642,7 @@ int main() {
XF86VidModeQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2604,7 +2670,7 @@ else
fi
echo $ac_n "checking for DPMSQueryExtension in -lXdpms""... $ac_c" 1>&6
-echo "configure:2608: checking for DPMSQueryExtension in -lXdpms" >&5
+echo "configure:2674: checking for DPMSQueryExtension in -lXdpms" >&5
ac_lib_var=`echo Xdpms'_'DPMSQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2612,7 +2678,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXdpms $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2616 "configure"
+#line 2682 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2623,7 +2689,7 @@ int main() {
DPMSQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2652,7 +2718,7 @@ fi
if test "$ac_cv_lib_Xdpms_DPMSQueryExtension" = "no"; then
echo $ac_n "checking for DPMSQueryExtension in -lXext""... $ac_c" 1>&6
-echo "configure:2656: checking for DPMSQueryExtension in -lXext" >&5
+echo "configure:2722: checking for DPMSQueryExtension in -lXext" >&5
ac_lib_var=`echo Xext'_'DPMSQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2660,7 +2726,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXext $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2664 "configure"
+#line 2730 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2671,7 +2737,7 @@ int main() {
DPMSQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2696,7 +2762,7 @@ fi
fi
echo $ac_n "checking for XineramaQueryExtension in -lXinerama""... $ac_c" 1>&6
-echo "configure:2700: checking for XineramaQueryExtension in -lXinerama" >&5
+echo "configure:2766: checking for XineramaQueryExtension in -lXinerama" >&5
ac_lib_var=`echo Xinerama'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2704,7 +2770,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXinerama $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2708 "configure"
+#line 2774 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2715,7 +2781,7 @@ int main() {
XineramaQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2748,7 +2814,7 @@ fi
if test "$enable_xvideo" != "no"; then
echo $ac_n "checking for XvQueryExtension in -lXv""... $ac_c" 1>&6
-echo "configure:2752: checking for XvQueryExtension in -lXv" >&5
+echo "configure:2818: checking for XvQueryExtension in -lXv" >&5
ac_lib_var=`echo Xv'_'XvQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2756,7 +2822,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXv $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2760 "configure"
+#line 2826 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2767,7 +2833,7 @@ int main() {
XvQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:2771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2800,7 +2866,7 @@ fi
if test "$enable_motif" != "no"; then
echo $ac_n "checking for XmStringGenerate in -lXm""... $ac_c" 1>&6
-echo "configure:2804: checking for XmStringGenerate in -lXm" >&5
+echo "configure:2870: checking for XmStringGenerate in -lXm" >&5
ac_lib_var=`echo Xm'_'XmStringGenerate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2808,7 +2874,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXm $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2812 "configure"
+#line 2878 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2819,7 +2885,7 @@ int main() {
XmStringGenerate()
; return 0; }
EOF
-if { (eval echo configure:2823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2847,7 +2913,7 @@ VERSION="`(cd $srcdir; pwd) | sed -e 's/.*-//'`"
echo $ac_n "checking for X11 config directory""... $ac_c" 1>&6
-echo "configure:2851: checking for X11 config directory" >&5
+echo "configure:2917: checking for X11 config directory" >&5
x11conf=/usr/X11R6/lib/X11
if test -d /etc/X11; then
x11conf=/etc/X11
@@ -2856,7 +2922,7 @@ echo "$ac_t""$x11conf" 1>&6
echo $ac_n "checking for X11 app-defaults directory""... $ac_c" 1>&6
-echo "configure:2860: checking for X11 app-defaults directory" >&5
+echo "configure:2926: checking for X11 app-defaults directory" >&5
resdir=/usr/X11R6/lib/X11
if test -d /etc/X11/app-defaults; then
resdir=/etc/X11
@@ -3007,11 +3073,12 @@ s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@DEPEND@%$DEPEND%g
-s%@NG_GRAB@%$NG_GRAB%g
s%@VBIFLAGS@%$VBIFLAGS%g
s%@PROGS@%$PROGS%g
s%@INST@%$INST%g
s%@RADIO@%$RADIO%g
+s%@PLUGINS@%$PLUGINS%g
+s%@DLFLAGS@%$DLFLAGS%g
s%@LIBPTHREAD@%$LIBPTHREAD%g
s%@LIBOSS@%$LIBOSS%g
s%@LIBCURSES@%$LIBCURSES%g
@@ -3025,9 +3092,10 @@ s%@ATHENA@%$ATHENA%g
s%@FSLIB@%$FSLIB%g
s%@SUBS@%$SUBS%g
s%@TOOLS@%$TOOLS%g
-s%@GFXLIBS@%$GFXLIBS%g
s%@LIBALSA@%$LIBALSA%g
s%@LIRC@%$LIRC%g
+s%@AALIBS@%$AALIBS%g
+s%@QTLIBS@%$QTLIBS%g
s%@VERSION@%$VERSION%g
s%@x11conf@%$x11conf%g
s%@resdir@%$resdir%g
diff --git a/configure.in b/configure.in
index 809c3eb..2a976a7 100644
--- a/configure.in
+++ b/configure.in
@@ -36,23 +36,23 @@ AC_CHECK_PROGS(DEPEND,gccmakedep makedepend,true)
dnl ---------------------------------------------------------------------
dnl do some OS specific stuff here
-NG_GRAB=""
VBIFLAGS=""
PROGS=""
INST=""
RADIO=""
+PLUGINS=""
case "`uname -s`" in
Linux)
- NG_GRAB="grab-v4l.o grab-v4l2.o"
+ PLUGINS="drv0-v4l2.so drv1-v4l.so snd-oss.so"
PROGS="v4l-conf fbtv"
INST="install-v4l-conf install-fbtv"
RADIO="radio"
;;
- OpenBSD | FreeBSD)
+ OpenBSD | FreeBSD | NetBSD)
# *BSD has important stuff (from ports) in
# /usr/local ...
CFLAGS="$CFLAGS -I/usr/local/include -L/usr/local/lib"
- NG_GRAB="grab-bsd.o"
+ PLUGINS="drv0-bsd.so snd-oss.so"
VBIFLAGS="-DBSD"
;;
*)
@@ -60,19 +60,32 @@ case "`uname -s`" in
AC_MSG_RESULT(maybe)
;;
esac
-AC_SUBST(NG_GRAB)
AC_SUBST(VBIFLAGS)
AC_SUBST(PROGS)
AC_SUBST(INST)
AC_SUBST(RADIO)
+AC_SUBST(PLUGINS)
dnl ---------------------------------------------------------------------
dnl Checks for functions
-AC_CHECK_FUNCS(ftello fseeko getpt getnameinfo getopt_long)
AC_EGREP_HEADER(sockaddr_storage,sys/socket.h,AC_DEFINE(HAVE_SOCKADDR_STORAGE))
-AC_CHECK_HEADERS(endian.h getopt.h soundcard.h sys/soundcard.h alsa/asoundlib.h linux/joystick.h)
+AC_CHECK_HEADERS(endian.h getopt.h soundcard.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 dlopen)
+
+AC_SUBST(DLFLAGS)
+DLFLAGS=""
+if test "$ac_cv_func_dlopen" = "no"; then
+ AC_CHECK_LIB(dl,dlopen, [ DLFLAGS="-ldl" ] )
+fi
+AC_MSG_CHECKING(for ELF)
+if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+ AC_MSG_RESULT(yes)
+ DLFLAGS="$DLFLAGS -Wl,-E"
+else
+ AC_MSG_RESULT(no)
+fi
AC_CHECK_LIB(pthread,pthread_create,LIBPTHREAD="-lpthread")
if test "$LIBPTHREAD" = ""; then
@@ -121,9 +134,7 @@ AC_SUBST(FSLIB)
AC_SUBST(SUBS)
AC_SUBST(TOOLS)
-AC_SUBST(GFXLIBS)
-GFXLIBS="";
-AC_CHECK_LIB(jpeg, jpeg_start_compress, GFXLIBS="-ljpeg"; JPEG="found",,)
+AC_CHECK_LIB(jpeg, jpeg_start_compress, JPEG="found",,)
if test "$JPEG" != "found"; then
echo "Oops: jpeg library not found. You need this one, please install."
echo "Note: to compile stuff just the library packages are not enougth,"
@@ -149,18 +160,26 @@ else
echo "*** lirc disabled"
fi
+AC_SUBST(AALIBS)
+AALIBS=""
if test "$enable_aa" != "no"; then
AC_CHECK_LIB(aa,aa_autoinit,
- [ PROGS="$PROGS ttv"; INST="$INST install-ttv" ],,)
+ [ PROGS="$PROGS ttv"; INST="$INST install-ttv"; AA="found" ],,)
+ if test "$AA" = "found"; then
+ AALIBS=-laa
+ if test -x "`which aalib-config 2>/dev/null`"; then
+ AALIBS=`aalib-config --libs`
+ fi
+ fi
else
echo "*** aalib support disabled"
fi
if test "$enable_quicktime" != "no"; then
- AC_CHECK_LIB(png, png_read_info, GFXLIBS="-lpng -lz -lm $GFXLIBS"; PNG="found")
+ AC_CHECK_LIB(png, png_read_info, PNG="found")
if test "$PNG" = "found"; then
AC_CHECK_LIB(quicktime, quicktime_open,
- GFXLIBS="-lquicktime -ldl -lglib $GFXLIBS";AC_DEFINE(HAVE_LIBQUICKTIME),,
+ QUICKTIME="found";AC_DEFINE(HAVE_LIBQUICKTIME),,
-ldl -lglib -ljpeg -lpng $LIBPTHREAD)
else
echo "*** libpng not found: no quicktime support, sorry"
@@ -168,6 +187,13 @@ if test "$enable_quicktime" != "no"; then
else
echo "*** quicktime disabled"
fi
+if test "$QUICKTIME" = "found"; then
+ QTLIBS="-lquicktime -ldl -lglib -lpng -lz -lm"
+ PLUGINS="$PLUGINS write-qt.so"
+else
+ QTLIBS=""
+fi
+AC_SUBST(QTLIBS)
if test "$enable_xfree_ext" != "no"; then
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,,,
diff --git a/debian/changelog b/debian/changelog
index 24782e4..f5579bb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xawtv (3.67) unstable; urgency=low
+
+ * new release (closes: #124275).
+
+ -- Gerd Knorr <kraxel@debian.org> Fri, 14 Dec 2001 13:00:56 +0100
+
xawtv (3.66) unstable; urgency=low
* new release.
diff --git a/debian/control b/debian/control
index 181a1f9..4b3df95 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Standards-Version: 3.5.2
Package: xawtv
Section: x11
Architecture: any
-Depends: ${shlibs:Depends}, v4l-conf, xutils, debconf, scantv
+Depends: ${shlibs:Depends}, v4l-conf, xutils, debconf, scantv, xawtv-plugins
Description: X11 TV application
TV application for X11. Supports video4linux
devices and the Xvideo extension.
@@ -18,7 +18,7 @@ Description: X11 TV application
Package: fbtv
Architecture: any
-Depends: ${shlibs:Depends}, v4l-conf
+Depends: ${shlibs:Depends}, v4l-conf, xawtv-plugins
Suggests: xawtv
Description: linux console (fbcon) TV application
TV application for the linux console, requires a
@@ -27,7 +27,7 @@ Description: linux console (fbcon) TV application
Package: ttv
Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, xawtv-plugins
Suggests: xawtv
Description: tty TV application
TV application for terminals, based on aalib.
@@ -35,7 +35,7 @@ Description: tty TV application
Package: scantv
Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, xawtv-plugins
Replaces: xawtv (<< 3.53)
Description: scan TV channels for stations
This utility can scan a channel set for TV stations
@@ -45,7 +45,7 @@ Description: scan TV channels for stations
Package: streamer
Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, xawtv-plugins
Suggests: xawtv
Description: capture tool (images / movies)
A tool to capture single/multiple images or
@@ -93,7 +93,7 @@ Description: plugins for xawtv and motv
Package: webcam
Section: net
Architecture: any
-Depends: ${shlibs:Depends},ftp
+Depends: ${shlibs:Depends}, ftp, xawtv-plugins
Description: capture and upload images
webcam captures images from a video4linux device like
bttv, annotates them and and uploads them to a webserver
diff --git a/http/about.html.in b/http/about.html.in
index 9726069..e09683d 100644
--- a/http/about.html.in
+++ b/http/about.html.in
@@ -7,13 +7,15 @@
<b>about the alevt http daemon</b>
<p>
This daemon serves videotext pages as HTML.&nbsp; The vbi decoder is
-taken from <a href="http://user.exit.de/froese/">alevt
-1.5.1</a>.&nbsp; Source code of this deamon comes with <a
-href="http://www.strusel007.de/linux/xawtv/">xawtv</a>.
+taken from <a href="http://lecker.essen.de/~froese/">alevt
+1.6.0</a>.&nbsp; Source code of this deamon comes with <a
+href="http://bytesex.org/xawtv/">xawtv</a>.
<p>
-&copy; 1999-2000 Gerd Knorr &lt;kraxel@goldbach.in-berlin.de&gt; [http server]
+&copy; 1999-2002 Gerd Knorr &lt;kraxel@goldbach.in-berlin.de&gt; [http server]
<br>
&copy; 1998-2000 Edgar Toernig &lt;froese@gmx.de&gt; [vbi decoding, alevt]
+<br>
+misc patches by several other hackers.
<hr noshade size=1>
<a href="/100/">100</a> &nbsp;
<a href="/200/">200</a> &nbsp;
diff --git a/http/devices.c b/http/devices.c
index f3d7713..031f00c 100644
--- a/http/devices.c
+++ b/http/devices.c
@@ -9,7 +9,7 @@
/*
* default devices names
*/
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD)
struct ng_device_config ng_dev = {
video: "/dev/bktr0",
radio: NULL,
diff --git a/http/httpd.h b/http/httpd.h
index 20d2fe1..20cacc5 100644
--- a/http/httpd.h
+++ b/http/httpd.h
@@ -56,6 +56,7 @@ struct REQUEST {
extern int debug;
extern int tcp_port;
+extern int ascii_art;
extern char *server_name;
extern char server_host[];
extern time_t now,start;
diff --git a/http/main.c b/http/main.c
index 250c5f6..77500eb 100644
--- a/http/main.c
+++ b/http/main.c
@@ -46,6 +46,7 @@ int dontdetach = 0;
int timeout = 60;
int keepalive_time = 5;
int tcp_port = 0;
+int ascii_art = 0;
char *listen_ip = NULL;
char *listen_port = "5654";
char server_host[256];
@@ -127,7 +128,8 @@ usage(char *name)
" -l log write access log to file >log< [%s]\n"
" -L log same as above + flush every line\n"
" -r poll tv frequency and clear cache\n"
- " on station changes [%s]\n",
+ " on station changes [%s]\n"
+ " -a use ascii art for block graphics [%s]\n",
h ? h+1 : name,
ng_dev.vbi,
debug ? "on" : "off",
@@ -138,7 +140,8 @@ usage(char *name)
server_host,
listen_ip ? listen_ip : "any",
logfile ? logfile : "none",
- cachereset ? "on" : "off");
+ cachereset ? "on" : "off",
+ ascii_art ? "on" : "off");
if (getuid() == 0) {
pw = getpwuid(0);
gr = getgrgid(getgid());
@@ -559,7 +562,7 @@ main(int argc, char *argv[])
/* parse options */
for (;;) {
- if (-1 == (c = getopt(argc,argv,"69hsdFrp:n:i:t:c:u:g:l:L:v:")))
+ if (-1 == (c = getopt(argc,argv,"69hasdFrp:n:i:t:c:u:g:l:L:v:")))
break;
switch (c) {
case 'h':
@@ -571,6 +574,9 @@ main(int argc, char *argv[])
case '9':
bttv = 1;
break;
+ case 'a':
+ ascii_art++;
+ break;
case 's':
usesyslog++;
break;
diff --git a/http/page.c b/http/page.c
index cb96dc6..a608b96 100644
--- a/http/page.c
+++ b/http/page.c
@@ -40,8 +40,38 @@ static char page_bottom[] =
#include "bottom.html.h"
;
+/* 01234567890123456789012345678901 */
+static char graphic1[32] = " '-.:::.;;;.}/}./#";
+/* 012345 6789 0123 456789012345678901 */
+static char graphic2[32] = ".:::.\\{{.\\||.\\#_:::.[.||].###";
+
/* ---------------------------------------------------------------------- */
+/* fix bcd issues ... */
+static int calc_page(int pagenr, int offset)
+{
+ int result;
+
+ result = pagenr + offset;
+ if (offset < 0) {
+ while ((result & 0x0f) > 0x09)
+ result -= 0x01;
+ while ((result & 0xf0) > 0x90)
+ result -= 0x10;
+ if (result < 0x100)
+ result = 0x100;
+ }
+ if (offset > 0) {
+ while ((result & 0x0f) > 0x09)
+ result += 0x01;
+ while ((result & 0xf0) > 0x90)
+ result += 0x10;
+ if (result > 0x899)
+ result = 0x899;
+ }
+ return result;
+}
+
static void vbipage(struct REQUEST *req, struct vt_page *page,
int pagenr, int subnr, int html)
{
@@ -76,8 +106,16 @@ static void vbipage(struct REQUEST *req, struct vt_page *page,
c.ch = '?';
break;
default:
- if (c.attr & EA_GRAPHIC)
- c.ch = '#';
+ if (c.attr & EA_GRAPHIC) {
+ if (ascii_art) {
+ if (!(c.ch & 128))
+ c.ch = graphic1[c.ch];
+ else
+ c.ch = graphic2[c.ch-128];
+ } else {
+ c.ch = '#';
+ }
+ }
break;
}
L[x] = c;
@@ -116,7 +154,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page,
lcolor = color;
}
- /* check for refences to other pages */
+ /* check for references to other pages */
if (html && y > 0 && -1 == link && x < W-2 &&
isdigit(L[x].ch) &&
isdigit(L[x+1].ch) &&
@@ -141,9 +179,37 @@ static void vbipage(struct REQUEST *req, struct vt_page *page,
page->pgno-1);
link = 1;
}
- /* check for refences to other subpages */
+
+ /* check for references to WWW pages */
+ if (html && y > 0 && -1 == link && x < W-9 &&
+ (((tolower(L[x+0].ch) == 'w') &&
+ (tolower(L[x+1].ch) == 'w') &&
+ (tolower(L[x+2].ch) == 'w') &&
+ (L[x+3].ch == '.')) ||
+ ((tolower(L[x+0].ch) == 'h') &&
+ (tolower(L[x+1].ch) == 't') &&
+ (tolower(L[x+2].ch) == 't') &&
+ (tolower(L[x+3].ch) == 'p')))) {
+ int offs = 0;
+
+ len += sprintf(out+len,"<a href=\"");
+ if(tolower(L[x].ch == 'w'))
+ len += sprintf(out+len,"http://");
+ while ((L[x+offs].ch!=' ') && (x+offs < W)) {
+ len += sprintf(out+len,"%c",tolower(L[x+offs].ch));
+ offs++;
+ }
+ while ( (*(out+len-1)<'a') || (*(out+len-1)>'z') ) {
+ len--;
+ offs--;
+ }
+ len += sprintf(out+len,"\">");
+ link = offs - 1;
+ }
+
+ /* check for references to other subpages */
if (html && y > 0 && -1 == link && x < W-2 &&
- page->subno > 0 &&
+ page->subno > 0 &&
isdigit(L[x].ch) &&
'/' == L[x+1].ch &&
isdigit(L[x+2].ch) &&
@@ -187,7 +253,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page,
link=1;
}
}
- out[len++] = L[x].ch;
+ out[len++] = L[x].ch;
}
/* close any tags + put newline */
if (html && link >= 0)
@@ -206,7 +272,7 @@ static void vbipage(struct REQUEST *req, struct vt_page *page,
if (html) {
#define MAXSUBPAGES 32
int subpage;
-
+
/* close preformatted text header */
len+=sprintf(out+len,"</pre>\n<div class=quick>\n") ;
if (vbi->cache->op->get(vbi->cache,pagenr,1)) {
@@ -224,6 +290,19 @@ static void vbipage(struct REQUEST *req, struct vt_page *page,
}
len += sprintf(out+len,"<br>\n") ;
}
+ len += sprintf(out+len,"<a href=\"/%03x/\"><<</a> &nbsp;",
+ calc_page(pagenr, -0x10));
+ len += sprintf(out+len,"<a href=\"/%03x/\"><</a> &nbsp;",
+ calc_page(pagenr, -0x01));
+ if (!subnr)
+ len += sprintf(out+len,"<a href=\"/%03x/\">o</a> &nbsp;", pagenr);
+ else
+ len += sprintf(out+len,"<a href=\"/%03x/%02x.html\">o</a> &nbsp;", pagenr, subnr);
+ len += sprintf(out+len,"<a href=\"/%03x/\">></a> &nbsp;",
+ calc_page(pagenr, +0x01));
+ len += sprintf(out+len,"<a href=\"/%03x/\">>></a>",
+ calc_page(pagenr, +0x10));
+ len += sprintf(out+len,"<br>\n") ;
len += sprintf(out+len,"%s",page_bottom);
req->mime = "text/html; charset=\"iso-8859-1\"";
} else {
diff --git a/libng/Makefile.in b/libng/Makefile.in
index 383567c..7eddf11 100644
--- a/libng/Makefile.in
+++ b/libng/Makefile.in
@@ -5,11 +5,9 @@ include ../Make.config
CFLAGS=-g @CFLAGS@ $(WARN_FLAGS) $(LFS_FLAGS) -I.. \
-DNG_PRIVATE -DLIBDIR='"$(libdir)"'
-OBJS=grab-ng.o devices.o @NG_GRAB@ \
+OBJS=grab-ng.o devices.o writefile.o \
color_common.o color_packed.o color_lut.o \
- color_yuv2rgb.o \
- clipping.o mjpeg.o \
- writefile.o writeavi.o writeqt.o
+ color_yuv2rgb.o
all build: libng.a
diff --git a/libng/clipping.c b/libng/clipping.c
deleted file mode 100644
index 64b2e08..0000000
--- a/libng/clipping.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * generic window clipping checking / optimization code
- *
- * (c) 2001 Gerd Knorr <kraxel@bytesex.org>
- *
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <pthread.h>
-
-#include "config.h"
-#include "grab-ng.h"
-
-/* --------------------------------------------------------------------- */
-
-static void dump(char *state, struct OVERLAY_CLIP *oc, int count)
-{
- int i;
-
- fprintf(stderr,"clip: %s - %d clips\n",state,count);
- for (i = 0; i < count; i++)
- fprintf(stderr,"clip: %d: %dx%d+%d+%d\n",i,
- oc[i].x2 - oc[i].x1,
- oc[i].y2 - oc[i].y1,
- oc[i].x1, oc[i].y1);
-}
-
-static void drop(struct OVERLAY_CLIP *oc, int n, int *count)
-{
- (*count)--;
- memmove(oc+n, oc+n+1, sizeof(struct OVERLAY_CLIP) * (*count-n));
-}
-
-/* --------------------------------------------------------------------- */
-
-void ng_check_clipping(int width, int height, int xadjust, int yadjust,
- struct OVERLAY_CLIP *oc, int *count)
-{
- int i,j;
-
- if (ng_debug > 1) {
- fprintf(stderr,"clip: win=%dx%d xa=%d ya=%d\n",
- width,height,xadjust,yadjust);
- dump("init",oc,*count);
- }
- for (i = 0; i < *count; i++) {
- /* fixup coordinates */
- oc[i].x1 += xadjust;
- oc[i].x2 += xadjust;
- oc[i].y1 += yadjust;
- oc[i].y2 += yadjust;
- }
- if (ng_debug > 1)
- dump("fixup adjust",oc,*count);
-
- for (i = 0; i < *count; i++) {
- /* fixup borders */
- if (oc[i].x1 < 0)
- oc[i].x1 = 0;
- if (oc[i].x2 < 0)
- oc[i].x2 = 0;
- if (oc[i].x1 > width)
- oc[i].x1 = width;
- if (oc[i].x2 > width)
- oc[i].x2 = width;
- if (oc[i].y1 < 0)
- oc[i].y1 = 0;
- if (oc[i].y2 < 0)
- oc[i].y2 = 0;
- if (oc[i].y1 > height)
- oc[i].y1 = height;
- if (oc[i].y2 > height)
- oc[i].y2 = height;
- }
- if (ng_debug > 1)
- dump("fixup range",oc,*count);
-
- /* drop zero-sized clips */
- for (i = 0; i < *count;) {
- if (oc[i].x1 == oc[i].x2 || oc[i].y1 == oc[i].y2) {
- drop(oc,i,count);
- continue;
- }
- i++;
- }
- if (ng_debug > 1)
- dump("zerosize done",oc,*count);
-
- /* try to merge clips */
- restart_merge:
- for (j = *count - 1; j >= 0; j--) {
- for (i = 0; i < *count; i++) {
- if (i == j)
- continue;
- if (oc[i].x1 == oc[j].x1 &&
- oc[i].x2 == oc[j].x2 &&
- oc[i].y1 <= oc[j].y1 &&
- oc[i].y2 >= oc[j].y1) {
- if (ng_debug > 1)
- fprintf(stderr,"clip: merge y %d,%d\n",i,j);
- if (oc[i].y2 < oc[j].y2)
- oc[i].y2 = oc[j].y2;
- drop(oc,j,count);
- if (ng_debug > 1)
- dump("merge y done",oc,*count);
- goto restart_merge;
- }
- if (oc[i].y1 == oc[j].y1 &&
- oc[i].y2 == oc[j].y2 &&
- oc[i].x1 <= oc[j].x1 &&
- oc[i].x2 >= oc[j].x1) {
- if (ng_debug > 1)
- fprintf(stderr,"clip: merge x %d,%d\n",i,j);
- if (oc[i].x2 < oc[j].x2)
- oc[i].x2 = oc[j].x2;
- drop(oc,j,count);
- if (ng_debug > 1)
- dump("merge x done",oc,*count);
- goto restart_merge;
- }
- }
- }
- if (ng_debug)
- dump("final",oc,*count);
-}
-
-/* --------------------------------------------------------------------- */
-/*
- * Local variables:
- * compile-command: "(cd ..; make)"
- * End:
- */
diff --git a/libng/devices.c b/libng/devices.c
index f3d7713..031f00c 100644
--- a/libng/devices.c
+++ b/libng/devices.c
@@ -9,7 +9,7 @@
/*
* default devices names
*/
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD)
struct ng_device_config ng_dev = {
video: "/dev/bktr0",
radio: NULL,
diff --git a/libng/grab-ng.c b/libng/grab-ng.c
index ef5718c..fb8803c 100644
--- a/libng/grab-ng.c
+++ b/libng/grab-ng.c
@@ -4,6 +4,8 @@
* (c) 2001 Gerd Knorr <kraxel@bytesex.org>
*
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -11,7 +13,6 @@
#include <pthread.h>
#include <dirent.h>
#include <fnmatch.h>
-#include <dlfcn.h>
#include <errno.h>
#include <ctype.h>
#include <sys/time.h>
@@ -19,7 +20,11 @@
# include <endian.h>
#endif
-#include "config.h"
+#include <dlfcn.h>
+#ifndef RTLD_NOW
+# define RTLD_NOW RTLD_LAZY
+#endif
+
#include "grab-ng.h"
int ng_debug = 0;
@@ -294,42 +299,89 @@ ng_ratio_fixup2(int *width, int *height, int *xoff, int *yoff,
/* --------------------------------------------------------------------- */
-extern const struct ng_writer files_writer;
-extern const struct ng_writer raw_writer;
-extern const struct ng_writer avi_writer;
-#ifdef HAVE_LIBQUICKTIME
-extern const struct ng_writer qt_writer;
-#endif
+struct ng_video_conv **ng_conv;
+struct ng_filter **ng_filters;
+struct ng_writer **ng_writers;
+struct ng_vid_driver **ng_vid_drivers;
+struct ng_dsp_driver **ng_dsp_drivers;
+struct ng_mix_driver **ng_mix_drivers;
-const struct ng_writer *ng_writers[] = {
- &files_writer,
- &raw_writer,
- &avi_writer,
-#ifdef HAVE_LIBQUICKTIME
- &qt_writer,
-#endif
- NULL
-};
+static void ng_register_listadd(void ***list, void *add)
+{
+ int n = 0;
-/* --------------------------------------------------------------------- */
+ if (*list)
+ for (n = 0; NULL != (*list)[n]; n++)
+ /* nothing */;
+ *list = realloc(*list,sizeof(void*)*(n+2));
+ (*list)[n++] = add;
+ (*list)[n++] = NULL;
+}
-extern const struct ng_driver v4l_driver;
-extern const struct ng_driver v4l2_driver;
-extern const struct ng_driver bsd_driver;
-const struct ng_driver *ng_drivers[] = {
-#ifdef __linux__
- &v4l2_driver,
- &v4l_driver,
-#endif
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
- &bsd_driver,
+void
+ng_conv_register(struct ng_video_conv *list, int count)
+{
+ int n;
+
+ for (n = 0; n < count; n++)
+ ng_register_listadd((void***)(&ng_conv),&list[n]);
+}
+
+void
+ng_filter_register(struct ng_filter *filter)
+{
+ ng_register_listadd((void***)(&ng_filters),filter);
+}
+
+void
+ng_writer_register(struct ng_writer *writer)
+{
+ ng_register_listadd((void***)(&ng_writers),writer);
+}
+
+void
+ng_vid_driver_register(struct ng_vid_driver *driver)
+{
+ ng_register_listadd((void***)(&ng_vid_drivers),driver);
+}
+
+void
+ng_dsp_driver_register(struct ng_dsp_driver *driver)
+{
+ ng_register_listadd((void***)(&ng_dsp_drivers),driver);
+}
+
+void
+ng_mix_driver_register(struct ng_mix_driver *driver)
+{
+ ng_register_listadd((void***)(&ng_mix_drivers),driver);
+}
+
+struct ng_video_conv*
+ng_conv_find(int out, int *i)
+{
+ struct ng_video_conv *ret = NULL;
+
+ for (; ng_conv[*i] != NULL; (*i)++) {
+#if 1
+ fprintf(stderr,"\tconv: %-28s => %s\n",
+ ng_vfmt_to_desc[ng_conv[*i]->fmtid_in],
+ ng_vfmt_to_desc[ng_conv[*i]->fmtid_out]);
#endif
- NULL
-};
+ if (ng_conv[*i]->fmtid_out == out) {
+ ret = ng_conv[*i];
+ (*i)++;
+ break;
+ }
+ }
+ return ret;
+}
-const struct ng_driver*
-ng_grabber_open(char *device, struct ng_video_fmt *screen, void *base,
- void **handle)
+/* --------------------------------------------------------------------- */
+
+const struct ng_vid_driver*
+ng_vid_open(char *device, struct ng_video_fmt *screen, void *base,
+ void **handle)
{
int i;
@@ -350,25 +402,77 @@ ng_grabber_open(char *device, struct ng_video_fmt *screen, void *base,
#endif
/* check all grabber drivers */
- for (i = 0; NULL != ng_drivers[i]; i++) {
- if (NULL == ng_drivers[i]->name)
- continue;
+ if (NULL == ng_vid_drivers)
+ return NULL;
+ for (i = 0; NULL != ng_vid_drivers[i]; i++) {
if (ng_debug)
- fprintf(stderr,"init: trying: %s... \n",ng_drivers[i]->name);
- if (NULL != (*handle = ng_drivers[i]->open(device)))
+ fprintf(stderr,"vid-open: trying: %s... \n",
+ ng_vid_drivers[i]->name);
+ if (NULL != (*handle = ng_vid_drivers[i]->open(device)))
break;
if (ng_debug)
- fprintf(stderr,"init: failed: %s\n",ng_drivers[i]->name);
+ fprintf(stderr,"vid-open: failed: %s\n",ng_vid_drivers[i]->name);
}
- if (NULL == ng_drivers[i])
+ if (NULL == ng_vid_drivers[i])
return NULL;
if (ng_debug)
- fprintf(stderr,"init: ok: %s\n",ng_drivers[i]->name);
+ fprintf(stderr,"vid-open: ok: %s\n",ng_vid_drivers[i]->name);
if (NULL != screen &&
- ng_drivers[i]->capabilities(*handle) & CAN_OVERLAY) {
- ng_drivers[i]->setupfb(*handle,screen,base);
+ ng_vid_drivers[i]->capabilities(*handle) & CAN_OVERLAY) {
+ ng_vid_drivers[i]->setupfb(*handle,screen,base);
}
- return ng_drivers[i];
+ return ng_vid_drivers[i];
+}
+
+const struct ng_dsp_driver*
+ng_dsp_open(char *device, struct ng_audio_fmt *fmt, void **handle)
+{
+ int i;
+
+ /* check all dsp drivers */
+ if (NULL == ng_dsp_drivers)
+ return NULL;
+ for (i = 0; NULL != ng_dsp_drivers[i]; i++) {
+ if (NULL == ng_dsp_drivers[i]->name)
+ continue;
+ if (ng_debug)
+ fprintf(stderr,"dsp-open: trying: %s... \n",
+ ng_dsp_drivers[i]->name);
+ if (NULL != (*handle = ng_dsp_drivers[i]->open(device,fmt)))
+ break;
+ if (ng_debug)
+ fprintf(stderr,"dsp-open: failed: %s\n",ng_dsp_drivers[i]->name);
+ }
+ if (NULL == ng_dsp_drivers[i])
+ return NULL;
+ if (ng_debug)
+ fprintf(stderr,"dsp-open: ok: %s\n",ng_dsp_drivers[i]->name);
+ return ng_dsp_drivers[i];
+}
+
+struct ng_attribute*
+ng_mix_init(char *device, char *channel)
+{
+ struct ng_attribute *attrs = NULL;
+ int i;
+
+ /* check all mixer drivers */
+ if (NULL == ng_mix_drivers)
+ return NULL;
+ for (i = 0; NULL != ng_mix_drivers[i]; i++) {
+ if (NULL == ng_mix_drivers[i]->name)
+ continue;
+ if (ng_debug)
+ fprintf(stderr,"mix-init: trying: %s... \n",
+ ng_mix_drivers[i]->name);
+ if (NULL != (attrs = ng_mix_drivers[i]->init(device,channel)))
+ break;
+ if (ng_debug)
+ fprintf(stderr,"mix-init: failed: %s\n",ng_mix_drivers[i]->name);
+ }
+ if (ng_debug && NULL != attrs)
+ fprintf(stderr,"mix-init: ok: %s\n",ng_mix_drivers[i]->name);
+ return attrs;
}
long long
@@ -387,73 +491,129 @@ ng_get_timestamp()
/* --------------------------------------------------------------------- */
-static struct ng_video_conv *ng_conv;
-static int ng_nconv;
-
-void
-ng_conv_register(struct ng_video_conv *list, int count)
+static void clip_dump(char *state, struct OVERLAY_CLIP *oc, int count)
{
- int size = sizeof(struct ng_video_conv) * (ng_nconv + count);
+ int i;
- ng_conv = realloc(ng_conv,size);
- memcpy(ng_conv + ng_nconv,list,sizeof(struct ng_video_conv)*count);
- ng_nconv += count;
+ fprintf(stderr,"clip: %s - %d clips\n",state,count);
+ for (i = 0; i < count; i++)
+ fprintf(stderr,"clip: %d: %dx%d+%d+%d\n",i,
+ oc[i].x2 - oc[i].x1,
+ oc[i].y2 - oc[i].y1,
+ oc[i].x1, oc[i].y1);
}
-struct ng_video_conv*
-ng_conv_find(int out, int *i)
+static void clip_drop(struct OVERLAY_CLIP *oc, int n, int *count)
{
- struct ng_video_conv *ret = NULL;
-
- for (; *i < ng_nconv; (*i)++) {
-#if 0
- fprintf(stderr,"\tconv: %-28s => %s\n",
- ng_vfmt_to_desc[ng_conv[*i].fmtid_in],
- ng_vfmt_to_desc[ng_conv[*i].fmtid_out]);
-#endif
- if (ng_conv[*i].fmtid_out == out) {
- ret = &ng_conv[*i];
- (*i)++;
- break;
- }
- }
- return ret;
+ (*count)--;
+ memmove(oc+n, oc+n+1, sizeof(struct OVERLAY_CLIP) * (*count-n));
}
-struct ng_filter **ng_filters;
-
-void
-ng_filter_register(struct ng_filter *list, int count)
+void ng_check_clipping(int width, int height, int xadjust, int yadjust,
+ struct OVERLAY_CLIP *oc, int *count)
{
- int n = 0;
+ int i,j;
- if (ng_filters)
- for (n = 0; NULL != ng_filters[n]; n++)
- /* nothing */;
- ng_filters = realloc(ng_filters,sizeof(struct ng_filter*)*(n+count+1));
- memcpy(ng_filters+n,&list,sizeof(struct ng_filter*)*count);
- memset(ng_filters+n+count,0,sizeof(struct ng_filter*));
-
-#if 0 /* DEBUG */
- for (n = 0; NULL != ng_filters[n]; n++)
- fprintf(stderr,"%s\n",ng_filters[n]->name);
- fprintf(stderr,"-- \n");
-#endif
+ if (ng_debug > 1) {
+ fprintf(stderr,"clip: win=%dx%d xa=%d ya=%d\n",
+ width,height,xadjust,yadjust);
+ clip_dump("init",oc,*count);
+ }
+ for (i = 0; i < *count; i++) {
+ /* fixup coordinates */
+ oc[i].x1 += xadjust;
+ oc[i].x2 += xadjust;
+ oc[i].y1 += yadjust;
+ oc[i].y2 += yadjust;
+ }
+ if (ng_debug > 1)
+ clip_dump("fixup adjust",oc,*count);
+
+ for (i = 0; i < *count; i++) {
+ /* fixup borders */
+ if (oc[i].x1 < 0)
+ oc[i].x1 = 0;
+ if (oc[i].x2 < 0)
+ oc[i].x2 = 0;
+ if (oc[i].x1 > width)
+ oc[i].x1 = width;
+ if (oc[i].x2 > width)
+ oc[i].x2 = width;
+ if (oc[i].y1 < 0)
+ oc[i].y1 = 0;
+ if (oc[i].y2 < 0)
+ oc[i].y2 = 0;
+ if (oc[i].y1 > height)
+ oc[i].y1 = height;
+ if (oc[i].y2 > height)
+ oc[i].y2 = height;
+ }
+ if (ng_debug > 1)
+ clip_dump("fixup range",oc,*count);
+
+ /* drop zero-sized clips */
+ for (i = 0; i < *count;) {
+ if (oc[i].x1 == oc[i].x2 || oc[i].y1 == oc[i].y2) {
+ clip_drop(oc,i,count);
+ continue;
+ }
+ i++;
+ }
+ if (ng_debug > 1)
+ clip_dump("zerosize done",oc,*count);
+
+ /* try to merge clips */
+ restart_merge:
+ for (j = *count - 1; j >= 0; j--) {
+ for (i = 0; i < *count; i++) {
+ if (i == j)
+ continue;
+ if (oc[i].x1 == oc[j].x1 &&
+ oc[i].x2 == oc[j].x2 &&
+ oc[i].y1 <= oc[j].y1 &&
+ oc[i].y2 >= oc[j].y1) {
+ if (ng_debug > 1)
+ fprintf(stderr,"clip: merge y %d,%d\n",i,j);
+ if (oc[i].y2 < oc[j].y2)
+ oc[i].y2 = oc[j].y2;
+ clip_drop(oc,j,count);
+ if (ng_debug > 1)
+ clip_dump("merge y done",oc,*count);
+ goto restart_merge;
+ }
+ if (oc[i].y1 == oc[j].y1 &&
+ oc[i].y2 == oc[j].y2 &&
+ oc[i].x1 <= oc[j].x1 &&
+ oc[i].x2 >= oc[j].x1) {
+ if (ng_debug > 1)
+ fprintf(stderr,"clip: merge x %d,%d\n",i,j);
+ if (oc[i].x2 < oc[j].x2)
+ oc[i].x2 = oc[j].x2;
+ clip_drop(oc,j,count);
+ if (ng_debug > 1)
+ clip_dump("merge x done",oc,*count);
+ goto restart_merge;
+ }
+ }
+ }
+ if (ng_debug)
+ clip_dump("final",oc,*count);
}
/* --------------------------------------------------------------------- */
-static void ng_plugins(char *dirname)
+static int ng_plugins(char *dirname)
{
struct dirent *ent;
char filename[1024];
void *plugin;
void (*initcall)(void);
DIR *dir;
+ int n = 0;
dir = opendir(dirname);
if (NULL == dir)
- return;
+ return n;
while (NULL != (ent = readdir(dir))) {
if (0 != fnmatch("*.so",ent->d_name,0))
continue;
@@ -463,12 +623,14 @@ static void ng_plugins(char *dirname)
continue;
}
if (NULL == (initcall = dlsym(plugin,"ng_plugin_init"))) {
- fprintf(stderr,"dlsym: %s\n",dlerror());
+ fprintf(stderr,"dlsym[%s]: %s\n",filename,dlerror());
continue;
}
initcall();
+ n++;
}
closedir(dir);
+ return n;
}
void
@@ -483,9 +645,10 @@ ng_init(void)
ng_device_init();
ng_color_packed_init();
ng_color_yuv2rgb_init();
- ng_mjpg_init();
+ ng_writefile_init();
- ng_plugins(LIBDIR);
+ if (0 == ng_plugins(LIBDIR))
+ ng_plugins("../libng/plugins"); /* nice for development */
}
/*
diff --git a/libng/grab-ng.h b/libng/grab-ng.h
index 1a9d791..91dc188 100644
--- a/libng/grab-ng.h
+++ b/libng/grab-ng.h
@@ -221,7 +221,7 @@ void ng_ratio_fixup2(int *width, int *height, int *xoff, int *yoff,
/* --------------------------------------------------------------------- */
/* capture/overlay interface driver */
-struct ng_driver {
+struct ng_vid_driver {
const char *name;
/* open/close */
@@ -253,6 +253,24 @@ struct ng_driver {
/* --------------------------------------------------------------------- */
+/* sound driver */
+
+struct ng_dsp_driver {
+ const char *name;
+ void* (*open)(char *device, struct ng_audio_fmt *fmt);
+ void (*close)(void *handle);
+ int (*fd)(void *handle);
+ int (*startrec)(void *handle);
+ struct ng_audio_buf* (*read)(void *handle, long long stopby);
+};
+
+struct ng_mix_driver {
+ const char *name;
+ struct ng_attribute* (*init)(char *device, char *channel);
+};
+
+
+/* --------------------------------------------------------------------- */
/* color space converters */
struct ng_video_conv {
@@ -281,19 +299,33 @@ struct ng_filter {
/* --------------------------------------------------------------------- */
-extern const struct ng_driver *ng_drivers[];
-extern const struct ng_writer *ng_writers[];
-extern struct ng_filter **ng_filters;
+extern struct ng_video_conv **ng_conv;
+extern struct ng_filter **ng_filters;
+extern struct ng_writer **ng_writers;
+extern struct ng_vid_driver **ng_vid_drivers;
+extern struct ng_dsp_driver **ng_dsp_drivers;
+extern struct ng_mix_driver **ng_mix_drivers;
void ng_conv_register(struct ng_video_conv *list, int count);
+void ng_filter_register(struct ng_filter *filter);
+void ng_writer_register(struct ng_writer *writer);
+void ng_vid_driver_register(struct ng_vid_driver *driver);
+void ng_dsp_driver_register(struct ng_dsp_driver *driver);
+void ng_mix_driver_register(struct ng_mix_driver *driver);
+
struct ng_video_conv* ng_conv_find(int out, int *i);
-void ng_filter_register(struct ng_filter *list, int count);
+const struct ng_vid_driver*
+ng_vid_open(char *device, struct ng_video_fmt *screen,
+ void *base, void **handle);
+const struct ng_dsp_driver*
+ng_dsp_open(char *device, struct ng_audio_fmt *fmt, void **handle);
+struct ng_attribute*
+ng_mix_init(char *device, char *channel);
-const struct ng_driver*
-ng_grabber_open(char *device, struct ng_video_fmt *screen,
- void *base, void **handle);
long long ng_get_timestamp(void);
+void ng_check_clipping(int width, int height, int xadjust, int yadjust,
+ struct OVERLAY_CLIP *oc, int *count);
/* --------------------------------------------------------------------- */
@@ -309,7 +341,7 @@ void ng_lut_init(unsigned long red_mask, unsigned long green_mask,
/* init functions */
void ng_color_packed_init(void);
void ng_color_yuv2rgb_init(void);
-void ng_mjpg_init(void);
+void ng_writefile_init(void);
/* for yuv2rgb using lookup tables (color_lut.c, color_yuv2rgb.c) */
unsigned long ng_lut_red[256];
@@ -338,10 +370,6 @@ void ng_conv_nop_fini(void *handle);
frame: ng_packed_frame, \
fini: ng_conv_nop_fini
-/* clipping.c stuff */
-void ng_check_clipping(int width, int height, int xadjust, int yadjust,
- struct OVERLAY_CLIP *oc, int *count);
-
#endif /* NG_PRIVATE */
/* --------------------------------------------------------------------- */
diff --git a/libng/plugins/Makefile.in b/libng/plugins/Makefile.in
index 7883acd..c75fce9 100644
--- a/libng/plugins/Makefile.in
+++ b/libng/plugins/Makefile.in
@@ -3,8 +3,9 @@ VPATH=$(srcdir)
include ../../Make.config
-CFLAGS=-g @CFLAGS@ $(WARN_FLAGS) $(LFS_FLAGS) -I../.. -I..
-PLUGINS=nop.so invert.so
+CFLAGS=-g -fPIC @CFLAGS@ $(WARN_FLAGS) $(LFS_FLAGS) -I../.. -I..
+PLUGINS=flt-nop.so flt-invert.so conv-mjpeg.so write-avi.so \
+ @PLUGINS@
all build: $(PLUGINS)
@@ -12,8 +13,11 @@ all build: $(PLUGINS)
.o.so:
gcc $(CFLAGS) -shared -Wl,-soname,$@ -o $@ $<
+write-qt.so: write-qt.o
+ gcc $(CFLAGS) -shared -Wl,-soname,$@ -o $@ $< $(QT_LIBS)
+
clean:
- rm -f $(PLUGINS) $(OBJS)
+ rm -f $(PLUGINS) *.o
distclean realclean: clean
rm -f Makefile *~ *.bak
diff --git a/libng/mjpeg.c b/libng/plugins/conv-mjpeg.c
index 1bbc2db..e3fe237 100644
--- a/libng/mjpeg.c
+++ b/libng/plugins/conv-mjpeg.c
@@ -396,8 +396,8 @@ static struct ng_video_conv mjpg_list[] = {
};
static const int nconv = sizeof(mjpg_list)/sizeof(struct ng_video_conv);
-void
-ng_mjpg_init(void)
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
{
ng_conv_register(mjpg_list,nconv);
}
diff --git a/libng/grab-bsd.c b/libng/plugins/drv0-bsd.c
index 2adff41..7ece078 100644
--- a/libng/grab-bsd.c
+++ b/libng/plugins/drv0-bsd.c
@@ -24,14 +24,15 @@
#endif
#include <pthread.h>
-#include "grab-ng.h"
-
-#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
-struct ng_driver bsd_driver;
-#else /* BSD */
+#ifdef HAVE_DEV_IC_BT8XX_H
+# include <dev/ic/bt8xx.h>
+#endif
+#ifdef HAVE_MACHINE_IOCTL_BT848_H
+# include <machine/ioctl_bt848.h>
+# include <machine/ioctl_meteor.h>
+#endif
-#include <machine/ioctl_bt848.h>
-#include <machine/ioctl_meteor.h>
+#include "grab-ng.h"
/* ---------------------------------------------------------------------- */
/* global variables */
@@ -98,7 +99,7 @@ static unsigned long bsd_getfreq(void *handle);
static void bsd_setfreq(void *handle, unsigned long freq);
static int bsd_tuned(void *handle);
-const struct ng_driver bsd_driver = {
+struct ng_vid_driver bsd_driver = {
name: "bktr",
open: bsd_open,
close: bsd_close,
@@ -800,4 +801,10 @@ static struct ng_video_buf* bsd_getimage(void *handle)
return buf;
}
-#endif /* BSD */
+/* ---------------------------------------------------------------------- */
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_vid_driver_register(&bsd_driver);
+}
diff --git a/libng/grab-v4l2.c b/libng/plugins/drv0-v4l2.c
index 5a8c386..eda822e 100644
--- a/libng/grab-v4l2.c
+++ b/libng/plugins/drv0-v4l2.c
@@ -24,15 +24,11 @@
# include <endian.h>
#endif
-#include "grab-ng.h"
-
-#ifndef __linux__
-struct ng_driver v4l2_driver;
-#else /* __linux__ */
-
#include <asm/types.h> /* XXX glibc */
#include "videodev2.h"
+#include "grab-ng.h"
+
/* ---------------------------------------------------------------------- */
/* open+close */
@@ -109,7 +105,7 @@ struct v4l2_handle {
/* ---------------------------------------------------------------------- */
-const struct ng_driver v4l2_driver = {
+struct ng_vid_driver v4l2_driver = {
name: "v4l2",
open: v4l2_open,
close: v4l2_close,
@@ -1286,11 +1282,10 @@ v4l2_getimage(void *handle)
return buf;
}
-#endif /* __linux__ */
+/* ---------------------------------------------------------------------- */
-/* --------------------------------------------------------------------- */
-/*
- * Local variables:
- * compile-command: "(cd ..; make)"
- * End:
- */
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_vid_driver_register(&v4l2_driver);
+}
diff --git a/libng/grab-v4l.c b/libng/plugins/drv1-v4l.c
index 117b4cf..b9de9d0 100644
--- a/libng/grab-v4l.c
+++ b/libng/plugins/drv1-v4l.c
@@ -23,15 +23,10 @@
# include <endian.h>
#endif
#include <pthread.h>
+#include <linux/videodev.h>
#include "grab-ng.h"
-#ifndef __linux__
-const struct ng_driver v4l_driver;
-#else /* __linux__ */
-
-#include <linux/videodev.h>
-
#define SYNC_TIMEOUT 3
/* ---------------------------------------------------------------------- */
@@ -176,7 +171,7 @@ struct v4l_handle {
struct ng_video_buf *buf_me;
};
-const struct ng_driver v4l_driver = {
+struct ng_vid_driver v4l_driver = {
name: "v4l",
open: v4l_open,
close: v4l_close,
@@ -1262,9 +1257,10 @@ v4l_getimage(void *handle)
}
}
-#endif /* __linux__ */
-/*
- * Local variables:
- * compile-command: "(cd ..; make)"
- * End:
- */
+/* ---------------------------------------------------------------------- */
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_vid_driver_register(&v4l_driver);
+}
diff --git a/libng/plugins/invert.c b/libng/plugins/flt-invert.c
index 9b71d37..f2809dd 100644
--- a/libng/plugins/invert.c
+++ b/libng/plugins/flt-invert.c
@@ -131,5 +131,5 @@ static struct ng_filter filter = {
extern void ng_plugin_init(void);
void ng_plugin_init(void)
{
- ng_filter_register(&filter,1);
+ ng_filter_register(&filter);
}
diff --git a/libng/plugins/nop.c b/libng/plugins/flt-nop.c
index 2f624e5..62701f2 100644
--- a/libng/plugins/nop.c
+++ b/libng/plugins/flt-nop.c
@@ -65,5 +65,5 @@ static struct ng_filter filter = {
extern void ng_plugin_init(void);
void ng_plugin_init(void)
{
- ng_filter_register(&filter,1);
+ ng_filter_register(&filter);
}
diff --git a/libng/plugins/snd-oss.c b/libng/plugins/snd-oss.c
new file mode 100644
index 0000000..69058ed
--- /dev/null
+++ b/libng/plugins/snd-oss.c
@@ -0,0 +1,469 @@
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <sys/ioctl.h>
+#ifdef HAVE_SOUNDCARD_H
+# include <soundcard.h>
+#endif
+#ifdef HAVE_SYS_SOUNDCARD_H
+# include <sys/soundcard.h>
+#endif
+
+#include "grab-ng.h"
+
+/* -------------------------------------------------------------------- */
+
+extern int debug;
+static const char *names[] = SOUND_DEVICE_NAMES;
+
+static int mixer_read_attr(struct ng_attribute *attr);
+static void mixer_write_attr(struct ng_attribute *attr, int val);
+
+struct mixer_handle {
+ int mix;
+ int dev;
+ int volume;
+ int muted;
+};
+
+static struct ng_attribute mixer_attrs[] = {
+ {
+ id: ATTR_ID_MUTE,
+ name: "mute",
+ type: ATTR_TYPE_BOOL,
+ read: mixer_read_attr,
+ write: mixer_write_attr,
+ },{
+ id: ATTR_ID_VOLUME,
+ name: "volume",
+ type: ATTR_TYPE_INTEGER,
+ read: mixer_read_attr,
+ write: mixer_write_attr,
+ },{
+ /* end of list */
+ }
+};
+
+static struct ng_attribute*
+mixer_open(char *device, char *channel)
+{
+ struct mixer_handle *h;
+ struct ng_attribute *attrs;
+ int i, devmask;
+
+ h = malloc(sizeof(*h));
+ memset(h,0,sizeof(*h));
+ h->mix = -1;
+ h->dev = -1;
+
+ if (-1 == (h->mix = open(device,O_RDONLY))) {
+ fprintf(stderr,"open %s: %s\n",device,strerror(errno));
+ goto err;
+ }
+ fcntl(h->mix,F_SETFD,FD_CLOEXEC);
+
+ if (-1 == ioctl(h->mix,MIXER_READ(SOUND_MIXER_DEVMASK),&devmask)) {
+ fprintf(stderr,"%s: read devmask: %s",device,strerror(errno));
+ goto err;
+ }
+ for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
+ if ((1<<i) & devmask && strcasecmp(names[i],channel) == 0) {
+ if (-1 == ioctl(h->mix,MIXER_READ(i),&h->volume)) {
+ fprintf(stderr,"%s: read volume: %s",
+ device,strerror(errno));
+ goto err;
+ } else {
+ h->dev = i;
+ }
+ }
+ }
+
+ if (-1 == h->dev) {
+ fprintf(stderr,"%s: '%s' not found.\n%s: available: ",
+ device,channel,device);
+ for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
+ if ((1<<i) & devmask)
+ fprintf(stderr," '%s'",names[i]);
+ fprintf(stderr,"\n");
+ goto err;
+ }
+
+ attrs = malloc(sizeof(mixer_attrs));
+ memcpy(attrs,mixer_attrs,sizeof(mixer_attrs));
+ for (i = 0; attrs[i].name != NULL; i++)
+ attrs[i].handle = h;
+
+ return attrs;
+
+ err:
+ if (h) {
+ if (-1 != h->mix)
+ close(h->mix);
+ free(h);
+ }
+ return NULL;
+}
+
+static int
+mixer_read_attr(struct ng_attribute *attr)
+{
+ struct mixer_handle *h = attr->handle;
+ int vol;
+
+ switch (attr->id) {
+ case ATTR_ID_VOLUME:
+ if (-1 == ioctl(h->mix,MIXER_READ(h->dev),&h->volume))
+ perror("oss mixer read volume");
+ vol = (h->volume & 0x7f) * 65535 / 100;
+ return vol;
+ case ATTR_ID_MUTE:
+ return h->muted;
+ default:
+ return -1;
+ }
+}
+
+static void
+mixer_write_attr(struct ng_attribute *attr, int val)
+{
+ struct mixer_handle *h = attr->handle;
+
+ switch (attr->id) {
+ case ATTR_ID_VOLUME:
+ val = val * 100 / 65535;
+ val &= 0x7f;
+ h->volume = val | (val << 8);
+ if (-1 == ioctl(h->mix,MIXER_WRITE(h->dev),&h->volume))
+ perror("oss mixer write volume");
+ h->muted = 0;
+ break;
+ case ATTR_ID_MUTE:
+ h->muted = val;
+ if (h->muted) {
+ int zero = 0;
+ if (-1 == ioctl(h->mix,MIXER_READ(h->dev),&h->volume))
+ perror("oss mixer read volume");
+ if (-1 == ioctl(h->mix,MIXER_WRITE(h->dev),&zero))
+ perror("oss mixer write volume");
+ } else {
+ if (-1 == ioctl(h->mix,MIXER_WRITE(h->dev),&h->volume))
+ perror("oss mixer write volume");
+ }
+ break;
+ }
+}
+
+struct ng_mix_driver oss_mixer = {
+ name: "oss",
+ init: mixer_open,
+};
+
+/* ------------------------------------------------------------------- */
+
+struct oss_handle {
+ int fd;
+
+ /* oss */
+ struct ng_audio_fmt ifmt;
+ int afmt,channels,rate;
+ int blocksize;
+
+ /* me */
+ struct ng_audio_fmt ofmt;
+ int byteswap;
+ int bytes;
+ int bytes_per_sec;
+};
+
+static const int afmt_to_oss[AUDIO_FMT_COUNT] = {
+ 0,
+ AFMT_U8,
+ AFMT_U8,
+ AFMT_S16_LE,
+ AFMT_S16_LE,
+ AFMT_S16_BE,
+ AFMT_S16_BE
+};
+
+static int
+oss_setformat(struct oss_handle *h, struct ng_audio_fmt *fmt)
+{
+ int frag;
+
+ if (0 == afmt_to_oss[fmt->fmtid])
+ return -1;
+
+ h->afmt = afmt_to_oss[fmt->fmtid];
+ h->channels = ng_afmt_to_channels[fmt->fmtid];
+ frag = 0x7fff000c; /* 4k */
+
+ /* format */
+ ioctl(h->fd, SNDCTL_DSP_SETFMT, &h->afmt);
+ if (h->afmt != afmt_to_oss[fmt->fmtid]) {
+ if (ng_debug)
+ fprintf(stderr,"oss: SNDCTL_DSP_SETFMT(%d): %s\n",
+ afmt_to_oss[fmt->fmtid],strerror(errno));
+ goto err;
+ }
+
+ /* channels */
+ ioctl(h->fd, SNDCTL_DSP_CHANNELS, &h->channels);
+ if (h->channels != ng_afmt_to_channels[fmt->fmtid]) {
+ if (ng_debug)
+ fprintf(stderr,"oss: SNDCTL_DSP_CHANNELS(%d): %s\n",
+ ng_afmt_to_channels[fmt->fmtid],strerror(errno));
+ goto err;
+ }
+
+ /* sample rate */
+ h->rate = fmt->rate;
+ ioctl(h->fd, SNDCTL_DSP_SPEED, &h->rate);
+ ioctl(h->fd, SNDCTL_DSP_SETFRAGMENT, &frag);
+ if (h->rate != fmt->rate) {
+ fprintf(stderr, "oss: warning: got sample rate %d (asked for %d)\n",
+ h->rate,fmt->rate);
+ if (h->rate < fmt->rate * 1001 / 1000 &&
+ h->rate > fmt->rate * 999 / 1000) {
+ /* ignore very small differences ... */
+ h->rate = fmt->rate;
+ }
+ }
+
+ if (-1 == ioctl(h->fd, SNDCTL_DSP_GETBLKSIZE, &h->blocksize)) {
+ if (ng_debug)
+ perror("SNDCTL_DSP_GETBLKSIZE");
+ goto err;
+ }
+ if (0 == h->blocksize)
+ /* dmasound bug compatibility */
+ h->blocksize = 4096;
+
+ if (ng_debug)
+ fprintf(stderr,"oss: bs=%d rate=%d channels=%d bits=%d (%s)\n",
+ h->blocksize,h->rate,
+ ng_afmt_to_channels[fmt->fmtid],
+ ng_afmt_to_bits[fmt->fmtid],
+ ng_afmt_to_desc[fmt->fmtid]);
+ return 0;
+
+ err:
+ if (ng_debug)
+ fprintf(stderr,"oss: sound format not supported [%s]\n",
+ ng_afmt_to_desc[fmt->fmtid]);
+ return -1;
+}
+
+static void*
+oss_open(char *device, struct ng_audio_fmt *fmt)
+{
+ struct oss_handle *h;
+ struct ng_audio_fmt ifmt;
+
+ h = malloc(sizeof(*h));
+ if (NULL == h)
+ return NULL;
+ memset(h,0,sizeof(*h));
+
+ if (-1 == (h->fd = open(device ? device : ng_dev.dsp, O_RDONLY))) {
+ fprintf(stderr,"oss: open %s: %s\n",
+ device ? device : ng_dev.dsp,
+ strerror(errno));
+ goto err;
+ }
+ fcntl(h->fd,F_SETFD,FD_CLOEXEC);
+
+ if (0 == oss_setformat(h,fmt)) {
+ /* fine, native format works */
+ fmt->rate = h->rate;
+ h->ifmt = *fmt;
+ h->ofmt = *fmt;
+ h->bytes_per_sec = ng_afmt_to_bits[h->ifmt.fmtid] *
+ ng_afmt_to_channels[h->ifmt.fmtid] * h->ifmt.rate / 8;
+ return h;
+ }
+
+ /* try byteswapping */
+ ifmt = *fmt;
+ switch (fmt->fmtid) {
+ case AUDIO_S16_LE_MONO: ifmt.fmtid = AUDIO_S16_BE_MONO; break;
+ case AUDIO_S16_LE_STEREO: ifmt.fmtid = AUDIO_S16_BE_STEREO; break;
+ case AUDIO_S16_BE_MONO: ifmt.fmtid = AUDIO_S16_LE_MONO; break;
+ case AUDIO_S16_BE_STEREO: ifmt.fmtid = AUDIO_S16_LE_STEREO; break;
+ }
+ if (0 == oss_setformat(h,&ifmt)) {
+ if (ng_debug)
+ fprintf(stderr,"oss: byteswapping pcm data\n");
+ h->byteswap = 1;
+ ifmt.rate = h->rate;
+ fmt->rate = h->rate;
+ h->ifmt = ifmt;
+ h->ofmt = *fmt;
+ h->bytes_per_sec = ng_afmt_to_bits[h->ifmt.fmtid] *
+ ng_afmt_to_channels[h->ifmt.fmtid] * h->ifmt.rate / 8;
+ return h;
+ }
+
+ fprintf(stderr,"oss: can't record %s\n",
+ ng_afmt_to_desc[fmt->fmtid]);
+
+ err:
+ fmt->rate = 0;
+ fmt->fmtid = AUDIO_NONE;
+ if (h->fd)
+ close(h->fd);
+ free(h);
+ return NULL;
+}
+
+static int
+oss_startrec(void *handle)
+{
+ struct oss_handle *h = handle;
+ int trigger;
+
+ if (ng_debug)
+ fprintf(stderr,"oss: startrec\n");
+ trigger = 0;
+ ioctl(h->fd,SNDCTL_DSP_SETTRIGGER,&trigger);
+
+#if 1
+ /*
+ * Try to clear the sound driver buffers. IMHO this shouldn't
+ * be needed, but looks like it is with some drivers ...
+ */
+ {
+ int oflags,flags,rc;
+ unsigned char buf[4096];
+
+ oflags = fcntl(h->fd,F_GETFL);
+ flags = oflags | O_NONBLOCK;
+ fcntl(h->fd,F_SETFL,flags);
+ for (;;) {
+ rc = read(h->fd,buf,sizeof(buf));
+ if (ng_debug)
+ fprintf(stderr,"oss: clearbuf rc=%d errno=%s\n",rc,strerror(errno));
+ if (rc != sizeof(buf))
+ break;
+ }
+ fcntl(h->fd,F_SETFL,oflags);
+ }
+#endif
+
+ trigger = PCM_ENABLE_INPUT;
+ ioctl(h->fd,SNDCTL_DSP_SETTRIGGER,&trigger);
+ return 0;
+}
+
+static struct ng_audio_buf*
+oss_bufalloc(struct ng_audio_fmt *fmt, int size)
+{
+ struct ng_audio_buf *buf;
+
+ buf = malloc(sizeof(*buf)+size);
+ memset(buf,0,sizeof(*buf));
+ buf->fmt = *fmt;
+ buf->size = size;
+ buf->data = (char*)buf + sizeof(*buf);
+ return buf;
+}
+
+static void
+oss_bufread(int fd,char *buffer,int blocksize)
+{
+ int rc,count=0;
+
+ /* why FreeBSD returns chunks smaller than blocksize? */
+ for (;;) {
+ rc = read(fd,buffer+count,blocksize-count);
+ if (rc < 0) {
+ if (EINTR == errno)
+ continue;
+ perror("oss: read");
+ exit(1);
+ }
+ count += rc;
+ if (count == blocksize)
+ return;
+ }
+ fprintf(stderr,"#");
+}
+
+static void
+oss_bufswap(void *ptr, int size)
+{
+ unsigned short *buf = ptr;
+ int i;
+
+ size = size >> 1;
+ for (i = 0; i < size; i++)
+ buf[i] = ((buf[i] >> 8) & 0xff) | ((buf[i] << 8) & 0xff00);
+}
+
+static struct ng_audio_buf*
+oss_read(void *handle, long long stopby)
+{
+ struct oss_handle *h = handle;
+ struct ng_audio_buf* buf;
+ int bytes;
+
+ if (stopby) {
+ bytes = stopby * h->bytes_per_sec / 1000000000 - h->bytes;
+ if (ng_debug)
+ fprintf(stderr,"oss: left: %d bytes (%.3fs)\n",
+ bytes,(float)bytes/h->bytes_per_sec);
+ if (bytes <= 0)
+ return NULL;
+ bytes = (bytes + 3) & ~3;
+ if (bytes > h->blocksize)
+ bytes = h->blocksize;
+ } else {
+ bytes = h->blocksize;
+ }
+ buf = oss_bufalloc(&h->ofmt,bytes);
+ oss_bufread(h->fd,buf->data,bytes);
+ if (h->byteswap)
+ oss_bufswap(buf->data,bytes);
+ h->bytes += bytes;
+ buf->info.ts = (long long)h->bytes * 1000000000 / h->bytes_per_sec;
+ return buf;
+}
+
+static int
+oss_fd(void *handle)
+{
+ struct oss_handle *h = handle;
+ return h->fd;
+}
+
+static void
+oss_close(void *handle)
+{
+ struct oss_handle *h = handle;
+
+ close(h->fd);
+ free(h);
+}
+
+/* ------------------------------------------------------------------- */
+
+static struct ng_dsp_driver oss_dsp = {
+ name: "oss",
+ open: oss_open,
+ close: oss_close,
+ fd: oss_fd,
+ startrec: oss_startrec,
+ read: oss_read,
+};
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_dsp_driver_register(&oss_dsp);
+ ng_mix_driver_register(&oss_mixer);
+}
diff --git a/libng/writeavi.c b/libng/plugins/write-avi.c
index ff28f34..8bf289b 100644
--- a/libng/writeavi.c
+++ b/libng/plugins/write-avi.c
@@ -650,7 +650,7 @@ static const struct ng_format_list avi_aformats[] = {
}
};
-const struct ng_writer avi_writer = {
+struct ng_writer avi_writer = {
name: "avi",
desc: "Microsoft AVI (RIFF) format",
combined: 1,
@@ -661,3 +661,9 @@ const struct ng_writer avi_writer = {
wr_audio: avi_audio,
wr_close: avi_close,
};
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_writer_register(&avi_writer);
+}
diff --git a/libng/writeqt.c b/libng/plugins/write-qt.c
index 3fc5db5..94c0179 100644
--- a/libng/writeqt.c
+++ b/libng/plugins/write-qt.c
@@ -271,7 +271,7 @@ static const struct ng_format_list qt_aformats[] = {
}
};
-const struct ng_writer qt_writer = {
+struct ng_writer qt_writer = {
name: "qt",
desc: "Apple QuickTime format",
combined: 1,
@@ -283,4 +283,10 @@ const struct ng_writer qt_writer = {
wr_close: qt_close,
};
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_writer_register(&qt_writer);
+}
+
#endif /* HAVE_LIBQUICKTIME */
diff --git a/libng/writefile.c b/libng/writefile.c
index 6b39b0c..88dd100 100644
--- a/libng/writefile.c
+++ b/libng/writefile.c
@@ -581,7 +581,7 @@ static const struct ng_format_list wav_aformats[] = {
}
};
-const struct ng_writer files_writer = {
+struct ng_writer files_writer = {
name: "files",
desc: "multiple image files",
video: files_vformats,
@@ -592,7 +592,7 @@ const struct ng_writer files_writer = {
wr_close: files_close,
};
-const struct ng_writer raw_writer = {
+struct ng_writer raw_writer = {
name: "raw",
desc: "single file, raw video data",
video: raw_vformats,
@@ -602,3 +602,12 @@ const struct ng_writer raw_writer = {
wr_audio: raw_audio,
wr_close: raw_close,
};
+
+/* ------------------------------------------------------------------- */
+
+void
+ng_writefile_init(void)
+{
+ ng_writer_register(&files_writer);
+ ng_writer_register(&raw_writer);
+}
diff --git a/src/Makefile.in b/src/Makefile.in
index 05bfeac..7c478a0 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -14,31 +14,31 @@ COMMON_OBJS = sound.o webcam.o frequencies.o commands.o parseconfig.o \
XAWTV_OBJS = main.o xt.o toolbox.o conf.o x11.o xv.o complete-xaw.o \
wmhooks.o channel.o lirc.o midictrl.o joystick.o \
$(COMMON_OBJS)
-XAWTV_LIBS = $(GFX_LIBS) $(LIRC_LIBS) $(ATHENA_LIBS) $(OSS_LIBS) \
- $(ALSA_LIBS) -lvbi
+XAWTV_LIBS = $(THREAD_LIBS) $(LIRC_LIBS) $(ATHENA_LIBS) $(OSS_LIBS) \
+ $(ALSA_LIBS) -ljpeg -lvbi
MOTV_OBJS = motif.o man.o xt.o x11.o xv.o channel-no-x11.o wmhooks.o \
RegEdit.o icons.o complete-motif.o lirc.o midictrl.o \
joystick.o $(COMMON_OBJS)
-MOTV_LIBS = $(GFX_LIBS) $(LIRC_LIBS) $(MOTIF_LIBS) $(OSS_LIBS) \
- $(ALSA_LIBS) -lvbi
+MOTV_LIBS = $(THREAD_LIBS) $(LIRC_LIBS) $(MOTIF_LIBS) $(OSS_LIBS) \
+ $(ALSA_LIBS) -ljpeg -lvbi
FBTV_OBJS = fbtv.o fbtools.o fs.o channel-no-x11.o matrox.o lirc.o \
midictrl.o joystick.o $(COMMON_OBJS)
-FBTV_LIBS = $(GFX_LIBS) $(LIRC_LIBS) $(CURSES_LIBS) $(ALSA_LIBS) \
- -L@x_libraries@ @FSLIB@ -lm
+FBTV_LIBS = $(THREAD_LIBS) $(LIRC_LIBS) $(CURSES_LIBS) $(ALSA_LIBS) \
+ -L@x_libraries@ @FSLIB@ -ljpeg -lm
TTV_OBJS = aa.o channel-no-x11.o $(COMMON_OBJS)
-TTV_LIBS = $(GFX_LIBS) $(AA_LIBS)
+TTV_LIBS = $(THREAD_LIBS) $(AA_LIBS) -ljpeg
V4LCTL_OBJS = v4lctl.o channel-no-x11.o xv.o $(COMMON_OBJS)
-V4LCTL_LIBS = $(GFX_LIBS) $(ATHENA_LIBS)
+V4LCTL_LIBS = $(THREAD_LIBS) $(ATHENA_LIBS) -ljpeg
STREAMER_OBJS = streamer.o channel-no-x11.o $(COMMON_OBJS)
-STREAMER_LIBS = $(GFX_LIBS) $(OSS_LIBS)
+STREAMER_LIBS = $(THREAD_LIBS) $(OSS_LIBS) -ljpeg
SCANTV_OBJS = scantv.o channel-no-x11.o $(COMMON_OBJS)
-SCANTV_LIBS = $(GFX_LIBS) -lvbi
+SCANTV_LIBS = $(THREAD_LIBS) -lvbi -ljpeg
# what to build / install
PROGS=v4lctl streamer scantv vbi-debug @PROGS@
@@ -68,25 +68,25 @@ i18n:
# build rules
xawtv: $(XAWTV_OBJS)
- $(CC) $(CFLAGS) -o $@ $(XAWTV_OBJS) $(XAWTV_LIBS) -ldl -Wl,-E
+ $(CC) $(CFLAGS) -o $@ $(XAWTV_OBJS) $(XAWTV_LIBS) $(DLFLAGS)
motv: $(MOTV_OBJS)
- $(CC) $(CFLAGS) -o $@ $(MOTV_OBJS) $(MOTV_LIBS) -ldl -Wl,-E
+ $(CC) $(CFLAGS) -o $@ $(MOTV_OBJS) $(MOTV_LIBS) $(DLFLAGS)
fbtv: $(FBTV_OBJS)
- $(CC) $(CFLAGS) -o $@ $(FBTV_OBJS) $(FBTV_LIBS) -ldl -Wl,-E
+ $(CC) $(CFLAGS) -o $@ $(FBTV_OBJS) $(FBTV_LIBS) $(DLFLAGS)
ttv: $(TTV_OBJS)
- $(CC) $(CFLAGS) -o $@ $(TTV_OBJS) $(TTV_LIBS) -ldl -Wl,-E
+ $(CC) $(CFLAGS) -o $@ $(TTV_OBJS) $(TTV_LIBS) $(DLFLAGS)
v4lctl: $(V4LCTL_OBJS)
- $(CC) $(CFLAGS) -o $@ $(V4LCTL_OBJS) $(V4LCTL_LIBS) -ldl -Wl,-E
+ $(CC) $(CFLAGS) -o $@ $(V4LCTL_OBJS) $(V4LCTL_LIBS) $(DLFLAGS)
streamer: $(STREAMER_OBJS)
- $(CC) $(CFLAGS) -o $@ $(STREAMER_OBJS) $(STREAMER_LIBS) -ldl -Wl,-E
+ $(CC) $(CFLAGS) -o $@ $(STREAMER_OBJS) $(STREAMER_LIBS) $(DLFLAGS)
scantv: $(SCANTV_OBJS)
- $(CC) $(CFLAGS) -o $@ $(SCANTV_OBJS) $(SCANTV_LIBS) -ldl -Wl,-E
+ $(CC) $(CFLAGS) -o $@ $(SCANTV_OBJS) $(SCANTV_LIBS) $(DLFLAGS)
xvideo: xvideo.o
$(CC) $(CFLAGS) -o $@ xvideo.o $(ATHENA_LIBS)
diff --git a/src/aa.c b/src/aa.c
index b6389f5..d956e7e 100644
--- a/src/aa.c
+++ b/src/aa.c
@@ -35,7 +35,7 @@ static int fast;
static void
grabber_init(void)
{
- drv = ng_grabber_open(ng_dev.video,NULL,0,&h_drv);
+ drv = ng_vid_open(ng_dev.video,NULL,0,&h_drv);
if (NULL == drv) {
fprintf(stderr,"no grabber device available\n");
exit(1);
@@ -215,7 +215,7 @@ main(int argc, char **argv)
/* init mixer */
if (0 != strlen(mixerdev)) {
struct ng_attribute *attr;
- if (NULL != (attr = mixer_open(mixerdev,mixerctl)))
+ if (NULL != (attr = ng_mix_init(mixerdev,mixerctl)))
add_attrs(attr);
}
diff --git a/src/capture.c b/src/capture.c
index b126130..8a65b7b 100644
--- a/src/capture.c
+++ b/src/capture.c
@@ -406,7 +406,8 @@ struct movie_handle {
pthread_t tconv[MAX_THREADS];
/* audio */
- void *sndhandle;
+ const struct ng_dsp_driver *dsp;
+ void *hdsp;
struct ng_audio_fmt afmt;
unsigned long bytes_per_sec;
unsigned long bytes;
@@ -501,7 +502,7 @@ record_audio_thread(void *arg)
if (debug)
fprintf(stderr,"record_audio_thread start [pid=%d]\n",getpid());
for (;;) {
- buf = oss_read(h->sndhandle,h->stopby);
+ buf = h->dsp->read(h->hdsp,h->stopby);
if (NULL == buf)
break;
if (0 == buf->size)
@@ -540,8 +541,8 @@ movie_writer_init(char *moviename, char *audioname,
/* audio */
if (audio->fmtid != AUDIO_NONE) {
- h->sndhandle = oss_open(dsp,audio);
- if (NULL == h->sndhandle) {
+ h->dsp = ng_dsp_open(dsp,audio,&h->hdsp);
+ if (NULL == h->dsp) {
free(h);
return NULL;
}
@@ -563,7 +564,7 @@ movie_writer_init(char *moviename, char *audioname,
struct ng_video_fmt gfmt = *video;
if (NULL == (conv = ng_grabber_findconv(&gfmt,1))) {
if (h->afmt.fmtid != AUDIO_NONE)
- oss_close(h->sndhandle);
+ h->dsp->close(h->hdsp);
free(h);
return NULL;
}
@@ -600,7 +601,7 @@ movie_writer_init(char *moviename, char *audioname,
if (h->afmt.fmtid != AUDIO_NONE) {
pthread_cancel(h->taudio);
pthread_join(h->taudio,&dummy);
- oss_close(h->sndhandle);
+ h->dsp->close(h->hdsp);
}
if (h->vfmt.fmtid != VIDEO_NONE) {
pthread_cancel(h->tvideo);
@@ -623,7 +624,7 @@ movie_writer_start(struct movie_handle *h)
fprintf(stderr,"movie_writer_start\n");
h->start = ng_get_timestamp();
if (h->afmt.fmtid != AUDIO_NONE)
- if (0 != oss_startrec(h->sndhandle))
+ if (0 != h->dsp->startrec(h->hdsp))
rc = -1;
if (h->vfmt.fmtid != VIDEO_NONE)
if (0 != drv->startvideo(h_drv,h->fps,h->slots))
@@ -682,7 +683,7 @@ movie_writer_stop(struct movie_handle *h)
/* close file */
h->writer->wr_close(h->handle);
if (h->afmt.fmtid != AUDIO_NONE)
- oss_close(h->sndhandle);
+ h->dsp->close(h->hdsp);
if (h->vfmt.fmtid != VIDEO_NONE)
drv->stopvideo(h_drv);
diff --git a/src/channel.c b/src/channel.c
index bd9384a..a267a4c 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -32,6 +32,8 @@
#include <pthread.h>
#ifndef NO_X11
+# include <X11/Xlib.h>
+# include <X11/Intrinsic.h>
# include <X11/StringDefs.h>
# include <X11/Xaw/XawInit.h>
# include <X11/Xaw/Command.h>
@@ -361,8 +363,9 @@ read_config(void)
char *val;
int i;
- cfg_parse_file(CONFIGFILE);
sprintf(filename,"%s/%s",getenv("HOME"),".xawtv");
+ if (0 == cfg_parse_file(CONFIGFILE))
+ have_config = 1;
if (0 == cfg_parse_file(filename))
have_config = 1;
diff --git a/src/commands.c b/src/commands.c
index d4b694a..da92247 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -58,11 +58,11 @@ struct ng_video_fmt x11_fmt;
int cur_movie,cur_attrs[256];
/* current hardware driver */
-const struct ng_driver *drv;
-void *h_drv;
-int f_drv;
+const struct ng_vid_driver *drv;
+void *h_drv;
+int f_drv;
-struct ng_attribute *attrs = NULL;
+struct ng_attribute *attrs = NULL;
/* ----------------------------------------------------------------------- */
@@ -507,7 +507,7 @@ set_defaults()
/* ----------------------------------------------------------------------- */
-static char* strnstr(char *haystack, char *needle)
+static char* strcasestr(char *haystack, char *needle)
{
int hlen = strlen(haystack);
int nlen = strlen(needle);
@@ -551,7 +551,7 @@ static int setstation_handler(char *name, int argc, char **argv)
/* ... next try substring matches ... */
if (i == count)
for (i = 0; i < count; i++)
- if (NULL != strnstr(channels[i]->name,argv[0]))
+ if (NULL != strcasestr(channels[i]->name,argv[0]))
break;
/* ... next try using the argument as index ... */
if (i == count)
diff --git a/src/commands.h b/src/commands.h
index e1c513b..6432b5a 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -46,7 +46,7 @@ extern struct ng_video_fmt x11_fmt;
extern int cur_movie,cur_attrs[256];
extern struct movie_parm m_parm;
-extern const struct ng_driver *drv;
+extern const struct ng_vid_driver *drv;
extern void *h_drv;
extern int f_drv;
diff --git a/src/fbtv.c b/src/fbtv.c
index 9cefd0a..e51a3b6 100644
--- a/src/fbtv.c
+++ b/src/fbtv.c
@@ -472,7 +472,7 @@ grabber_init(void)
screen.width = fb_var.xres_virtual;
screen.height = fb_var.yres_virtual;
screen.bytesperline = fb_fix.line_length;
- drv = ng_grabber_open(ng_dev.video,&screen,0,&h_drv);
+ drv = ng_vid_open(ng_dev.video,&screen,0,&h_drv);
if (NULL == drv) {
fprintf(stderr,"no grabber device available\n");
exit(1);
@@ -616,7 +616,7 @@ main(int argc, char *argv[])
fb_initcolors(fb,gray);
fb_switch_init();
switch_last = fb_switch_state;
- fs_init_fb();
+ fs_init_fb(15);
if (matrox)
if (-1 == gfx_init(fb))
@@ -628,7 +628,7 @@ main(int argc, char *argv[])
read_config();
if (0 != strlen(mixerdev)) {
struct ng_attribute *attr;
- if (NULL != (attr = mixer_open(mixerdev,mixerctl)))
+ if (NULL != (attr = ng_mix_init(mixerdev,mixerctl)))
add_attrs(attr);
}
diff --git a/src/fs.c b/src/fs.c
index 5cc8b5f..c5008a2 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -72,11 +72,11 @@ static void setpixel4(void *ptr, unsigned int color)
*p = color;
}
-int fs_init_fb()
+int fs_init_fb(int white8)
{
switch (fb_var.bits_per_pixel) {
case 8:
- white = 15; black = 0; bpp = 1;
+ white = white8; black = 0; bpp = 1;
setpixel = setpixel1;
break;
case 15:
@@ -367,6 +367,7 @@ struct fs_font* fs_consolefont(char **filename)
fprintf(stderr,"can't use font %s\n",filename[i]);
return NULL;
}
+ fprintf(stderr,"using linux console font \"%s\"\n",filename[i]);
f = malloc(sizeof(*f));
memset(f,0,sizeof(*f));
@@ -396,7 +397,6 @@ struct fs_font* fs_consolefont(char **filename)
f->eindex[i]->descent = 0;
f->eindex[i]->ascent = f->height;
}
- fprintf(stderr,"using linux console font \"%s\"\n",filename[i]);
return f;
}
diff --git a/src/fs.h b/src/fs.h
index 99f0421..2ac7228 100644
--- a/src/fs.h
+++ b/src/fs.h
@@ -53,7 +53,7 @@ struct fs_font {
/* ------------------------------------------------------------------ */
-int fs_init_fb(void);
+int fs_init_fb(int white8);
void fs_render_fb(unsigned char *ptr, int pitch,
FSXCharInfo *charInfo, unsigned char *data);
int fs_puts(struct fs_font *f, int x, int y, unsigned char *str);
diff --git a/src/main.c b/src/main.c
index 7c14d62..5b38499 100644
--- a/src/main.c
+++ b/src/main.c
@@ -7,6 +7,8 @@
#define _GNU_SOURCE
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -24,8 +26,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
-#include "config.h"
-
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xproto.h>
@@ -1661,7 +1661,7 @@ main(int argc, char *argv[])
struct ng_attribute *attr;
if (debug)
fprintf(stderr,"main: open mixer device...\n");
- if (NULL != (attr = mixer_open(mixerdev,mixerctl)))
+ if (NULL != (attr = ng_mix_init(mixerdev,mixerctl)))
add_attrs(attr);
}
init_movie_menus();
diff --git a/src/midictrl.c b/src/midictrl.c
index 5d032d8..cf30e3e 100644
--- a/src/midictrl.c
+++ b/src/midictrl.c
@@ -135,8 +135,8 @@ int midi_open(struct midi_handle *h, char *name)
func = "snd_seq_open";
#if SND_LIB_VERSION >= 0x000900
- if ((rc = snd_seq_open(&h->seq, "hw", SND_SEQ_OPEN_INPUT,
- SND_SEQ_TYPE_HW)) < 0)
+ if ((rc = snd_seq_open(&h->seq, "default", SND_SEQ_OPEN_INPUT,
+ SND_SEQ_NONBLOCK)) < 0)
goto err;
#else
if ((rc = snd_seq_open(&h->seq, SND_SEQ_OPEN_IN)) < 0)
diff --git a/src/motif.c b/src/motif.c
index c8b0b2c..1408e88 100644
--- a/src/motif.c
+++ b/src/motif.c
@@ -2699,7 +2699,8 @@ void IpcAction(Widget widget, XEvent *event, String *argv, Cardinal *argc)
Widget levels_left, levels_right;
XtInputId levels_id;
-void *levels_oss;
+const struct ng_dsp_driver *levels_dsp;
+void *levels_hdsp;
static void
levels_input(XtPointer clientdata, int *src, XtInputId *id)
@@ -2707,7 +2708,7 @@ levels_input(XtPointer clientdata, int *src, XtInputId *id)
struct ng_audio_buf *buf;
int left, right;
- buf = oss_read(levels_oss,0);
+ buf = levels_dsp->read(levels_hdsp,0);
oss_levels(buf,&left,&right);
XmScaleSetValue(levels_left,left);
XmScaleSetValue(levels_right,right);
@@ -2724,25 +2725,26 @@ levels_toggle_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
if (tb->reason != XmCR_VALUE_CHANGED)
return;
- if (tb->set && NULL == levels_oss) {
+ if (tb->set && NULL == levels_dsp) {
/* enable */
a.fmtid = AUDIO_U8_STEREO;
a.rate = 44100;
- levels_oss = oss_open(args.dspdev,&a);
- if (levels_oss) {
- oss_startrec(levels_oss);
- levels_id = XtAppAddInput(app_context,oss_fd(levels_oss),
+ levels_dsp = ng_dsp_open(args.dspdev,&a,&levels_hdsp);
+ if (levels_dsp) {
+ levels_dsp->startrec(levels_hdsp);
+ levels_id = XtAppAddInput(app_context,levels_dsp->fd(levels_hdsp),
(XtPointer)XtInputReadMask,
levels_input,NULL);
if (debug)
fprintf(stderr,"levels: started sound monitor\n");
}
}
- if (!tb->set && NULL != levels_oss) {
+ if (!tb->set && NULL != levels_hdsp) {
/* disable */
XtRemoveInput(levels_id);
- oss_close(levels_oss);
- levels_oss = NULL;
+ levels_dsp->close(levels_hdsp);
+ levels_dsp = NULL;
+ levels_hdsp = NULL;
XmScaleSetValue(levels_left,0);
XmScaleSetValue(levels_right,0);
if (debug)
@@ -3012,7 +3014,7 @@ main(int argc, char *argv[])
struct ng_attribute *attr;
if (debug)
fprintf(stderr,"main: open mixer device...\n");
- if (NULL != (attr = mixer_open(mixerdev,mixerctl)))
+ if (NULL != (attr = ng_mix_init(mixerdev,mixerctl)))
add_attrs(attr);
}
init_movie_menus();
diff --git a/src/scantv.c b/src/scantv.c
index 4e8233b..1706835 100644
--- a/src/scantv.c
+++ b/src/scantv.c
@@ -42,7 +42,7 @@ char scratch[1024*256];
static void
grabber_init(void)
{
- drv = ng_grabber_open(ng_dev.video,NULL,0,&h_drv);
+ drv = ng_vid_open(ng_dev.video,NULL,0,&h_drv);
if (NULL == drv) {
fprintf(stderr,"no grabber device available\n");
exit(1);
@@ -159,13 +159,23 @@ menu(char *intro, struct STRTAB *tab, char *opt)
}
static void
-usage(FILE *out, char *prog)
+usage(FILE *out, char *prog, char *outfile)
{
fprintf(out,
"This tool scan for tv stations and writes "
"a initial xawtv config file.\n"
- "usage: %s outfile\n",
- prog);
+ "usage: %s [ options ]\n"
+ "options:\n"
+ " -h print this text\n"
+ " -o outfile set output file. [%s]\n"
+ " -n norm set tv norm.\n"
+ " -f table set frequency table.\n"
+ " -c device set video device file. [%s]\n"
+ " -C device set vbi device file. [%s]\n"
+ " -s skip channel scan\n",
+ prog,
+ outfile ? outfile : "stdout",
+ ng_dev.video,ng_dev.vbi);
}
int
@@ -183,6 +193,7 @@ main(int argc, char **argv)
setprgname(argv[0]);
/* parse options */
+ ng_init();
for (;;) {
if (-1 == (c = getopt(argc, argv, "hsdn:f:o:c:C:")))
break;
@@ -209,10 +220,10 @@ main(int argc, char **argv)
ng_dev.vbi = optarg;
break;
case 'h':
- usage(stdout,argv[0]);
+ usage(stdout,argv[0],outfile);
exit(0);
default:
- usage(stderr,argv[0]);
+ usage(stderr,argv[0],outfile);
exit(1);
}
}
diff --git a/src/sound.c b/src/sound.c
index e180f6d..490d3f2 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -4,434 +4,11 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#ifdef HAVE_SOUNDCARD_H
-# include <soundcard.h>
-#endif
-#ifdef HAVE_SYS_SOUNDCARD_H
-# include <sys/soundcard.h>
-#endif
#include <pthread.h>
#include "grab-ng.h"
#include "sound.h"
-/* -------------------------------------------------------------------- */
-
-extern int debug;
-static const char *names[] = SOUND_DEVICE_NAMES;
-
-static int mixer_read_attr(struct ng_attribute *attr);
-static void mixer_write_attr(struct ng_attribute *attr, int val);
-
-struct mixer_handle {
- int mix;
- int dev;
- int volume;
- int muted;
-};
-
-static struct ng_attribute mixer_attrs[] = {
- {
- id: ATTR_ID_MUTE,
- name: "mute",
- type: ATTR_TYPE_BOOL,
- read: mixer_read_attr,
- write: mixer_write_attr,
- },{
- id: ATTR_ID_VOLUME,
- name: "volume",
- type: ATTR_TYPE_INTEGER,
- read: mixer_read_attr,
- write: mixer_write_attr,
- },{
- /* end of list */
- }
-};
-
-/* -------------------------------------------------------------------- */
-
-struct ng_attribute*
-mixer_open(char *filename, char *device)
-{
- struct mixer_handle *h;
- struct ng_attribute *attrs;
- int i, devmask;
-
- h = malloc(sizeof(*h));
- memset(h,0,sizeof(*h));
- h->mix = -1;
- h->dev = -1;
-
- if (-1 == (h->mix = open(filename,O_RDONLY))) {
- fprintf(stderr,"open %s: %s\n",filename,strerror(errno));
- goto err;
- }
- fcntl(h->mix,F_SETFD,FD_CLOEXEC);
-
- if (-1 == ioctl(h->mix,MIXER_READ(SOUND_MIXER_DEVMASK),&devmask)) {
- fprintf(stderr,"%s: read devmask: %s",filename,strerror(errno));
- goto err;
- }
- for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
- if ((1<<i) & devmask && strcasecmp(names[i],device) == 0) {
- if (-1 == ioctl(h->mix,MIXER_READ(i),&h->volume)) {
- fprintf(stderr,"%s: read volume: %s",
- filename,strerror(errno));
- goto err;
- } else {
- h->dev = i;
- }
- }
- }
-
- if (-1 == h->dev) {
- fprintf(stderr,"%s: '%s' not found.\n%s: available: ",
- filename,device,filename);
- for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
- if ((1<<i) & devmask)
- fprintf(stderr," '%s'",names[i]);
- fprintf(stderr,"\n");
- goto err;
- }
-
- attrs = malloc(sizeof(mixer_attrs));
- memcpy(attrs,mixer_attrs,sizeof(mixer_attrs));
- for (i = 0; attrs[i].name != NULL; i++)
- attrs[i].handle = h;
-
- return attrs;
-
- err:
- if (h) {
- if (-1 != h->mix)
- close(h->mix);
- free(h);
- }
- return NULL;
-}
-
-static int
-mixer_read_attr(struct ng_attribute *attr)
-{
- struct mixer_handle *h = attr->handle;
- int vol;
-
- switch (attr->id) {
- case ATTR_ID_VOLUME:
- if (-1 == ioctl(h->mix,MIXER_READ(h->dev),&h->volume))
- perror("oss mixer read volume");
- vol = (h->volume & 0x7f) * 65535 / 100;
- return vol;
- case ATTR_ID_MUTE:
- return h->muted;
- default:
- return -1;
- }
-}
-
-static void
-mixer_write_attr(struct ng_attribute *attr, int val)
-{
- struct mixer_handle *h = attr->handle;
-
- switch (attr->id) {
- case ATTR_ID_VOLUME:
- val = val * 100 / 65535;
- val &= 0x7f;
- h->volume = val | (val << 8);
- if (-1 == ioctl(h->mix,MIXER_WRITE(h->dev),&h->volume))
- perror("oss mixer write volume");
- h->muted = 0;
- break;
- case ATTR_ID_MUTE:
- h->muted = val;
- if (h->muted) {
- int zero = 0;
- if (-1 == ioctl(h->mix,MIXER_READ(h->dev),&h->volume))
- perror("oss mixer read volume");
- if (-1 == ioctl(h->mix,MIXER_WRITE(h->dev),&zero))
- perror("oss mixer write volume");
- } else {
- if (-1 == ioctl(h->mix,MIXER_WRITE(h->dev),&h->volume))
- perror("oss mixer write volume");
- }
- break;
- }
-}
-
-/* -------------------------------------------------------------------- */
-
-struct oss_handle {
- int fd;
-
- /* oss */
- struct ng_audio_fmt ifmt;
- int afmt,channels,rate;
- int blocksize;
-
- /* me */
- struct ng_audio_fmt ofmt;
- int byteswap;
- int bytes;
- int bytes_per_sec;
-};
-
-static const int afmt_to_oss[AUDIO_FMT_COUNT] = {
- 0,
- AFMT_U8,
- AFMT_U8,
- AFMT_S16_LE,
- AFMT_S16_LE,
- AFMT_S16_BE,
- AFMT_S16_BE
-};
-
-static int
-oss_setformat(struct oss_handle *h, struct ng_audio_fmt *fmt)
-{
- int frag;
-
- if (0 == afmt_to_oss[fmt->fmtid])
- return -1;
-
- h->afmt = afmt_to_oss[fmt->fmtid];
- h->channels = ng_afmt_to_channels[fmt->fmtid];
- frag = 0x7fff000c; /* 4k */
-
- /* format */
- ioctl(h->fd, SNDCTL_DSP_SETFMT, &h->afmt);
- if (h->afmt != afmt_to_oss[fmt->fmtid]) {
- if (debug)
- fprintf(stderr,"oss: SNDCTL_DSP_SETFMT(%d): %s\n",
- afmt_to_oss[fmt->fmtid],strerror(errno));
- goto err;
- }
-
- /* channels */
- ioctl(h->fd, SNDCTL_DSP_CHANNELS, &h->channels);
- if (h->channels != ng_afmt_to_channels[fmt->fmtid]) {
- if (debug)
- fprintf(stderr,"oss: SNDCTL_DSP_CHANNELS(%d): %s\n",
- ng_afmt_to_channels[fmt->fmtid],strerror(errno));
- goto err;
- }
-
- /* sample rate */
- h->rate = fmt->rate;
- ioctl(h->fd, SNDCTL_DSP_SPEED, &h->rate);
- ioctl(h->fd, SNDCTL_DSP_SETFRAGMENT, &frag);
- if (h->rate != fmt->rate) {
- fprintf(stderr, "oss: warning: got sample rate %d (asked for %d)\n",
- h->rate,fmt->rate);
- if (h->rate < fmt->rate * 1001 / 1000 &&
- h->rate > fmt->rate * 999 / 1000) {
- /* ignore very small differences ... */
- h->rate = fmt->rate;
- }
- }
-
- if (-1 == ioctl(h->fd, SNDCTL_DSP_GETBLKSIZE, &h->blocksize)) {
- if (debug)
- perror("SNDCTL_DSP_GETBLKSIZE");
- goto err;
- }
- if (0 == h->blocksize)
- /* dmasound bug compatibility */
- h->blocksize = 4096;
-
- if (debug)
- fprintf(stderr,"oss: bs=%d rate=%d channels=%d bits=%d (%s)\n",
- h->blocksize,h->rate,
- ng_afmt_to_channels[fmt->fmtid],
- ng_afmt_to_bits[fmt->fmtid],
- ng_afmt_to_desc[fmt->fmtid]);
- return 0;
-
- err:
- if (debug)
- fprintf(stderr,"oss: sound format not supported [%s]\n",
- ng_afmt_to_desc[fmt->fmtid]);
- return -1;
-}
-
-void*
-oss_open(char *device, struct ng_audio_fmt *fmt)
-{
- struct oss_handle *h;
- struct ng_audio_fmt ifmt;
-
- h = malloc(sizeof(*h));
- if (NULL == h)
- return NULL;
- memset(h,0,sizeof(*h));
-
- if (-1 == (h->fd = open(device ? device : ng_dev.dsp, O_RDONLY))) {
- fprintf(stderr,"oss: open %s: %s\n",
- device ? device : ng_dev.dsp,
- strerror(errno));
- goto err;
- }
- fcntl(h->fd,F_SETFD,FD_CLOEXEC);
-
- if (0 == oss_setformat(h,fmt)) {
- /* fine, native format works */
- fmt->rate = h->rate;
- h->ifmt = *fmt;
- h->ofmt = *fmt;
- h->bytes_per_sec = ng_afmt_to_bits[h->ifmt.fmtid] *
- ng_afmt_to_channels[h->ifmt.fmtid] * h->ifmt.rate / 8;
- return h;
- }
-
- /* try byteswapping */
- ifmt = *fmt;
- switch (fmt->fmtid) {
- case AUDIO_S16_LE_MONO: ifmt.fmtid = AUDIO_S16_BE_MONO; break;
- case AUDIO_S16_LE_STEREO: ifmt.fmtid = AUDIO_S16_BE_STEREO; break;
- case AUDIO_S16_BE_MONO: ifmt.fmtid = AUDIO_S16_LE_MONO; break;
- case AUDIO_S16_BE_STEREO: ifmt.fmtid = AUDIO_S16_LE_STEREO; break;
- }
- if (0 == oss_setformat(h,&ifmt)) {
- if (debug)
- fprintf(stderr,"oss: byteswapping pcm data\n");
- h->byteswap = 1;
- ifmt.rate = h->rate;
- fmt->rate = h->rate;
- h->ifmt = ifmt;
- h->ofmt = *fmt;
- h->bytes_per_sec = ng_afmt_to_bits[h->ifmt.fmtid] *
- ng_afmt_to_channels[h->ifmt.fmtid] * h->ifmt.rate / 8;
- return h;
- }
-
- fprintf(stderr,"oss: can't record %s\n",
- ng_afmt_to_desc[fmt->fmtid]);
-
- err:
- fmt->rate = 0;
- fmt->fmtid = AUDIO_NONE;
- if (h->fd)
- close(h->fd);
- free(h);
- return NULL;
-}
-
-int
-oss_startrec(void *handle)
-{
- struct oss_handle *h = handle;
- int trigger;
-
- if (debug)
- fprintf(stderr,"oss: startrec\n");
- trigger = 0;
- ioctl(h->fd,SNDCTL_DSP_SETTRIGGER,&trigger);
-
-#if 1
- /*
- * Try to clear the sound driver buffers. IMHO this shouldn't
- * be needed, but looks like it is with some drivers ...
- */
- {
- int oflags,flags,rc;
- unsigned char buf[4096];
-
- oflags = fcntl(h->fd,F_GETFL);
- flags = oflags | O_NONBLOCK;
- fcntl(h->fd,F_SETFL,flags);
- for (;;) {
- rc = read(h->fd,buf,sizeof(buf));
- if (debug)
- fprintf(stderr,"oss: clearbuf rc=%d errno=%s\n",rc,strerror(errno));
- if (rc != sizeof(buf))
- break;
- }
- fcntl(h->fd,F_SETFL,oflags);
- }
-#endif
-
- trigger = PCM_ENABLE_INPUT;
- ioctl(h->fd,SNDCTL_DSP_SETTRIGGER,&trigger);
- return 0;
-}
-
-static struct ng_audio_buf*
-oss_bufalloc(struct ng_audio_fmt *fmt, int size)
-{
- struct ng_audio_buf *buf;
-
- buf = malloc(sizeof(*buf)+size);
- memset(buf,0,sizeof(*buf));
- buf->fmt = *fmt;
- buf->size = size;
- buf->data = (char*)buf + sizeof(*buf);
- return buf;
-}
-
-static void
-oss_bufread(int fd,char *buffer,int blocksize)
-{
- int rc,count=0;
-
- /* why FreeBSD returns chunks smaller than blocksize? */
- for (;;) {
- rc = read(fd,buffer+count,blocksize-count);
- if (rc < 0) {
- if (EINTR == errno)
- continue;
- perror("oss: read");
- exit(1);
- }
- count += rc;
- if (count == blocksize)
- return;
- }
- fprintf(stderr,"#");
-}
-
-static void
-oss_bufswap(void *ptr, int size)
-{
- unsigned short *buf = ptr;
- int i;
-
- size = size >> 1;
- for (i = 0; i < size; i++)
- buf[i] = ((buf[i] >> 8) & 0xff) | ((buf[i] << 8) & 0xff00);
-}
-
-struct ng_audio_buf*
-oss_read(void *handle, long long stopby)
-{
- struct oss_handle *h = handle;
- struct ng_audio_buf* buf;
- int bytes;
-
- if (stopby) {
- bytes = stopby * h->bytes_per_sec / 1000000000 - h->bytes;
- if (debug)
- fprintf(stderr,"oss: left: %d bytes (%.3fs)\n",
- bytes,(float)bytes/h->bytes_per_sec);
- if (bytes <= 0)
- return NULL;
- bytes = (bytes + 3) & ~3;
- if (bytes > h->blocksize)
- bytes = h->blocksize;
- } else {
- bytes = h->blocksize;
- }
- buf = oss_bufalloc(&h->ofmt,bytes);
- oss_bufread(h->fd,buf->data,bytes);
- if (h->byteswap)
- oss_bufswap(buf->data,bytes);
- h->bytes += bytes;
- buf->info.ts = (long long)h->bytes * 1000000000 / h->bytes_per_sec;
- return buf;
-}
-
void
oss_levels(struct ng_audio_buf *buf, int *left, int *right)
{
@@ -489,19 +66,3 @@ oss_levels(struct ng_audio_buf *buf, int *left, int *right)
*left = lmax;
*right = rmax;
}
-
-int
-oss_fd(void *handle)
-{
- struct oss_handle *h = handle;
- return h->fd;
-}
-
-void
-oss_close(void *handle)
-{
- struct oss_handle *h = handle;
-
- close(h->fd);
- free(h);
-}
diff --git a/src/sound.h b/src/sound.h
index c12ddbc..7eb767f 100644
--- a/src/sound.h
+++ b/src/sound.h
@@ -1,13 +1,6 @@
#ifndef _SOUND_H_
#define _SOUND_H_
-void* oss_open(char *device, struct ng_audio_fmt *fmt);
-int oss_startrec(void *handle);
-struct ng_audio_buf* oss_read(void *handle, long long stopby);
void oss_levels(struct ng_audio_buf *buf, int *left, int *right);
-int oss_fd(void *handle);
-void oss_close(void *handle);
-
-struct ng_attribute* mixer_open(char *filename, char *device);
#endif /* _SOUND_H_ */
diff --git a/src/streamer.c b/src/streamer.c
index 28577c3..fa014db 100644
--- a/src/streamer.c
+++ b/src/streamer.c
@@ -417,7 +417,7 @@ main(int argc, char **argv)
ng_vfmt_to_desc[video.fmtid],ng_afmt_to_desc[audio.fmtid]);
if (video.fmtid != VIDEO_NONE) {
- drv = ng_grabber_open(ng_dev.video,NULL,0,&h_drv);
+ drv = ng_vid_open(ng_dev.video,NULL,0,&h_drv);
if (NULL == drv) {
fprintf(stderr,"no grabber device available\n");
exit(1);
diff --git a/src/v4lctl.c b/src/v4lctl.c
index 3e09f8c..c945389 100644
--- a/src/v4lctl.c
+++ b/src/v4lctl.c
@@ -36,7 +36,7 @@ Display *dpy;
static void
grabber_init(void)
{
- drv = ng_grabber_open(ng_dev.video,NULL,0,&h_drv);
+ drv = ng_vid_open(ng_dev.video,NULL,0,&h_drv);
if (NULL == drv) {
fprintf(stderr,"no grabber device available\n");
exit(1);
diff --git a/src/xt.c b/src/xt.c
index 389a596..4f84d97 100644
--- a/src/xt.c
+++ b/src/xt.c
@@ -1146,7 +1146,7 @@ grabber_init()
if (!do_overlay) {
if (debug)
fprintf(stderr,"x11: remote display (overlay disabled)\n");
- drv = ng_grabber_open(args.device, NULL, base, &h_drv);
+ drv = ng_vid_open(args.device, NULL, base, &h_drv);
} else {
screen.width = XtScreen(app_shell)->width;
screen.height = XtScreen(app_shell)->height;
@@ -1159,7 +1159,7 @@ grabber_init()
screen.bytesperline,
have_dga ? ", DGA" : "",
have_vm ? ", VidMode" : "");
- drv = ng_grabber_open(args.device, &screen, base, &h_drv);
+ drv = ng_vid_open(args.device, &screen, base, &h_drv);
}
if (NULL == drv) {
fprintf(stderr,"no video grabber device available\n");
@@ -1172,7 +1172,7 @@ grabber_init()
void
grabber_scan(void)
{
- const struct ng_driver *driver;
+ const struct ng_vid_driver *driver;
void *handle;
struct stat st;
int n,i,fh,flags;
@@ -1193,7 +1193,7 @@ grabber_scan(void)
}
close(fh);
- driver = ng_grabber_open(ng_dev.video_scan[i], NULL, NULL, &handle);
+ driver = ng_vid_open(ng_dev.video_scan[i], NULL, NULL, &handle);
if (NULL == driver) {
fprintf(stderr,"%s: initialization failed\n",ng_dev.video_scan[i]);
continue;
diff --git a/src/xv.c b/src/xv.c
index d071ac8..57682f9 100644
--- a/src/xv.c
+++ b/src/xv.c
@@ -47,7 +47,7 @@ int have_xv;
int im_adaptor = -1, im_port = -1;
unsigned int im_formats[VIDEO_FMT_COUNT];
-const struct ng_driver xv_driver;
+const struct ng_vid_driver xv_driver;
static int ver, rel, req, ev, err;
static int adaptors;
@@ -693,7 +693,7 @@ init_icon_window(Widget shell,WidgetClass class)
/* ********************************************************************* */
-const struct ng_driver xv_driver = {
+const struct ng_vid_driver xv_driver = {
name: "Xvideo",
close: xv_close,
diff --git a/tools/record.c b/tools/record.c
index a8f4b26..a410496 100644
--- a/tools/record.c
+++ b/tools/record.c
@@ -6,7 +6,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <ncurses.h>
+#include <curses.h>
#include <sys/time.h>
#include <sys/signal.h>
#include <sys/ioctl.h>
diff --git a/webcam/Makefile.in b/webcam/Makefile.in
index a29b31c..05d3380 100644
--- a/webcam/Makefile.in
+++ b/webcam/Makefile.in
@@ -4,7 +4,7 @@ VPATH=$(srcdir)
include ../Make.config
CFLAGS=-g @CFLAGS@ $(WARN_FLAGS) $(LIB_FLAGS) -I..
-LDLIBS=$(GFX_LIBS)
+LDLIBS=$(THREAD_LIBS) -ljpeg
PROGS=webcam
@@ -15,7 +15,7 @@ OBJS=webcam.o ftp.o parseconfig.o
all build: $(PROGS)
webcam: $(OBJS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) ../libng/libng.a $(LDLIBS) -ldl -Wl,-E
+ $(CC) $(CFLAGS) -o $@ $(OBJS) ../libng/libng.a $(LDLIBS) $(DLFLAGS)
install: all
$(INSTALL_DIR) $(bindir)
@@ -29,4 +29,8 @@ clean:
realclean distclean: clean
-rm -f $(PROGS) Makefile *~ *.bak
-dep depend install:
+depend dep:
+ $(DEPEND) -- $(CFLAGS) -- *.c
+
+##########################################################################
+# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/webcam/webcam.c b/webcam/webcam.c
index bb18b2f..b26de87 100644
--- a/webcam/webcam.c
+++ b/webcam/webcam.c
@@ -1,8 +1,8 @@
/*
- * (c) 1998-2000 Gerd Knorr
+ * (c) 1998-2002 Gerd Knorr
*
* capture a image, compress as jpeg and upload to the webserver
- * using ftp the ftp utility
+ * using the ftp utility
*
*/
@@ -27,15 +27,22 @@
/* ---------------------------------------------------------------------- */
/* configuration */
+enum mode {
+ FTP = 1,
+ SSH = 2,
+ LOCAL = 3,
+};
+
char *ftp_host = "www";
char *ftp_user = "webcam";
char *ftp_pass = "xxxxxx";
char *ftp_dir = "public_html/images";
char *ftp_file = "webcam.jpeg";
char *ftp_tmp = "uploading.jpeg";
+char *ssh_cmd;
int ftp_passive = 1;
int ftp_auto = 0;
-int ftp_local = 0;
+enum mode ftp_mode = FTP;
char *grab_text = "webcam %Y-%m-%d %H:%M:%S"; /* strftime */
char *grab_infofile = NULL;
@@ -92,11 +99,11 @@ write_file(int fd, char *data, int width, int height)
/* ---------------------------------------------------------------------- */
/* capture stuff */
-const struct ng_driver *drv;
-void *h_drv;
-struct ng_video_fmt fmt,gfmt;
-struct ng_video_conv *conv;
-void *hconv;
+const struct ng_vid_driver *drv;
+void *h_drv;
+struct ng_video_fmt fmt,gfmt;
+struct ng_video_conv *conv;
+void *hconv;
static void
grab_init(void)
@@ -104,7 +111,7 @@ grab_init(void)
struct ng_attribute *attr;
int val,i;
- drv = ng_grabber_open(ng_dev.video,NULL,0,&h_drv);
+ drv = ng_vid_open(ng_dev.video,NULL,0,&h_drv);
if (NULL == drv) {
fprintf(stderr,"no grabber device available\n");
exit(1);
@@ -340,6 +347,30 @@ compare_images(unsigned char *last, unsigned char *current,
/* ---------------------------------------------------------------------- */
+static void ssh_upload(char *filename)
+{
+ unsigned char ssh_buf[4096];
+ FILE *sshp, *imgdata;
+ int len;
+
+ if ((sshp=popen(ssh_cmd, "w")) == NULL) {
+ perror("open");
+ exit(1);
+ }
+ if ((imgdata = fopen(filename,"rb"))==NULL) {
+ perror("fopen");
+ exit(1);
+ }
+ for (;;) {
+ len = fread(ssh_buf,1,sizeof(ssh_buf),imgdata);
+ if (len <= 0)
+ break;
+ fwrite(ssh_buf,1,len,sshp);
+ }
+ fclose(imgdata);
+ pclose(sshp);
+}
+
int
main(int argc, char *argv[])
{
@@ -376,7 +407,11 @@ main(int argc, char *argv[])
if (-1 != (i = cfg_get_int("ftp","debug")))
ftp_debug = i;
if (-1 != (i = cfg_get_int("ftp","local")))
- ftp_local = i;
+ if (i)
+ ftp_mode = LOCAL;
+ if (-1 != (i = cfg_get_int("ftp","ssh")))
+ if (i)
+ ftp_mode = SSH;
if (NULL != (val = cfg_get_str("grab","device")))
ng_dev.video = val;
@@ -420,25 +455,32 @@ main(int argc, char *argv[])
if ( grab_top >= grab_bottom ) grab_top = 0;
if ( grab_left >= grab_right ) grab_left = 0;
- if ( ftp_local ) {
- if ( ftp_dir != NULL && ftp_dir[0] != '\0' ) {
+ /* init everything */
+ grab_init();
+ tmpdir = (NULL != getenv("TMPDIR")) ? getenv("TMPDIR") : "/tmp";
+ switch (ftp_mode) {
+ case LOCAL:
+ if (ftp_dir != NULL && ftp_dir[0] != '\0' ) {
char * t = malloc(strlen(ftp_tmp)+strlen(ftp_dir)+2);
sprintf(t, "%s/%s", ftp_dir, ftp_tmp);
ftp_tmp = t;
-
+
t = malloc(strlen(ftp_file)+strlen(ftp_dir)+2);
sprintf(t, "%s/%s", ftp_dir, ftp_file);
ftp_file = t;
}
- }
-
- /* init everything */
- grab_init();
- if (!ftp_local) {
+ break;
+ case FTP:
ftp_init(ftp_auto,ftp_passive);
ftp_connect(ftp_host,ftp_user,ftp_pass,ftp_dir);
+ break;
+ case SSH:
+ ssh_cmd = malloc(strlen(ftp_user)+strlen(ftp_host)+
+ strlen(ftp_tmp)*2+strlen(ftp_dir)+strlen(ftp_file)+32);
+ sprintf(ssh_cmd, "ssh %s@%s \"cat >%s && mv %s %s/%s\"",
+ ftp_user,ftp_host,ftp_tmp,ftp_tmp,ftp_dir,ftp_file);
+ break;
}
- tmpdir = (NULL != getenv("TMPDIR")) ? getenv("TMPDIR") : "/tmp";
/* print config */
fprintf(stderr,"video4linux webcam v1.3 - (c) 1998-2001 Gerd Knorr\n");
@@ -448,13 +490,20 @@ main(int argc, char *argv[])
grab_input,grab_norm, grab_quality);
fprintf(stderr," rotate=%d, top=%d, left=%d, bottom=%d, right=%d\n",
grab_rotate, grab_top, grab_left, grab_bottom, grab_right);
-
- if (ftp_local)
- fprintf(stderr,"ftp config:\n local transfer %s => %s\n",
+ switch (ftp_mode) {
+ case LOCAL:
+ fprintf(stderr,"write config:\n local transfer %s => %s\n",
ftp_tmp,ftp_file);
- else
+ break;
+ case FTP:
fprintf(stderr,"ftp config:\n %s@%s:%s\n %s => %s\n",
ftp_user,ftp_host,ftp_dir,ftp_tmp,ftp_file);
+ break;
+ case SSH:
+ fprintf(stderr,"ssh config:\n %s@%s:%s\n %s => %s\n",
+ ftp_user,ftp_host,ftp_dir,ftp_tmp,ftp_file);
+ break;
+ }
/* main loop */
for (;;) {
@@ -477,7 +526,8 @@ main(int argc, char *argv[])
/* ok, label it and upload */
add_text(image,width,height);
- if (ftp_local) {
+ switch (ftp_mode) {
+ case LOCAL:
if (-1 == (fh = open(ftp_tmp,O_CREAT|O_WRONLY|O_TRUNC,0666))) {
fprintf(stderr,"open %s: %s\n",ftp_tmp,strerror(errno));
exit(1);
@@ -486,17 +536,24 @@ main(int argc, char *argv[])
if (rename(ftp_tmp, ftp_file) ) {
fprintf(stderr, "can't move %s -> %s\n", ftp_tmp, ftp_file);
}
- } else {
+ break;
+ case FTP:
+ case SSH:
sprintf(filename,"%s/webcamXXXXXX",tmpdir);
if (-1 == (fh = mkstemp(filename))) {
perror("mkstemp");
exit(1);
}
write_file(fh, image, width, height);
- if (!ftp_connected)
- ftp_connect(ftp_host,ftp_user,ftp_pass,ftp_dir);
- ftp_upload(filename,ftp_file,ftp_tmp);
+ if (FTP == ftp_mode) {
+ if (!ftp_connected)
+ ftp_connect(ftp_host,ftp_user,ftp_pass,ftp_dir);
+ ftp_upload(filename,ftp_file,ftp_tmp);
+ }
+ if (SSH == ftp_mode)
+ ssh_upload(filename);
unlink(filename);
+ break;
}
if (archive) {
time_t t;
@@ -517,7 +574,7 @@ main(int argc, char *argv[])
if (grab_delay > 0)
sleep(grab_delay);
}
- if (!ftp_local) {
+ if (FTP == ftp_mode) {
ftp_send(1,"bye");
ftp_recv();
}
diff --git a/webcam/webcam.man b/webcam/webcam.man
index f0fb994..14354d8 100644
--- a/webcam/webcam.man
+++ b/webcam/webcam.man
@@ -25,7 +25,8 @@ tmp = uploading.jpeg
passive = 1
debug = 0
auto = 0
-local= 0
+local = 0
+ssh = 0
[grab]
device = /dev/video0
@@ -77,6 +78,8 @@ the
and
.B file
parameters) rather than ftped.
+.B ssh
+set to non-zero makes webcam use ssh instead of ftp.
.P
.B top, bottom, left,
and
diff --git a/xawtv.spec b/xawtv.spec
index bfd779e..4ed154a 100644
--- a/xawtv.spec
+++ b/xawtv.spec
@@ -8,7 +8,7 @@
Summary: Video4Linux Stream Capture Viewer
Name: xawtv
-Version: 3.66
+Version: 3.67
Release: 1
Source0: xawtv_%{version}.tar.gz
Group: X11/Applications

Privacy Policy