diff options
Diffstat (limited to 'abs/core-testing')
-rw-r--r-- | abs/core-testing/mplayer-wrapper/PKGBUILD | 2 | ||||
-rwxr-xr-x | abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl | 54 |
2 files changed, 48 insertions, 8 deletions
diff --git a/abs/core-testing/mplayer-wrapper/PKGBUILD b/abs/core-testing/mplayer-wrapper/PKGBUILD index 9c0934b..2774c1a 100644 --- a/abs/core-testing/mplayer-wrapper/PKGBUILD +++ b/abs/core-testing/mplayer-wrapper/PKGBUILD @@ -1,6 +1,6 @@ pkgname=mplayer-wrapper pkgver=1 -pkgrel=5 +pkgrel=8 pkgdesc="wrapper for mplayer and mplayer derivatives" arch=('i686' 'x86_64') diff --git a/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl b/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl index 86c40c6..da0e838 100755 --- a/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl +++ b/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl @@ -97,7 +97,39 @@ sub dynamic_parameters () { my($mediafile)=@_; my @parameters = (); my $codec=""; + my %vdpau_supported_modes=(); + # See if the GPU and driver support vdpau for GPU-based accelerated decoding + my $command="vdpinfo |"; + # On supported hardware, vdpinfo produces relevant results that look something like this (see + # http://www.phoronix.com/forums/showthread.php?t=14493 for additional details, or run + # vdpinfo on vdpau-capable hardware yourself): + # + #MPEG1 0 2 4096 4096 + #MPEG2_SIMPLE 3 2 4096 4096 + #MPEG2_MAIN 3 2 4096 4096 + #H264_MAIN 41 4 4096 4096 + #H264_HIGH 41 4 4096 4096 + + my $grabbing_modes=0; + open(SHELL, $command); + while (<SHELL>) { + chop; + if (m/Decoder Capabilities/gi) { + $grabbing_modes=1; + #print "*** MODES START NOW" + } elsif (m/Output Surface/gi) { + $grabbing_modes=0; + } elsif ($grabbing_modes) { + if (m/[A-Z]+[0-9]+/g) { + s/(_.*)//g; + #print "*** GRABBED MODE $_\n"; + $vdpau_supported_modes{$_} = 1; + } + } + } + close(SHELL); + # figure out what codec the video uses my $command="mplayer -identify -frames 0 \"$mediafile\" | grep ID_VIDEO_CODEC | cut -c 16- |"; open(SHELL, $command); @@ -109,30 +141,38 @@ sub dynamic_parameters () { close(SHELL); # We should use vdpau if it's available and helps with the codec we need to decode. - # ??? NOTE: At the moment, vdpau capability is assumed, not verified. if ($codec eq "ffh264") { # h.264 - push(@parameters, "-vo vdpau"); - push(@parameters, "-vc ffh264vdpau"); + if ($vdpau_supported_modes{"H264"}) { + push(@parameters, "-vo vdpau"); + push(@parameters, "-vc ffh264vdpau"); + } } elsif ($codec eq "ffmpeg2") { # MPEG2 - push(@parameters, "-vo vdpau"); - push(@parameters, "-vc ffmpeg12vdpau"); + if ($vdpau_supported_modes{"MPEG2"}) { + push(@parameters, "-vo vdpau"); + push(@parameters, "-vc ffmpeg12vdpau"); + } + # ??? although MPEG1 is rare, it seems as if it should work with -vc ffmpeg12vdpau as well + # problems have been reported with WMV3 support # } elsif ($codec eq "ffwmv3") { # WMV3 +# if ($vdpau_supported) { # push(@parameters, "-vo vdpau"); # push(@parameters, "-vc ffwmv3vdpau"); - +# } # problems have been reported with WVC1 support # } elsif ($codec eq "ffvc1") { # WVC1 +# if ($vdpau_supported) { # push(@parameters, "-vo vdpau"); # push(@parameters, "-vc ffvc1vdpau"); +# } } else { push(@parameters, "-vo xv,x11,"); push(@parameters, "-vc ,"); - push(@parameters, "-vf pp=lb,"); + push(@parameters, "-vf pp=lb,"); # doesn't actually work with vdpau, but doesn't break anything } return(@parameters); } |