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
commitab5d04be814f12985f0590495aef5113ffb43799 (patch)
tree9f285f346b5822841b14656909cc3ef8b8f20877
parent20425e5b96ea436628042dfbf3a112f8bd5d0fa1 (diff)
v3.43
-rw-r--r--Changes11
-rw-r--r--debian/changelog6
-rw-r--r--libng/grab-v4l.c2
-rw-r--r--src/main.c3
-rw-r--r--src/motif.c30
-rw-r--r--src/sound.c9
-rw-r--r--webcam/webcam.c39
-rw-r--r--webcam/webcam.man7
-rw-r--r--xawtv.spec2
9 files changed, 80 insertions, 29 deletions
diff --git a/Changes b/Changes
index 8cfa7ef..997dce3 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,15 @@
+3.42 => 3.43
+============
+
+ * webcam update (tmp file fix, allow to give a config file as
+ argument)
+ * turned off the *&%($ debugging code in grab-v4l.c
+ * some bugfixes in sound recording code.
+ * made the motif version compile again (still very incomplete
+ and not built by default).
+
+
3.41 => 3.42
============
diff --git a/debian/changelog b/debian/changelog
index 609c066..697b63e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xawtv (3.43) unstable; urgency=low
+
+ * new release.
+
+ -- Gerd Knorr <kraxel@debian.org> Mon, 9 Apr 2001 09:03:17 +0000
+
xawtv (3.42) unstable; urgency=low
* new release.
diff --git a/libng/grab-v4l.c b/libng/grab-v4l.c
index 6c826a2..bb2b915 100644
--- a/libng/grab-v4l.c
+++ b/libng/grab-v4l.c
@@ -1105,7 +1105,7 @@ v4l_setformat(void *handle, struct ng_video_fmt *fmt)
struct v4l_handle *h = handle;
int rc;
-#if 1
+#if 0
/* for debugging color space conversion functions:
force xawtv to capture some specific format */
if (fmt->fmtid != VIDEO_YUV422)
diff --git a/src/main.c b/src/main.c
index b58baeb..b0630b0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2582,6 +2582,9 @@ main(int argc, char *argv[])
XtVaGetValues(tv,XtNwidth,&w,NULL);
if (!w) {
fprintf(stderr,"The app-defaults file is not correctly installed.\n");
+ fprintf(stderr,"It should be either in /etc/X11/app-defaults or in\n");
+ fprintf(stderr,"/usr/X11R6/lib/X11/app-defaults, depending on how\n");
+ fprintf(stderr,"your XFree86 installation is configured.\n");
fprintf(stderr,"Your fault (core dumped)\n");
exit(1);
}
diff --git a/src/motif.c b/src/motif.c
index cfd96ab..819c1d0 100644
--- a/src/motif.c
+++ b/src/motif.c
@@ -33,12 +33,15 @@
# include <X11/extensions/xf86vmode.h>
# include <X11/extensions/xf86vmstr.h>
#endif
+#ifdef HAVE_LIBXINERAMA
+# include <X11/extensions/Xinerama.h>
+#endif
#ifdef HAVE_LIBXV
# include <X11/extensions/Xv.h>
# include <X11/extensions/Xvlib.h>
#endif
-#include "grab.h"
+#include "grab-ng.h"
#include "channel.h"
#include "commands.h"
#include "frequencies.h"
@@ -227,6 +230,7 @@ create_control(void)
XtVaCreateManagedWidget("sep1",xmSeparatorWidgetClass,menu,
NULL);
+#if 0
/* options / input */
submenu = XmCreatePulldownMenu(menu,"inputM",NULL,0);
XtVaCreateManagedWidget("input",xmCascadeButtonWidgetClass,menu,
@@ -244,6 +248,7 @@ create_control(void)
add_cmd_menuitem("norm", i, submenu,
grabber->norms[i].str, NULL, NULL,
"setnorm",grabber->norms[i].str);
+#endif
XtManageChild(menubar);
/* scales */
@@ -291,13 +296,13 @@ do_capture(int from, int to)
/* off */
switch (from) {
case CAPTURE_OVERLAY:
- video_overlay(NULL);
+ video_overlay(0);
break;
}
/* on */
switch (to) {
case CAPTURE_OVERLAY:
- video_overlay(grabber->grab_overlay);
+ video_overlay(1);
break;
}
}
@@ -348,8 +353,11 @@ main(int argc, char *argv[])
set_capture_hook = do_capture;
tv = video_init(app_shell,&vinfo,xmPrimitiveWidgetClass);
- if (NULL == grabber)
+ if (NULL == drv) {
+ if (debug)
+ fprintf(stderr,"main: open grabber device...\n");
grabber_init();
+ }
XtVaGetValues(tv,XtNwidth,&w,NULL);
if (!w) {
@@ -389,7 +397,7 @@ main(int argc, char *argv[])
if (optind+1 == argc) {
do_va_cmd(2,"setstation",argv[optind]);
} else {
- if (grabber->grab_tune && 0 != (freq = grabber->grab_tune(-1,-1))) {
+ if ((f_drv & CAN_TUNE) && 0 != (freq = drv->getfreq(h_drv))) {
for (i = 0; i < chancount; i++)
if (chanlist[i].freq == freq*1000/16) {
do_va_cmd(2,"setchannel",chanlist[i].name);
@@ -397,10 +405,18 @@ main(int argc, char *argv[])
}
}
if (-1 == cur_channel) {
- if (count > 0)
+ if (count > 0) {
+ if (debug)
+ fprintf(stderr,"main: tuning first station\n");
do_va_cmd(2,"setstation","0");
- else
+ } else {
+ if (debug)
+ fprintf(stderr,"main: setting defaults\n");
set_defaults();
+ }
+ } else {
+ if (debug)
+ fprintf(stderr,"main: known station tuned, not changing\n");
}
}
diff --git a/src/sound.c b/src/sound.c
index 35d954e..e1aa721 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -303,13 +303,17 @@ oss_bufread(int fd,char *buffer,int blocksize)
for (;;) {
rc = read(fd,buffer+count,blocksize-count);
if (rc < 0) {
+ if (EINTR == errno)
+ continue;
perror("read /dev/dsp");
exit(1);
}
count += rc;
+ fprintf(stderr,"%d %d\n",count,blocksize);
if (count == blocksize)
return;
}
+ fprintf(stderr,"#");
}
static void
@@ -335,10 +339,11 @@ oss_read(void *handle, long long stopby)
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;
- if (0 == bytes)
- return NULL;
} else {
bytes = h->blocksize;
}
diff --git a/webcam/webcam.c b/webcam/webcam.c
index f3051af..0e1ac3e 100644
--- a/webcam/webcam.c
+++ b/webcam/webcam.c
@@ -12,6 +12,7 @@
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <pthread.h>
#include <sys/time.h>
#include <sys/mman.h>
@@ -26,8 +27,6 @@
/* ---------------------------------------------------------------------- */
/* configuration */
-#define JPEG_FILE "/tmp/webcam.jpeg"
-
char *ftp_host = "www";
char *ftp_user = "webcam";
char *ftp_pass = "xxxxxx";
@@ -63,7 +62,7 @@ void swap_rgb24(char *mem, int n);
/* jpeg stuff */
int
-write_file(char *filename, char *data, int width, int height)
+write_file(int fd, char *data, int width, int height)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
@@ -71,12 +70,7 @@ write_file(char *filename, char *data, int width, int height)
int i;
unsigned char *line;
- if (NULL == (fp = fopen(filename,"w"))) {
- fprintf(stderr,"can't open %s for writing: %s\n",
- filename,strerror(errno));
- return -1;
- }
-
+ fp = fdopen(fd,"w");
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_compress(&cinfo);
jpeg_stdio_dest(&cinfo, fp);
@@ -321,11 +315,15 @@ int
main(int argc, char *argv[])
{
unsigned char *image,*val,*gimg,*lastimg = NULL;
- char filename[100];
- int width, height, i;
+ char filename[1024], *tmpdir;
+ int width, height, i, fh;
/* read config */
- sprintf(filename,"%s/%s",getenv("HOME"),".webcamrc");
+ if (argc > 1) {
+ strcpy(filename,argv[1]);
+ } else {
+ sprintf(filename,"%s/%s",getenv("HOME"),".webcamrc");
+ }
fprintf(stderr,"reading config file: %s\n",filename);
cfg_parse_file(filename);
@@ -421,6 +419,7 @@ main(int argc, char *argv[])
ftp_init(ftp_auto,ftp_passive);
ftp_connect(ftp_host,ftp_user,ftp_pass,ftp_dir);
}
+ tmpdir = (NULL != getenv("TMPDIR")) ? getenv("TMPDIR") : "/tmp";
/* main loop */
for (;;) {
@@ -444,15 +443,25 @@ main(int argc, char *argv[])
/* ok, label it and upload */
add_text(image,width,height);
if ( ftp_local ) {
- write_file(ftp_tmp, image, width, height);
+ if (-1 == (fh = open(ftp_tmp,O_WRONLY,0600))) {
+ fprintf(stderr,"open %s: %s\n",ftp_tmp,strerror(errno));
+ exit(1);
+ }
+ write_file(fh, image, width, height);
if ( rename(ftp_tmp, ftp_file) ) {
fprintf(stderr, "can't move %s -> %s\n", ftp_tmp, ftp_file);
}
} else {
- write_file(JPEG_FILE, image, width, height);
+ 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(JPEG_FILE,ftp_file,ftp_tmp);
+ ftp_upload(filename,ftp_file,ftp_tmp);
+ unlink(filename);
}
if (grab_once)
diff --git a/webcam/webcam.man b/webcam/webcam.man
index dfb3cae..1e61851 100644
--- a/webcam/webcam.man
+++ b/webcam/webcam.man
@@ -2,7 +2,7 @@
.SH NAME
webcam - capture images and upload them to a webserver using ftp
.SH SYNOPSIS
-.B webcam
+.B webcam [ config file ]
.SH DESCRIPTION
.B webcam
captures images from a video4linux device like bttv, annotates them
@@ -10,8 +10,9 @@ and and uploads them to a webserver using ftp in a endless loop.
.SH CONFIGURATION
At startup
.B webcam
-reads the configuration file ~/.webcamrc. It looks like this (the
-given values are the defaults):
+reads the configuration from the given config file or ~/.webcamrc if
+none is specified in the command line. It looks like this (the given
+values are the defaults):
.nf
[ftp]
diff --git a/xawtv.spec b/xawtv.spec
index 64aaa3a..2afecbf 100644
--- a/xawtv.spec
+++ b/xawtv.spec
@@ -8,7 +8,7 @@
Summary: Video4Linux Stream Capture Viewer
Name: xawtv
-Version: 3.42
+Version: 3.43
Release: 1
Source0: xawtv_%{version}.tar.gz
Group: X11/Applications

Privacy Policy