/usr/share/doc/libgstreamer-perl/examples/manual/playbin.pl is in libgstreamer-perl 0.19-1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #!/usr/bin/perl
use strict;
use warnings;
use Glib qw(TRUE FALSE filename_to_unicode);
use GStreamer;
# $Id$
sub my_bus_callback {
my ($bus, $message, $loop) = @_;
if ($message -> type & "error") {
warn $message -> error;
$loop -> quit();
}
elsif ($message -> type & "eos") {
$loop -> quit();
}
# remove message from the queue
return TRUE;
}
GStreamer -> init();
my $loop = Glib::MainLoop -> new(undef, FALSE);
# make sure we have a URI
unless ($#ARGV == 0) {
print "Usage: $0 <URI>\n";
exit -1;
}
# set up
my $play = GStreamer::ElementFactory -> make("playbin", "play");
$play -> set(uri => filename_to_unicode $ARGV[0]);
$play -> get_bus() -> add_watch(\&my_bus_callback, $loop);
$play -> set_state("playing");
# now run
$loop -> run();
# also clean up
$play -> set_state("null");
|