GStreamer Application Development Manual | ||
---|---|---|
<<< Previous | Programs | Next >>> |
This is a tool that will construct pipelines based on a command-line syntax.
A simple commandline looks like:
gstreamer-launch disksrc location=hello.mp3 ! mp3parse ! mpg123 ! audiosink |
gstreamer-launch disksrc redpill.vob audio_00! (ac3parse ! ac3dec ! audiosink) \ video_00! (mpeg2dec ! videosink) |
Note that the parser isn't capable of more complex pipelines yet, including the VOB player above. The minor tweaks will be made post 0.1.0.
You can also use the the parser in you own code. GStreamer provides a function gst_parse_launch () that you can use to construt a pipeline. The code of gstreamer-launch actually looks like:
#include <gst/gst.h> #include <string.h> #include <stdlib.h> int main(int argc, char *argv[]) { GstElement *pipeline; char **argvn; gchar *cmdline; int i; gst_init(&argc,&argv); pipeline = gst_pipeline_new("launch"); // make a null-terminated version of argv argvn = g_new0(char *,argc); memcpy(argvn,argv+1,sizeof(char*)*(argc-1)); // join the argvs together cmdline = g_strjoinv(" ",argvn); // free the null-terminated argv g_free(argvn); gst_parse_launch(cmdline,pipeline); fprintf(stderr,"RUNNING pipeline\n"); gst_element_set_state(pipeline,GST_STATE_PLAYING); while (1) gst_bin_iterate (GST_BIN (pipeline)); return 0; } |
<<< Previous | Home | Next >>> |
gstreamer-register | Up | gstreamer-inspect |