diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2002-02-04 21:39:45 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2002-02-04 21:39:45 +0000 |
commit | 79ab7003417718a9b2cb615a7780787a8b5d34b0 (patch) | |
tree | 2faa1903662b535475e70ec4dbef505699a12c9a /tools/gst-launch-ext | |
parent | e51e53d0d5764d879e2125cc55f87811ea73bbfe (diff) |
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.
Diffstat (limited to 'tools/gst-launch-ext')
-rwxr-xr-x | tools/gst-launch-ext | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/tools/gst-launch-ext b/tools/gst-launch-ext index 6c5cd893..74e9caa1 100755 --- a/tools/gst-launch-ext +++ b/tools/gst-launch-ext @@ -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 { |