summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl')
-rwxr-xr-xabs/core-testing/mplayer-wrapper/mplayer-wrapper.pl48
1 files changed, 44 insertions, 4 deletions
diff --git a/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl b/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl
index 9977741..2d823d9 100755
--- a/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl
+++ b/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl
@@ -76,7 +76,46 @@ sub translate_parameters() {
# general capability of the CPU.
sub dynamic_parameters () {
my($mediafile)=@_;
- return(); # ??? empty for now; further development required
+ my @parameters = ();
+ my $codec="";
+
+ # figure out what codec the video uses
+ my $command="mplayer -identify -vo null -frames 0 \"$mediafile\" | grep ID_VIDEO_CODEC | cut -c 16- |";
+ open(SHELL, $command);
+ while (<SHELL>) {
+ chop;
+ $codec = $_;
+ #print "DEBUG: codec is $codec\n";
+ }
+ 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");
+ } elsif ($codec eq "ffmpeg2") { # MPEG2
+ push(@parameters, "-vo vdpau");
+ push(@parameters, "-vc ffmpeg12vdpau");
+
+ # problems reported with WMV3 support
+
+# } elsif ($codec eq "ffwmv3") { # WMV3
+# push(@parameters, "-vo vdpau");
+# push(@parameters, "-vc ffwmv3vdpau");
+
+ # problems reported with WVC1 support
+
+# } elsif ($codec eq "ffvc1") { # WVC1
+# push(@parameters, "-vo vdpau");
+# push(@parameters, "-vc ffvc1vdpau");
+
+ } else {
+ push(@parameters, "-vo xv,x11,");
+ push(@parameters, "-vc ,");
+ }
+ push(@parameters, "-vf pp=lb,");
+ return(@parameters);
}
# Find the best player for use on this system. The script prefers smplayer,
@@ -84,7 +123,8 @@ sub dynamic_parameters () {
# implements bookmarking as an mplayer wrapper, if smplayer cannot be found.
# Finally, if no bookmarking players can be found, a barebones mplayer is used.
sub pick_player () {
- my @possible_players = ("smplayer", "mplayer-resumer.pl", "mplayer");
+ #my @possible_players = ("smplayer", "mplayer-resumer.pl", "mplayer");
+ my @possible_players = ("mplayer-resumer.pl", "mplayer");
my $command;
my $candidate_player;
foreach (@possible_players) {
@@ -102,9 +142,9 @@ sub pick_player () {
# Calls player
sub player () {
my($player,$parameters,$mediafile)=@_;
- my $command = "$player $parameters \"$mediafile\" 2>&1 2>/dev/null |";
+ my $command = "$player $parameters \"$mediafile\" 2>&1 |";
- #print "DEBUG: command is:\n$command\n";
+ print "DEBUG: command is:\n$command\n";
open(SHELL, $command);
while (<SHELL>) {
print $_;