X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fxscreensaver-getimage-video;h=d35d0ca730476ead33a91473f070235d47e1fd26;hb=96a411663168b0ba5432b407a83be55f3df0c802;hp=d79bc47c8bd6b7d477f73c74756452d8d758ef74;hpb=585e1a6717d1dd9b90fbb53acaaae82106354d33;p=xscreensaver diff --git a/driver/xscreensaver-getimage-video b/driver/xscreensaver-getimage-video index d79bc47c..d35d0ca7 100755 --- a/driver/xscreensaver-getimage-video +++ b/driver/xscreensaver-getimage-video @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2001 Jamie Zawinski , all rights reserved. +# Copyright © 2001, 2002, 2003 Jamie Zawinski . # # 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; -my $version = q{ $Revision: 1.4 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.12 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $verbose = 0; @@ -44,7 +44,7 @@ my $verbose = 0; my $tmpdir = $ENV{TMPDIR}; $tmpdir = "/tmp" unless $tmpdir; -my $tmpfile = "$tmpdir/xssgv.$$"; +my $tmpfile = "$tmpdir/xssgv.$$.ppm"; # this crap is because "vidtomem" can only write to a file, and uses # a stupid, non-overridable file name format. @@ -52,12 +52,19 @@ my $sgi_bogosity = "$tmpfile-00000.rgb"; my @programs = ( - "bttvgrab -d q -Q -l 1 -o jpg -f $tmpfile", # BTTV + "bttvgrab -d q -Q -l 1 -o ppm -f $tmpfile", # BTTV "qcam > $tmpfile", # Connectix Qcam - "streamer -o $tmpfile", # XawTV + "gqcam -t PPM -d $tmpfile", # GTK+ Qcam clone + "streamer -s 768x576 -o $tmpfile", # XawTV "atitv snap $tmpfile", # ATI video capture card - "vidtomem -f $tmpfile 2>- && mv $sgi_bogosity $tmpfile", # Silicon Graphics + "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 ); @@ -91,7 +98,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(); @@ -106,7 +114,11 @@ sub grab_image { 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"; @@ -140,7 +152,7 @@ sub grab_image { sub usage { - print STDERR "usage: $progname [--verbose] [--stdout]\n"; + print STDERR "usage: $progname [--verbose] [--name | --stdout]\n"; exit 1; } @@ -149,7 +161,8 @@ sub main { 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; } }