mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +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).
This commit is contained in:
parent
976b3b565d
commit
d6386e096a
24 changed files with 212 additions and 143 deletions
30
ChangeLog
30
ChangeLog
|
@ -1,3 +1,33 @@
|
||||||
|
2005-04-22 Kjartan Maraas <kmaraas@gnome.org>
|
||||||
|
|
||||||
|
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 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
2005-04-22 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* gst/gstpad.c: (gst_pad_event_default):
|
* gst/gstpad.c: (gst_pad_event_default):
|
||||||
|
|
|
@ -6,10 +6,10 @@ type_found (GstElement * typefind, const GstCaps * caps)
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
xmlNodePtr parent;
|
xmlNodePtr parent;
|
||||||
|
|
||||||
doc = xmlNewDoc ("1.0");
|
doc = xmlNewDoc ((guchar *) "1.0");
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
|
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "Capabilities", NULL);
|
||||||
|
|
||||||
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
|
parent = xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "Caps1", NULL);
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
//gst_caps_save_thyself (caps, parent);
|
//gst_caps_save_thyself (caps, parent);
|
||||||
|
|
||||||
|
|
|
@ -11,16 +11,17 @@ object_saved (GstObject * object, xmlNodePtr parent, gpointer data)
|
||||||
|
|
||||||
/* first see if the namespace is already known */
|
/* first see if the namespace is already known */
|
||||||
ns = xmlSearchNsByHref (parent->doc, parent,
|
ns = xmlSearchNsByHref (parent->doc, parent,
|
||||||
"http://gstreamer.net/gst-test/1.0/");
|
(guchar *) "http://gstreamer.net/gst-test/1.0/");
|
||||||
if (ns == NULL) {
|
if (ns == NULL) {
|
||||||
xmlNodePtr root = xmlDocGetRootElement (parent->doc);
|
xmlNodePtr root = xmlDocGetRootElement (parent->doc);
|
||||||
|
|
||||||
/* add namespace to root node */
|
/* add namespace to root node */
|
||||||
ns = xmlNewNs (root, "http://gstreamer.net/gst-test/1.0/", "test");
|
ns = xmlNewNs (root, (guchar *) "http://gstreamer.net/gst-test/1.0/",
|
||||||
|
(guchar *) "test");
|
||||||
}
|
}
|
||||||
child = xmlNewChild (parent, ns, "comment", NULL);
|
child = xmlNewChild (parent, ns, (guchar *) "comment", NULL);
|
||||||
|
|
||||||
xmlNewChild (child, NULL, "text", (gchar *) data);
|
xmlNewChild (child, NULL, (guchar *) "text", (guchar *) data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -10,12 +10,12 @@ xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
|
||||||
xmlNodePtr children = self->xmlChildrenNode;
|
xmlNodePtr children = self->xmlChildrenNode;
|
||||||
|
|
||||||
while (children) {
|
while (children) {
|
||||||
if (!strcmp (children->name, "comment")) {
|
if (!strcmp ((char *) children->name, "comment")) {
|
||||||
xmlNodePtr nodes = children->xmlChildrenNode;
|
xmlNodePtr nodes = children->xmlChildrenNode;
|
||||||
|
|
||||||
while (nodes) {
|
while (nodes) {
|
||||||
if (!strcmp (nodes->name, "text")) {
|
if (!strcmp ((char *) nodes->name, "text")) {
|
||||||
gchar *name = g_strdup (xmlNodeGetContent (nodes));
|
gchar *name = g_strdup ((char *) xmlNodeGetContent (nodes));
|
||||||
|
|
||||||
g_print ("object %s loaded with comment '%s'\n",
|
g_print ("object %s loaded with comment '%s'\n",
|
||||||
gst_object_get_name (object), name);
|
gst_object_get_name (object), name);
|
||||||
|
@ -42,13 +42,13 @@ main (int argc, char *argv[])
|
||||||
/* G_CALLBACK (xml_loaded), xml); */
|
/* G_CALLBACK (xml_loaded), xml); */
|
||||||
|
|
||||||
if (argc == 2)
|
if (argc == 2)
|
||||||
ret = gst_xml_parse_file (xml, argv[1], NULL);
|
ret = gst_xml_parse_file (xml, (guchar *) argv[1], NULL);
|
||||||
else
|
else
|
||||||
ret = gst_xml_parse_file (xml, "xmlTest.gst", NULL);
|
ret = gst_xml_parse_file (xml, (guchar *) "xmlTest.gst", NULL);
|
||||||
|
|
||||||
g_assert (ret == TRUE);
|
g_assert (ret == TRUE);
|
||||||
|
|
||||||
pipeline = gst_xml_get_element (xml, "pipeline");
|
pipeline = gst_xml_get_element (xml, (guchar *) "pipeline");
|
||||||
g_assert (pipeline != NULL);
|
g_assert (pipeline != NULL);
|
||||||
|
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
|
|
|
@ -333,7 +333,7 @@ gst_aggregator_loop (GstElement * element)
|
||||||
*/
|
*/
|
||||||
if (GST_PAD_IS_USABLE (pad)) {
|
if (GST_PAD_IS_USABLE (pad)) {
|
||||||
buf = GST_BUFFER (gst_pad_pull (pad));
|
buf = GST_BUFFER (gst_pad_pull (pad));
|
||||||
debug = "loop";
|
debug = (guchar *) "loop";
|
||||||
|
|
||||||
/* then push it forward */
|
/* then push it forward */
|
||||||
gst_aggregator_push (aggregator, pad, buf, debug);
|
gst_aggregator_push (aggregator, pad, buf, debug);
|
||||||
|
@ -343,7 +343,7 @@ gst_aggregator_loop (GstElement * element)
|
||||||
if (aggregator->sched == AGGREGATOR_LOOP_SELECT) {
|
if (aggregator->sched == AGGREGATOR_LOOP_SELECT) {
|
||||||
GstPad *pad;
|
GstPad *pad;
|
||||||
|
|
||||||
debug = "loop_select";
|
debug = (guchar *) "loop_select";
|
||||||
|
|
||||||
buf = GST_BUFFER (gst_pad_collectv (&pad, aggregator->sinkpads));
|
buf = GST_BUFFER (gst_pad_collectv (&pad, aggregator->sinkpads));
|
||||||
|
|
||||||
|
@ -374,5 +374,5 @@ gst_aggregator_chain (GstPad * pad, GstData * _data)
|
||||||
aggregator = GST_AGGREGATOR (gst_pad_get_parent (pad));
|
aggregator = GST_AGGREGATOR (gst_pad_get_parent (pad));
|
||||||
/* gst_trace_add_entry (NULL, 0, buf, "aggregator buffer");*/
|
/* gst_trace_add_entry (NULL, 0, buf, "aggregator buffer");*/
|
||||||
|
|
||||||
gst_aggregator_push (aggregator, pad, buf, "chain");
|
gst_aggregator_push (aggregator, pad, buf, (guchar *) "chain");
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,7 +464,7 @@ gst_md5sink_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
* md5_read_ctx (sink, sink->md5); */
|
* md5_read_ctx (sink, sink->md5); */
|
||||||
/* md5 is a guchar[16] */
|
/* md5 is a guchar[16] */
|
||||||
int i;
|
int i;
|
||||||
guchar *md5string = g_malloc0 (33);
|
gchar *md5string = g_malloc0 (33);
|
||||||
|
|
||||||
for (i = 0; i < 16; ++i)
|
for (i = 0; i < 16; ++i)
|
||||||
sprintf (md5string + i * 2, "%02x", sink->md5[i]);
|
sprintf (md5string + i * 2, "%02x", sink->md5[i]);
|
||||||
|
|
|
@ -455,7 +455,7 @@ find_element_get_length (gpointer data)
|
||||||
if (entry->self->stream_length == 0) {
|
if (entry->self->stream_length == 0) {
|
||||||
typefind->stream_length_available =
|
typefind->stream_length_available =
|
||||||
gst_pad_query (GST_PAD_PEER (entry->self->sink), GST_QUERY_TOTAL,
|
gst_pad_query (GST_PAD_PEER (entry->self->sink), GST_QUERY_TOTAL,
|
||||||
&format, &entry->self->stream_length);
|
&format, (gint64 *) & entry->self->stream_length);
|
||||||
if (format != GST_FORMAT_BYTES)
|
if (format != GST_FORMAT_BYTES)
|
||||||
typefind->stream_length_available = FALSE;
|
typefind->stream_length_available = FALSE;
|
||||||
if (!typefind->stream_length_available) {
|
if (!typefind->stream_length_available) {
|
||||||
|
@ -517,7 +517,7 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
|
||||||
start_typefinding (typefind);
|
start_typefinding (typefind);
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
} else {
|
} else {
|
||||||
guint64 off;
|
gint64 off;
|
||||||
|
|
||||||
if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &off) &&
|
if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &off) &&
|
||||||
off == typefind->waiting_for_discont_offset) {
|
off == typefind->waiting_for_discont_offset) {
|
||||||
|
|
|
@ -105,13 +105,25 @@ gst_trace_destroy (GstTrace * trace)
|
||||||
void
|
void
|
||||||
gst_trace_flush (GstTrace * trace)
|
gst_trace_flush (GstTrace * trace)
|
||||||
{
|
{
|
||||||
|
gint to_write, written;
|
||||||
|
guint8 *ptr;
|
||||||
|
|
||||||
if (!trace) {
|
if (!trace) {
|
||||||
trace = _gst_trace_default;
|
trace = _gst_trace_default;
|
||||||
if (!trace)
|
if (!trace)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
write (trace->fd, trace->buf, trace->bufoffset * sizeof (GstTraceEntry));
|
to_write = trace->bufoffset * sizeof (GstTraceEntry);
|
||||||
|
ptr = (guint8 *) trace->buf;
|
||||||
|
while (to_write > 0) {
|
||||||
|
written = write (trace->fd, ptr, to_write);
|
||||||
|
if (written <= 0) {
|
||||||
|
GST_ERROR ("Trace flush failed");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
to_write -= written;
|
||||||
|
}
|
||||||
trace->bufoffset = 0;
|
trace->bufoffset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +133,7 @@ gst_trace_text_flush (GstTrace * trace)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#define STRSIZE (20 + 1 + 10 + 1 + 10 + 1 + 112 + 1 + 1)
|
#define STRSIZE (20 + 1 + 10 + 1 + 10 + 1 + 112 + 1 + 1)
|
||||||
char str[STRSIZE];
|
char str[STRSIZE], *ptr;
|
||||||
|
|
||||||
if (!trace) {
|
if (!trace) {
|
||||||
trace = _gst_trace_default;
|
trace = _gst_trace_default;
|
||||||
|
@ -130,10 +142,21 @@ gst_trace_text_flush (GstTrace * trace)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < trace->bufoffset; i++) {
|
for (i = 0; i < trace->bufoffset; i++) {
|
||||||
|
gint written, to_write;
|
||||||
|
|
||||||
g_snprintf (str, STRSIZE, "%20" G_GINT64_FORMAT " %10d %10d %s\n",
|
g_snprintf (str, STRSIZE, "%20" G_GINT64_FORMAT " %10d %10d %s\n",
|
||||||
trace->buf[i].timestamp,
|
trace->buf[i].timestamp,
|
||||||
trace->buf[i].sequence, trace->buf[i].data, trace->buf[i].message);
|
trace->buf[i].sequence, trace->buf[i].data, trace->buf[i].message);
|
||||||
write (trace->fd, str, strlen (str));
|
to_write = strlen (str);
|
||||||
|
ptr = str;
|
||||||
|
while (to_write > 0) {
|
||||||
|
written = write (trace->fd, ptr, to_write);
|
||||||
|
if (written <= 0) {
|
||||||
|
GST_ERROR ("Text flush failed");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
to_write -= written;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
trace->bufoffset = 0;
|
trace->bufoffset = 0;
|
||||||
#undef STRSIZE
|
#undef STRSIZE
|
||||||
|
|
33
gst/gstxml.c
33
gst/gstxml.c
|
@ -118,14 +118,16 @@ gst_xml_write (GstElement * element)
|
||||||
xmlNodePtr elementnode;
|
xmlNodePtr elementnode;
|
||||||
xmlNsPtr gst_ns;
|
xmlNsPtr gst_ns;
|
||||||
|
|
||||||
doc = xmlNewDoc ("1.0");
|
doc = xmlNewDoc ((guchar *) "1.0");
|
||||||
|
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "gstreamer", NULL);
|
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "gstreamer", NULL);
|
||||||
|
|
||||||
gst_ns =
|
gst_ns =
|
||||||
xmlNewNs (doc->xmlRootNode, "http://gstreamer.net/gst-core/1.0/", "gst");
|
xmlNewNs (doc->xmlRootNode,
|
||||||
|
(guchar *) "http://gstreamer.net/gst-core/1.0/", (guchar *) "gst");
|
||||||
|
|
||||||
elementnode = xmlNewChild (doc->xmlRootNode, gst_ns, "element", NULL);
|
elementnode =
|
||||||
|
xmlNewChild (doc->xmlRootNode, gst_ns, (guchar *) "element", NULL);
|
||||||
|
|
||||||
gst_object_save_thyself (GST_OBJECT (element), elementnode);
|
gst_object_save_thyself (GST_OBJECT (element), elementnode);
|
||||||
|
|
||||||
|
@ -218,12 +220,13 @@ gst_xml_parse_doc (GstXML * xml, xmlDocPtr doc, const guchar * root)
|
||||||
g_warning ("gstxml: empty document\n");
|
g_warning ("gstxml: empty document\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
ns = xmlSearchNsByHref (doc, cur, "http://gstreamer.net/gst-core/1.0/");
|
ns = xmlSearchNsByHref (doc, cur,
|
||||||
|
(guchar *) "http://gstreamer.net/gst-core/1.0/");
|
||||||
if (ns == NULL) {
|
if (ns == NULL) {
|
||||||
g_warning ("gstxml: document of wrong type, core namespace not found\n");
|
g_warning ("gstxml: document of wrong type, core namespace not found\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (strcmp (cur->name, "gstreamer")) {
|
if (strcmp ((char *) cur->name, "gstreamer")) {
|
||||||
g_warning ("gstxml: XML file is in wrong format\n");
|
g_warning ("gstxml: XML file is in wrong format\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -236,7 +239,7 @@ gst_xml_parse_doc (GstXML * xml, xmlDocPtr doc, const guchar * root)
|
||||||
field = cur->xmlChildrenNode;
|
field = cur->xmlChildrenNode;
|
||||||
|
|
||||||
while (field) {
|
while (field) {
|
||||||
if (!strcmp (field->name, "element") && (field->ns == xml->ns)) {
|
if (!strcmp ((char *) field->name, "element") && (field->ns == xml->ns)) {
|
||||||
GstElement *element;
|
GstElement *element;
|
||||||
|
|
||||||
element = gst_xml_make_element (field, NULL);
|
element = gst_xml_make_element (field, NULL);
|
||||||
|
@ -275,7 +278,7 @@ gst_xml_parse_file (GstXML * xml, const guchar * fname, const guchar * root)
|
||||||
|
|
||||||
g_return_val_if_fail (fname != NULL, FALSE);
|
g_return_val_if_fail (fname != NULL, FALSE);
|
||||||
|
|
||||||
doc = xmlParseFile (fname);
|
doc = xmlParseFile ((char *) fname);
|
||||||
|
|
||||||
if (!doc) {
|
if (!doc) {
|
||||||
g_warning ("gstxml: XML file \"%s\" could not be read\n", fname);
|
g_warning ("gstxml: XML file \"%s\" could not be read\n", fname);
|
||||||
|
@ -305,9 +308,9 @@ gst_xml_parse_memory (GstXML * xml, guchar * buffer, guint size,
|
||||||
|
|
||||||
g_return_val_if_fail (buffer != NULL, FALSE);
|
g_return_val_if_fail (buffer != NULL, FALSE);
|
||||||
|
|
||||||
doc = xmlParseMemory (buffer, size);
|
doc = xmlParseMemory ((char *) buffer, size);
|
||||||
|
|
||||||
return gst_xml_parse_doc (xml, doc, root);
|
return gst_xml_parse_doc (xml, doc, (const guchar *) root);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -365,11 +368,11 @@ gst_xml_get_element (GstXML * xml, const guchar * name)
|
||||||
GstElement *top = GST_ELEMENT (topelements->data);
|
GstElement *top = GST_ELEMENT (topelements->data);
|
||||||
|
|
||||||
GST_DEBUG ("gstxml: getting element \"%s\"", name);
|
GST_DEBUG ("gstxml: getting element \"%s\"", name);
|
||||||
if (!strcmp (GST_ELEMENT_NAME (top), name)) {
|
if (!strcmp ((char *) GST_ELEMENT_NAME (top), (char *) name)) {
|
||||||
return top;
|
return top;
|
||||||
} else {
|
} else {
|
||||||
if (GST_IS_BIN (top)) {
|
if (GST_IS_BIN (top)) {
|
||||||
element = gst_bin_get_by_name (GST_BIN (top), name);
|
element = gst_bin_get_by_name (GST_BIN (top), (char *) name);
|
||||||
|
|
||||||
if (element)
|
if (element)
|
||||||
return element;
|
return element;
|
||||||
|
@ -399,9 +402,9 @@ gst_xml_make_element (xmlNodePtr cur, GstObject * parent)
|
||||||
|
|
||||||
/* first get the needed tags to construct the element */
|
/* first get the needed tags to construct the element */
|
||||||
while (children) {
|
while (children) {
|
||||||
if (!strcmp (children->name, "name")) {
|
if (!strcmp ((char *) children->name, "name")) {
|
||||||
name = xmlNodeGetContent (children);
|
name = xmlNodeGetContent (children);
|
||||||
} else if (!strcmp (children->name, "type")) {
|
} else if (!strcmp ((char *) children->name, "type")) {
|
||||||
type = xmlNodeGetContent (children);
|
type = xmlNodeGetContent (children);
|
||||||
}
|
}
|
||||||
children = children->next;
|
children = children->next;
|
||||||
|
@ -411,7 +414,7 @@ gst_xml_make_element (xmlNodePtr cur, GstObject * parent)
|
||||||
|
|
||||||
GST_CAT_INFO (GST_CAT_XML, "loading \"%s\" of type \"%s\"", name, type);
|
GST_CAT_INFO (GST_CAT_XML, "loading \"%s\" of type \"%s\"", name, type);
|
||||||
|
|
||||||
element = gst_element_factory_make (type, name);
|
element = gst_element_factory_make ((char *) type, (char *) name);
|
||||||
|
|
||||||
g_return_val_if_fail (element != NULL, NULL);
|
g_return_val_if_fail (element != NULL, NULL);
|
||||||
|
|
||||||
|
|
|
@ -364,24 +364,24 @@ gst_file_index_load (GstFileIndex * index)
|
||||||
//xmlDocFormatDump (stderr, doc, TRUE);
|
//xmlDocFormatDump (stderr, doc, TRUE);
|
||||||
|
|
||||||
root = doc->xmlRootNode;
|
root = doc->xmlRootNode;
|
||||||
if (strcmp (root->name, "gstfileindex") != 0) {
|
if (strcmp ((char *) root->name, "gstfileindex") != 0) {
|
||||||
GST_ERROR_OBJECT (index, "root node isn't a gstfileindex");
|
GST_ERROR_OBJECT (index, "root node isn't a gstfileindex");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
val = xmlGetProp (root, "version");
|
val = xmlGetProp (root, (guchar *) "version");
|
||||||
if (!val || atoi (val) != 1) {
|
if (!val || atoi ((char *) val) != 1) {
|
||||||
GST_ERROR_OBJECT (index, "version != 1");
|
GST_ERROR_OBJECT (index, "version != 1");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
free (val);
|
free (val);
|
||||||
|
|
||||||
for (part = root->children; part; part = part->next) {
|
for (part = root->children; part; part = part->next) {
|
||||||
if (strcmp (part->name, "writers") == 0) {
|
if (strcmp ((char *) part->name, "writers") == 0) {
|
||||||
xmlNodePtr writer;
|
xmlNodePtr writer;
|
||||||
|
|
||||||
for (writer = part->children; writer; writer = writer->next) {
|
for (writer = part->children; writer; writer = writer->next) {
|
||||||
xmlChar *datafile = xmlGetProp (writer, "datafile");
|
xmlChar *datafile = xmlGetProp (writer, (guchar *) "datafile");
|
||||||
gchar *path = g_strdup_printf ("%s/%s", index->location, datafile);
|
gchar *path = g_strdup_printf ("%s/%s", index->location, datafile);
|
||||||
int fd;
|
int fd;
|
||||||
GstFileIndexId *id_index;
|
GstFileIndexId *id_index;
|
||||||
|
@ -400,22 +400,22 @@ gst_file_index_load (GstFileIndex * index)
|
||||||
}
|
}
|
||||||
|
|
||||||
id_index = g_new0 (GstFileIndexId, 1);
|
id_index = g_new0 (GstFileIndexId, 1);
|
||||||
id_index->id_desc = xmlGetProp (writer, "id");
|
id_index->id_desc = (char *) xmlGetProp (writer, (guchar *) "id");
|
||||||
|
|
||||||
for (wpart = writer->children; wpart; wpart = wpart->next) {
|
for (wpart = writer->children; wpart; wpart = wpart->next) {
|
||||||
if (strcmp (wpart->name, "formats") == 0) {
|
if (strcmp ((char *) wpart->name, "formats") == 0) {
|
||||||
xmlChar *count_str = xmlGetProp (wpart, "count");
|
xmlChar *count_str = xmlGetProp (wpart, (guchar *) "count");
|
||||||
gint fx = 0;
|
gint fx = 0;
|
||||||
xmlNodePtr format;
|
xmlNodePtr format;
|
||||||
|
|
||||||
id_index->nformats = atoi (count_str);
|
id_index->nformats = atoi ((char *) count_str);
|
||||||
free (count_str);
|
free (count_str);
|
||||||
|
|
||||||
id_index->format = g_new (GstFormat, id_index->nformats);
|
id_index->format = g_new (GstFormat, id_index->nformats);
|
||||||
|
|
||||||
for (format = wpart->children; format; format = format->next) {
|
for (format = wpart->children; format; format = format->next) {
|
||||||
xmlChar *nick = xmlGetProp (format, "nick");
|
xmlChar *nick = xmlGetProp (format, (guchar *) "nick");
|
||||||
GstFormat fmt = gst_format_get_by_nick (nick);
|
GstFormat fmt = gst_format_get_by_nick ((char *) nick);
|
||||||
|
|
||||||
if (fmt == GST_FORMAT_UNDEFINED)
|
if (fmt == GST_FORMAT_UNDEFINED)
|
||||||
GST_ERROR_OBJECT (index, "format '%s' undefined", nick);
|
GST_ERROR_OBJECT (index, "format '%s' undefined", nick);
|
||||||
|
@ -431,8 +431,8 @@ gst_file_index_load (GstFileIndex * index)
|
||||||
_fc_alloc_array (id_index);
|
_fc_alloc_array (id_index);
|
||||||
g_assert (id_index->array->data == NULL); /* little bit risky */
|
g_assert (id_index->array->data == NULL); /* little bit risky */
|
||||||
|
|
||||||
entries_str = xmlGetProp (writer, "entries");
|
entries_str = xmlGetProp (writer, (guchar *) "entries");
|
||||||
id_index->array->len = atoi (entries_str);
|
id_index->array->len = atoi ((char *) entries_str);
|
||||||
free (entries_str);
|
free (entries_str);
|
||||||
|
|
||||||
array_data =
|
array_data =
|
||||||
|
@ -505,22 +505,22 @@ _file_index_id_save_xml (gpointer _key, GstFileIndexId * ii, xmlNodePtr writers)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
writer = xmlNewChild (writers, NULL, "writer", NULL);
|
writer = xmlNewChild (writers, NULL, (guchar *) "writer", NULL);
|
||||||
xmlSetProp (writer, "id", ii->id_desc);
|
xmlSetProp (writer, (guchar *) "id", (guchar *) ii->id_desc);
|
||||||
g_snprintf (buf, bufsize, "%d", ii->array->len);
|
g_snprintf (buf, bufsize, "%d", ii->array->len);
|
||||||
xmlSetProp (writer, "entries", buf);
|
xmlSetProp (writer, (guchar *) "entries", (guchar *) buf);
|
||||||
g_snprintf (buf, bufsize, "%d", ii->id); /* any unique number is OK */
|
g_snprintf (buf, bufsize, "%d", ii->id); /* any unique number is OK */
|
||||||
xmlSetProp (writer, "datafile", buf);
|
xmlSetProp (writer, (guchar *) "datafile", (guchar *) buf);
|
||||||
|
|
||||||
formats = xmlNewChild (writer, NULL, "formats", NULL);
|
formats = xmlNewChild (writer, NULL, (guchar *) "formats", NULL);
|
||||||
g_snprintf (buf, bufsize, "%d", ii->nformats);
|
g_snprintf (buf, bufsize, "%d", ii->nformats);
|
||||||
xmlSetProp (formats, "count", buf);
|
xmlSetProp (formats, (guchar *) "count", (guchar *) buf);
|
||||||
|
|
||||||
for (xx = 0; xx < ii->nformats; xx++) {
|
for (xx = 0; xx < ii->nformats; xx++) {
|
||||||
xmlNodePtr format = xmlNewChild (formats, NULL, "format", NULL);
|
xmlNodePtr format = xmlNewChild (formats, NULL, (guchar *) "format", NULL);
|
||||||
const GstFormatDefinition *def = gst_format_get_details (ii->format[xx]);
|
const GstFormatDefinition *def = gst_format_get_details (ii->format[xx]);
|
||||||
|
|
||||||
xmlSetProp (format, "nick", def->nick);
|
xmlSetProp (format, (guchar *) "nick", (guchar *) def->nick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,11 +591,11 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
|
||||||
|
|
||||||
GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
|
GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
|
||||||
|
|
||||||
doc = xmlNewDoc ("1.0");
|
doc = xmlNewDoc ((guchar *) "1.0");
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "gstfileindex", NULL);
|
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "gstfileindex", NULL);
|
||||||
xmlSetProp (doc->xmlRootNode, "version", "1");
|
xmlSetProp (doc->xmlRootNode, (guchar *) "version", (guchar *) "1");
|
||||||
|
|
||||||
writers = xmlNewChild (doc->xmlRootNode, NULL, "writers", NULL);
|
writers = xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "writers", NULL);
|
||||||
g_hash_table_foreach (index->id_index,
|
g_hash_table_foreach (index->id_index,
|
||||||
(GHFunc) _file_index_id_save_xml, writers);
|
(GHFunc) _file_index_id_save_xml, writers);
|
||||||
|
|
||||||
|
@ -623,7 +623,7 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
|
||||||
int xmlsize;
|
int xmlsize;
|
||||||
|
|
||||||
xmlDocDumpMemory (doc, &xmlmem, &xmlsize);
|
xmlDocDumpMemory (doc, &xmlmem, &xmlsize);
|
||||||
g_io_channel_write_chars (tocfile, xmlmem, xmlsize, NULL, &err);
|
g_io_channel_write_chars (tocfile, (char *) xmlmem, xmlsize, NULL, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
GST_ERROR_OBJECT (index, "%s", err->message);
|
GST_ERROR_OBJECT (index, "%s", err->message);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2468,13 +2468,14 @@ group_inc_links_for_element (GstOptSchedulerGroup * group, GstElement * element)
|
||||||
pad = (GstPad *) l->data;
|
pad = (GstPad *) l->data;
|
||||||
if (GST_IS_REAL_PAD (pad) && GST_PAD_PEER (pad)) {
|
if (GST_IS_REAL_PAD (pad) && GST_PAD_PEER (pad)) {
|
||||||
get_group (GST_PAD_PARENT (GST_PAD_PEER (pad)), &peer_group);
|
get_group (GST_PAD_PARENT (GST_PAD_PEER (pad)), &peer_group);
|
||||||
if (peer_group && peer_group != group)
|
if (peer_group && peer_group != group) {
|
||||||
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC)
|
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC)
|
||||||
group_inc_link (group, peer_group);
|
group_inc_link (group, peer_group);
|
||||||
else
|
else
|
||||||
group_inc_link (peer_group, group);
|
group_inc_link (peer_group, group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -276,14 +276,14 @@ gst_dp_packet_from_caps (const GstCaps * caps, GstDPHeaderFlag flags,
|
||||||
|
|
||||||
crc = 0;
|
crc = 0;
|
||||||
if (flags & GST_DP_HEADER_FLAG_CRC_PAYLOAD) {
|
if (flags & GST_DP_HEADER_FLAG_CRC_PAYLOAD) {
|
||||||
crc = gst_dp_crc (string, strlen (string) + 1);
|
crc = gst_dp_crc ((guchar *) string, strlen (string) + 1);
|
||||||
}
|
}
|
||||||
GST_WRITE_UINT16_BE (h + 58, crc);
|
GST_WRITE_UINT16_BE (h + 58, crc);
|
||||||
|
|
||||||
GST_LOG ("created header from caps:");
|
GST_LOG ("created header from caps:");
|
||||||
gst_dp_dump_byte_array (h, GST_DP_HEADER_LENGTH);
|
gst_dp_dump_byte_array (h, GST_DP_HEADER_LENGTH);
|
||||||
*header = h;
|
*header = h;
|
||||||
*payload = string;
|
*payload = (guchar *) string;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ gst_dp_packet_from_event (const GstEvent * event, GstDPHeaderFlag flags,
|
||||||
crc = 0;
|
crc = 0;
|
||||||
/* events can have a NULL payload */
|
/* events can have a NULL payload */
|
||||||
if (*payload && flags & GST_DP_HEADER_FLAG_CRC_PAYLOAD) {
|
if (*payload && flags & GST_DP_HEADER_FLAG_CRC_PAYLOAD) {
|
||||||
crc = gst_dp_crc (*payload, strlen (*payload) + 1);
|
crc = gst_dp_crc (*payload, strlen ((char *) *payload) + 1);
|
||||||
}
|
}
|
||||||
GST_WRITE_UINT16_BE (h + 58, crc);
|
GST_WRITE_UINT16_BE (h + 58, crc);
|
||||||
|
|
||||||
|
@ -457,7 +457,7 @@ gst_dp_caps_from_packet (guint header_length, const guint8 * header,
|
||||||
g_return_val_if_fail (GST_DP_HEADER_PAYLOAD_TYPE (header) ==
|
g_return_val_if_fail (GST_DP_HEADER_PAYLOAD_TYPE (header) ==
|
||||||
GST_DP_PAYLOAD_CAPS, NULL);
|
GST_DP_PAYLOAD_CAPS, NULL);
|
||||||
|
|
||||||
string = payload;
|
string = (char *) payload;
|
||||||
caps = gst_caps_from_string (string);
|
caps = gst_caps_from_string (string);
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
|
@ -333,7 +333,7 @@ gst_aggregator_loop (GstElement * element)
|
||||||
*/
|
*/
|
||||||
if (GST_PAD_IS_USABLE (pad)) {
|
if (GST_PAD_IS_USABLE (pad)) {
|
||||||
buf = GST_BUFFER (gst_pad_pull (pad));
|
buf = GST_BUFFER (gst_pad_pull (pad));
|
||||||
debug = "loop";
|
debug = (guchar *) "loop";
|
||||||
|
|
||||||
/* then push it forward */
|
/* then push it forward */
|
||||||
gst_aggregator_push (aggregator, pad, buf, debug);
|
gst_aggregator_push (aggregator, pad, buf, debug);
|
||||||
|
@ -343,7 +343,7 @@ gst_aggregator_loop (GstElement * element)
|
||||||
if (aggregator->sched == AGGREGATOR_LOOP_SELECT) {
|
if (aggregator->sched == AGGREGATOR_LOOP_SELECT) {
|
||||||
GstPad *pad;
|
GstPad *pad;
|
||||||
|
|
||||||
debug = "loop_select";
|
debug = (guchar *) "loop_select";
|
||||||
|
|
||||||
buf = GST_BUFFER (gst_pad_collectv (&pad, aggregator->sinkpads));
|
buf = GST_BUFFER (gst_pad_collectv (&pad, aggregator->sinkpads));
|
||||||
|
|
||||||
|
@ -374,5 +374,5 @@ gst_aggregator_chain (GstPad * pad, GstData * _data)
|
||||||
aggregator = GST_AGGREGATOR (gst_pad_get_parent (pad));
|
aggregator = GST_AGGREGATOR (gst_pad_get_parent (pad));
|
||||||
/* gst_trace_add_entry (NULL, 0, buf, "aggregator buffer");*/
|
/* gst_trace_add_entry (NULL, 0, buf, "aggregator buffer");*/
|
||||||
|
|
||||||
gst_aggregator_push (aggregator, pad, buf, "chain");
|
gst_aggregator_push (aggregator, pad, buf, (guchar *) "chain");
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,7 +464,7 @@ gst_md5sink_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
* md5_read_ctx (sink, sink->md5); */
|
* md5_read_ctx (sink, sink->md5); */
|
||||||
/* md5 is a guchar[16] */
|
/* md5 is a guchar[16] */
|
||||||
int i;
|
int i;
|
||||||
guchar *md5string = g_malloc0 (33);
|
gchar *md5string = g_malloc0 (33);
|
||||||
|
|
||||||
for (i = 0; i < 16; ++i)
|
for (i = 0; i < 16; ++i)
|
||||||
sprintf (md5string + i * 2, "%02x", sink->md5[i]);
|
sprintf (md5string + i * 2, "%02x", sink->md5[i]);
|
||||||
|
|
|
@ -455,7 +455,7 @@ find_element_get_length (gpointer data)
|
||||||
if (entry->self->stream_length == 0) {
|
if (entry->self->stream_length == 0) {
|
||||||
typefind->stream_length_available =
|
typefind->stream_length_available =
|
||||||
gst_pad_query (GST_PAD_PEER (entry->self->sink), GST_QUERY_TOTAL,
|
gst_pad_query (GST_PAD_PEER (entry->self->sink), GST_QUERY_TOTAL,
|
||||||
&format, &entry->self->stream_length);
|
&format, (gint64 *) & entry->self->stream_length);
|
||||||
if (format != GST_FORMAT_BYTES)
|
if (format != GST_FORMAT_BYTES)
|
||||||
typefind->stream_length_available = FALSE;
|
typefind->stream_length_available = FALSE;
|
||||||
if (!typefind->stream_length_available) {
|
if (!typefind->stream_length_available) {
|
||||||
|
@ -517,7 +517,7 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
|
||||||
start_typefinding (typefind);
|
start_typefinding (typefind);
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
} else {
|
} else {
|
||||||
guint64 off;
|
gint64 off;
|
||||||
|
|
||||||
if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &off) &&
|
if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &off) &&
|
||||||
off == typefind->waiting_for_discont_offset) {
|
off == typefind->waiting_for_discont_offset) {
|
||||||
|
|
|
@ -364,24 +364,24 @@ gst_file_index_load (GstFileIndex * index)
|
||||||
//xmlDocFormatDump (stderr, doc, TRUE);
|
//xmlDocFormatDump (stderr, doc, TRUE);
|
||||||
|
|
||||||
root = doc->xmlRootNode;
|
root = doc->xmlRootNode;
|
||||||
if (strcmp (root->name, "gstfileindex") != 0) {
|
if (strcmp ((char *) root->name, "gstfileindex") != 0) {
|
||||||
GST_ERROR_OBJECT (index, "root node isn't a gstfileindex");
|
GST_ERROR_OBJECT (index, "root node isn't a gstfileindex");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
val = xmlGetProp (root, "version");
|
val = xmlGetProp (root, (guchar *) "version");
|
||||||
if (!val || atoi (val) != 1) {
|
if (!val || atoi ((char *) val) != 1) {
|
||||||
GST_ERROR_OBJECT (index, "version != 1");
|
GST_ERROR_OBJECT (index, "version != 1");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
free (val);
|
free (val);
|
||||||
|
|
||||||
for (part = root->children; part; part = part->next) {
|
for (part = root->children; part; part = part->next) {
|
||||||
if (strcmp (part->name, "writers") == 0) {
|
if (strcmp ((char *) part->name, "writers") == 0) {
|
||||||
xmlNodePtr writer;
|
xmlNodePtr writer;
|
||||||
|
|
||||||
for (writer = part->children; writer; writer = writer->next) {
|
for (writer = part->children; writer; writer = writer->next) {
|
||||||
xmlChar *datafile = xmlGetProp (writer, "datafile");
|
xmlChar *datafile = xmlGetProp (writer, (guchar *) "datafile");
|
||||||
gchar *path = g_strdup_printf ("%s/%s", index->location, datafile);
|
gchar *path = g_strdup_printf ("%s/%s", index->location, datafile);
|
||||||
int fd;
|
int fd;
|
||||||
GstFileIndexId *id_index;
|
GstFileIndexId *id_index;
|
||||||
|
@ -400,22 +400,22 @@ gst_file_index_load (GstFileIndex * index)
|
||||||
}
|
}
|
||||||
|
|
||||||
id_index = g_new0 (GstFileIndexId, 1);
|
id_index = g_new0 (GstFileIndexId, 1);
|
||||||
id_index->id_desc = xmlGetProp (writer, "id");
|
id_index->id_desc = (char *) xmlGetProp (writer, (guchar *) "id");
|
||||||
|
|
||||||
for (wpart = writer->children; wpart; wpart = wpart->next) {
|
for (wpart = writer->children; wpart; wpart = wpart->next) {
|
||||||
if (strcmp (wpart->name, "formats") == 0) {
|
if (strcmp ((char *) wpart->name, "formats") == 0) {
|
||||||
xmlChar *count_str = xmlGetProp (wpart, "count");
|
xmlChar *count_str = xmlGetProp (wpart, (guchar *) "count");
|
||||||
gint fx = 0;
|
gint fx = 0;
|
||||||
xmlNodePtr format;
|
xmlNodePtr format;
|
||||||
|
|
||||||
id_index->nformats = atoi (count_str);
|
id_index->nformats = atoi ((char *) count_str);
|
||||||
free (count_str);
|
free (count_str);
|
||||||
|
|
||||||
id_index->format = g_new (GstFormat, id_index->nformats);
|
id_index->format = g_new (GstFormat, id_index->nformats);
|
||||||
|
|
||||||
for (format = wpart->children; format; format = format->next) {
|
for (format = wpart->children; format; format = format->next) {
|
||||||
xmlChar *nick = xmlGetProp (format, "nick");
|
xmlChar *nick = xmlGetProp (format, (guchar *) "nick");
|
||||||
GstFormat fmt = gst_format_get_by_nick (nick);
|
GstFormat fmt = gst_format_get_by_nick ((char *) nick);
|
||||||
|
|
||||||
if (fmt == GST_FORMAT_UNDEFINED)
|
if (fmt == GST_FORMAT_UNDEFINED)
|
||||||
GST_ERROR_OBJECT (index, "format '%s' undefined", nick);
|
GST_ERROR_OBJECT (index, "format '%s' undefined", nick);
|
||||||
|
@ -431,8 +431,8 @@ gst_file_index_load (GstFileIndex * index)
|
||||||
_fc_alloc_array (id_index);
|
_fc_alloc_array (id_index);
|
||||||
g_assert (id_index->array->data == NULL); /* little bit risky */
|
g_assert (id_index->array->data == NULL); /* little bit risky */
|
||||||
|
|
||||||
entries_str = xmlGetProp (writer, "entries");
|
entries_str = xmlGetProp (writer, (guchar *) "entries");
|
||||||
id_index->array->len = atoi (entries_str);
|
id_index->array->len = atoi ((char *) entries_str);
|
||||||
free (entries_str);
|
free (entries_str);
|
||||||
|
|
||||||
array_data =
|
array_data =
|
||||||
|
@ -505,22 +505,22 @@ _file_index_id_save_xml (gpointer _key, GstFileIndexId * ii, xmlNodePtr writers)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
writer = xmlNewChild (writers, NULL, "writer", NULL);
|
writer = xmlNewChild (writers, NULL, (guchar *) "writer", NULL);
|
||||||
xmlSetProp (writer, "id", ii->id_desc);
|
xmlSetProp (writer, (guchar *) "id", (guchar *) ii->id_desc);
|
||||||
g_snprintf (buf, bufsize, "%d", ii->array->len);
|
g_snprintf (buf, bufsize, "%d", ii->array->len);
|
||||||
xmlSetProp (writer, "entries", buf);
|
xmlSetProp (writer, (guchar *) "entries", (guchar *) buf);
|
||||||
g_snprintf (buf, bufsize, "%d", ii->id); /* any unique number is OK */
|
g_snprintf (buf, bufsize, "%d", ii->id); /* any unique number is OK */
|
||||||
xmlSetProp (writer, "datafile", buf);
|
xmlSetProp (writer, (guchar *) "datafile", (guchar *) buf);
|
||||||
|
|
||||||
formats = xmlNewChild (writer, NULL, "formats", NULL);
|
formats = xmlNewChild (writer, NULL, (guchar *) "formats", NULL);
|
||||||
g_snprintf (buf, bufsize, "%d", ii->nformats);
|
g_snprintf (buf, bufsize, "%d", ii->nformats);
|
||||||
xmlSetProp (formats, "count", buf);
|
xmlSetProp (formats, (guchar *) "count", (guchar *) buf);
|
||||||
|
|
||||||
for (xx = 0; xx < ii->nformats; xx++) {
|
for (xx = 0; xx < ii->nformats; xx++) {
|
||||||
xmlNodePtr format = xmlNewChild (formats, NULL, "format", NULL);
|
xmlNodePtr format = xmlNewChild (formats, NULL, (guchar *) "format", NULL);
|
||||||
const GstFormatDefinition *def = gst_format_get_details (ii->format[xx]);
|
const GstFormatDefinition *def = gst_format_get_details (ii->format[xx]);
|
||||||
|
|
||||||
xmlSetProp (format, "nick", def->nick);
|
xmlSetProp (format, (guchar *) "nick", (guchar *) def->nick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,11 +591,11 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
|
||||||
|
|
||||||
GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
|
GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
|
||||||
|
|
||||||
doc = xmlNewDoc ("1.0");
|
doc = xmlNewDoc ((guchar *) "1.0");
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "gstfileindex", NULL);
|
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "gstfileindex", NULL);
|
||||||
xmlSetProp (doc->xmlRootNode, "version", "1");
|
xmlSetProp (doc->xmlRootNode, (guchar *) "version", (guchar *) "1");
|
||||||
|
|
||||||
writers = xmlNewChild (doc->xmlRootNode, NULL, "writers", NULL);
|
writers = xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "writers", NULL);
|
||||||
g_hash_table_foreach (index->id_index,
|
g_hash_table_foreach (index->id_index,
|
||||||
(GHFunc) _file_index_id_save_xml, writers);
|
(GHFunc) _file_index_id_save_xml, writers);
|
||||||
|
|
||||||
|
@ -623,7 +623,7 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
|
||||||
int xmlsize;
|
int xmlsize;
|
||||||
|
|
||||||
xmlDocDumpMemory (doc, &xmlmem, &xmlsize);
|
xmlDocDumpMemory (doc, &xmlmem, &xmlsize);
|
||||||
g_io_channel_write_chars (tocfile, xmlmem, xmlsize, NULL, &err);
|
g_io_channel_write_chars (tocfile, (char *) xmlmem, xmlsize, NULL, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
GST_ERROR_OBJECT (index, "%s", err->message);
|
GST_ERROR_OBJECT (index, "%s", err->message);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -6,10 +6,10 @@ type_found (GstElement * typefind, const GstCaps * caps)
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
xmlNodePtr parent;
|
xmlNodePtr parent;
|
||||||
|
|
||||||
doc = xmlNewDoc ("1.0");
|
doc = xmlNewDoc ((guchar *) "1.0");
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
|
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "Capabilities", NULL);
|
||||||
|
|
||||||
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
|
parent = xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "Caps1", NULL);
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
//gst_caps_save_thyself (caps, parent);
|
//gst_caps_save_thyself (caps, parent);
|
||||||
|
|
||||||
|
|
|
@ -11,16 +11,17 @@ object_saved (GstObject * object, xmlNodePtr parent, gpointer data)
|
||||||
|
|
||||||
/* first see if the namespace is already known */
|
/* first see if the namespace is already known */
|
||||||
ns = xmlSearchNsByHref (parent->doc, parent,
|
ns = xmlSearchNsByHref (parent->doc, parent,
|
||||||
"http://gstreamer.net/gst-test/1.0/");
|
(guchar *) "http://gstreamer.net/gst-test/1.0/");
|
||||||
if (ns == NULL) {
|
if (ns == NULL) {
|
||||||
xmlNodePtr root = xmlDocGetRootElement (parent->doc);
|
xmlNodePtr root = xmlDocGetRootElement (parent->doc);
|
||||||
|
|
||||||
/* add namespace to root node */
|
/* add namespace to root node */
|
||||||
ns = xmlNewNs (root, "http://gstreamer.net/gst-test/1.0/", "test");
|
ns = xmlNewNs (root, (guchar *) "http://gstreamer.net/gst-test/1.0/",
|
||||||
|
(guchar *) "test");
|
||||||
}
|
}
|
||||||
child = xmlNewChild (parent, ns, "comment", NULL);
|
child = xmlNewChild (parent, ns, (guchar *) "comment", NULL);
|
||||||
|
|
||||||
xmlNewChild (child, NULL, "text", (gchar *) data);
|
xmlNewChild (child, NULL, (guchar *) "text", (guchar *) data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -10,12 +10,12 @@ xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
|
||||||
xmlNodePtr children = self->xmlChildrenNode;
|
xmlNodePtr children = self->xmlChildrenNode;
|
||||||
|
|
||||||
while (children) {
|
while (children) {
|
||||||
if (!strcmp (children->name, "comment")) {
|
if (!strcmp ((char *) children->name, "comment")) {
|
||||||
xmlNodePtr nodes = children->xmlChildrenNode;
|
xmlNodePtr nodes = children->xmlChildrenNode;
|
||||||
|
|
||||||
while (nodes) {
|
while (nodes) {
|
||||||
if (!strcmp (nodes->name, "text")) {
|
if (!strcmp ((char *) nodes->name, "text")) {
|
||||||
gchar *name = g_strdup (xmlNodeGetContent (nodes));
|
gchar *name = g_strdup ((char *) xmlNodeGetContent (nodes));
|
||||||
|
|
||||||
g_print ("object %s loaded with comment '%s'\n",
|
g_print ("object %s loaded with comment '%s'\n",
|
||||||
gst_object_get_name (object), name);
|
gst_object_get_name (object), name);
|
||||||
|
@ -42,13 +42,13 @@ main (int argc, char *argv[])
|
||||||
/* G_CALLBACK (xml_loaded), xml); */
|
/* G_CALLBACK (xml_loaded), xml); */
|
||||||
|
|
||||||
if (argc == 2)
|
if (argc == 2)
|
||||||
ret = gst_xml_parse_file (xml, argv[1], NULL);
|
ret = gst_xml_parse_file (xml, (guchar *) argv[1], NULL);
|
||||||
else
|
else
|
||||||
ret = gst_xml_parse_file (xml, "xmlTest.gst", NULL);
|
ret = gst_xml_parse_file (xml, (guchar *) "xmlTest.gst", NULL);
|
||||||
|
|
||||||
g_assert (ret == TRUE);
|
g_assert (ret == TRUE);
|
||||||
|
|
||||||
pipeline = gst_xml_get_element (xml, "pipeline");
|
pipeline = gst_xml_get_element (xml, (guchar *) "pipeline");
|
||||||
g_assert (pipeline != NULL);
|
g_assert (pipeline != NULL);
|
||||||
|
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
|
|
|
@ -108,44 +108,45 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
elementnode = rootnode->xmlChildrenNode;
|
elementnode = rootnode->xmlChildrenNode;
|
||||||
while (elementnode) {
|
while (elementnode) {
|
||||||
if (!strcmp (elementnode->name, "element")) {
|
if (!strcmp ((char *) elementnode->name, "element")) {
|
||||||
element = g_new0 (comp_element, 1);
|
element = g_new0 (comp_element, 1);
|
||||||
propnode = elementnode->xmlChildrenNode;
|
propnode = elementnode->xmlChildrenNode;
|
||||||
while (propnode) {
|
while (propnode) {
|
||||||
|
|
||||||
if (!strcmp (propnode->name, "name")) {
|
if (!strcmp ((char *) propnode->name, "name")) {
|
||||||
element->name = xmlNodeGetContent (propnode);
|
element->name = (char *) xmlNodeGetContent (propnode);
|
||||||
/* fprintf(stderr,element->name); */
|
/* fprintf(stderr,element->name); */
|
||||||
} else if (!strcmp (propnode->name, "srcpad")) {
|
} else if (!strcmp ((char *) propnode->name, "srcpad")) {
|
||||||
element->srcpads =
|
element->srcpads =
|
||||||
g_slist_prepend (element->srcpads, xmlNodeGetContent (propnode));
|
g_slist_prepend (element->srcpads, xmlNodeGetContent (propnode));
|
||||||
/* fprintf(stderr,"."); */
|
/* fprintf(stderr,"."); */
|
||||||
} else if (!strcmp (propnode->name, "sinkpad")) {
|
} else if (!strcmp ((char *) propnode->name, "sinkpad")) {
|
||||||
element->sinkpads =
|
element->sinkpads =
|
||||||
g_slist_prepend (element->sinkpads, xmlNodeGetContent (propnode));
|
g_slist_prepend (element->sinkpads, xmlNodeGetContent (propnode));
|
||||||
} else if (!strcmp (propnode->name, "srcpadtemplate")) {
|
} else if (!strcmp ((char *) propnode->name, "srcpadtemplate")) {
|
||||||
element->srcpadtemplates =
|
element->srcpadtemplates =
|
||||||
g_slist_prepend (element->srcpadtemplates,
|
g_slist_prepend (element->srcpadtemplates,
|
||||||
xmlNodeGetContent (propnode));
|
xmlNodeGetContent (propnode));
|
||||||
/* fprintf(stderr,"."); */
|
/* fprintf(stderr,"."); */
|
||||||
} else if (!strcmp (propnode->name, "sinkpad")) {
|
} else if (!strcmp ((char *) propnode->name, "sinkpad")) {
|
||||||
element->sinkpadtemplates =
|
element->sinkpadtemplates =
|
||||||
g_slist_prepend (element->sinkpadtemplates,
|
g_slist_prepend (element->sinkpadtemplates,
|
||||||
xmlNodeGetContent (propnode));
|
xmlNodeGetContent (propnode));
|
||||||
} else if (!strcmp (propnode->name, "argument")) {
|
} else if (!strcmp ((char *) propnode->name, "argument")) {
|
||||||
argument = g_new0 (comp_argument, 1);
|
argument = g_new0 (comp_argument, 1);
|
||||||
argument->name = xmlNodeGetContent (propnode);
|
argument->name = (char *) xmlNodeGetContent (propnode);
|
||||||
argument->type = ARG_INT;
|
argument->type = ARG_INT;
|
||||||
|
|
||||||
/* walk through the values data */
|
/* walk through the values data */
|
||||||
argnode = propnode->xmlChildrenNode;
|
argnode = propnode->xmlChildrenNode;
|
||||||
while (argnode) {
|
while (argnode) {
|
||||||
if (!strcmp (argnode->name, "filename")) {
|
if (!strcmp ((char *) argnode->name, "filename")) {
|
||||||
argument->type = ARG_FILENAME;
|
argument->type = ARG_FILENAME;
|
||||||
} else if (!strcmp (argnode->name, "option")) {
|
} else if (!strcmp ((char *) argnode->name, "option")) {
|
||||||
argument->type = ARG_ENUM;
|
argument->type = ARG_ENUM;
|
||||||
option = g_new0 (enum_value, 1);
|
option = g_new0 (enum_value, 1);
|
||||||
sscanf (xmlNodeGetContent (argnode), "%d", &option->value);
|
sscanf ((char *) xmlNodeGetContent (argnode), "%d",
|
||||||
|
&option->value);
|
||||||
argument->enums = g_slist_prepend (argument->enums, option);
|
argument->enums = g_slist_prepend (argument->enums, option);
|
||||||
}
|
}
|
||||||
argnode = argnode->next;
|
argnode = argnode->next;
|
||||||
|
|
|
@ -40,8 +40,9 @@ main (int argc, char *argv[])
|
||||||
GST_DEBUG_CATEGORY_INIT (debug_compprep, "compprep", GST_DEBUG_BOLD,
|
GST_DEBUG_CATEGORY_INIT (debug_compprep, "compprep", GST_DEBUG_BOLD,
|
||||||
"gst-compprep application");
|
"gst-compprep application");
|
||||||
|
|
||||||
doc = xmlNewDoc ("1.0");
|
doc = xmlNewDoc ((guchar *) "1.0");
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "GST-CompletionRegistry", NULL);
|
doc->xmlRootNode =
|
||||||
|
xmlNewDocNode (doc, NULL, (guchar *) "GST-CompletionRegistry", NULL);
|
||||||
|
|
||||||
plugins = g_list_copy (gst_registry_pool_plugin_list ());
|
plugins = g_list_copy (gst_registry_pool_plugin_list ());
|
||||||
while (plugins) {
|
while (plugins) {
|
||||||
|
@ -63,9 +64,10 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
factory = GST_ELEMENT_FACTORY (feature);
|
factory = GST_ELEMENT_FACTORY (feature);
|
||||||
|
|
||||||
factorynode = xmlNewChild (doc->xmlRootNode, NULL, "element", NULL);
|
factorynode =
|
||||||
xmlNewChild (factorynode, NULL, "name",
|
xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "element", NULL);
|
||||||
GST_PLUGIN_FEATURE_NAME (factory));
|
xmlNewChild (factorynode, NULL, (guchar *) "name",
|
||||||
|
(guchar *) GST_PLUGIN_FEATURE_NAME (factory));
|
||||||
|
|
||||||
element = gst_element_factory_create (factory, NULL);
|
element = gst_element_factory_create (factory, NULL);
|
||||||
GST_DEBUG ("adding factory %s", GST_PLUGIN_FEATURE_NAME (factory));
|
GST_DEBUG ("adding factory %s", GST_PLUGIN_FEATURE_NAME (factory));
|
||||||
|
@ -83,12 +85,12 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
if (padtemplate->direction == GST_PAD_SRC)
|
if (padtemplate->direction == GST_PAD_SRC)
|
||||||
padnode =
|
padnode =
|
||||||
xmlNewChild (factorynode, NULL, "srcpadtemplate",
|
xmlNewChild (factorynode, NULL, (guchar *) "srcpadtemplate",
|
||||||
padtemplate->name_template);
|
(guchar *) padtemplate->name_template);
|
||||||
else if (padtemplate->direction == GST_PAD_SINK)
|
else if (padtemplate->direction == GST_PAD_SINK)
|
||||||
padnode =
|
padnode =
|
||||||
xmlNewChild (factorynode, NULL, "sinkpadtemplate",
|
xmlNewChild (factorynode, NULL, (guchar *) "sinkpadtemplate",
|
||||||
padtemplate->name_template);
|
(guchar *) padtemplate->name_template);
|
||||||
}
|
}
|
||||||
|
|
||||||
pads = gst_element_get_pad_list (element);
|
pads = gst_element_get_pad_list (element);
|
||||||
|
@ -98,10 +100,12 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC)
|
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC)
|
||||||
padnode =
|
padnode =
|
||||||
xmlNewChild (factorynode, NULL, "srcpad", GST_PAD_NAME (pad));
|
xmlNewChild (factorynode, NULL, (guchar *) "srcpad",
|
||||||
|
(guchar *) GST_PAD_NAME (pad));
|
||||||
else if (GST_PAD_DIRECTION (pad) == GST_PAD_SINK)
|
else if (GST_PAD_DIRECTION (pad) == GST_PAD_SINK)
|
||||||
padnode =
|
padnode =
|
||||||
xmlNewChild (factorynode, NULL, "sinkpad", GST_PAD_NAME (pad));
|
xmlNewChild (factorynode, NULL, (guchar *) "sinkpad",
|
||||||
|
(guchar *) GST_PAD_NAME (pad));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write out the args */
|
/* write out the args */
|
||||||
|
@ -111,9 +115,11 @@ main (int argc, char *argv[])
|
||||||
for (i = 0; i < num_properties; i++) {
|
for (i = 0; i < num_properties; i++) {
|
||||||
GParamSpec *param = property_specs[i];
|
GParamSpec *param = property_specs[i];
|
||||||
|
|
||||||
argnode = xmlNewChild (factorynode, NULL, "argument", param->name);
|
argnode =
|
||||||
|
xmlNewChild (factorynode, NULL, (guchar *) "argument",
|
||||||
|
(guchar *) param->name);
|
||||||
if (param->value_type == GST_TYPE_URI) {
|
if (param->value_type == GST_TYPE_URI) {
|
||||||
xmlNewChild (argnode, NULL, "filename", NULL);
|
xmlNewChild (argnode, NULL, (guchar *) "filename", NULL);
|
||||||
} else if (G_IS_PARAM_SPEC_ENUM (param) == G_TYPE_ENUM) {
|
} else if (G_IS_PARAM_SPEC_ENUM (param) == G_TYPE_ENUM) {
|
||||||
GEnumValue *values;
|
GEnumValue *values;
|
||||||
gint j;
|
gint j;
|
||||||
|
@ -122,8 +128,11 @@ main (int argc, char *argv[])
|
||||||
for (j = 0; values[j].value_name; j++) {
|
for (j = 0; values[j].value_name; j++) {
|
||||||
gchar *value = g_strdup_printf ("%d", values[j].value);
|
gchar *value = g_strdup_printf ("%d", values[j].value);
|
||||||
|
|
||||||
optionnode = xmlNewChild (argnode, NULL, "option", value);
|
optionnode =
|
||||||
xmlNewChild (optionnode, NULL, "value_nick", values[j].value_nick);
|
xmlNewChild (argnode, NULL, (guchar *) "option",
|
||||||
|
(guchar *) value);
|
||||||
|
xmlNewChild (optionnode, NULL, (guchar *) "value_nick",
|
||||||
|
(guchar *) values[j].value_nick);
|
||||||
g_free (value);
|
g_free (value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ static void
|
||||||
print_element_properties_info (GstElement * element)
|
print_element_properties_info (GstElement * element)
|
||||||
{
|
{
|
||||||
GParamSpec **property_specs;
|
GParamSpec **property_specs;
|
||||||
gint num_properties, i;
|
guint num_properties, i;
|
||||||
gboolean readable;
|
gboolean readable;
|
||||||
const char *string_val;
|
const char *string_val;
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ xmllaunch_parse_cmdline (const gchar ** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = gst_xml_new ();
|
xml = gst_xml_new ();
|
||||||
err = gst_xml_parse_file (xml, arg, NULL);
|
err = gst_xml_parse_file (xml, (guchar *) arg, NULL);
|
||||||
|
|
||||||
if (err != TRUE) {
|
if (err != TRUE) {
|
||||||
fprintf (stderr, _("ERROR: parse of xml file '%s' failed.\n"), arg);
|
fprintf (stderr, _("ERROR: parse of xml file '%s' failed.\n"), arg);
|
||||||
|
|
|
@ -179,7 +179,7 @@ static void
|
||||||
print_element_properties (GstElement * element, gint pfx)
|
print_element_properties (GstElement * element, gint pfx)
|
||||||
{
|
{
|
||||||
GParamSpec **property_specs;
|
GParamSpec **property_specs;
|
||||||
gint num_properties, i;
|
guint num_properties, i;
|
||||||
gboolean readable;
|
gboolean readable;
|
||||||
|
|
||||||
property_specs = g_object_class_list_properties
|
property_specs = g_object_class_list_properties
|
||||||
|
|
Loading…
Reference in a new issue