aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-04-01 11:24:38 +0200
committerGerd Hoffmann <kraxel@redhat.com>2010-04-01 11:24:38 +0200
commita4606ece6f6346c7af3193409161d53310feeeb3 (patch)
tree56070a663354148513207be56489e5f0a369b984
parentdb5d03c91f0bd7ab6274d3d4f27eda0cfd0a0fe6 (diff)
v3.72
-rw-r--r--Changes8
-rw-r--r--debian/changelog6
-rw-r--r--debian/control2
-rw-r--r--libng/grab-ng.c6
-rw-r--r--libng/plugins/drv0-v4l2.c8
-rw-r--r--libng/plugins/write-avi.c2
-rw-r--r--libng/videodev2.h32
-rw-r--r--man/xawtv.11
-rw-r--r--src/Makefile.in10
-rw-r--r--src/commands.c18
-rw-r--r--src/frequencies.c46
-rw-r--r--src/hwscan.c121
-rw-r--r--src/rootv.c22
-rw-r--r--webcam/ftp.c1
-rw-r--r--xawtv.spec2
15 files changed, 237 insertions, 48 deletions
diff --git a/Changes b/Changes
index 7c31f4c..4c39f0f 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,12 @@
+3.71 => 3.72
+============
+
+ * v4l2 fixes.
+ * irish frequency table fix (Dan Lindstrom).
+ * made the snap command write files using "write tmpfile + rename".
+
+
3.70 => 3.71
============
diff --git a/debian/changelog b/debian/changelog
index 057cf52..08c8667 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xawtv (3.72) unstable; urgency=low
+
+ * new release (closes: #134444).
+
+ -- Gerd Knorr <kraxel@debian.org> Tue, 19 Feb 2002 15:18:45 +0100
+
xawtv (3.71) unstable; urgency=low
* new release (closes: #133120).
diff --git a/debian/control b/debian/control
index 47a4dde..b9e6d36 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, xawtv-plugins
+Depends: ${shlibs:Depends}, v4l-conf, xutils, debconf, scantv, xawtv-plugins (=${Source-Version})
Description: X11 TV application
TV application for X11. Supports video4linux
devices and the Xvideo extension.
diff --git a/libng/grab-ng.c b/libng/grab-ng.c
index 0797d93..cf2935d 100644
--- a/libng/grab-ng.c
+++ b/libng/grab-ng.c
@@ -715,8 +715,10 @@ static int ng_plugins(char *dirname)
continue;
}
if (NULL == (initcall = dlsym(plugin,"ng_plugin_init"))) {
- fprintf(stderr,"dlsym[%s]: %s\n",filename,dlerror());
- continue;
+ if (NULL == (initcall = dlsym(plugin,"_ng_plugin_init"))) {
+ fprintf(stderr,"dlsym[%s]: %s\n",filename,dlerror());
+ continue;
+ }
}
initcall();
n++;
diff --git a/libng/plugins/drv0-v4l2.c b/libng/plugins/drv0-v4l2.c
index a921833..8d155a3 100644
--- a/libng/plugins/drv0-v4l2.c
+++ b/libng/plugins/drv0-v4l2.c
@@ -143,11 +143,7 @@ static __u32 xawtv_pixelformat[VIDEO_FMT_COUNT] = {
0, /* LUT 2 */
0, /* LUT 4 */
V4L2_PIX_FMT_YUYV, /* YUV422 */
-#if 0
- V4L2_PIX_FMT_YVU422P, /* YUV422P */
-#else
- 0,
-#endif
+ V4L2_PIX_FMT_YUV422P, /* YUV422P */
V4L2_PIX_FMT_YUV420, /* YUV420P */
};
@@ -221,7 +217,7 @@ xioctl(int fd, int cmd, void *arg, int mayfail)
a->fmt.pix.sizeimage);
break;
default:
- fprintf(stderr,"???)");
+ fprintf(stderr,"??" "?)"); /* break trigraph */
break;
}
break;
diff --git a/libng/plugins/write-avi.c b/libng/plugins/write-avi.c
index 70fa72a..61ae492 100644
--- a/libng/plugins/write-avi.c
+++ b/libng/plugins/write-avi.c
@@ -362,6 +362,8 @@ avi_open(char *filename, char *dummy,
if (NULL == (h = malloc(sizeof(*h))))
return NULL;
+ if (NULL == filename)
+ return NULL;
/* init */
memset(h,0,sizeof(*h));
diff --git a/libng/videodev2.h b/libng/videodev2.h
index a05c08b..a40b207 100644
--- a/libng/videodev2.h
+++ b/libng/videodev2.h
@@ -107,11 +107,17 @@ struct v4l2_pix_format
#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */
#if 0
-# define V4L2_PIX_FMT_YVU422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
-# define V4L2_PIX_FMT_YVU411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
+#define V4L2_PIX_FMT_YVU422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
+#define V4L2_PIX_FMT_YVU411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
#endif
+#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
+/* two planes -- one Y, one Cr + Cb interleaved */
+#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */
+#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */
+
/* The following formats are not defined in the V4L2 specification */
#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */
#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */
@@ -661,7 +667,7 @@ struct v4l2_modulator
struct v4l2_frequency
{
- int port;
+ int input;
__u32 frequency;
__u32 reserved[2];
};
@@ -814,6 +820,8 @@ struct v4l2_streamparm
#define VIDIOC_S_EFFECT _IOWR ('V', 53, int)
#define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator)
#define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator)
+#define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency)
+#define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency)
#define VIDIOC_ENUM_CAPFMT VIDIOC_ENUM_PIXFMT
#define VIDIOC_ENUM_OUTFMT VIDIOC_ENUM_PIXFMT
@@ -901,20 +909,10 @@ extern int v4l2_video_std_construct(struct v4l2_standard *vs,
#define V4L2_MAX_IOCTL_SIZE 256
/* Compatibility layer interface */
-struct v4l2_v4l_compat
-{
- int (*translate_ioctl)(struct inode *inode,
- struct file *file,
- int cmd,
- void *arg);
-#if 0
- void (*fix_offset)(struct file *file,
- struct v4l2_device *vfl,
- struct vm_area_struct *vma);
-#endif
-};
-extern int v4l2_v4l_compat_register(struct v4l2_v4l_compat *);
-extern void v4l2_v4l_compat_unregister(struct v4l2_v4l_compat *);
+typedef int (*v4l2_ioctl_compat)(struct inode *inode, struct file *file,
+ int cmd, void *arg);
+int v4l2_compat_register(v4l2_ioctl_compat hook);
+void v4l2_compat_unregister(v4l2_ioctl_compat hook);
#endif /* __KERNEL__ */
#endif /* __LINUX_VIDEODEV2_H */
diff --git a/man/xawtv.1 b/man/xawtv.1
index 8548368..d950a6f 100644
--- a/man/xawtv.1
+++ b/man/xawtv.1
@@ -191,6 +191,7 @@ pgup/pgdown station up/down (the ones you have in the config file)
space next station (same as pgup)
backspace previously tuned station
Ctrl+up scan for next station
+F5-F12 adjust bright/hue/contrast/color
ESC,Q \fIQ\fPuit
diff --git a/src/Makefile.in b/src/Makefile.in
index d0bfff1..696ba66 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -43,7 +43,7 @@ SCANTV_LIBS = $(THREAD_LIBS) -lvbi -ljpeg
# what to build / install
PROGS=v4lctl streamer scantv vbi-debug @PROGS@
INST=install-dirs install-common @INST@
-LANG=de it
+LANGS=de it
all build: $(PROGS) i18n
@@ -59,7 +59,7 @@ MoTV.ad: $(srcdir)/MoTV-default $(srcdir)/MoTV-fixed
cat $(srcdir)/MoTV-default $(srcdir)/MoTV-fixed > MoTV.ad
i18n:
- for lang in $(LANG); do \
+ for lang in $(LANGS); do \
cat $(srcdir)/MoTV-$$lang $(srcdir)/MoTV-fixed > MoTV.$$lang.ad; \
done
@@ -109,6 +109,8 @@ mididump: midictrl.c
gl: gl.o RegEdit.o
$(CC) $(CFLAGS) -o $@ gl.o RegEdit.o $(MOTIF_LIBS) \
-lGLU -lGL -lng -ljpeg $(DLFLAGS)
+hwscan: hwscan.o
+ $(CC) $(CFLAGS) -o $@ hwscan.o -lasound
channel-no-x11.o: $(srcdir)/channel.c
$(CC) $(CFLAGS) -DNO_X11=1 -c -o $@ $(srcdir)/channel.c
@@ -146,7 +148,7 @@ install-motv:
$(INSTALL_PROGRAM) -s motv $(bindir)
$(INSTALL_DIR) $(resdir)/app-defaults
$(INSTALL_DATA) MoTV.ad $(resdir)/app-defaults/MoTV
- for lang in $(LANG); do \
+ for lang in $(LANGS); do \
$(INSTALL_DIR) $(resdir)/$$lang/app-defaults; \
$(INSTALL_DATA) MoTV.$$lang.ad $(resdir)/$$lang/app-defaults/MoTV; \
done
@@ -168,7 +170,7 @@ clean:
-rm -f *.o *.moc *core TAGS Xawtv.h MoTV.h MoTV.ad $(I18N)
realclean distclean: clean
- -rm -f $(PROGS) Makefile *~ *.bak gl
+ -rm -f $(PROGS) Makefile *~ *.bak gl hwscan
depend dep: Xawtv.h MoTV.h gl.h
$(DEPEND) -- $(CFLAGS) -- *.c
diff --git a/src/commands.c b/src/commands.c
index d1c184b..b78df0e 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -960,6 +960,7 @@ static int dattr_handler(char *name, int argc, char **argv)
static int snap_handler(char *hname, int argc, char **argv)
{
char message[512];
+ char *tmpfilename = NULL;
char *filename = NULL;
char *name;
int jpeg = 0;
@@ -1029,24 +1030,35 @@ static int snap_handler(char *hname, int argc, char **argv)
}
filename = snap_filename(snapbase, name, jpeg ? "jpeg" : "ppm");
}
+ tmpfilename = malloc(strlen(filename)+8);
+ sprintf(tmpfilename,"%s.$$$",filename);
if (jpeg) {
- if (-1 == write_jpeg(filename, buf, ng_jpeg_quality, 0)) {
- sprintf(message,"open %s: %s\n",filename,strerror(errno));
+ if (-1 == write_jpeg(tmpfilename, buf, ng_jpeg_quality, 0)) {
+ sprintf(message,"open %s: %s\n",tmpfilename,strerror(errno));
} else {
sprintf(message,"saved jpeg: %s",filename);
}
} else {
if (-1 == write_ppm(filename, buf)) {
- sprintf(message,"open %s: %s\n",filename,strerror(errno));
+ sprintf(message,"open %s: %s\n",tmpfilename,strerror(errno));
} else {
sprintf(message,"saved ppm: %s",filename);
}
}
+ unlink(filename);
+ if (-1 == link(tmpfilename,filename)) {
+ fprintf(stderr,"link(%s,%s): %s\n",
+ tmpfilename,filename,strerror(errno));
+ goto done;
+ }
+ unlink(tmpfilename);
if (display_message)
display_message(message);
done:
+ if (tmpfilename)
+ free(tmpfilename);
if (NULL != buf)
ng_release_video_buf(buf);
if (capture_rel_hook)
diff --git a/src/frequencies.c b/src/frequencies.c
index df4db83..4863736 100644
--- a/src/frequencies.c
+++ b/src/frequencies.c
@@ -883,15 +883,43 @@ static struct CHANLIST pal_italy[] = {
};
static struct CHANLIST pal_ireland[] = {
- { "0", 45750 },
- { "1", 53750 },
- { "2", 61750 },
- { "3", 175250 },
- { "4", 183250 },
- { "5", 191250 },
- { "6", 199250 },
- { "7", 207250 },
- { "8", 215250 },
+ { "A0", 45750 },
+ { "A1", 48000 },
+ { "A2", 53750 },
+ { "A3", 56000 },
+ { "A4", 61750 },
+ { "A5", 64000 },
+ { "A6", 175250 },
+ { "A7", 176000 },
+ { "A8", 183250 },
+ { "A9", 184000 },
+ { "A10", 191250 },
+ { "A11", 192000 },
+ { "A12", 199250 },
+ { "A13", 200000 },
+ { "A14", 207250 },
+ { "A15", 208000 },
+ { "A16", 215250 },
+ { "A17", 216000 },
+ { "A18", 224000 },
+ { "A19", 232000 },
+ { "A20", 248000 },
+ { "A21", 256000 },
+ { "A22", 264000 },
+ { "A23", 272000 },
+ { "A24", 280000 },
+ { "A25", 288000 },
+ { "A26", 296000 },
+ { "A27", 304000 },
+ { "A28", 312000 },
+ { "A29", 320000 },
+ { "A30", 344000 },
+ { "A31", 352000 },
+ { "A32", 408000 },
+ { "A33", 416000 },
+ { "A34", 448000 },
+ { "A35", 480000 },
+ { "A36", 520000 },
FREQ_UHF,
};
diff --git a/src/hwscan.c b/src/hwscan.c
new file mode 100644
index 0000000..7c90c36
--- /dev/null
+++ b/src/hwscan.c
@@ -0,0 +1,121 @@
+/*
+ * just some test / debug code for now ...
+ *
+ * (c) 2002 Gerd Knorr
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <alsa/asoundlib.h>
+
+#define ALSAERR(func,args...) \
+ if ((err = func(## args)) < 0) { \
+ fprintf(stderr,"fixme: %s\n",snd_strerror(err)); \
+ goto oops; }
+
+static int alsa_mixer(char *id)
+{
+ int err;
+ long min,max;
+ snd_mixer_t *handle = NULL;
+ snd_mixer_elem_t *elem;
+ snd_mixer_selem_id_t *sid;
+ snd_mixer_selem_id_alloca(&sid);
+
+ ALSAERR(snd_mixer_open, &handle, 0);
+ ALSAERR(snd_mixer_attach, handle, id);
+ ALSAERR(snd_mixer_selem_register, handle, NULL, NULL);
+ ALSAERR(snd_mixer_load, handle);
+
+ for (elem = snd_mixer_first_elem(handle);
+ elem;
+ elem = snd_mixer_elem_next(elem)) {
+ snd_mixer_selem_get_id(elem, sid);
+ if (!snd_mixer_selem_has_playback_volume(elem))
+ continue;
+ snd_mixer_selem_get_playback_volume_range(elem, &min, &max);
+ printf(" mixer ctl playback vol [%ld-%ld] \"%s\", #%i\n",
+ min,max,
+ snd_mixer_selem_id_get_name(sid),
+ snd_mixer_selem_id_get_index(sid));
+ }
+
+ snd_mixer_close(handle);
+ return 0;
+
+ oops:
+ if (handle)
+ snd_mixer_close(handle);
+ return err;
+}
+
+static int alsa_card(char *id)
+{
+ int err;
+ int device = -1;
+ snd_ctl_t *handle = NULL;
+ snd_ctl_card_info_t *card;
+ snd_ctl_elem_list_t *elems;
+ snd_ctl_card_info_alloca(&card);
+ snd_ctl_elem_list_alloca(&elems);
+
+ ALSAERR(snd_ctl_open, &handle, id, 0);
+ ALSAERR(snd_ctl_card_info, handle, card);
+ printf("alsa card %s id=\"%s\" name=\"%s\"\n", id,
+ snd_ctl_card_info_get_id(card),
+ snd_ctl_card_info_get_name(card));
+
+ ALSAERR(snd_ctl_elem_list, handle, elems);
+ printf(" %d controls\n",snd_ctl_elem_list_get_count(elems));
+
+ for (;;) {
+ ALSAERR(snd_ctl_pcm_next_device,handle,&device);
+ if (-1 == device)
+ break;
+ printf(" pcm%d\n",device);
+ }
+
+ snd_ctl_close(handle);
+ handle = NULL;
+
+ oops:
+ if (handle)
+ snd_ctl_close(handle);
+ return err;
+}
+
+static int scan_alsa(void)
+{
+ char name[8];
+ int card = -1;
+
+ for (;;) {
+ if (snd_card_next(&card) < 0) {
+ fprintf(stderr,"snd_card_next failed\n");
+ break;
+ }
+ if (-1 == card)
+ break;
+ sprintf(name,"hw:%d",card);
+ alsa_card(name);
+ alsa_mixer(name);
+ printf("\n");
+ }
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ scan_alsa();
+ return 0;
+}
+
+/* --------------------------------------------------------------------- */
+/*
+ * Local variables:
+ * compile-command: "make hwscan"
+ * End:
+ */
diff --git a/src/rootv.c b/src/rootv.c
index 5fe63e9..bed8f43 100644
--- a/src/rootv.c
+++ b/src/rootv.c
@@ -53,6 +53,7 @@ wm_menu(void)
if (0 == strcmp(*list,"defaults")) continue;
if (0 == strcmp(*list,"global")) continue;
if (0 == strcmp(*list,"launch")) continue;
+ if (0 == strcmp(*list,"eventmap")) continue;
printf("\t\"%s\" EXEC v4lctl setstation \"%s\"\n",*list,*list);
}
printf("\"TV stations\" END\n");
@@ -63,7 +64,7 @@ main(int argc, char *argv[])
{
Display *dpy;
Screen *scr;
- Window win;
+ Window win = 0;
XWindowAttributes wts;
int ver, rel, req, ev, err;
@@ -71,22 +72,33 @@ main(int argc, char *argv[])
int i,stop;
stop = 0;
- if (argc > 1) {
- /* windowmaker menu */
+ while (argc > 1) {
if (0 == strcmp(argv[1],"-wm")) {
+ /* windowmaker menu */
wm_menu();
exit(0);
}
- /* stop video */
if (0 == strcmp(argv[1],"-stop")) {
+ /* stop video */
stop = 1;
+ argc--;
+ argv++;
+ } else if (argc > 2 && 0 == strcmp(argv[1],"-id")) {
+ /* pick window id (default: root window) */
+ sscanf(argv[2],"%li",&win);
+ argc-=2;
+ argv+=2;
+ } else {
+ fprintf(stderr,"unknown arg: %s\n",argv[1]);
+ exit(1);
}
}
/* init X11 */
dpy = XOpenDisplay(NULL);
scr = DefaultScreenOfDisplay(dpy);
- win = RootWindowOfScreen(scr);
+ if (0 == win)
+ win = RootWindowOfScreen(scr);
/* query+print Xvideo properties */
if (Success != XvQueryExtension(dpy,&ver,&rel,&req,&ev,&err)) {
diff --git a/webcam/ftp.c b/webcam/ftp.c
index 37c3984..29c8f59 100644
--- a/webcam/ftp.c
+++ b/webcam/ftp.c
@@ -5,6 +5,7 @@
*
*/
#include "config.h"
+#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
diff --git a/xawtv.spec b/xawtv.spec
index 3df8530..a8d4e17 100644
--- a/xawtv.spec
+++ b/xawtv.spec
@@ -2,7 +2,7 @@ Name: xawtv
Group: Applications/Multimedia
Requires: v4l-conf, tv-common
Autoreqprov: on
-Version: 3.71
+Version: 3.72
Release: 0
License: GPL
Summary: Video4Linux TV application (Athena)

Privacy Policy