mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 16:48:11 +00:00
Added a parse_launch example.
Original commit message from CVS: Added a parse_launch example.
This commit is contained in:
parent
67bf0e5c60
commit
9593a39754
4 changed files with 60 additions and 0 deletions
|
@ -1,2 +1,8 @@
|
||||||
|
noinst_PROGRAMS = mp3parselaunch
|
||||||
|
|
||||||
|
# just an app here, we're safe
|
||||||
|
LIBS += $(GST_LIBS)
|
||||||
|
CFLAGS += $(GST_CFLAGS)
|
||||||
|
|
||||||
noinst_SCRIPTS = mp3play
|
noinst_SCRIPTS = mp3play
|
||||||
EXTRA_DIST = mp3play
|
EXTRA_DIST = mp3play
|
||||||
|
|
24
examples/launch/mp3parselaunch.c
Normal file
24
examples/launch/mp3parselaunch.c
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char *argv[])
|
||||||
|
{
|
||||||
|
GstElement *pipeline;
|
||||||
|
GstElement *disksrc;
|
||||||
|
|
||||||
|
gst_init (&argc, &argv);
|
||||||
|
|
||||||
|
pipeline = gst_pipeline_new ("my_pipeline");
|
||||||
|
|
||||||
|
gst_parse_launch ("disksrc[my_disksrc] ! mp3parse ! mpg123 ! osssink", GST_BIN (pipeline));
|
||||||
|
|
||||||
|
disksrc = gst_bin_get_by_name (GST_BIN (pipeline), "my_disksrc");
|
||||||
|
g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
|
||||||
|
|
||||||
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
|
|
||||||
|
while (gst_bin_iterate (GST_BIN (pipeline)));
|
||||||
|
|
||||||
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||||
|
|
||||||
|
}
|
|
@ -1,2 +1,8 @@
|
||||||
|
noinst_PROGRAMS = mp3parselaunch
|
||||||
|
|
||||||
|
# just an app here, we're safe
|
||||||
|
LIBS += $(GST_LIBS)
|
||||||
|
CFLAGS += $(GST_CFLAGS)
|
||||||
|
|
||||||
noinst_SCRIPTS = mp3play
|
noinst_SCRIPTS = mp3play
|
||||||
EXTRA_DIST = mp3play
|
EXTRA_DIST = mp3play
|
||||||
|
|
24
tests/old/examples/launch/mp3parselaunch.c
Normal file
24
tests/old/examples/launch/mp3parselaunch.c
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char *argv[])
|
||||||
|
{
|
||||||
|
GstElement *pipeline;
|
||||||
|
GstElement *disksrc;
|
||||||
|
|
||||||
|
gst_init (&argc, &argv);
|
||||||
|
|
||||||
|
pipeline = gst_pipeline_new ("my_pipeline");
|
||||||
|
|
||||||
|
gst_parse_launch ("disksrc[my_disksrc] ! mp3parse ! mpg123 ! osssink", GST_BIN (pipeline));
|
||||||
|
|
||||||
|
disksrc = gst_bin_get_by_name (GST_BIN (pipeline), "my_disksrc");
|
||||||
|
g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
|
||||||
|
|
||||||
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
|
|
||||||
|
while (gst_bin_iterate (GST_BIN (pipeline)));
|
||||||
|
|
||||||
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue