mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
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.
This commit is contained in:
parent
52b230c1d1
commit
b4d7be2014
36 changed files with 425 additions and 257 deletions
51
ChangeLog
51
ChangeLog
|
@ -1,3 +1,49 @@
|
||||||
|
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>
|
2005-05-03 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* gst/gstplugin.c: (gst_plugin_check_module),
|
* gst/gstplugin.c: (gst_plugin_check_module),
|
||||||
|
@ -266,6 +312,11 @@
|
||||||
|
|
||||||
2005-04-18 Andy Wingo <wingo@pobox.com>
|
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/elements/gstfakesrc.c: s/ARG_/PROP_/.
|
||||||
|
|
||||||
* gst/base/gstbasesrc.c (gst_basesrc_set_property)
|
* gst/base/gstbasesrc.c (gst_basesrc_set_property)
|
||||||
|
|
|
@ -32,6 +32,7 @@ TESTS = $(top_builddir)/tools/gst-register \
|
||||||
gst/gstobject \
|
gst/gstobject \
|
||||||
gst/gstpad \
|
gst/gstpad \
|
||||||
gst/gstsystemclock \
|
gst/gstsystemclock \
|
||||||
|
pipelines/simple_launch_lines \
|
||||||
gst-libs/gdp
|
gst-libs/gdp
|
||||||
|
|
||||||
check_PROGRAMS = $(TESTS)
|
check_PROGRAMS = $(TESTS)
|
||||||
|
|
|
@ -19,81 +19,15 @@ as external methods.
|
||||||
#GstMemChunk
|
#GstMemChunk
|
||||||
</para>
|
</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 ##### -->
|
<!-- ##### FUNCTION gst_atomic_int_set ##### -->
|
||||||
<para>
|
<para>
|
||||||
Atomically set the value on the #GstAtomicInt.
|
Atomically set the value on the #GstAtomicInt.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@atomic_int:
|
||||||
|
@value:
|
||||||
|
<!-- # Unused Parameters # -->
|
||||||
@aint: a #GstAtomicInt
|
@aint: a #GstAtomicInt
|
||||||
@val: The new value
|
@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:
|
@Returns:
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gst_library_load ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@name:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -752,6 +752,7 @@ gst_basesink_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
/* if we have a scheduler we can start the task */
|
/* if we have a scheduler we can start the task */
|
||||||
g_return_val_if_fail (basesink->has_loop, FALSE);
|
g_return_val_if_fail (basesink->has_loop, FALSE);
|
||||||
gst_pad_peer_set_active (pad, mode);
|
gst_pad_peer_set_active (pad, mode);
|
||||||
|
|
|
@ -48,6 +48,8 @@ enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_BLOCKSIZE,
|
PROP_BLOCKSIZE,
|
||||||
|
PROP_HAS_LOOP,
|
||||||
|
PROP_HAS_GETRANGE
|
||||||
};
|
};
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
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 GstElementStateReturn gst_basesrc_change_state (GstElement * element);
|
||||||
|
|
||||||
|
static void gst_basesrc_set_dataflow_funcs (GstBaseSrc * this);
|
||||||
static void gst_basesrc_loop (GstPad * pad);
|
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,
|
static GstFlowReturn gst_basesrc_get_range (GstPad * pad, guint64 offset,
|
||||||
guint length, GstBuffer ** buf);
|
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,
|
"Size in bytes to read per buffer", 1, G_MAXULONG, DEFAULT_BLOCKSIZE,
|
||||||
G_PARAM_READWRITE));
|
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);
|
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_function (pad, gst_basesrc_query);
|
||||||
gst_pad_set_query_type_function (pad, gst_basesrc_get_query_types);
|
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_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_checkgetrange_function (pad, gst_basesrc_check_get_range);
|
||||||
gst_pad_set_getrange_function (pad, gst_basesrc_get_range);
|
|
||||||
/* hold ref to pad */
|
/* hold ref to pad */
|
||||||
basesrc->srcpad = pad;
|
basesrc->srcpad = pad;
|
||||||
gst_element_add_pad (GST_ELEMENT (basesrc), 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);
|
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 *
|
static const GstFormat *
|
||||||
gst_basesrc_get_formats (GstPad * pad)
|
gst_basesrc_get_formats (GstPad * pad)
|
||||||
{
|
{
|
||||||
|
@ -206,7 +232,8 @@ gst_basesrc_query (GstPad * pad, GstQueryType type,
|
||||||
{
|
{
|
||||||
gboolean ret;
|
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);
|
GST_DEBUG ("getting length %d %lld", ret, *value);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -223,7 +250,8 @@ gst_basesrc_query (GstPad * pad, GstQueryType type,
|
||||||
*value = src->offset;
|
*value = src->offset;
|
||||||
break;
|
break;
|
||||||
case GST_FORMAT_PERCENT:
|
case GST_FORMAT_PERCENT:
|
||||||
if (!gst_basesrc_get_size (src, value))
|
/* fixme */
|
||||||
|
if (!gst_basesrc_get_size (src, (guint64 *) value))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
*value = src->offset * GST_FORMAT_PERCENT_MAX / *value;
|
*value = src->offset * GST_FORMAT_PERCENT_MAX / *value;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -402,6 +430,14 @@ gst_basesrc_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
case PROP_BLOCKSIZE:
|
case PROP_BLOCKSIZE:
|
||||||
src->blocksize = g_value_get_ulong (value);
|
src->blocksize = g_value_get_ulong (value);
|
||||||
break;
|
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:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -420,6 +456,12 @@ gst_basesrc_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
case PROP_BLOCKSIZE:
|
case PROP_BLOCKSIZE:
|
||||||
g_value_set_ulong (value, src->blocksize);
|
g_value_set_ulong (value, src->blocksize);
|
||||||
break;
|
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:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -495,7 +537,7 @@ gst_basesrc_get_range (GstPad * pad, guint64 offset, guint length,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_basesrc_check_get_range (GstPad * pad)
|
gst_basesrc_check_get_range (GstPad * pad, gboolean * random_access)
|
||||||
{
|
{
|
||||||
GstBaseSrc *src;
|
GstBaseSrc *src;
|
||||||
|
|
||||||
|
@ -506,6 +548,7 @@ gst_basesrc_check_get_range (GstPad * pad)
|
||||||
gst_basesrc_stop (src);
|
gst_basesrc_stop (src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*random_access = src->random_access;
|
||||||
return src->seekable;
|
return src->seekable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,6 +718,7 @@ gst_basesrc_activate (GstPad * pad, GstActivateMode mode)
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GST_ACTIVATE_PUSH:
|
case GST_ACTIVATE_PUSH:
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
result = gst_basesrc_start (basesrc);
|
result = gst_basesrc_start (basesrc);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -701,6 +745,7 @@ gst_basesrc_activate (GstPad * pad, GstActivateMode mode)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_NONE:
|
case GST_ACTIVATE_NONE:
|
||||||
|
|
|
@ -56,7 +56,11 @@ struct _GstBaseSrc {
|
||||||
gint64 segment_end;
|
gint64 segment_end;
|
||||||
gboolean segment_loop;
|
gboolean segment_loop;
|
||||||
|
|
||||||
|
gboolean has_loop;
|
||||||
|
gboolean has_getrange;
|
||||||
|
|
||||||
gboolean seekable;
|
gboolean seekable;
|
||||||
|
gboolean random_access;
|
||||||
guint64 offset;
|
guint64 offset;
|
||||||
guint64 size;
|
guint64 size;
|
||||||
};
|
};
|
||||||
|
|
|
@ -334,6 +334,7 @@ gst_base_transform_sink_activate (GstPad * pad, GstActivateMode mode)
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GST_ACTIVATE_PUSH:
|
case GST_ACTIVATE_PUSH:
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
if (bclass->start)
|
if (bclass->start)
|
||||||
result = bclass->start (trans);
|
result = bclass->start (trans);
|
||||||
break;
|
break;
|
||||||
|
@ -357,6 +358,7 @@ gst_base_transform_src_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
result = gst_pad_set_active (trans->sinkpad, mode);
|
result = gst_pad_set_active (trans->sinkpad, mode);
|
||||||
result = gst_pad_peer_set_active (trans->sinkpad, mode);
|
result = gst_pad_peer_set_active (trans->sinkpad, mode);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -74,7 +74,7 @@ static struct _elements_entry _elements[] = {
|
||||||
// {"statistics", GST_RANK_NONE, gst_statistics_get_type},
|
// {"statistics", GST_RANK_NONE, gst_statistics_get_type},
|
||||||
{"tee", GST_RANK_NONE, gst_tee_get_type},
|
{"tee", GST_RANK_NONE, gst_tee_get_type},
|
||||||
{"typefind", GST_RANK_NONE, gst_type_find_element_get_type},
|
{"typefind", GST_RANK_NONE, gst_type_find_element_get_type},
|
||||||
// {NULL, 0},
|
{NULL, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
@ -88,7 +88,9 @@ enum
|
||||||
PROP_SILENT,
|
PROP_SILENT,
|
||||||
PROP_DUMP,
|
PROP_DUMP,
|
||||||
PROP_PARENTSIZE,
|
PROP_PARENTSIZE,
|
||||||
PROP_LAST_MESSAGE
|
PROP_LAST_MESSAGE,
|
||||||
|
PROP_HAS_LOOP,
|
||||||
|
PROP_HAS_GETRANGE
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())
|
#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_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DUMP,
|
||||||
g_param_spec_boolean ("dump", "Dump", "Dump produced bytes to stdout",
|
g_param_spec_boolean ("dump", "Dump", "Dump produced bytes to stdout",
|
||||||
DEFAULT_DUMP, G_PARAM_READWRITE));
|
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] =
|
gst_fakesrc_signals[SIGNAL_HANDOFF] =
|
||||||
g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
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_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 1,
|
||||||
GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE);
|
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->start = GST_DEBUG_FUNCPTR (gst_fakesrc_start);
|
||||||
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_fakesrc_stop);
|
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_fakesrc_stop);
|
||||||
gstbasesrc_class->event = GST_DEBUG_FUNCPTR (gst_fakesrc_event_handler);
|
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:
|
case PROP_DUMP:
|
||||||
src->dump = g_value_get_boolean (value);
|
src->dump = g_value_get_boolean (value);
|
||||||
break;
|
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:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -476,6 +495,12 @@ gst_fakesrc_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
case PROP_LAST_MESSAGE:
|
case PROP_LAST_MESSAGE:
|
||||||
g_value_set_string (value, src->last_message);
|
g_value_set_string (value, src->last_message);
|
||||||
break;
|
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:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -369,6 +369,7 @@ gst_tee_sink_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
g_return_val_if_fail (tee->has_sink_loop, FALSE);
|
g_return_val_if_fail (tee->has_sink_loop, FALSE);
|
||||||
if (GST_ELEMENT_SCHEDULER (tee)) {
|
if (GST_ELEMENT_SCHEDULER (tee)) {
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
|
|
|
@ -128,7 +128,8 @@ static GstFlowReturn gst_type_find_element_chain (GstPad * sinkpad,
|
||||||
GstBuffer * buffer);
|
GstBuffer * buffer);
|
||||||
static GstFlowReturn gst_type_find_element_getrange (GstPad * srcpad,
|
static GstFlowReturn gst_type_find_element_getrange (GstPad * srcpad,
|
||||||
guint64 offset, guint length, GstBuffer ** buffer);
|
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
|
static GstElementStateReturn
|
||||||
gst_type_find_element_change_state (GstElement * element);
|
gst_type_find_element_change_state (GstElement * element);
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -463,7 +464,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) {
|
||||||
|
@ -806,13 +807,13 @@ gst_type_find_element_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_type_find_element_checkgetrange (GstPad * srcpad)
|
gst_type_find_element_checkgetrange (GstPad * srcpad, gboolean * random_access)
|
||||||
{
|
{
|
||||||
GstTypeFindElement *typefind;
|
GstTypeFindElement *typefind;
|
||||||
|
|
||||||
typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (srcpad));
|
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
|
static GstFlowReturn
|
||||||
|
@ -861,6 +862,7 @@ gst_type_find_element_activate (GstPad * pad, GstActivateMode mode)
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GST_ACTIVATE_PUSH:
|
case GST_ACTIVATE_PUSH:
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -1268,7 +1268,7 @@ gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
|
||||||
if (GST_OBJECT_CLASS (parent_class)->save_thyself)
|
if (GST_OBJECT_CLASS (parent_class)->save_thyself)
|
||||||
GST_OBJECT_CLASS (parent_class)->save_thyself (GST_OBJECT (bin), parent);
|
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_CAT_INFO (GST_CAT_XML, "[%s]: saving %d children",
|
||||||
GST_ELEMENT_NAME (bin), bin->numchildren);
|
GST_ELEMENT_NAME (bin), bin->numchildren);
|
||||||
|
@ -1276,7 +1276,7 @@ gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
|
||||||
children = bin->children;
|
children = bin->children;
|
||||||
while (children) {
|
while (children) {
|
||||||
child = GST_ELEMENT (children->data);
|
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);
|
gst_object_save_thyself (GST_OBJECT (child), elementnode);
|
||||||
children = g_list_next (children);
|
children = g_list_next (children);
|
||||||
}
|
}
|
||||||
|
@ -1291,12 +1291,12 @@ gst_bin_restore_thyself (GstObject * object, xmlNodePtr self)
|
||||||
xmlNodePtr childlist;
|
xmlNodePtr childlist;
|
||||||
|
|
||||||
while (field) {
|
while (field) {
|
||||||
if (!strcmp (field->name, "children")) {
|
if (!strcmp ((char *) field->name, "children")) {
|
||||||
GST_CAT_INFO (GST_CAT_XML, "[%s]: loading children",
|
GST_CAT_INFO (GST_CAT_XML, "[%s]: loading children",
|
||||||
GST_ELEMENT_NAME (object));
|
GST_ELEMENT_NAME (object));
|
||||||
childlist = field->xmlChildrenNode;
|
childlist = field->xmlChildrenNode;
|
||||||
while (childlist) {
|
while (childlist) {
|
||||||
if (!strcmp (childlist->name, "element")) {
|
if (!strcmp ((char *) childlist->name, "element")) {
|
||||||
GstElement *element =
|
GstElement *element =
|
||||||
gst_xml_make_element (childlist, GST_OBJECT (bin));
|
gst_xml_make_element (childlist, GST_OBJECT (bin));
|
||||||
|
|
||||||
|
|
|
@ -1372,7 +1372,7 @@ gst_caps_switch_structures (GstCaps * caps, GstStructure * old,
|
||||||
gboolean
|
gboolean
|
||||||
gst_caps_do_simplify (GstCaps * caps)
|
gst_caps_do_simplify (GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstStructure *simplify, *compare, *result;
|
GstStructure *simplify, *compare, *result = NULL;
|
||||||
gint i, j, start;
|
gint i, j, start;
|
||||||
gboolean changed = FALSE;
|
gboolean changed = FALSE;
|
||||||
|
|
||||||
|
@ -1439,7 +1439,7 @@ gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent)
|
||||||
{
|
{
|
||||||
char *s = gst_caps_to_string (caps);
|
char *s = gst_caps_to_string (caps);
|
||||||
|
|
||||||
xmlNewChild (parent, NULL, "caps", s);
|
xmlNewChild (parent, NULL, (xmlChar *) "caps", (xmlChar *) s);
|
||||||
g_free (s);
|
g_free (s);
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
@ -1455,8 +1455,8 @@ gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent)
|
||||||
GstCaps *
|
GstCaps *
|
||||||
gst_caps_load_thyself (xmlNodePtr parent)
|
gst_caps_load_thyself (xmlNodePtr parent)
|
||||||
{
|
{
|
||||||
if (strcmp ("caps", parent->name) == 0) {
|
if (strcmp ("caps", (char *) parent->name) == 0) {
|
||||||
return gst_caps_from_string (xmlNodeGetContent (parent));
|
return gst_caps_from_string ((gchar *) xmlNodeGetContent (parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -1985,11 +1985,11 @@ restart:
|
||||||
if (GST_IS_REAL_PAD (pad)) {
|
if (GST_IS_REAL_PAD (pad)) {
|
||||||
GstRealPad *peer;
|
GstRealPad *peer;
|
||||||
gboolean pad_loop, pad_get;
|
gboolean pad_loop, pad_get;
|
||||||
gboolean done = FALSE;
|
gboolean done = FALSE, pad_random = FALSE;
|
||||||
|
|
||||||
/* see if the pad has a loop function and grab
|
/* see if the pad has a loop function and grab
|
||||||
* the peer */
|
* the peer */
|
||||||
pad_get = gst_pad_check_pull_range (pad);
|
pad_get = gst_pad_check_pull_range (pad, &pad_random);
|
||||||
GST_LOCK (pad);
|
GST_LOCK (pad);
|
||||||
pad_loop = GST_RPAD_LOOPFUNC (pad) != NULL;
|
pad_loop = GST_RPAD_LOOPFUNC (pad) != NULL;
|
||||||
peer = GST_RPAD_PEER (pad);
|
peer = GST_RPAD_PEER (pad);
|
||||||
|
@ -1999,9 +1999,11 @@ restart:
|
||||||
|
|
||||||
if (peer) {
|
if (peer) {
|
||||||
gboolean peer_loop, peer_get;
|
gboolean peer_loop, peer_get;
|
||||||
|
gboolean peer_random = FALSE;
|
||||||
|
GstActivateMode mode;
|
||||||
|
|
||||||
/* see if the peer has a getrange function */
|
/* 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 */
|
/* see if the peer has a loop function */
|
||||||
peer_loop = GST_RPAD_LOOPFUNC (peer) != NULL;
|
peer_loop = GST_RPAD_LOOPFUNC (peer) != NULL;
|
||||||
|
|
||||||
|
@ -2012,8 +2014,10 @@ restart:
|
||||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||||
"%sactivating pad %s pull mode", (active ? "" : "(de)"),
|
"%sactivating pad %s pull mode", (active ? "" : "(de)"),
|
||||||
GST_OBJECT_NAME (pad));
|
GST_OBJECT_NAME (pad));
|
||||||
result &= gst_pad_set_active (pad,
|
/* only one of pad_random and peer_random can be true */
|
||||||
(active ? GST_ACTIVATE_PULL : GST_ACTIVATE_NONE));
|
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;
|
done = TRUE;
|
||||||
}
|
}
|
||||||
gst_object_unref (GST_OBJECT (peer));
|
gst_object_unref (GST_OBJECT (peer));
|
||||||
|
@ -2190,7 +2194,8 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
|
||||||
GList *pads;
|
GList *pads;
|
||||||
GstElementClass *oclass;
|
GstElementClass *oclass;
|
||||||
GParamSpec **specs, *spec;
|
GParamSpec **specs, *spec;
|
||||||
gint nspecs, i;
|
guint nspecs;
|
||||||
|
gint i;
|
||||||
GValue value = { 0, };
|
GValue value = { 0, };
|
||||||
GstElement *element;
|
GstElement *element;
|
||||||
|
|
||||||
|
@ -2200,12 +2205,14 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
|
||||||
|
|
||||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
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) {
|
if (oclass->elementfactory != NULL) {
|
||||||
GstElementFactory *factory = (GstElementFactory *) oclass->elementfactory;
|
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? */
|
/* 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_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (spec));
|
||||||
|
|
||||||
g_object_get_property (G_OBJECT (element), spec->name, &value);
|
g_object_get_property (G_OBJECT (element), spec->name, &value);
|
||||||
param = xmlNewChild (parent, NULL, "param", NULL);
|
param = xmlNewChild (parent, NULL, (xmlChar *) "param", NULL);
|
||||||
xmlNewChild (param, NULL, "name", spec->name);
|
xmlNewChild (param, NULL, (xmlChar *) "name", (xmlChar *) spec->name);
|
||||||
|
|
||||||
if (G_IS_PARAM_SPEC_STRING (spec))
|
if (G_IS_PARAM_SPEC_STRING (spec))
|
||||||
contents = g_value_dup_string (&value);
|
contents = g_value_dup_string (&value);
|
||||||
|
@ -2237,7 +2244,7 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
|
||||||
else
|
else
|
||||||
contents = g_strdup_value_contents (&value);
|
contents = g_strdup_value_contents (&value);
|
||||||
|
|
||||||
xmlNewChild (param, NULL, "value", contents);
|
xmlNewChild (param, NULL, (xmlChar *) "value", (xmlChar *) contents);
|
||||||
g_free (contents);
|
g_free (contents);
|
||||||
|
|
||||||
g_value_unset (&value);
|
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 */
|
/* figure out if it's a direct pad or a ghostpad */
|
||||||
if (GST_ELEMENT (GST_OBJECT_PARENT (pad)) == element) {
|
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);
|
gst_object_save_thyself (GST_OBJECT (pad), padtag);
|
||||||
}
|
}
|
||||||
|
@ -2275,14 +2282,14 @@ gst_element_restore_thyself (GstObject * object, xmlNodePtr self)
|
||||||
/* parameters */
|
/* parameters */
|
||||||
children = self->xmlChildrenNode;
|
children = self->xmlChildrenNode;
|
||||||
while (children) {
|
while (children) {
|
||||||
if (!strcmp (children->name, "param")) {
|
if (!strcmp ((char *) children->name, "param")) {
|
||||||
xmlNodePtr child = children->xmlChildrenNode;
|
xmlNodePtr child = children->xmlChildrenNode;
|
||||||
|
|
||||||
while (child) {
|
while (child) {
|
||||||
if (!strcmp (child->name, "name")) {
|
if (!strcmp ((char *) child->name, "name")) {
|
||||||
name = xmlNodeGetContent (child);
|
name = (gchar *) xmlNodeGetContent (child);
|
||||||
} else if (!strcmp (child->name, "value")) {
|
} else if (!strcmp ((char *) child->name, "value")) {
|
||||||
value = xmlNodeGetContent (child);
|
value = (gchar *) xmlNodeGetContent (child);
|
||||||
}
|
}
|
||||||
child = child->next;
|
child = child->next;
|
||||||
}
|
}
|
||||||
|
@ -2298,7 +2305,7 @@ gst_element_restore_thyself (GstObject * object, xmlNodePtr self)
|
||||||
/* pads */
|
/* pads */
|
||||||
children = self->xmlChildrenNode;
|
children = self->xmlChildrenNode;
|
||||||
while (children) {
|
while (children) {
|
||||||
if (!strcmp (children->name, "pad")) {
|
if (!strcmp ((char *) children->name, "pad")) {
|
||||||
gst_pad_load_and_link (children, GST_OBJECT (element));
|
gst_pad_load_and_link (children, GST_OBJECT (element));
|
||||||
}
|
}
|
||||||
children = children->next;
|
children = children->next;
|
||||||
|
|
29
gst/gstpad.c
29
gst/gstpad.c
|
@ -2493,12 +2493,12 @@ gst_pad_load_and_link (xmlNodePtr self, GstObject * parent)
|
||||||
gchar *name = NULL;
|
gchar *name = NULL;
|
||||||
|
|
||||||
while (field) {
|
while (field) {
|
||||||
if (!strcmp (field->name, "name")) {
|
if (!strcmp ((char *) field->name, "name")) {
|
||||||
name = xmlNodeGetContent (field);
|
name = (gchar *) xmlNodeGetContent (field);
|
||||||
pad = gst_element_get_pad (GST_ELEMENT (parent), name);
|
pad = gst_element_get_pad (GST_ELEMENT (parent), name);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
} else if (!strcmp (field->name, "peer")) {
|
} else if (!strcmp ((char *) field->name, "peer")) {
|
||||||
peer = xmlNodeGetContent (field);
|
peer = (gchar *) xmlNodeGetContent (field);
|
||||||
}
|
}
|
||||||
field = field->next;
|
field = field->next;
|
||||||
}
|
}
|
||||||
|
@ -2562,7 +2562,8 @@ gst_pad_save_thyself (GstObject * object, xmlNodePtr parent)
|
||||||
|
|
||||||
realpad = GST_REAL_PAD (object);
|
realpad = GST_REAL_PAD (object);
|
||||||
|
|
||||||
xmlNewChild (parent, NULL, "name", GST_PAD_NAME (realpad));
|
xmlNewChild (parent, NULL, (xmlChar *) "name",
|
||||||
|
(xmlChar *) GST_PAD_NAME (realpad));
|
||||||
if (GST_RPAD_PEER (realpad) != NULL) {
|
if (GST_RPAD_PEER (realpad) != NULL) {
|
||||||
gchar *content;
|
gchar *content;
|
||||||
|
|
||||||
|
@ -2571,10 +2572,10 @@ gst_pad_save_thyself (GstObject * object, xmlNodePtr parent)
|
||||||
/* we just save it off */
|
/* we just save it off */
|
||||||
content = g_strdup_printf ("%s.%s",
|
content = g_strdup_printf ("%s.%s",
|
||||||
GST_OBJECT_NAME (GST_PAD_PARENT (peer)), GST_PAD_NAME (peer));
|
GST_OBJECT_NAME (GST_PAD_PARENT (peer)), GST_PAD_NAME (peer));
|
||||||
xmlNewChild (parent, NULL, "peer", content);
|
xmlNewChild (parent, NULL, (xmlChar *) "peer", (xmlChar *) content);
|
||||||
g_free (content);
|
g_free (content);
|
||||||
} else
|
} else
|
||||||
xmlNewChild (parent, NULL, "peer", "");
|
xmlNewChild (parent, NULL, (xmlChar *) "peer", (xmlChar *) "");
|
||||||
|
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
@ -2595,9 +2596,10 @@ gst_ghost_pad_save_thyself (GstPad * pad, xmlNodePtr parent)
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_GHOST_PAD (pad), NULL);
|
g_return_val_if_fail (GST_IS_GHOST_PAD (pad), NULL);
|
||||||
|
|
||||||
self = xmlNewChild (parent, NULL, "ghostpad", NULL);
|
self = xmlNewChild (parent, NULL, (xmlChar *) "ghostpad", NULL);
|
||||||
xmlNewChild (self, NULL, "name", GST_PAD_NAME (pad));
|
xmlNewChild (self, NULL, (xmlChar *) "name", (xmlChar *) GST_PAD_NAME (pad));
|
||||||
xmlNewChild (self, NULL, "parent", GST_OBJECT_NAME (GST_PAD_PARENT (pad)));
|
xmlNewChild (self, NULL, (xmlChar *) "parent",
|
||||||
|
(xmlChar *) GST_OBJECT_NAME (GST_PAD_PARENT (pad)));
|
||||||
|
|
||||||
/* FIXME FIXME FIXME! */
|
/* FIXME FIXME FIXME! */
|
||||||
|
|
||||||
|
@ -2777,7 +2779,7 @@ no_function:
|
||||||
* MT safe.
|
* MT safe.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_pad_check_pull_range (GstPad * pad)
|
gst_pad_check_pull_range (GstPad * pad, gboolean * random_access)
|
||||||
{
|
{
|
||||||
GstRealPad *peer;
|
GstRealPad *peer;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
@ -2797,13 +2799,14 @@ gst_pad_check_pull_range (GstPad * pad)
|
||||||
|
|
||||||
/* see note in above function */
|
/* see note in above function */
|
||||||
if (G_LIKELY ((checkgetrangefunc = peer->checkgetrangefunc) == NULL)) {
|
if (G_LIKELY ((checkgetrangefunc = peer->checkgetrangefunc) == NULL)) {
|
||||||
|
*random_access = FALSE;
|
||||||
ret = GST_RPAD_GETRANGEFUNC (peer) != NULL;
|
ret = GST_RPAD_GETRANGEFUNC (peer) != NULL;
|
||||||
} else {
|
} else {
|
||||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||||
"calling checkgetrangefunc %s of peer pad %s:%s",
|
"calling checkgetrangefunc %s of peer pad %s:%s",
|
||||||
GST_DEBUG_FUNCPTR_NAME (checkgetrangefunc), GST_DEBUG_PAD_NAME (peer));
|
GST_DEBUG_FUNCPTR_NAME (checkgetrangefunc), GST_DEBUG_PAD_NAME (peer));
|
||||||
|
|
||||||
ret = checkgetrangefunc (GST_PAD_CAST (peer));
|
ret = checkgetrangefunc (GST_PAD_CAST (peer), random_access);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_object_unref (GST_OBJECT_CAST (peer));
|
gst_object_unref (GST_OBJECT_CAST (peer));
|
||||||
|
@ -2814,6 +2817,7 @@ gst_pad_check_pull_range (GstPad * pad)
|
||||||
wrong_direction:
|
wrong_direction:
|
||||||
{
|
{
|
||||||
GST_UNLOCK (pad);
|
GST_UNLOCK (pad);
|
||||||
|
*random_access = FALSE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
not_connected:
|
not_connected:
|
||||||
|
@ -2821,6 +2825,7 @@ not_connected:
|
||||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||||
"checking pull range, but it was not linked");
|
"checking pull range, but it was not linked");
|
||||||
GST_UNLOCK (pad);
|
GST_UNLOCK (pad);
|
||||||
|
*random_access = FALSE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,7 @@ typedef enum {
|
||||||
GST_ACTIVATE_NONE,
|
GST_ACTIVATE_NONE,
|
||||||
GST_ACTIVATE_PUSH,
|
GST_ACTIVATE_PUSH,
|
||||||
GST_ACTIVATE_PULL,
|
GST_ACTIVATE_PULL,
|
||||||
|
GST_ACTIVATE_PULL_RANGE,
|
||||||
} GstActivateMode;
|
} GstActivateMode;
|
||||||
|
|
||||||
#define GST_PAD_MODE_ACTIVATE(mode) ((mode) != GST_ACTIVATE_NONE)
|
#define GST_PAD_MODE_ACTIVATE(mode) ((mode) != GST_ACTIVATE_NONE)
|
||||||
|
@ -138,7 +139,7 @@ typedef void (*GstPadLoopFunction) (GstPad *pad);
|
||||||
typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstBuffer *buffer);
|
typedef GstFlowReturn (*GstPadChainFunction) (GstPad *pad, GstBuffer *buffer);
|
||||||
typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, guint64 offset,
|
typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, guint64 offset,
|
||||||
guint length, GstBuffer **buffer);
|
guint length, GstBuffer **buffer);
|
||||||
typedef gboolean (*GstPadCheckGetRangeFunction) (GstPad *pad);
|
typedef gboolean (*GstPadCheckGetRangeFunction) (GstPad *pad, gboolean *random_access);
|
||||||
typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event);
|
typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event);
|
||||||
|
|
||||||
/* convert/query/format functions */
|
/* convert/query/format functions */
|
||||||
|
@ -523,7 +524,7 @@ GstCaps * gst_pad_get_negotiated_caps (GstPad * pad);
|
||||||
|
|
||||||
/* data passing functions */
|
/* data passing functions */
|
||||||
GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer);
|
GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer);
|
||||||
gboolean gst_pad_check_pull_range (GstPad *pad);
|
gboolean gst_pad_check_pull_range (GstPad *pad, gboolean *random_access);
|
||||||
GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size,
|
GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size,
|
||||||
GstBuffer **buffer);
|
GstBuffer **buffer);
|
||||||
gboolean gst_pad_push_event (GstPad *pad, GstEvent *event);
|
gboolean gst_pad_push_event (GstPad *pad, GstEvent *event);
|
||||||
|
|
42
gst/gstxml.c
42
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 ((xmlChar *) "1.0");
|
||||||
|
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "gstreamer", NULL);
|
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *) "gstreamer", NULL);
|
||||||
|
|
||||||
gst_ns =
|
gst_ns =
|
||||||
xmlNewNs (doc->xmlRootNode, "http://gstreamer.net/gst-core/1.0/", "gst");
|
xmlNewNs (doc->xmlRootNode,
|
||||||
|
(xmlChar *) "http://gstreamer.net/gst-core/1.0/", (xmlChar *) "gst");
|
||||||
|
|
||||||
elementnode = xmlNewChild (doc->xmlRootNode, gst_ns, "element", NULL);
|
elementnode = xmlNewChild (doc->xmlRootNode, gst_ns, (xmlChar *) "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,
|
||||||
|
(xmlChar *) "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);
|
||||||
|
@ -251,6 +254,7 @@ gst_xml_parse_doc (GstXML * xml, xmlDocPtr doc, const guchar * root)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME 0.9: Why guchar*? */
|
||||||
/**
|
/**
|
||||||
* gst_xml_parse_file:
|
* gst_xml_parse_file:
|
||||||
* @xml: a pointer to a GstXML object
|
* @xml: a pointer to a GstXML object
|
||||||
|
@ -275,7 +279,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);
|
||||||
|
@ -285,6 +289,7 @@ gst_xml_parse_file (GstXML * xml, const guchar * fname, const guchar * root)
|
||||||
return gst_xml_parse_doc (xml, doc, root);
|
return gst_xml_parse_doc (xml, doc, root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME guchar* */
|
||||||
/**
|
/**
|
||||||
* gst_xml_parse_memory:
|
* gst_xml_parse_memory:
|
||||||
* @xml: a pointer to a GstXML object
|
* @xml: a pointer to a GstXML object
|
||||||
|
@ -305,9 +310,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 xmlChar *) root);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -337,6 +342,7 @@ gst_xml_get_topelements (GstXML * xml)
|
||||||
return xml->topelements;
|
return xml->topelements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME 0.9: why is the arg guchar* instead of gchar*? */
|
||||||
/**
|
/**
|
||||||
* gst_xml_get_element:
|
* gst_xml_get_element:
|
||||||
* @xml: The GstXML to get the element from
|
* @xml: The GstXML to get the element from
|
||||||
|
@ -365,11 +371,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 (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), (gchar *) name);
|
||||||
|
|
||||||
if (element)
|
if (element)
|
||||||
return element;
|
return element;
|
||||||
|
@ -394,15 +400,15 @@ gst_xml_make_element (xmlNodePtr cur, GstObject * parent)
|
||||||
{
|
{
|
||||||
xmlNodePtr children = cur->xmlChildrenNode;
|
xmlNodePtr children = cur->xmlChildrenNode;
|
||||||
GstElement *element;
|
GstElement *element;
|
||||||
guchar *name = NULL;
|
gchar *name = NULL;
|
||||||
guchar *type = NULL;
|
gchar *type = NULL;
|
||||||
|
|
||||||
/* 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 = (gchar *) xmlNodeGetContent (children);
|
||||||
} else if (!strcmp (children->name, "type")) {
|
} else if (!strcmp ((char *) children->name, "type")) {
|
||||||
type = xmlNodeGetContent (children);
|
type = (gchar *) xmlNodeGetContent (children);
|
||||||
}
|
}
|
||||||
children = children->next;
|
children = children->next;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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, (xmlChar *) "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, (xmlChar *) "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, (xmlChar *) "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, (xmlChar *) "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, (xmlChar *) "nick");
|
||||||
GstFormat fmt = gst_format_get_by_nick (nick);
|
GstFormat fmt = gst_format_get_by_nick ((gchar *) 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, (xmlChar *) "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, (xmlChar *) "writer", NULL);
|
||||||
xmlSetProp (writer, "id", ii->id_desc);
|
xmlSetProp (writer, (xmlChar *) "id", (xmlChar *) 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, (xmlChar *) "entries", (xmlChar *) 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, (xmlChar *) "datafile", (xmlChar *) buf);
|
||||||
|
|
||||||
formats = xmlNewChild (writer, NULL, "formats", NULL);
|
formats = xmlNewChild (writer, NULL, (xmlChar *) "formats", NULL);
|
||||||
g_snprintf (buf, bufsize, "%d", ii->nformats);
|
g_snprintf (buf, bufsize, "%d", ii->nformats);
|
||||||
xmlSetProp (formats, "count", buf);
|
xmlSetProp (formats, (xmlChar *) "count", (xmlChar *) 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, (xmlChar *) "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, (xmlChar *) "nick", (xmlChar *) def->nick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,11 +591,12 @@ 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 ((xmlChar *) "1.0");
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "gstfileindex", NULL);
|
doc->xmlRootNode =
|
||||||
xmlSetProp (doc->xmlRootNode, "version", "1");
|
xmlNewDocNode (doc, NULL, (xmlChar *) "gstfileindex", NULL);
|
||||||
|
xmlSetProp (doc->xmlRootNode, (xmlChar *) "version", (xmlChar *) "1");
|
||||||
|
|
||||||
writers = xmlNewChild (doc->xmlRootNode, NULL, "writers", NULL);
|
writers = xmlNewChild (doc->xmlRootNode, NULL, (xmlChar *) "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 +624,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, (gchar *) xmlmem, xmlsize, NULL, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
GST_ERROR_OBJECT (index, "%s", err->message);
|
GST_ERROR_OBJECT (index, "%s", err->message);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -587,7 +587,7 @@ read_string (xmlTextReaderPtr reader, gchar ** write_to)
|
||||||
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_TEXT) {
|
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_TEXT) {
|
||||||
if (found)
|
if (found)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
*write_to = g_strdup (xmlTextReaderConstValue (reader));
|
*write_to = g_strdup ((gchar *) xmlTextReaderConstValue (reader));
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -610,7 +610,7 @@ read_uint (xmlTextReaderPtr reader, guint * write_to)
|
||||||
|
|
||||||
if (found)
|
if (found)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
*write_to = strtol (xmlTextReaderConstValue (reader), &ret, 0);
|
*write_to = strtol ((char *) xmlTextReaderConstValue (reader), &ret, 0);
|
||||||
if (ret != NULL)
|
if (ret != NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
|
@ -641,7 +641,7 @@ read_enum (xmlTextReaderPtr reader, GType enum_type, guint * write_to)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
value =
|
value =
|
||||||
g_enum_get_value_by_nick (enum_class,
|
g_enum_get_value_by_nick (enum_class,
|
||||||
xmlTextReaderConstValue (reader));
|
(gchar *) xmlTextReaderConstValue (reader));
|
||||||
if (value) {
|
if (value) {
|
||||||
*write_to = value->value;
|
*write_to = value->value;
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
|
@ -674,7 +674,7 @@ load_pad_template (xmlTextReaderPtr reader)
|
||||||
}
|
}
|
||||||
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
||||||
xmlTextReaderDepth (reader) == depth + 1) {
|
xmlTextReaderDepth (reader) == depth + 1) {
|
||||||
const gchar *tag = xmlTextReaderConstName (reader);
|
const gchar *tag = (gchar *) xmlTextReaderConstName (reader);
|
||||||
|
|
||||||
if (g_str_equal (tag, "nametemplate")) {
|
if (g_str_equal (tag, "nametemplate")) {
|
||||||
read_string (reader, &name);
|
read_string (reader, &name);
|
||||||
|
@ -720,7 +720,7 @@ load_feature (xmlTextReaderPtr reader)
|
||||||
return feature;
|
return feature;
|
||||||
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
||||||
xmlTextReaderDepth (reader) == depth + 1) {
|
xmlTextReaderDepth (reader) == depth + 1) {
|
||||||
const gchar *tag = xmlTextReaderConstName (reader);
|
const gchar *tag = (gchar *) xmlTextReaderConstName (reader);
|
||||||
|
|
||||||
if (g_str_equal (tag, "name"))
|
if (g_str_equal (tag, "name"))
|
||||||
read_string (reader, &feature->name);
|
read_string (reader, &feature->name);
|
||||||
|
@ -812,7 +812,7 @@ load_plugin (xmlTextReaderPtr reader)
|
||||||
}
|
}
|
||||||
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
||||||
xmlTextReaderDepth (reader) == 2) {
|
xmlTextReaderDepth (reader) == 2) {
|
||||||
const gchar *tag = xmlTextReaderConstName (reader);
|
const gchar *tag = (gchar *) xmlTextReaderConstName (reader);
|
||||||
|
|
||||||
if (g_str_equal (tag, "name")) {
|
if (g_str_equal (tag, "name")) {
|
||||||
if (!read_string (reader, &plugin->desc.name))
|
if (!read_string (reader, &plugin->desc.name))
|
||||||
|
@ -860,7 +860,7 @@ load_paths (xmlTextReaderPtr reader, GstXMLRegistry * registry)
|
||||||
}
|
}
|
||||||
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT &&
|
||||||
xmlTextReaderDepth (reader) == 2) {
|
xmlTextReaderDepth (reader) == 2) {
|
||||||
const gchar *tag = xmlTextReaderConstName (reader);
|
const gchar *tag = (gchar *) xmlTextReaderConstName (reader);
|
||||||
|
|
||||||
if (g_str_equal (tag, "path")) {
|
if (g_str_equal (tag, "path")) {
|
||||||
gchar *s = NULL;
|
gchar *s = NULL;
|
||||||
|
|
|
@ -752,6 +752,7 @@ gst_basesink_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
/* if we have a scheduler we can start the task */
|
/* if we have a scheduler we can start the task */
|
||||||
g_return_val_if_fail (basesink->has_loop, FALSE);
|
g_return_val_if_fail (basesink->has_loop, FALSE);
|
||||||
gst_pad_peer_set_active (pad, mode);
|
gst_pad_peer_set_active (pad, mode);
|
||||||
|
|
|
@ -48,6 +48,8 @@ enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_BLOCKSIZE,
|
PROP_BLOCKSIZE,
|
||||||
|
PROP_HAS_LOOP,
|
||||||
|
PROP_HAS_GETRANGE
|
||||||
};
|
};
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
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 GstElementStateReturn gst_basesrc_change_state (GstElement * element);
|
||||||
|
|
||||||
|
static void gst_basesrc_set_dataflow_funcs (GstBaseSrc * this);
|
||||||
static void gst_basesrc_loop (GstPad * pad);
|
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,
|
static GstFlowReturn gst_basesrc_get_range (GstPad * pad, guint64 offset,
|
||||||
guint length, GstBuffer ** buf);
|
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,
|
"Size in bytes to read per buffer", 1, G_MAXULONG, DEFAULT_BLOCKSIZE,
|
||||||
G_PARAM_READWRITE));
|
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);
|
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_function (pad, gst_basesrc_query);
|
||||||
gst_pad_set_query_type_function (pad, gst_basesrc_get_query_types);
|
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_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_checkgetrange_function (pad, gst_basesrc_check_get_range);
|
||||||
gst_pad_set_getrange_function (pad, gst_basesrc_get_range);
|
|
||||||
/* hold ref to pad */
|
/* hold ref to pad */
|
||||||
basesrc->srcpad = pad;
|
basesrc->srcpad = pad;
|
||||||
gst_element_add_pad (GST_ELEMENT (basesrc), 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);
|
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 *
|
static const GstFormat *
|
||||||
gst_basesrc_get_formats (GstPad * pad)
|
gst_basesrc_get_formats (GstPad * pad)
|
||||||
{
|
{
|
||||||
|
@ -206,7 +232,8 @@ gst_basesrc_query (GstPad * pad, GstQueryType type,
|
||||||
{
|
{
|
||||||
gboolean ret;
|
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);
|
GST_DEBUG ("getting length %d %lld", ret, *value);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -223,7 +250,8 @@ gst_basesrc_query (GstPad * pad, GstQueryType type,
|
||||||
*value = src->offset;
|
*value = src->offset;
|
||||||
break;
|
break;
|
||||||
case GST_FORMAT_PERCENT:
|
case GST_FORMAT_PERCENT:
|
||||||
if (!gst_basesrc_get_size (src, value))
|
/* fixme */
|
||||||
|
if (!gst_basesrc_get_size (src, (guint64 *) value))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
*value = src->offset * GST_FORMAT_PERCENT_MAX / *value;
|
*value = src->offset * GST_FORMAT_PERCENT_MAX / *value;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -402,6 +430,14 @@ gst_basesrc_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
case PROP_BLOCKSIZE:
|
case PROP_BLOCKSIZE:
|
||||||
src->blocksize = g_value_get_ulong (value);
|
src->blocksize = g_value_get_ulong (value);
|
||||||
break;
|
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:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -420,6 +456,12 @@ gst_basesrc_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
case PROP_BLOCKSIZE:
|
case PROP_BLOCKSIZE:
|
||||||
g_value_set_ulong (value, src->blocksize);
|
g_value_set_ulong (value, src->blocksize);
|
||||||
break;
|
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:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -495,7 +537,7 @@ gst_basesrc_get_range (GstPad * pad, guint64 offset, guint length,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_basesrc_check_get_range (GstPad * pad)
|
gst_basesrc_check_get_range (GstPad * pad, gboolean * random_access)
|
||||||
{
|
{
|
||||||
GstBaseSrc *src;
|
GstBaseSrc *src;
|
||||||
|
|
||||||
|
@ -506,6 +548,7 @@ gst_basesrc_check_get_range (GstPad * pad)
|
||||||
gst_basesrc_stop (src);
|
gst_basesrc_stop (src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*random_access = src->random_access;
|
||||||
return src->seekable;
|
return src->seekable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,6 +718,7 @@ gst_basesrc_activate (GstPad * pad, GstActivateMode mode)
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GST_ACTIVATE_PUSH:
|
case GST_ACTIVATE_PUSH:
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
result = gst_basesrc_start (basesrc);
|
result = gst_basesrc_start (basesrc);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -701,6 +745,7 @@ gst_basesrc_activate (GstPad * pad, GstActivateMode mode)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_NONE:
|
case GST_ACTIVATE_NONE:
|
||||||
|
|
|
@ -56,7 +56,11 @@ struct _GstBaseSrc {
|
||||||
gint64 segment_end;
|
gint64 segment_end;
|
||||||
gboolean segment_loop;
|
gboolean segment_loop;
|
||||||
|
|
||||||
|
gboolean has_loop;
|
||||||
|
gboolean has_getrange;
|
||||||
|
|
||||||
gboolean seekable;
|
gboolean seekable;
|
||||||
|
gboolean random_access;
|
||||||
guint64 offset;
|
guint64 offset;
|
||||||
guint64 size;
|
guint64 size;
|
||||||
};
|
};
|
||||||
|
|
|
@ -334,6 +334,7 @@ gst_base_transform_sink_activate (GstPad * pad, GstActivateMode mode)
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GST_ACTIVATE_PUSH:
|
case GST_ACTIVATE_PUSH:
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
if (bclass->start)
|
if (bclass->start)
|
||||||
result = bclass->start (trans);
|
result = bclass->start (trans);
|
||||||
break;
|
break;
|
||||||
|
@ -357,6 +358,7 @@ gst_base_transform_src_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
result = gst_pad_set_active (trans->sinkpad, mode);
|
result = gst_pad_set_active (trans->sinkpad, mode);
|
||||||
result = gst_pad_peer_set_active (trans->sinkpad, mode);
|
result = gst_pad_peer_set_active (trans->sinkpad, mode);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -237,7 +237,7 @@ gst_dp_packet_from_caps (const GstCaps * caps, GstDPHeaderFlag flags,
|
||||||
{
|
{
|
||||||
guint8 *h;
|
guint8 *h;
|
||||||
guint16 crc;
|
guint16 crc;
|
||||||
gchar *string;
|
guchar *string;
|
||||||
|
|
||||||
/* FIXME: GST_IS_CAPS doesn't work
|
/* FIXME: GST_IS_CAPS doesn't work
|
||||||
g_return_val_if_fail (GST_IS_CAPS (caps), FALSE); */
|
g_return_val_if_fail (GST_IS_CAPS (caps), FALSE); */
|
||||||
|
@ -248,7 +248,7 @@ gst_dp_packet_from_caps (const GstCaps * caps, GstDPHeaderFlag flags,
|
||||||
*length = GST_DP_HEADER_LENGTH;
|
*length = GST_DP_HEADER_LENGTH;
|
||||||
h = g_malloc (GST_DP_HEADER_LENGTH);
|
h = g_malloc (GST_DP_HEADER_LENGTH);
|
||||||
|
|
||||||
string = gst_caps_to_string (caps);
|
string = (guchar *) gst_caps_to_string (caps);
|
||||||
|
|
||||||
/* version, flags, type */
|
/* version, flags, type */
|
||||||
h[0] = (guint8) GST_DP_VERSION_MAJOR;
|
h[0] = (guint8) GST_DP_VERSION_MAJOR;
|
||||||
|
@ -257,7 +257,7 @@ gst_dp_packet_from_caps (const GstCaps * caps, GstDPHeaderFlag flags,
|
||||||
h[3] = GST_DP_PAYLOAD_CAPS;
|
h[3] = GST_DP_PAYLOAD_CAPS;
|
||||||
|
|
||||||
/* buffer properties */
|
/* buffer properties */
|
||||||
GST_WRITE_UINT32_BE (h + 4, strlen (string) + 1); /* include trailing 0 */
|
GST_WRITE_UINT32_BE (h + 4, strlen ((gchar *) string) + 1); /* include trailing 0 */
|
||||||
GST_WRITE_UINT64_BE (h + 8, (guint64) 0);
|
GST_WRITE_UINT64_BE (h + 8, (guint64) 0);
|
||||||
GST_WRITE_UINT64_BE (h + 16, (guint64) 0);
|
GST_WRITE_UINT64_BE (h + 16, (guint64) 0);
|
||||||
GST_WRITE_UINT64_BE (h + 24, (guint64) 0);
|
GST_WRITE_UINT64_BE (h + 24, (guint64) 0);
|
||||||
|
@ -276,7 +276,7 @@ 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 (string, strlen ((gchar *) string) + 1);
|
||||||
}
|
}
|
||||||
GST_WRITE_UINT16_BE (h + 58, crc);
|
GST_WRITE_UINT16_BE (h + 58, crc);
|
||||||
|
|
||||||
|
@ -379,7 +379,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 ((gchar *) * payload) + 1);
|
||||||
}
|
}
|
||||||
GST_WRITE_UINT16_BE (h + 58, crc);
|
GST_WRITE_UINT16_BE (h + 58, crc);
|
||||||
|
|
||||||
|
@ -443,7 +443,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, FALSE);
|
GST_DP_PAYLOAD_CAPS, FALSE);
|
||||||
|
|
||||||
string = payload;
|
string = (gchar *) payload;
|
||||||
caps = gst_caps_from_string (string);
|
caps = gst_caps_from_string (string);
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ static struct _elements_entry _elements[] = {
|
||||||
// {"statistics", GST_RANK_NONE, gst_statistics_get_type},
|
// {"statistics", GST_RANK_NONE, gst_statistics_get_type},
|
||||||
{"tee", GST_RANK_NONE, gst_tee_get_type},
|
{"tee", GST_RANK_NONE, gst_tee_get_type},
|
||||||
{"typefind", GST_RANK_NONE, gst_type_find_element_get_type},
|
{"typefind", GST_RANK_NONE, gst_type_find_element_get_type},
|
||||||
// {NULL, 0},
|
{NULL, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
@ -88,7 +88,9 @@ enum
|
||||||
PROP_SILENT,
|
PROP_SILENT,
|
||||||
PROP_DUMP,
|
PROP_DUMP,
|
||||||
PROP_PARENTSIZE,
|
PROP_PARENTSIZE,
|
||||||
PROP_LAST_MESSAGE
|
PROP_LAST_MESSAGE,
|
||||||
|
PROP_HAS_LOOP,
|
||||||
|
PROP_HAS_GETRANGE
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())
|
#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_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DUMP,
|
||||||
g_param_spec_boolean ("dump", "Dump", "Dump produced bytes to stdout",
|
g_param_spec_boolean ("dump", "Dump", "Dump produced bytes to stdout",
|
||||||
DEFAULT_DUMP, G_PARAM_READWRITE));
|
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] =
|
gst_fakesrc_signals[SIGNAL_HANDOFF] =
|
||||||
g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
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_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 1,
|
||||||
GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE);
|
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->start = GST_DEBUG_FUNCPTR (gst_fakesrc_start);
|
||||||
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_fakesrc_stop);
|
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_fakesrc_stop);
|
||||||
gstbasesrc_class->event = GST_DEBUG_FUNCPTR (gst_fakesrc_event_handler);
|
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:
|
case PROP_DUMP:
|
||||||
src->dump = g_value_get_boolean (value);
|
src->dump = g_value_get_boolean (value);
|
||||||
break;
|
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:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -476,6 +495,12 @@ gst_fakesrc_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
case PROP_LAST_MESSAGE:
|
case PROP_LAST_MESSAGE:
|
||||||
g_value_set_string (value, src->last_message);
|
g_value_set_string (value, src->last_message);
|
||||||
break;
|
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:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -369,6 +369,7 @@ gst_tee_sink_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
g_return_val_if_fail (tee->has_sink_loop, FALSE);
|
g_return_val_if_fail (tee->has_sink_loop, FALSE);
|
||||||
if (GST_ELEMENT_SCHEDULER (tee)) {
|
if (GST_ELEMENT_SCHEDULER (tee)) {
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
|
|
|
@ -128,7 +128,8 @@ static GstFlowReturn gst_type_find_element_chain (GstPad * sinkpad,
|
||||||
GstBuffer * buffer);
|
GstBuffer * buffer);
|
||||||
static GstFlowReturn gst_type_find_element_getrange (GstPad * srcpad,
|
static GstFlowReturn gst_type_find_element_getrange (GstPad * srcpad,
|
||||||
guint64 offset, guint length, GstBuffer ** buffer);
|
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
|
static GstElementStateReturn
|
||||||
gst_type_find_element_change_state (GstElement * element);
|
gst_type_find_element_change_state (GstElement * element);
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -463,7 +464,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) {
|
||||||
|
@ -806,13 +807,13 @@ gst_type_find_element_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_type_find_element_checkgetrange (GstPad * srcpad)
|
gst_type_find_element_checkgetrange (GstPad * srcpad, gboolean * random_access)
|
||||||
{
|
{
|
||||||
GstTypeFindElement *typefind;
|
GstTypeFindElement *typefind;
|
||||||
|
|
||||||
typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (srcpad));
|
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
|
static GstFlowReturn
|
||||||
|
@ -861,6 +862,7 @@ gst_type_find_element_activate (GstPad * pad, GstActivateMode mode)
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GST_ACTIVATE_PUSH:
|
case GST_ACTIVATE_PUSH:
|
||||||
case GST_ACTIVATE_PULL:
|
case GST_ACTIVATE_PULL:
|
||||||
|
case GST_ACTIVATE_PULL_RANGE:
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -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, (xmlChar *) "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, (xmlChar *) "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, (xmlChar *) "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, (xmlChar *) "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, (xmlChar *) "nick");
|
||||||
GstFormat fmt = gst_format_get_by_nick (nick);
|
GstFormat fmt = gst_format_get_by_nick ((gchar *) 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, (xmlChar *) "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, (xmlChar *) "writer", NULL);
|
||||||
xmlSetProp (writer, "id", ii->id_desc);
|
xmlSetProp (writer, (xmlChar *) "id", (xmlChar *) 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, (xmlChar *) "entries", (xmlChar *) 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, (xmlChar *) "datafile", (xmlChar *) buf);
|
||||||
|
|
||||||
formats = xmlNewChild (writer, NULL, "formats", NULL);
|
formats = xmlNewChild (writer, NULL, (xmlChar *) "formats", NULL);
|
||||||
g_snprintf (buf, bufsize, "%d", ii->nformats);
|
g_snprintf (buf, bufsize, "%d", ii->nformats);
|
||||||
xmlSetProp (formats, "count", buf);
|
xmlSetProp (formats, (xmlChar *) "count", (xmlChar *) 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, (xmlChar *) "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, (xmlChar *) "nick", (xmlChar *) def->nick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,11 +591,12 @@ 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 ((xmlChar *) "1.0");
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "gstfileindex", NULL);
|
doc->xmlRootNode =
|
||||||
xmlSetProp (doc->xmlRootNode, "version", "1");
|
xmlNewDocNode (doc, NULL, (xmlChar *) "gstfileindex", NULL);
|
||||||
|
xmlSetProp (doc->xmlRootNode, (xmlChar *) "version", (xmlChar *) "1");
|
||||||
|
|
||||||
writers = xmlNewChild (doc->xmlRootNode, NULL, "writers", NULL);
|
writers = xmlNewChild (doc->xmlRootNode, NULL, (xmlChar *) "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 +624,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, (gchar *) xmlmem, xmlsize, NULL, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
GST_ERROR_OBJECT (index, "%s", err->message);
|
GST_ERROR_OBJECT (index, "%s", err->message);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -32,6 +32,7 @@ TESTS = $(top_builddir)/tools/gst-register \
|
||||||
gst/gstobject \
|
gst/gstobject \
|
||||||
gst/gstpad \
|
gst/gstpad \
|
||||||
gst/gstsystemclock \
|
gst/gstsystemclock \
|
||||||
|
pipelines/simple_launch_lines \
|
||||||
gst-libs/gdp
|
gst-libs/gdp
|
||||||
|
|
||||||
check_PROGRAMS = $(TESTS)
|
check_PROGRAMS = $(TESTS)
|
||||||
|
|
|
@ -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 = (gchar *) 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 = (gchar *) 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 ((xmlChar *) "1.0");
|
||||||
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "GST-CompletionRegistry", NULL);
|
doc->xmlRootNode = xmlNewDocNode (doc, NULL,
|
||||||
|
(xmlChar *) "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 (doc->xmlRootNode, NULL, (xmlChar *) "element",
|
||||||
xmlNewChild (factorynode, NULL, "name",
|
NULL);
|
||||||
GST_PLUGIN_FEATURE_NAME (factory));
|
xmlNewChild (factorynode, NULL, (xmlChar *) "name",
|
||||||
|
(xmlChar *) 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, (xmlChar *) "srcpadtemplate",
|
||||||
padtemplate->name_template);
|
(xmlChar *) 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, (xmlChar *) "sinkpadtemplate",
|
||||||
padtemplate->name_template);
|
(xmlChar *) padtemplate->name_template);
|
||||||
}
|
}
|
||||||
|
|
||||||
pads = element->pads;
|
pads = element->pads;
|
||||||
|
@ -97,11 +99,11 @@ main (int argc, char *argv[])
|
||||||
pads = g_list_next (pads);
|
pads = g_list_next (pads);
|
||||||
|
|
||||||
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC)
|
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC)
|
||||||
padnode =
|
padnode = xmlNewChild (factorynode, NULL, (xmlChar *) "srcpad",
|
||||||
xmlNewChild (factorynode, NULL, "srcpad", GST_PAD_NAME (pad));
|
(xmlChar *) 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, (xmlChar *) "sinkpad",
|
||||||
xmlNewChild (factorynode, NULL, "sinkpad", GST_PAD_NAME (pad));
|
(xmlChar *) GST_PAD_NAME (pad));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write out the args */
|
/* write out the args */
|
||||||
|
@ -111,9 +113,10 @@ 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, (xmlChar *) "argument",
|
||||||
|
(xmlChar *) param->name);
|
||||||
if (param->value_type == GST_TYPE_URI) {
|
if (param->value_type == GST_TYPE_URI) {
|
||||||
xmlNewChild (argnode, NULL, "filename", NULL);
|
xmlNewChild (argnode, NULL, (xmlChar *) "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 +125,10 @@ 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 (argnode, NULL, (xmlChar *) "option",
|
||||||
xmlNewChild (optionnode, NULL, "value_nick", values[j].value_nick);
|
(xmlChar *) value);
|
||||||
|
xmlNewChild (optionnode, NULL, (xmlChar *) "value_nick",
|
||||||
|
(xmlChar *) values[j].value_nick);
|
||||||
g_free (value);
|
g_free (value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,8 @@ 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;
|
||||||
|
gint i;
|
||||||
gboolean readable;
|
gboolean readable;
|
||||||
const char *string_val;
|
const char *string_val;
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,8 @@ xmllaunch_parse_cmdline (const gchar ** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = gst_xml_new ();
|
xml = gst_xml_new ();
|
||||||
err = gst_xml_parse_file (xml, arg, NULL);
|
/* FIXME guchar from gstxml.c */
|
||||||
|
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,8 @@ 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;
|
||||||
|
gint 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