mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
d6386e096a
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).
61 lines
1.4 KiB
C
61 lines
1.4 KiB
C
#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 ((char *) children->name, "comment")) {
|
|
xmlNodePtr nodes = children->xmlChildrenNode;
|
|
|
|
while (nodes) {
|
|
if (!strcmp ((char *) nodes->name, "text")) {
|
|
gchar *name = g_strdup ((char *) 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, (guchar *) argv[1], NULL);
|
|
else
|
|
ret = gst_xml_parse_file (xml, (guchar *) "xmlTest.gst", NULL);
|
|
|
|
g_assert (ret == TRUE);
|
|
|
|
pipeline = gst_xml_get_element (xml, (guchar *) "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);
|
|
}
|