Programsgstreamer-configgstreamer-config is a script to get information about the installed
version of GStreamer.
This program "knows" what compiler switches are needed to compile programs that use
GStreamer.
gstreamer-config accepts the following options:
Print the currently installed version of
GStreamer on the standard output.
Print the linker flags that are necessary to link a
GStreamer program.
Print the compiler flags that are necessary to compile a
GStreamer program.
If specified, use PREFIX instead of the installation
prefix that GStreamer was built with when computing the
output for the and options.
This option is also used for the exec prefix if
was not specified. This option must be specified before any
or options.
If specified, use PREFIX instead of the installation exec
prefix that GStreamer was built with when computing the
output for the and options. This option must be
specified before any or
options.
A simple Makefile will contain something like:
CC = gcc
helloworld2: helloworld2.c
$(CC) -Wall `gstreamer-config --cflags --libs` helloworld2.c -o helloworld2
clean:
rm -f *.o helloworld2
gstreamer-registergstreamer-register is used to rebuild the database of plugins.
It is used after a new plugin has been added to the system. The plugin database
can be found in /etc/gstreamer/reg.xml.
gstreamer-launch
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
A more complex pipeline looks like:
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;
}
gstreamer-inspect
This is a tool to query a plugin or an element about its properties.
To query the information about the element mpg123, you would specify:
gstreamer-inspect mpg123
Below is the output of a query for the audiosink element:
Factory Details:
Long name: Audio Sink (OSS)
Class: Sink/Audio
Description: Output to a sound card via OSS
Version: 0.1.0
Author(s): Erik Walthinsen <omega@cse.ogi.edu>
Copyright: (C) 1999
Pad Templates:
SINK template: 'sink'
Exists: Always
Capabilities:
'audiosink_sink':
MIME type: 'audio/raw':
format: Integer: 16
depth: List:
Integer: 8
Integer: 16
rate: Integer range: 8000 - 48000
channels: Integer range: 1 - 2
Element Flags:
GST_ELEMENT_THREADSUGGESTED
no flags set
Element Implementation:
No loopfunc(), must be chain-based or not configured yet
Has change_state() function
Pads:
SINK: 'sink'
Implementation:
Has chainfunc(): 0x4001cde8
Has default eosfunc() gst_pad_eos_func()
Pad Template: 'sink'
Capabilities:
'audiosink_sink':
MIME type: 'audio/raw':
format: Integer: 16
depth: List:
Integer: 8
Integer: 16
rate: Integer range: 8000 - 48000
channels: Integer range: 1 - 2
Element Arguments:
GstAudioSink::mute: Boolean
GstAudioSink::format: Enum (default 16)
(8): 8 Bits
(16): 16 Bits
GstAudioSink::channels: Enum (default 2)
(1): Mono
(2): Stereo
GstAudioSink::frequency: Integer
To query the information about a plugin, you would do:
gstreamer-inspect gstelements
gstmediaplay
A sample media player.