2001-12-13 19:00:58 +00:00
|
|
|
#include <string.h>
|
2001-01-01 00:42:10 +00:00
|
|
|
#include <stdlib.h>
|
2000-09-24 22:45:48 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
gboolean playing;
|
|
|
|
|
2002-04-07 23:32:16 +00:00
|
|
|
G_GNUC_UNUSED static void
|
2004-03-13 15:27:01 +00:00
|
|
|
xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
|
2000-09-24 22:45:48 +00:00
|
|
|
{
|
2001-01-30 23:53:04 +00:00
|
|
|
xmlNodePtr children = self->xmlChildrenNode;
|
|
|
|
|
|
|
|
while (children) {
|
More GCC4 warning fixes. Basically all libxml-guchar* to sane-gchar* casts (and reverse).
Original commit message from CVS:
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* examples/typefind/typefind.c: (type_found):
* examples/xml/createxml.c: (object_saved):
* examples/xml/runxml.c: (xml_loaded), (main):
* gst/elements/gstaggregator.c: (gst_aggregator_loop),
(gst_aggregator_chain):
* gst/elements/gstmd5sink.c: (gst_md5sink_get_property):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_handle_event):
* gst/gsttrace.c: (gst_trace_flush), (gst_trace_text_flush):
* gst/gstxml.c: (gst_xml_write), (gst_xml_parse_doc),
(gst_xml_parse_file), (gst_xml_parse_memory),
(gst_xml_get_element), (gst_xml_make_element):
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(_file_index_id_save_xml), (gst_file_index_commit):
* gst/schedulers/gstoptimalscheduler.c:
(group_inc_links_for_element):
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_caps),
(gst_dp_packet_from_event), (gst_dp_caps_from_packet):
* tools/gst-complete.c: (main):
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_element_properties_info):
* tools/gst-launch.c: (xmllaunch_parse_cmdline):
* tools/gst-xmlinspect.c: (print_element_properties):
More GCC4 warning fixes. Basically all libxml-guchar* to
sane-gchar* casts (and reverse).
2005-04-22 12:30:01 +00:00
|
|
|
if (!strcmp ((char *) children->name, "comment")) {
|
2001-01-30 23:53:04 +00:00
|
|
|
xmlNodePtr nodes = children->xmlChildrenNode;
|
|
|
|
|
|
|
|
while (nodes) {
|
More GCC4 warning fixes. Basically all libxml-guchar* to sane-gchar* casts (and reverse).
Original commit message from CVS:
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* examples/typefind/typefind.c: (type_found):
* examples/xml/createxml.c: (object_saved):
* examples/xml/runxml.c: (xml_loaded), (main):
* gst/elements/gstaggregator.c: (gst_aggregator_loop),
(gst_aggregator_chain):
* gst/elements/gstmd5sink.c: (gst_md5sink_get_property):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_handle_event):
* gst/gsttrace.c: (gst_trace_flush), (gst_trace_text_flush):
* gst/gstxml.c: (gst_xml_write), (gst_xml_parse_doc),
(gst_xml_parse_file), (gst_xml_parse_memory),
(gst_xml_get_element), (gst_xml_make_element):
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(_file_index_id_save_xml), (gst_file_index_commit):
* gst/schedulers/gstoptimalscheduler.c:
(group_inc_links_for_element):
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_caps),
(gst_dp_packet_from_event), (gst_dp_caps_from_packet):
* tools/gst-complete.c: (main):
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_element_properties_info):
* tools/gst-launch.c: (xmllaunch_parse_cmdline):
* tools/gst-xmlinspect.c: (print_element_properties):
More GCC4 warning fixes. Basically all libxml-guchar* to
sane-gchar* casts (and reverse).
2005-04-22 12:30:01 +00:00
|
|
|
if (!strcmp ((char *) nodes->name, "text")) {
|
|
|
|
gchar *name = g_strdup ((char *) xmlNodeGetContent (nodes));
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2004-03-15 19:27:17 +00:00
|
|
|
g_print ("object %s loaded with comment '%s'\n",
|
|
|
|
gst_object_get_name (object), name);
|
|
|
|
}
|
|
|
|
nodes = nodes->next;
|
2001-01-30 23:53:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
children = children->next;
|
2001-01-29 00:06:02 +00:00
|
|
|
}
|
2000-09-24 22:45:48 +00:00
|
|
|
}
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
2000-09-24 22:45:48 +00:00
|
|
|
{
|
|
|
|
GstXML *xml;
|
2002-01-11 15:49:47 +00:00
|
|
|
GstElement *pipeline;
|
2001-01-29 00:06:02 +00:00
|
|
|
gboolean ret;
|
2000-09-24 22:45:48 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_init (&argc, &argv);
|
2000-09-24 22:45:48 +00:00
|
|
|
|
2001-01-29 00:06:02 +00:00
|
|
|
xml = gst_xml_new ();
|
|
|
|
|
2002-03-19 04:10:13 +00:00
|
|
|
/* g_signal_connect (G_OBJECT (xml), "object_loaded", */
|
|
|
|
/* G_CALLBACK (xml_loaded), xml); */
|
2001-01-29 00:06:02 +00:00
|
|
|
|
2002-01-11 17:23:49 +00:00
|
|
|
if (argc == 2)
|
More GCC4 warning fixes. Basically all libxml-guchar* to sane-gchar* casts (and reverse).
Original commit message from CVS:
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* examples/typefind/typefind.c: (type_found):
* examples/xml/createxml.c: (object_saved):
* examples/xml/runxml.c: (xml_loaded), (main):
* gst/elements/gstaggregator.c: (gst_aggregator_loop),
(gst_aggregator_chain):
* gst/elements/gstmd5sink.c: (gst_md5sink_get_property):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_handle_event):
* gst/gsttrace.c: (gst_trace_flush), (gst_trace_text_flush):
* gst/gstxml.c: (gst_xml_write), (gst_xml_parse_doc),
(gst_xml_parse_file), (gst_xml_parse_memory),
(gst_xml_get_element), (gst_xml_make_element):
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(_file_index_id_save_xml), (gst_file_index_commit):
* gst/schedulers/gstoptimalscheduler.c:
(group_inc_links_for_element):
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_caps),
(gst_dp_packet_from_event), (gst_dp_caps_from_packet):
* tools/gst-complete.c: (main):
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_element_properties_info):
* tools/gst-launch.c: (xmllaunch_parse_cmdline):
* tools/gst-xmlinspect.c: (print_element_properties):
More GCC4 warning fixes. Basically all libxml-guchar* to
sane-gchar* casts (and reverse).
2005-04-22 12:30:01 +00:00
|
|
|
ret = gst_xml_parse_file (xml, (guchar *) argv[1], NULL);
|
2002-01-11 17:23:49 +00:00
|
|
|
else
|
More GCC4 warning fixes. Basically all libxml-guchar* to sane-gchar* casts (and reverse).
Original commit message from CVS:
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* examples/typefind/typefind.c: (type_found):
* examples/xml/createxml.c: (object_saved):
* examples/xml/runxml.c: (xml_loaded), (main):
* gst/elements/gstaggregator.c: (gst_aggregator_loop),
(gst_aggregator_chain):
* gst/elements/gstmd5sink.c: (gst_md5sink_get_property):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_handle_event):
* gst/gsttrace.c: (gst_trace_flush), (gst_trace_text_flush):
* gst/gstxml.c: (gst_xml_write), (gst_xml_parse_doc),
(gst_xml_parse_file), (gst_xml_parse_memory),
(gst_xml_get_element), (gst_xml_make_element):
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(_file_index_id_save_xml), (gst_file_index_commit):
* gst/schedulers/gstoptimalscheduler.c:
(group_inc_links_for_element):
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_caps),
(gst_dp_packet_from_event), (gst_dp_caps_from_packet):
* tools/gst-complete.c: (main):
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_element_properties_info):
* tools/gst-launch.c: (xmllaunch_parse_cmdline):
* tools/gst-xmlinspect.c: (print_element_properties):
More GCC4 warning fixes. Basically all libxml-guchar* to
sane-gchar* casts (and reverse).
2005-04-22 12:30:01 +00:00
|
|
|
ret = gst_xml_parse_file (xml, (guchar *) "xmlTest.gst", NULL);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2001-01-29 00:06:02 +00:00
|
|
|
g_assert (ret == TRUE);
|
2000-09-24 22:45:48 +00:00
|
|
|
|
More GCC4 warning fixes. Basically all libxml-guchar* to sane-gchar* casts (and reverse).
Original commit message from CVS:
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* examples/typefind/typefind.c: (type_found):
* examples/xml/createxml.c: (object_saved):
* examples/xml/runxml.c: (xml_loaded), (main):
* gst/elements/gstaggregator.c: (gst_aggregator_loop),
(gst_aggregator_chain):
* gst/elements/gstmd5sink.c: (gst_md5sink_get_property):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_handle_event):
* gst/gsttrace.c: (gst_trace_flush), (gst_trace_text_flush):
* gst/gstxml.c: (gst_xml_write), (gst_xml_parse_doc),
(gst_xml_parse_file), (gst_xml_parse_memory),
(gst_xml_get_element), (gst_xml_make_element):
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(_file_index_id_save_xml), (gst_file_index_commit):
* gst/schedulers/gstoptimalscheduler.c:
(group_inc_links_for_element):
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_caps),
(gst_dp_packet_from_event), (gst_dp_caps_from_packet):
* tools/gst-complete.c: (main):
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_element_properties_info):
* tools/gst-launch.c: (xmllaunch_parse_cmdline):
* tools/gst-xmlinspect.c: (print_element_properties):
More GCC4 warning fixes. Basically all libxml-guchar* to
sane-gchar* casts (and reverse).
2005-04-22 12:30:01 +00:00
|
|
|
pipeline = gst_xml_get_element (xml, (guchar *) "pipeline");
|
2002-01-11 15:49:47 +00:00
|
|
|
g_assert (pipeline != NULL);
|
2001-01-29 00:06:02 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
2000-09-24 22:45:48 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
while (gst_bin_iterate (GST_BIN (pipeline)));
|
2000-09-24 22:45:48 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
2000-09-24 22:45:48 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
exit (0);
|
2000-09-24 22:45:48 +00:00
|
|
|
}
|