Commit b4d7be20 authored by Andy Wingo Wingo's avatar Andy Wingo Wingo
Browse files

GCC 4 fixen.

Original commit message from CVS:
2005-05-04  Andy Wingo <wingo@pobox.com>

* check/Makefile.am:
* docs/gst/tmpl/gstatomic.sgml:
* docs/gst/tmpl/gstplugin.sgml:
* gst/base/gstbasesink.c: (gst_basesink_activate):
* gst/base/gstbasesrc.c: (gst_basesrc_class_init),
(gst_basesrc_init), (gst_basesrc_set_dataflow_funcs),
(gst_basesrc_query), (gst_basesrc_set_property),
(gst_basesrc_get_property), (gst_basesrc_check_get_range),
(gst_basesrc_activate):
* gst/base/gstbasesrc.h:
* gst/base/gstbasetransform.c: (gst_base_transform_sink_activate),
(gst_base_transform_src_activate):
* gst/elements/gstelements.c:
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init),
(gst_fakesrc_set_property), (gst_fakesrc_get_property):
* gst/elements/gsttee.c: (gst_tee_sink_activate):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_checkgetrange),
(gst_type_find_element_activate):
* gst/gstbin.c: (gst_bin_save_thyself), (gst_bin_restore_thyself):
* gst/gstcaps.c: (gst_caps_do_simplify), (gst_caps_save_thyself),
(gst_caps_load_thyself):
* gst/gstelement.c: (gst_element_pads_activate),
(gst_element_save_thyself), (gst_element_restore_thyself):
* gst/gstpad.c: (gst_pad_load_and_link), (gst_pad_save_thyself),
(gst_ghost_pad_save_thyself), (gst_pad_check_pull_range):
* gst/gstpad.h:
* 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/registries/gstlibxmlregistry.c: (read_string), (read_uint),
(read_enum), (load_pad_template), (load_feature), (load_plugin),
(load_paths):
* 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):
GCC 4 fixen.
parent 52b230c1
2005-05-04 Andy Wingo <wingo@pobox.com>
* check/Makefile.am:
* docs/gst/tmpl/gstatomic.sgml:
* docs/gst/tmpl/gstplugin.sgml:
* gst/base/gstbasesink.c: (gst_basesink_activate):
* gst/base/gstbasesrc.c: (gst_basesrc_class_init),
(gst_basesrc_init), (gst_basesrc_set_dataflow_funcs),
(gst_basesrc_query), (gst_basesrc_set_property),
(gst_basesrc_get_property), (gst_basesrc_check_get_range),
(gst_basesrc_activate):
* gst/base/gstbasesrc.h:
* gst/base/gstbasetransform.c: (gst_base_transform_sink_activate),
(gst_base_transform_src_activate):
* gst/elements/gstelements.c:
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init),
(gst_fakesrc_set_property), (gst_fakesrc_get_property):
* gst/elements/gsttee.c: (gst_tee_sink_activate):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_checkgetrange),
(gst_type_find_element_activate):
* gst/gstbin.c: (gst_bin_save_thyself), (gst_bin_restore_thyself):
* gst/gstcaps.c: (gst_caps_do_simplify), (gst_caps_save_thyself),
(gst_caps_load_thyself):
* gst/gstelement.c: (gst_element_pads_activate),
(gst_element_save_thyself), (gst_element_restore_thyself):
* gst/gstpad.c: (gst_pad_load_and_link), (gst_pad_save_thyself),
(gst_ghost_pad_save_thyself), (gst_pad_check_pull_range):
* gst/gstpad.h:
* 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/registries/gstlibxmlregistry.c: (read_string), (read_uint),
(read_enum), (load_pad_template), (load_feature), (load_plugin),
(load_paths):
* 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):
GCC 4 fixen.
2005-05-03 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gstplugin.c: (gst_plugin_check_module),
......@@ -266,6 +312,11 @@
2005-04-18 Andy Wingo <wingo@pobox.com>
* gst/gstelement.c (gst_element_pads_activate): Check pull_range
on the peer, not the pad. I think that was a typo. Pass an extra
arg to see if random access is possible. Activate the pads as
PULL_RANGE if possible.
* gst/elements/gstfakesrc.c: s/ARG_/PROP_/.
* gst/base/gstbasesrc.c (gst_basesrc_set_property)
......
......@@ -32,6 +32,7 @@ TESTS = $(top_builddir)/tools/gst-register \
gst/gstobject \
gst/gstpad \
gst/gstsystemclock \
pipelines/simple_launch_lines \
gst-libs/gdp
check_PROGRAMS = $(TESTS)
......
......@@ -19,81 +19,15 @@ as external methods.
#GstMemChunk
</para>
<!-- ##### TYPEDEF gst_vgint ##### -->
<para>
</para>
<!-- ##### STRUCT GstAtomicInt ##### -->
<para>
A structure that contains an integer that can be modified
atomically.
</para>
@counter:
@lock:
<!-- ##### FUNCTION gst_atomic_int_init ##### -->
<para>
Initialize an allocated #GstAtomicInt with a value. Call this method
only once as it will allocate a mutex in the C-fallback case.
</para>
@aint: a #GstAtomicInt
@val: a new value
<!-- ##### FUNCTION gst_atomic_int_destroy ##### -->
<para>
Destroy a #GstAtomicInt. Call this method only once as it will
free the mutex in the C-fallback case.
</para>
@aint: a #GstAtomicInt
<!-- ##### FUNCTION gst_atomic_int_set ##### -->
<para>
Atomically set the value on the #GstAtomicInt.
</para>
@atomic_int:
@value:
<!-- # Unused Parameters # -->
@aint: a #GstAtomicInt
@val: The new value
<!-- ##### FUNCTION gst_atomic_int_read ##### -->
<para>
Atomically read the contents of a #GstAtomicInt
</para>
@aint: a #GstAtomicInt
@Returns: the value of the atomic int
<!-- ##### FUNCTION gst_atomic_int_add ##### -->
<para>
Atomically add the given value to the #GstAtomicInt.
</para>
@aint: a #GstAtomicInt
@val: the value to add
<!-- ##### FUNCTION gst_atomic_int_inc ##### -->
<para>
Atomically increment the #GstAtomicInt
</para>
@aint: a #GstAtomicInt
<!-- ##### FUNCTION gst_atomic_int_dec_and_test ##### -->
<para>
Atomically decrement the #GstAtomicInt and test if it is zero.
</para>
@aint: a #GstAtomicInt
@Returns: TRUE if the atomic int is 0
......@@ -344,12 +344,3 @@ to get a list of plugins that match certain criteria.
@Returns:
<!-- ##### FUNCTION gst_library_load ##### -->
<para>
</para>
@name:
@Returns:
......@@ -752,6 +752,7 @@ gst_basesink_activate (GstPad * pad, GstActivateMode mode)
result = TRUE;
break;
case GST_ACTIVATE_PULL:
case GST_ACTIVATE_PULL_RANGE:
/* if we have a scheduler we can start the task */
g_return_val_if_fail (basesink->has_loop, FALSE);
gst_pad_peer_set_active (pad, mode);
......
......@@ -48,6 +48,8 @@ enum
{
PROP_0,
PROP_BLOCKSIZE,
PROP_HAS_LOOP,
PROP_HAS_GETRANGE
};
static GstElementClass *parent_class = NULL;
......@@ -99,8 +101,10 @@ static gboolean gst_basesrc_stop (GstBaseSrc * basesrc);
static GstElementStateReturn gst_basesrc_change_state (GstElement * element);
static void gst_basesrc_set_dataflow_funcs (GstBaseSrc * this);
static void gst_basesrc_loop (GstPad * pad);
static gboolean gst_basesrc_check_get_range (GstPad * pad);
static gboolean gst_basesrc_check_get_range (GstPad * pad,
gboolean * random_access);
static GstFlowReturn gst_basesrc_get_range (GstPad * pad, guint64 offset,
guint length, GstBuffer ** buf);
......@@ -129,6 +133,16 @@ gst_basesrc_class_init (GstBaseSrcClass * klass)
"Size in bytes to read per buffer", 1, G_MAXULONG, DEFAULT_BLOCKSIZE,
G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HAS_LOOP,
g_param_spec_boolean ("has-loop", "Has loop function",
"True if the element should expose a loop function", TRUE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HAS_GETRANGE,
g_param_spec_boolean ("has-getrange", "Has getrange function",
"True if the element should expose a getrange function", TRUE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_basesrc_change_state);
}
......@@ -150,9 +164,7 @@ gst_basesrc_init (GstBaseSrc * basesrc, gpointer g_class)
gst_pad_set_query_function (pad, gst_basesrc_query);
gst_pad_set_query_type_function (pad, gst_basesrc_get_query_types);
gst_pad_set_formats_function (pad, gst_basesrc_get_formats);
gst_pad_set_loop_function (pad, gst_basesrc_loop);
gst_pad_set_checkgetrange_function (pad, gst_basesrc_check_get_range);
gst_pad_set_getrange_function (pad, gst_basesrc_get_range);
/* hold ref to pad */
basesrc->srcpad = pad;
gst_element_add_pad (GST_ELEMENT (basesrc), pad);
......@@ -164,6 +176,20 @@ gst_basesrc_init (GstBaseSrc * basesrc, gpointer g_class)
GST_FLAG_UNSET (basesrc, GST_BASESRC_STARTED);
}
static void
gst_basesrc_set_dataflow_funcs (GstBaseSrc * this)
{
if (this->has_loop)
gst_pad_set_loop_function (this->srcpad, gst_basesrc_loop);
else
gst_pad_set_loop_function (this->srcpad, NULL);
if (this->has_getrange)
gst_pad_set_getrange_function (this->srcpad, gst_basesrc_get_range);
else
gst_pad_set_getrange_function (this->srcpad, NULL);
}
static const GstFormat *
gst_basesrc_get_formats (GstPad * pad)
{
......@@ -206,7 +232,8 @@ gst_basesrc_query (GstPad * pad, GstQueryType type,
{
gboolean ret;
ret = gst_basesrc_get_size (src, value);
/* FIXME-wim: is this cast right? */
ret = gst_basesrc_get_size (src, (guint64 *) value);
GST_DEBUG ("getting length %d %lld", ret, *value);
return ret;
}
......@@ -223,7 +250,8 @@ gst_basesrc_query (GstPad * pad, GstQueryType type,
*value = src->offset;
break;
case GST_FORMAT_PERCENT:
if (!gst_basesrc_get_size (src, value))
/* fixme */
if (!gst_basesrc_get_size (src, (guint64 *) value))
return FALSE;
*value = src->offset * GST_FORMAT_PERCENT_MAX / *value;
return TRUE;
......@@ -402,6 +430,14 @@ gst_basesrc_set_property (GObject * object, guint prop_id, const GValue * value,
case PROP_BLOCKSIZE:
src->blocksize = g_value_get_ulong (value);
break;
case PROP_HAS_LOOP:
src->has_loop = g_value_get_boolean (value);
gst_basesrc_set_dataflow_funcs (src);
break;
case PROP_HAS_GETRANGE:
src->has_getrange = g_value_get_boolean (value);
gst_basesrc_set_dataflow_funcs (src);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -420,6 +456,12 @@ gst_basesrc_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_BLOCKSIZE:
g_value_set_ulong (value, src->blocksize);
break;
case PROP_HAS_LOOP:
g_value_set_boolean (value, src->has_loop);
break;
case PROP_HAS_GETRANGE:
g_value_set_boolean (value, src->has_getrange);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -495,7 +537,7 @@ gst_basesrc_get_range (GstPad * pad, guint64 offset, guint length,
}
static gboolean
gst_basesrc_check_get_range (GstPad * pad)
gst_basesrc_check_get_range (GstPad * pad, gboolean * random_access)
{
GstBaseSrc *src;
......@@ -506,6 +548,7 @@ gst_basesrc_check_get_range (GstPad * pad)
gst_basesrc_stop (src);
}
*random_access = src->random_access;
return src->seekable;
}
......@@ -675,6 +718,7 @@ gst_basesrc_activate (GstPad * pad, GstActivateMode mode)
switch (mode) {
case GST_ACTIVATE_PUSH:
case GST_ACTIVATE_PULL:
case GST_ACTIVATE_PULL_RANGE:
result = gst_basesrc_start (basesrc);
break;
default:
......@@ -701,6 +745,7 @@ gst_basesrc_activate (GstPad * pad, GstActivateMode mode)
}
break;
case GST_ACTIVATE_PULL:
case GST_ACTIVATE_PULL_RANGE:
result = TRUE;
break;
case GST_ACTIVATE_NONE:
......
......@@ -56,7 +56,11 @@ struct _GstBaseSrc {
gint64 segment_end;
gboolean segment_loop;
gboolean has_loop;
gboolean has_getrange;
gboolean seekable;
gboolean random_access;
guint64 offset;
guint64 size;
};
......
......@@ -334,6 +334,7 @@ gst_base_transform_sink_activate (GstPad * pad, GstActivateMode mode)
switch (mode) {
case GST_ACTIVATE_PUSH:
case GST_ACTIVATE_PULL:
case GST_ACTIVATE_PULL_RANGE:
if (bclass->start)
result = bclass->start (trans);
break;
......@@ -357,6 +358,7 @@ gst_base_transform_src_activate (GstPad * pad, GstActivateMode mode)
result = TRUE;
break;
case GST_ACTIVATE_PULL:
case GST_ACTIVATE_PULL_RANGE:
result = gst_pad_set_active (trans->sinkpad, mode);
result = gst_pad_peer_set_active (trans->sinkpad, mode);
break;
......
......@@ -74,7 +74,7 @@ static struct _elements_entry _elements[] = {
// {"statistics", GST_RANK_NONE, gst_statistics_get_type},
{"tee", GST_RANK_NONE, gst_tee_get_type},
{"typefind", GST_RANK_NONE, gst_type_find_element_get_type},
// {NULL, 0},
{NULL, 0},
};
static gboolean
......
......@@ -88,7 +88,9 @@ enum
PROP_SILENT,
PROP_DUMP,
PROP_PARENTSIZE,
PROP_LAST_MESSAGE
PROP_LAST_MESSAGE,
PROP_HAS_LOOP,
PROP_HAS_GETRANGE
};
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())
......@@ -274,6 +276,14 @@ gst_fakesrc_class_init (GstFakeSrcClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DUMP,
g_param_spec_boolean ("dump", "Dump", "Dump produced bytes to stdout",
DEFAULT_DUMP, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HAS_LOOP,
g_param_spec_boolean ("has-loop", "Has loop function",
"True if the element exposes a loop function", TRUE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HAS_GETRANGE,
g_param_spec_boolean ("has-getrange", "Has getrange function",
"True if the element exposes a getrange function", TRUE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
gst_fakesrc_signals[SIGNAL_HANDOFF] =
g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
......@@ -281,6 +291,7 @@ gst_fakesrc_class_init (GstFakeSrcClass * klass)
gst_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 1,
GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE);
/*gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_fakesrc_is_seekable); */
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_fakesrc_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_fakesrc_stop);
gstbasesrc_class->event = GST_DEBUG_FUNCPTR (gst_fakesrc_event_handler);
......@@ -410,6 +421,14 @@ gst_fakesrc_set_property (GObject * object, guint prop_id, const GValue * value,
case PROP_DUMP:
src->dump = g_value_get_boolean (value);
break;
case PROP_HAS_LOOP:
g_return_if_fail (!GST_FLAG_IS_SET (object, GST_BASESRC_STARTED));
src->has_loop = g_value_get_boolean (value);
break;
case PROP_HAS_GETRANGE:
g_return_if_fail (!GST_FLAG_IS_SET (object, GST_BASESRC_STARTED));
src->has_getrange = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -476,6 +495,12 @@ gst_fakesrc_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_LAST_MESSAGE:
g_value_set_string (value, src->last_message);
break;
case PROP_HAS_LOOP:
g_value_set_boolean (value, src->has_loop);
break;
case PROP_HAS_GETRANGE:
g_value_set_boolean (value, src->has_getrange);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......
......@@ -369,6 +369,7 @@ gst_tee_sink_activate (GstPad * pad, GstActivateMode mode)
result = TRUE;
break;
case GST_ACTIVATE_PULL:
case GST_ACTIVATE_PULL_RANGE:
g_return_val_if_fail (tee->has_sink_loop, FALSE);
if (GST_ELEMENT_SCHEDULER (tee)) {
GST_STREAM_LOCK (pad);
......
......@@ -128,7 +128,8 @@ static GstFlowReturn gst_type_find_element_chain (GstPad * sinkpad,
GstBuffer * buffer);
static GstFlowReturn gst_type_find_element_getrange (GstPad * srcpad,
guint64 offset, guint length, GstBuffer ** buffer);
static gboolean gst_type_find_element_checkgetrange (GstPad * srcpad);
static gboolean gst_type_find_element_checkgetrange (GstPad * srcpad,
gboolean * random_access);
static GstElementStateReturn
gst_type_find_element_change_state (GstElement * element);
static gboolean
......@@ -463,7 +464,7 @@ find_element_get_length (gpointer data)
if (entry->self->stream_length == 0) {
typefind->stream_length_available =
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)
typefind->stream_length_available = FALSE;
if (!typefind->stream_length_available) {
......@@ -806,13 +807,13 @@ gst_type_find_element_chain (GstPad * pad, GstBuffer * buffer)
}
static gboolean
gst_type_find_element_checkgetrange (GstPad * srcpad)
gst_type_find_element_checkgetrange (GstPad * srcpad, gboolean * random_access)
{
GstTypeFindElement *typefind;
typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (srcpad));
return gst_pad_check_pull_range (typefind->sink);
return gst_pad_check_pull_range (typefind->sink, random_access);
}
static GstFlowReturn
......@@ -861,6 +862,7 @@ gst_type_find_element_activate (GstPad * pad, GstActivateMode mode)
switch (mode) {
case GST_ACTIVATE_PUSH:
case GST_ACTIVATE_PULL:
case GST_ACTIVATE_PULL_RANGE:
result = TRUE;
break;
default:
......
......@@ -1268,7 +1268,7 @@ gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
if (GST_OBJECT_CLASS (parent_class)->save_thyself)
GST_OBJECT_CLASS (parent_class)->save_thyself (GST_OBJECT (bin), parent);
childlist = xmlNewChild (parent, NULL, "children", NULL);
childlist = xmlNewChild (parent, NULL, (xmlChar *) "children", NULL);
GST_CAT_INFO (GST_CAT_XML, "[%s]: saving %d children",
GST_ELEMENT_NAME (bin), bin->numchildren);
......@@ -1276,7 +1276,7 @@ gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
children = bin->children;
while (children) {
child = GST_ELEMENT (children->data);
elementnode = xmlNewChild (childlist, NULL, "element", NULL);
elementnode = xmlNewChild (childlist, NULL, (xmlChar *) "element", NULL);
gst_object_save_thyself (GST_OBJECT (child), elementnode);
children = g_list_next (children);
}
......@@ -1291,12 +1291,12 @@ gst_bin_restore_thyself (GstObject * object, xmlNodePtr self)
xmlNodePtr childlist;
while (field) {
if (!strcmp (field->name, "children")) {
if (!strcmp ((char *) field->name, "children")) {
GST_CAT_INFO (GST_CAT_XML, "[%s]: loading children",
GST_ELEMENT_NAME (object));
childlist = field->xmlChildrenNode;
while (childlist) {
if (!strcmp (childlist->name, "element")) {
if (!strcmp ((char *) childlist->name, "element")) {
GstElement *element =
gst_xml_make_element (childlist, GST_OBJECT (bin));
......
......@@ -1372,7 +1372,7 @@ gst_caps_switch_structures (GstCaps * caps, GstStructure * old,
gboolean
gst_caps_do_simplify (GstCaps * caps)
{
GstStructure *simplify, *compare, *result;
GstStructure *simplify, *compare, *result = NULL;
gint i, j, start;
gboolean changed = FALSE;
......@@ -1439,7 +1439,7 @@ gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent)
{
char *s = gst_caps_to_string (caps);
xmlNewChild (parent, NULL, "caps", s);
xmlNewChild (parent, NULL, (xmlChar *) "caps", (xmlChar *) s);
g_free (s);
return parent;
}
......@@ -1455,8 +1455,8 @@ gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent)
GstCaps *
gst_caps_load_thyself (xmlNodePtr parent)
{
if (strcmp ("caps", parent->name) == 0) {
return gst_caps_from_string (xmlNodeGetContent (parent));
if (strcmp ("caps", (char *) parent->name) == 0) {
return gst_caps_from_string ((gchar *) xmlNodeGetContent (parent));
}
return NULL;
......
......@@ -1985,11 +1985,11 @@ restart:
if (GST_IS_REAL_PAD (pad)) {
GstRealPad *peer;
gboolean pad_loop, pad_get;
gboolean done = FALSE;
gboolean done = FALSE, pad_random = FALSE;
/* see if the pad has a loop function and grab
* the peer */
pad_get = gst_pad_check_pull_range (pad);
pad_get = gst_pad_check_pull_range (pad, &pad_random);
GST_LOCK (pad);
pad_loop = GST_RPAD_LOOPFUNC (pad) != NULL;
peer = GST_RPAD_PEER (pad);
......@@ -1999,9 +1999,11 @@ restart:
if (peer) {
gboolean peer_loop, peer_get;
gboolean peer_random = FALSE;
GstActivateMode mode;
/* see if the peer has a getrange function */
peer_get = gst_pad_check_pull_range (pad);
peer_get = gst_pad_check_pull_range (GST_PAD_CAST (peer), &peer_random);
/* see if the peer has a loop function */
peer_loop = GST_RPAD_LOOPFUNC (peer) != NULL;
......@@ -2012,8 +2014,10 @@ restart:
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"%sactivating pad %s pull mode", (active ? "" : "(de)"),
GST_OBJECT_NAME (pad));
result &= gst_pad_set_active (pad,
(active ? GST_ACTIVATE_PULL : GST_ACTIVATE_NONE));
/* only one of pad_random and peer_random can be true */
mode = (pad_random || peer_random)
? GST_ACTIVATE_PULL_RANGE : GST_ACTIVATE_PULL;
result &= gst_pad_set_active (pad, active ? mode : GST_ACTIVATE_NONE);
done = TRUE;
}
gst_object_unref (GST_OBJECT (peer));
......@@ -2190,7 +2194,8 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
GList *pads;
GstElementClass *oclass;
GParamSpec **specs, *spec;
gint nspecs, i;
guint nspecs;
gint i;
GValue value = { 0, };
GstElement *element;
......@@ -2200,12 +2205,14 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
oclass = GST_ELEMENT_GET_CLASS (element);
xmlNewChild (parent, NULL, "name", GST_ELEMENT_NAME (element));
xmlNewChild (parent, NULL, (xmlChar *) "name",
(xmlChar *) GST_ELEMENT_NAME (element));
if (oclass->elementfactory != NULL) {
GstElementFactory *factory = (GstElementFactory *) oclass->elementfactory;
xmlNewChild (parent, NULL, "type", GST_PLUGIN_FEATURE (factory)->name);
xmlNewChild (parent, NULL, (xmlChar *) "type",
(xmlChar *) GST_PLUGIN_FEATURE (factory)->name);
}
/* FIXME: what is this? */
......@@ -2224,8 +2231,8 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (spec));
g_object_get_property (G_OBJECT (element), spec->name, &value);
param = xmlNewChild (parent, NULL, "param", NULL);
xmlNewChild (param, NULL, "name", spec->name);
param = xmlNewChild (parent, NULL, (xmlChar *) "param", NULL);
xmlNewChild (param, NULL, (xmlChar *) "name", (xmlChar *) spec->name);
if (G_IS_PARAM_SPEC_STRING (spec))
contents = g_value_dup_string (&value);
......@@ -2237,7 +2244,7 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
else
contents = g_strdup_value_contents (&value);
xmlNewChild (param, NULL, "value", contents);
xmlNewChild (param, NULL, (xmlChar *) "value", (xmlChar *) contents);
g_free (contents);
g_value_unset (&value);
......@@ -2251,7 +2258,7 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
/* figure out if it's a direct pad or a ghostpad */
if (GST_ELEMENT (GST_OBJECT_PARENT (pad)) == element) {
xmlNodePtr padtag = xmlNewChild (parent, NULL, "pad", NULL);
xmlNodePtr padtag = xmlNewChild (parent, NULL, (xmlChar *) "pad", NULL);
gst_object_save_thyself (GST_OBJECT (pad), padtag);
}