GitLab will be down for maintenance this Sunday 13th June, from approx 7-11am UTC. This is for a PostgreSQL migration. See the tracker issue for more informations.

Commit 9c10719b authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

gst-launch-ext can be used to play common media files with fixed pipes based on the file extension.

Original commit message from CVS:
gst-launch-ext can be used to play common media files with fixed pipes
based on the file extension.

It optionally uses a .gst file in the home directory to select preferred
audio and video sinks.
parent 2114eaf1
......@@ -20,7 +20,7 @@ sub extension
sub read_config
{
my $config_file = "~/.gst";
my $config_file = `echo -n ~`."/.gst";
if (-e $config_file)
{
open CONFIG, $config_file;
......@@ -45,18 +45,10 @@ sub read_config
else
{
print "No configuration file $config_file found. You might want to create one.\n";
$cfg{AUDIOSINK} = "osssink";
$cfg{VIDEOSINK} = "xvideosink";
$cfg{CVS_PATH} = "~/gst/cvs";
}
# check for gst-launch in cvs dir
$GST_LAUNCH=$cfg{CVS_PATH}."/gstreamer/tools/gst-launch";
if (! -x $GST_LAUNCH)
{
# let's hope it's installed ...
$GST_LAUNCH="gst-launch";
}
if (!defined $cfg{AUDIOSINK}) { $cfg{AUDIOSINK} = "osssink"; }
if (!defined $cfg{VIDEOSINK}) { $cfg{VIDEOSINK} = "sdlvideosink"; }
if (!defined $cfg{CVS_PATH}) { $cfg{CVS_PATH} = `echo -n ~`."/gst/cvs"; }
}
### main
......@@ -66,7 +58,7 @@ read_config ();
my %pipes = (
"mp3", "mad ! $cfg{AUDIOSINK}",
"ogg", "vorbisdec ! $cfg{AUDIOSINK}",
"mpg", "mpegdemux video_00! { queue ! mpeg2dec ! $cfg{VIDEOSINK} } audio_00! { queue ! mad ! $cfg{AUDIOSINK} }",
"mpg", "mpegdemux audio_00! { queue ! mad ! $cfg{AUDIOSINK} } mpegdemux0.video_00! { queue ! mpeg2dec ! $cfg{VIDEOSINK} }",
"avi", "avidemux video_00! { queue ! windec ! $cfg{VIDEOSINK} }",
"vob", "mpegdemux video_00! { queue ! mpeg2dec ! $cfg{VIDEOSINK} }",
......@@ -77,9 +69,9 @@ my $ext = extension ($file);
if ($pipe = $pipes{$ext})
{
$command = "$GST_LAUNCH filesrc location=\"$file\" ! $pipe";
$command = "gst-launch filesrc location=\"$file\" ! $pipe";
print "Running $command\n";
system ($command);
system ("PATH=\$PATH:".$cfg{CVS_PATH}."/gstreamer/tools/gst-launch $command");
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment