projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ftp://ftp.jp.xemacs.org/pub/NetBSD/packages/distfiles/xscreensaver-4.15.tar.gz
[xscreensaver]
/
driver
/
xscreensaver-getimage-video
diff --git
a/driver/xscreensaver-getimage-video
b/driver/xscreensaver-getimage-video
index 4dc449ff53fe52c5088cec86d68b9d2690312554..f8474670cca37a567ef68d4f1c8f282449a2de20 100755
(executable)
--- a/
driver/xscreensaver-getimage-video
+++ b/
driver/xscreensaver-getimage-video
@@
-1,5
+1,5
@@
#!/usr/bin/perl -w
#!/usr/bin/perl -w
-# Copyright © 2001
Jamie Zawinski <jwz@jwz.org>, all rights reserved
.
+# Copyright © 2001
, 2002, 2003 Jamie Zawinski <jwz@jwz.org>
.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
@@
-29,7
+29,7
@@
use diagnostics;
use strict;
my $progname = $0; $progname =~ s@.*/@@g;
use strict;
my $progname = $0; $progname =~ s@.*/@@g;
-my $version = q{ $Revision: 1.
6
$ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my $version = q{ $Revision: 1.
13
$ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
my $verbose = 0;
my $verbose = 0;
@@
-44,7
+44,7
@@
my $verbose = 0;
my $tmpdir = $ENV{TMPDIR};
$tmpdir = "/tmp" unless $tmpdir;
my $tmpdir = $ENV{TMPDIR};
$tmpdir = "/tmp" unless $tmpdir;
-my $tmpfile =
"$tmpdir/xssgv.$$.ppm"
;
+my $tmpfile =
sprintf ("%s/xssgv.%08x.ppm", $tmpdir, rand(0xFFFFFFFF))
;
# this crap is because "vidtomem" can only write to a file, and uses
# a stupid, non-overridable file name format.
# this crap is because "vidtomem" can only write to a file, and uses
# a stupid, non-overridable file name format.
@@
-54,9
+54,19
@@
my @programs = (
"bttvgrab -d q -Q -l 1 -o ppm -f $tmpfile", # BTTV
"qcam > $tmpfile", # Connectix Qcam
"bttvgrab -d q -Q -l 1 -o ppm -f $tmpfile", # BTTV
"qcam > $tmpfile", # Connectix Qcam
- "streamer -s 768x576 -o $tmpfile", # XawTV
+ "gqcam -t PPM -d $tmpfile", # GTK+ Qcam clone
+
+ "streamer -a -s 768x576 -o $tmpfile", # XawTV
+ # the "-a" option ("mute audio") arrived with XawTV 3.76.
+
"atitv snap $tmpfile", # ATI video capture card
"atitv snap $tmpfile", # ATI video capture card
+ "grab -type ppm -format ntsc -source 1 " .
+ "-settle 0.75 -output $tmpfile", # *BSD BT848 module
+
+ "motioneye -j $tmpfile", # Sony Vaio MotionEye
+ # (hardware jpeg encoder)
+
"vidtomem -f $tmpfile 2>&- && mv $sgi_bogosity $tmpfile", # Silicon Graphics
);
"vidtomem -f $tmpfile 2>&- && mv $sgi_bogosity $tmpfile", # Silicon Graphics
);
@@
-91,7
+101,8
@@
sub pick_grabber {
}
}
-my $use_stdout = 0;
+my $use_stdout_p = 0;
+my $return_filename_p = 0;
sub grab_image {
my $cmd = pick_grabber();
sub grab_image {
my $cmd = pick_grabber();
@@
-106,7
+117,11
@@
sub grab_image {
error "\"$cmd\" produced no data.";
}
error "\"$cmd\" produced no data.";
}
- if ($use_stdout) {
+ if ($return_filename_p) {
+ print STDERR "$progname: wrote \"$tmpfile\"\n" if ($verbose);
+ print STDOUT "$tmpfile\n";
+
+ } elsif ($use_stdout_p) {
local *IN;
my $ppm = "";
my $reader = "<$tmpfile";
local *IN;
my $ppm = "";
my $reader = "<$tmpfile";
@@
-140,7
+155,7
@@
sub grab_image {
sub usage {
sub usage {
- print STDERR "usage: $progname [--verbose] [--stdout]\n";
+ print STDERR "usage: $progname [--verbose] [--
name | --
stdout]\n";
exit 1;
}
exit 1;
}
@@
-149,7
+164,8
@@
sub main {
shift @ARGV;
if ($_ eq "--verbose") { $verbose++; }
elsif (m/^-v+$/) { $verbose += length($_)-1; }
shift @ARGV;
if ($_ eq "--verbose") { $verbose++; }
elsif (m/^-v+$/) { $verbose += length($_)-1; }
- elsif (m/^--?stdout$/) { $use_stdout = 1; }
+ elsif (m/^--?stdout$/) { $use_stdout_p = 1; }
+ elsif (m/^--?name$/) { $return_filename_p = 1; }
elsif (m/^-./) { usage; }
else { usage; }
}
elsif (m/^-./) { usage; }
else { usage; }
}