mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-08 18:39:54 +00:00
applied some simple fixing to some examples re-enabled the working examples
Original commit message from CVS: * configure.ac: * docs/random/ensonic/media-device-daemon.txt: * tests/examples/controller/.cvsignore: * tests/examples/controller/Makefile.am: * tests/examples/controller/audio-example.c: (main): * tests/examples/helloworld/.cvsignore: * tests/examples/helloworld/Makefile.am: * tests/examples/helloworld/helloworld.c: (event_loop), (main): * tests/examples/launch/.cvsignore: * tests/examples/launch/Makefile.am: * tests/examples/launch/mp3parselaunch.c: (event_loop), (main): * tests/examples/metadata/.cvsignore: * tests/examples/metadata/Makefile.am: * tests/examples/metadata/read-metadata.c: (message_loop), (make_pipeline), (print_tag), (main): * tests/examples/queue/.cvsignore: * tests/examples/queue/Makefile.am: * tests/examples/queue/queue.c: (event_loop), (main): * tests/examples/typefind/.cvsignore: * tests/examples/typefind/Makefile.am: * tests/examples/typefind/typefind.c: (type_found), (event_loop), (main): * tests/examples/xml/.cvsignore: * tests/examples/xml/Makefile.am: * tests/examples/xml/createxml.c: (object_saved), (main): * tests/examples/xml/runxml.c: (xml_loaded), (event_loop), (main): * tests/old/examples/Makefile.am: * tests/old/examples/TODO: * tests/old/examples/controller/.cvsignore: * tests/old/examples/controller/Makefile.am: * tests/old/examples/controller/audio-example.c: * tests/old/examples/helloworld/.cvsignore: * tests/old/examples/helloworld/Makefile.am: * tests/old/examples/helloworld/helloworld.c: * tests/old/examples/launch/.cvsignore: * tests/old/examples/launch/Makefile.am: * tests/old/examples/launch/mp3parselaunch.c: * tests/old/examples/launch/mp3play: * tests/old/examples/manual/Makefile.am: * tests/old/examples/metadata/Makefile.am: * tests/old/examples/metadata/read-metadata.c: * tests/old/examples/queue/.cvsignore: * tests/old/examples/queue/Makefile.am: * tests/old/examples/queue/queue.c: * tests/old/examples/typefind/.cvsignore: * tests/old/examples/typefind/Makefile.am: * tests/old/examples/typefind/typefind.c: * tests/old/examples/xml/.cvsignore: * tests/old/examples/xml/Makefile.am: * tests/old/examples/xml/createxml.c: * tests/old/examples/xml/runxml.c: applied some simple fixing to some examples re-enabled the working examples
This commit is contained in:
parent
8666c1597d
commit
7c17de8f03
31 changed files with 414 additions and 146 deletions
56
ChangeLog
56
ChangeLog
|
@ -1,3 +1,59 @@
|
|||
2005-12-12 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* configure.ac:
|
||||
* docs/random/ensonic/media-device-daemon.txt:
|
||||
* tests/examples/controller/.cvsignore:
|
||||
* tests/examples/controller/Makefile.am:
|
||||
* tests/examples/controller/audio-example.c: (main):
|
||||
* tests/examples/helloworld/.cvsignore:
|
||||
* tests/examples/helloworld/Makefile.am:
|
||||
* tests/examples/helloworld/helloworld.c: (event_loop), (main):
|
||||
* tests/examples/launch/.cvsignore:
|
||||
* tests/examples/launch/Makefile.am:
|
||||
* tests/examples/launch/mp3parselaunch.c: (event_loop), (main):
|
||||
* tests/examples/metadata/.cvsignore:
|
||||
* tests/examples/metadata/Makefile.am:
|
||||
* tests/examples/metadata/read-metadata.c: (message_loop),
|
||||
(make_pipeline), (print_tag), (main):
|
||||
* tests/examples/queue/.cvsignore:
|
||||
* tests/examples/queue/Makefile.am:
|
||||
* tests/examples/queue/queue.c: (event_loop), (main):
|
||||
* tests/examples/typefind/.cvsignore:
|
||||
* tests/examples/typefind/Makefile.am:
|
||||
* tests/examples/typefind/typefind.c: (type_found), (event_loop),
|
||||
(main):
|
||||
* tests/examples/xml/.cvsignore:
|
||||
* tests/examples/xml/Makefile.am:
|
||||
* tests/examples/xml/createxml.c: (object_saved), (main):
|
||||
* tests/examples/xml/runxml.c: (xml_loaded), (event_loop), (main):
|
||||
* tests/old/examples/Makefile.am:
|
||||
* tests/old/examples/TODO:
|
||||
* tests/old/examples/controller/.cvsignore:
|
||||
* tests/old/examples/controller/Makefile.am:
|
||||
* tests/old/examples/controller/audio-example.c:
|
||||
* tests/old/examples/helloworld/.cvsignore:
|
||||
* tests/old/examples/helloworld/Makefile.am:
|
||||
* tests/old/examples/helloworld/helloworld.c:
|
||||
* tests/old/examples/launch/.cvsignore:
|
||||
* tests/old/examples/launch/Makefile.am:
|
||||
* tests/old/examples/launch/mp3parselaunch.c:
|
||||
* tests/old/examples/launch/mp3play:
|
||||
* tests/old/examples/manual/Makefile.am:
|
||||
* tests/old/examples/metadata/Makefile.am:
|
||||
* tests/old/examples/metadata/read-metadata.c:
|
||||
* tests/old/examples/queue/.cvsignore:
|
||||
* tests/old/examples/queue/Makefile.am:
|
||||
* tests/old/examples/queue/queue.c:
|
||||
* tests/old/examples/typefind/.cvsignore:
|
||||
* tests/old/examples/typefind/Makefile.am:
|
||||
* tests/old/examples/typefind/typefind.c:
|
||||
* tests/old/examples/xml/.cvsignore:
|
||||
* tests/old/examples/xml/Makefile.am:
|
||||
* tests/old/examples/xml/createxml.c:
|
||||
* tests/old/examples/xml/runxml.c:
|
||||
applied some simple fixing to some examples
|
||||
re-enabled the working examples
|
||||
|
||||
2005-12-12 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/gstsegment.c: (gst_segment_init),
|
||||
|
|
23
configure.ac
23
configure.ac
|
@ -498,6 +498,29 @@ tests/Makefile
|
|||
tests/benchmarks/Makefile
|
||||
tests/check/Makefile
|
||||
tests/misc/Makefile
|
||||
tests/examples/Makefile
|
||||
tests/examples/controller/Makefile
|
||||
tests/examples/helloworld/Makefile
|
||||
tests/examples/launch/Makefile
|
||||
tests/examples/metadata/Makefile
|
||||
tests/examples/queue/Makefile
|
||||
tests/examples/typefind/Makefile
|
||||
tests/examples/xml/Makefile
|
||||
tests/old/examples/Makefile
|
||||
tests/old/examples/appreader/Makefile
|
||||
tests/old/examples/cutter/Makefile
|
||||
tests/old/examples/events/Makefile
|
||||
tests/old/examples/helloworld2/Makefile
|
||||
tests/old/examples/manual/Makefile
|
||||
tests/old/examples/mixer/Makefile
|
||||
tests/old/examples/pingpong/Makefile
|
||||
tests/old/examples/plugins/Makefile
|
||||
tests/old/examples/pwg/Makefile
|
||||
tests/old/examples/queue2/Makefile
|
||||
tests/old/examples/queue3/Makefile
|
||||
tests/old/examples/queue4/Makefile
|
||||
tests/old/examples/retag/Makefile
|
||||
tests/old/examples/thread/Makefile
|
||||
tools/Makefile
|
||||
common/Makefile
|
||||
common/m4/Makefile
|
||||
|
|
|
@ -1,21 +1,33 @@
|
|||
$Id$
|
||||
|
||||
- 4 new elements
|
||||
virtual-audiosink, virtual-videosink
|
||||
virtual-audiosrc, virtual-videosrc
|
||||
components
|
||||
================================================================================
|
||||
|
||||
- daemon process
|
||||
- is a gstreamer appliation
|
||||
- open physical sink, src elements
|
||||
- prepends an adder to sinks
|
||||
- appends an tee to sources
|
||||
|
||||
- 4 new elements
|
||||
- virtual-audiosink, virtual-videosink
|
||||
virtual-audiosrc, virtual-videosrc
|
||||
- virtual sinks establish a connection to the daemon
|
||||
- they link to request_pads of the adder/tee elements
|
||||
|
||||
- gui app
|
||||
- lists instances as mixing-desk like channelstrips
|
||||
- channelstrips would contain
|
||||
- audio
|
||||
- volume, panorama, 3-band eq
|
||||
- video
|
||||
- brightness, contrast, alpha-level
|
||||
- user can
|
||||
- add insert-fx
|
||||
- route channel to targets, where targets can be real sinks or more
|
||||
virtual-sinks (sub-groups)
|
||||
- virtual sinks need queues to decouple application processes
|
||||
|
||||
- daemon that holds list of instances
|
||||
- gui app that lists instances as mixing-desk like channelstrips
|
||||
- channelstrips would contain
|
||||
- audio
|
||||
- volume, panorama, 3-band eq
|
||||
- video
|
||||
- brightness, contrast, alpha-level
|
||||
- user can
|
||||
- add insert-fx
|
||||
- route channel to targets, where targets can be real sinks or more
|
||||
virtual-sinks (sub-groups)
|
||||
- virtual sinks need queues to decouple application processes
|
||||
- interfaces
|
||||
- expose child-elements via child-proxy
|
||||
- then e.g. the applications volume-control could directly access the
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
mp3play
|
||||
mp3parselaunch
|
||||
*.bb
|
||||
*.bbg
|
74
tests/examples/launch/mp3parselaunch.c
Normal file
74
tests/examples/launch/mp3parselaunch.c
Normal file
|
@ -0,0 +1,74 @@
|
|||
#include <stdlib.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
static void
|
||||
event_loop (GstElement * pipe)
|
||||
{
|
||||
GstBus *bus;
|
||||
GstMessage *message = NULL;
|
||||
|
||||
bus = gst_element_get_bus (GST_ELEMENT (pipe));
|
||||
|
||||
while (TRUE) {
|
||||
message = gst_bus_poll (bus, GST_MESSAGE_ANY, -1);
|
||||
|
||||
g_assert (message != NULL);
|
||||
|
||||
switch (message->type) {
|
||||
case GST_MESSAGE_EOS:
|
||||
gst_message_unref (message);
|
||||
return;
|
||||
case GST_MESSAGE_WARNING:
|
||||
case GST_MESSAGE_ERROR:{
|
||||
GError *gerror;
|
||||
gchar *debug;
|
||||
|
||||
gst_message_parse_error (message, &gerror, &debug);
|
||||
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
|
||||
gst_message_unref (message);
|
||||
g_error_free (gerror);
|
||||
g_free (debug);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
gst_message_unref (message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GstElement *bin;
|
||||
GstElement *filesrc;
|
||||
GError *error = NULL;
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
|
||||
if (argc != 2) {
|
||||
g_print ("usage: %s <mp3 file>\n", argv[0]);
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
bin = (GstElement *)
|
||||
gst_parse_launch ("filesrc name=my_filesrc ! mad ! osssink", &error);
|
||||
if (!bin) {
|
||||
fprintf (stderr, "Parse error: %s", error->message);
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
filesrc = gst_bin_get_by_name (GST_BIN (bin), "my_filesrc");
|
||||
g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
|
||||
|
||||
/* start playing */
|
||||
gst_element_set_state (bin, GST_STATE_PLAYING);
|
||||
|
||||
/* Run event loop listening for bus messages until EOS or ERROR */
|
||||
event_loop (bin);
|
||||
|
||||
/* stop the bin */
|
||||
gst_element_set_state (bin, GST_STATE_NULL);
|
||||
|
||||
exit (0);
|
||||
}
|
5
tests/examples/metadata/.gitignore
vendored
Normal file
5
tests/examples/metadata/.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
read-metadata
|
||||
*.bb
|
||||
*.bbg
|
||||
*.da
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
void
|
||||
static void
|
||||
type_found (GstElement * typefind, const GstCaps * caps)
|
||||
{
|
||||
xmlDocPtr doc;
|
||||
|
@ -16,6 +16,42 @@ type_found (GstElement * typefind, const GstCaps * caps)
|
|||
xmlDocDump (stdout, doc);
|
||||
}
|
||||
|
||||
static void
|
||||
event_loop (GstElement * pipe)
|
||||
{
|
||||
GstBus *bus;
|
||||
GstMessage *message = NULL;
|
||||
|
||||
bus = gst_element_get_bus (GST_ELEMENT (pipe));
|
||||
|
||||
while (TRUE) {
|
||||
message = gst_bus_poll (bus, GST_MESSAGE_ANY, -1);
|
||||
|
||||
g_assert (message != NULL);
|
||||
|
||||
switch (message->type) {
|
||||
case GST_MESSAGE_EOS:
|
||||
gst_message_unref (message);
|
||||
return;
|
||||
case GST_MESSAGE_WARNING:
|
||||
case GST_MESSAGE_ERROR:{
|
||||
GError *gerror;
|
||||
gchar *debug;
|
||||
|
||||
gst_message_parse_error (message, &gerror, &debug);
|
||||
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
|
||||
gst_message_unref (message);
|
||||
g_error_free (gerror);
|
||||
g_free (debug);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
gst_message_unref (message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
@ -50,11 +86,13 @@ main (int argc, char *argv[])
|
|||
gst_element_link (filesrc, typefind);
|
||||
|
||||
/* start playing */
|
||||
gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING);
|
||||
gst_element_set_state (bin, GST_STATE_PLAYING);
|
||||
|
||||
gst_bin_iterate (GST_BIN (bin));
|
||||
/* Run event loop listening for bus messages until EOS or ERROR */
|
||||
event_loop (bin);
|
||||
|
||||
gst_element_set_state (GST_ELEMENT (bin), GST_STATE_NULL);
|
||||
/* stop the bin */
|
||||
gst_element_set_state (bin, GST_STATE_NULL);
|
||||
|
||||
exit (0);
|
||||
}
|
101
tests/examples/xml/runxml.c
Normal file
101
tests/examples/xml/runxml.c
Normal file
|
@ -0,0 +1,101 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
gboolean playing;
|
||||
|
||||
G_GNUC_UNUSED static void
|
||||
xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
|
||||
{
|
||||
xmlNodePtr children = self->xmlChildrenNode;
|
||||
|
||||
while (children) {
|
||||
if (!strcmp (children->name, "comment")) {
|
||||
xmlNodePtr nodes = children->xmlChildrenNode;
|
||||
|
||||
while (nodes) {
|
||||
if (!strcmp (nodes->name, "text")) {
|
||||
gchar *name = g_strdup (xmlNodeGetContent (nodes));
|
||||
|
||||
g_print ("object %s loaded with comment '%s'\n",
|
||||
gst_object_get_name (object), name);
|
||||
}
|
||||
nodes = nodes->next;
|
||||
}
|
||||
}
|
||||
children = children->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
event_loop (GstElement * pipe)
|
||||
{
|
||||
GstBus *bus;
|
||||
GstMessage *message = NULL;
|
||||
|
||||
bus = gst_element_get_bus (GST_ELEMENT (pipe));
|
||||
|
||||
while (TRUE) {
|
||||
message = gst_bus_poll (bus, GST_MESSAGE_ANY, -1);
|
||||
|
||||
g_assert (message != NULL);
|
||||
|
||||
switch (message->type) {
|
||||
case GST_MESSAGE_EOS:
|
||||
gst_message_unref (message);
|
||||
return;
|
||||
case GST_MESSAGE_WARNING:
|
||||
case GST_MESSAGE_ERROR:{
|
||||
GError *gerror;
|
||||
gchar *debug;
|
||||
|
||||
gst_message_parse_error (message, &gerror, &debug);
|
||||
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
|
||||
gst_message_unref (message);
|
||||
g_error_free (gerror);
|
||||
g_free (debug);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
gst_message_unref (message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GstXML *xml;
|
||||
GstElement *bin;
|
||||
gboolean ret;
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
|
||||
if (argc != 2) {
|
||||
g_print ("usage: %s <xml pipeline description>\n", argv[0]);
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
xml = gst_xml_new ();
|
||||
|
||||
/* g_signal_connect (G_OBJECT (xml), "object_loaded", */
|
||||
/* G_CALLBACK (xml_loaded), xml); */
|
||||
|
||||
ret = gst_xml_parse_file (xml, argv[1], NULL);
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
bin = gst_xml_get_element (xml, "pipeline");
|
||||
g_assert (bin != NULL);
|
||||
|
||||
/* start playing */
|
||||
gst_element_set_state (bin, GST_STATE_PLAYING);
|
||||
|
||||
/* Run event loop listening for bus messages until EOS or ERROR */
|
||||
event_loop (bin);
|
||||
|
||||
/* stop the bin */
|
||||
gst_element_set_state (bin, GST_STATE_NULL);
|
||||
|
||||
exit (0);
|
||||
}
|
|
@ -1,29 +1,23 @@
|
|||
if GST_DISABLE_LOADSAVE
|
||||
GST_LOADSAVE_DIRS =
|
||||
else
|
||||
GST_LOADSAVE_DIRS = xml typefind
|
||||
endif
|
||||
# these example currently don't build (see TODO)
|
||||
|
||||
dirs = \
|
||||
helloworld \
|
||||
queue \
|
||||
launch \
|
||||
thread \
|
||||
plugins \
|
||||
mixer \
|
||||
metadata \
|
||||
controller \
|
||||
cutter \
|
||||
pingpong \
|
||||
manual \
|
||||
pwg \
|
||||
retag
|
||||
dirs =
|
||||
|
||||
#queue2 \
|
||||
#queue3 \
|
||||
#queue4
|
||||
#appreader
|
||||
#cutter
|
||||
#events
|
||||
#helloworld2
|
||||
#launch
|
||||
#manual
|
||||
#mixer
|
||||
#pingpong
|
||||
#plugins
|
||||
#pwg
|
||||
#queue2
|
||||
#queue3
|
||||
#queue4
|
||||
#retag
|
||||
#thread
|
||||
|
||||
SUBDIRS = $(dirs) \
|
||||
$(GST_LOADSAVE_DIRS)
|
||||
SUBDIRS = $(dirs)
|
||||
|
||||
DIST_SUBDIRS = $(dirs) xml typefind
|
||||
DIST_SUBDIRS = $(dirs)
|
||||
|
|
66
tests/old/examples/TODO
Normal file
66
tests/old/examples/TODO
Normal file
|
@ -0,0 +1,66 @@
|
|||
state of the examples:
|
||||
|
||||
appreader
|
||||
controller
|
||||
okay
|
||||
cutter
|
||||
events
|
||||
helloworld
|
||||
helloworld2
|
||||
manual
|
||||
metadata
|
||||
mixer
|
||||
pingpong
|
||||
plugins
|
||||
pwg
|
||||
queue
|
||||
queue2
|
||||
queue3
|
||||
queue4
|
||||
retag
|
||||
typefind
|
||||
xml
|
||||
|
||||
----
|
||||
|
||||
appreader
|
||||
gst_bin_iterate
|
||||
|
||||
cutter
|
||||
gst_bin_iterate
|
||||
|
||||
events
|
||||
gst_bin_iterate
|
||||
gst_event_new_seek
|
||||
gst_event_new_flush
|
||||
|
||||
helloworld
|
||||
GstAutoplug
|
||||
|
||||
manual
|
||||
dynamic
|
||||
gst_registry_pool_feature_filter
|
||||
|
||||
mixer
|
||||
gst_bin_iterate
|
||||
gst_scheduler_show
|
||||
gst_element_add_ghost_pad
|
||||
|
||||
pingpong
|
||||
gst_bin_iterate
|
||||
gst_element_add_ghost_pad
|
||||
gst_element_default_deep_notify
|
||||
|
||||
plugins
|
||||
lots of errors
|
||||
|
||||
pwg
|
||||
lots of errors
|
||||
|
||||
retag
|
||||
gst_tag_setter_
|
||||
gst_bin_iterate
|
||||
|
||||
thread
|
||||
obsolete, uses gst_thread_new
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#include <stdlib.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GstElement *pipeline;
|
||||
GstElement *filesrc;
|
||||
GError *error = NULL;
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
|
||||
if (argc != 2) {
|
||||
g_print ("usage: %s <filename>\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pipeline = (GstElement *)
|
||||
gst_parse_launch ("filesrc name=my_filesrc ! mad ! osssink", &error);
|
||||
if (!pipeline) {
|
||||
fprintf (stderr, "Parse error: %s", error->message);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "my_filesrc");
|
||||
g_object_set (G_OBJECT (filesrc), "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);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
#! /bin/sh
|
||||
for loc in "$@"; do
|
||||
../../tools/gst-launch filesrc location="$loc" ! mp3parse ! mad ! osssink
|
||||
done
|
|
@ -94,7 +94,7 @@ xml-mp3.c: $(top_srcdir)/docs/manual/highlevel-xml.xml
|
|||
|
||||
# we use some of the examples as testsuite apps, to verify that
|
||||
# they actually run
|
||||
include $(top_srcdir)/testsuite/Rules
|
||||
include $(top_srcdir)/tests/old/testsuite/Rules
|
||||
|
||||
tests_pass = elementmake elementget init goption
|
||||
tests_fail =
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
gboolean playing;
|
||||
|
||||
G_GNUC_UNUSED static void
|
||||
xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
|
||||
{
|
||||
xmlNodePtr children = self->xmlChildrenNode;
|
||||
|
||||
while (children) {
|
||||
if (!strcmp (children->name, "comment")) {
|
||||
xmlNodePtr nodes = children->xmlChildrenNode;
|
||||
|
||||
while (nodes) {
|
||||
if (!strcmp (nodes->name, "text")) {
|
||||
gchar *name = g_strdup (xmlNodeGetContent (nodes));
|
||||
|
||||
g_print ("object %s loaded with comment '%s'\n",
|
||||
gst_object_get_name (object), name);
|
||||
}
|
||||
nodes = nodes->next;
|
||||
}
|
||||
}
|
||||
children = children->next;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GstXML *xml;
|
||||
GstElement *pipeline;
|
||||
gboolean ret;
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
|
||||
xml = gst_xml_new ();
|
||||
|
||||
/* g_signal_connect (G_OBJECT (xml), "object_loaded", */
|
||||
/* G_CALLBACK (xml_loaded), xml); */
|
||||
|
||||
if (argc == 2)
|
||||
ret = gst_xml_parse_file (xml, argv[1], NULL);
|
||||
else
|
||||
ret = gst_xml_parse_file (xml, "xmlTest.gst", NULL);
|
||||
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
pipeline = gst_xml_get_element (xml, "pipeline");
|
||||
g_assert (pipeline != NULL);
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
|
||||
while (gst_bin_iterate (GST_BIN (pipeline)));
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||
|
||||
exit (0);
|
||||
}
|
Loading…
Reference in a new issue