X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fxscreensaver-getimage-video;h=468bf3afc1f2615b0c4923792a9c8ae68c13f622;hb=ccb7f4903325f92555a9722bba74b58346654ba0;hp=d4e9e865671a9c4235e715440a1b75ddfab5ebff;hpb=40eacb5812ef7c0e3374fb139afbb4f5bc8bbfb5;p=xscreensaver diff --git a/driver/xscreensaver-getimage-video b/driver/xscreensaver-getimage-video index d4e9e865..468bf3af 100755 --- a/driver/xscreensaver-getimage-video +++ b/driver/xscreensaver-getimage-video @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2001, 2002, 2003 Jamie Zawinski . +# Copyright © 2001, 2002, 2003, 2005 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 @@ -22,49 +22,51 @@ # value of the "grabVideoFrames" setting in the ~/.xscreensaver file # (or in /usr/lib/X11/app-defaults/XScreenSaver). # -# Created: 13-Apr-01. +# Created: 13-Apr-2001. require 5; use diagnostics; use strict; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.11 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.16 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $verbose = 0; +my $tmpdir = $ENV{TMPDIR} || "/tmp"; +my $tmpfile = sprintf ("%s/xssgv.%08x.ppm", $tmpdir, rand(0xFFFFFFFF)); + + # These are programs that can be used to grab a video frame. The first one # of these programs that exists on $PATH will be used, and the image file -# is assumed to be written to stdout (in some image format acceptable to +# is assumed to be written to $tmpfile (in some image format acceptable to # "xscreensaver-getimage-file", e.g., PPM or JPEG.) # # If you add other programs to this list, please let me know! # - -my $tmpdir = $ENV{TMPDIR}; -$tmpdir = "/tmp" unless $tmpdir; - -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. -my $sgi_bogosity = "$tmpfile-00000.rgb"; - my @programs = ( "bttvgrab -d q -Q -l 1 -o ppm -f $tmpfile", # BTTV "qcam > $tmpfile", # Connectix Qcam "gqcam -t PPM -d $tmpfile", # GTK+ Qcam clone + + "v4lctl snap ppm full $tmpfile", # XawTV 3.94. + "streamer -a -s 768x576 -o $tmpfile", # XawTV + # the "-a" option ("mute audio") arrived with XawTV 3.76. + "atitv snap $tmpfile", # ATI video capture card - "grab -type ppm -format ntsc -source 1 " . - "-settle 0.75 -output $tmpfile", # *BSD BT848 module + "grab -type ppm -format ntsc -source 1 " . # *BSD BT848 module + "-settle 0.75 -output $tmpfile", - "motioneye -j $tmpfile", # Sony Vaio MotionEye + "motioneye -j $tmpfile", # Sony Vaio MotionEye # (hardware jpeg encoder) - "vidtomem -f $tmpfile 2>&- && mv $sgi_bogosity $tmpfile", # Silicon Graphics + "vidcat -b -f ppm -s 640x480 > $tmpfile 2>-", # w3cam/ovcam + + "vidtomem -f $tmpfile 2>&- " . # Silicon Graphics + "&& mv $tmpfile-00000.rgb $tmpfile", );