mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-13 19:44:10 +00:00
GstElement::new-pad -> pad-added, GstElement::state-change -> state-changed, GstValueFixedList -> GstValueArray, add ...
Original commit message from CVS: * docs/manual/advanced-autoplugging.xml: * docs/manual/basics-helloworld.xml: * docs/manual/basics-pads.xml: * docs/random/ds/0.9-suggested-changes: * gst/gstelement.c: (gst_element_class_init), (gst_element_seek): * gst/gstelement.h: * gst/gstevent.h: * gst/gstformat.h: * gst/gstquery.h: * gst/gststructure.c: (gst_structure_value_get_generic_type), (gst_structure_parse_array), (gst_structure_parse_value): * gst/gstvalue.c: (gst_type_is_fixed), (gst_value_list_prepend_value), (gst_value_list_append_value), (gst_value_list_get_size), (gst_value_list_get_value), (gst_value_transform_array_string), (gst_value_serialize_array), (gst_value_deserialize_array), (gst_value_intersect_array), (gst_value_is_fixed), (_gst_value_initialize): * gst/gstvalue.h: GstElement::new-pad -> pad-added, GstElement::state-change -> state-changed, GstValueFixedList -> GstValueArray, add format and flags as their own arguments in gst_element_seek() (should improve "bindeability"), remove function generators since they don't work under a whole bunch of compilers (they were deprecated already anyway).
This commit is contained in:
parent
b1f9462791
commit
3f62c7db23
13 changed files with 107 additions and 194 deletions
27
ChangeLog
27
ChangeLog
|
@ -1,3 +1,30 @@
|
|||
2005-07-20 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* docs/manual/advanced-autoplugging.xml:
|
||||
* docs/manual/basics-helloworld.xml:
|
||||
* docs/manual/basics-pads.xml:
|
||||
* docs/random/ds/0.9-suggested-changes:
|
||||
* gst/gstelement.c: (gst_element_class_init), (gst_element_seek):
|
||||
* gst/gstelement.h:
|
||||
* gst/gstevent.h:
|
||||
* gst/gstformat.h:
|
||||
* gst/gstquery.h:
|
||||
* gst/gststructure.c: (gst_structure_value_get_generic_type),
|
||||
(gst_structure_parse_array), (gst_structure_parse_value):
|
||||
* gst/gstvalue.c: (gst_type_is_fixed),
|
||||
(gst_value_list_prepend_value), (gst_value_list_append_value),
|
||||
(gst_value_list_get_size), (gst_value_list_get_value),
|
||||
(gst_value_transform_array_string), (gst_value_serialize_array),
|
||||
(gst_value_deserialize_array), (gst_value_intersect_array),
|
||||
(gst_value_is_fixed), (_gst_value_initialize):
|
||||
* gst/gstvalue.h:
|
||||
GstElement::new-pad -> pad-added, GstElement::state-change ->
|
||||
state-changed, GstValueFixedList -> GstValueArray, add format and
|
||||
flags as their own arguments in gst_element_seek() (should improve
|
||||
"bindeability"), remove function generators since they don't work
|
||||
under a whole bunch of compilers (they were deprecated already
|
||||
anyway).
|
||||
|
||||
2005-07-20 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* gst/gstinfo.c: (_gst_debug_nameof_funcptr),
|
||||
|
|
|
@ -365,7 +365,7 @@ close_link (GstPad *srcpad,
|
|||
gst_object_unref (GST_OBJECT (pad));
|
||||
|
||||
/* if we have static source pads, link those. If we have dynamic
|
||||
* source pads, listen for new-pad signals on the element */
|
||||
* source pads, listen for pad-added signals on the element */
|
||||
for ( ; templlist != NULL; templlist = templlist->next) {
|
||||
GstStaticPadTemplate *templ = templlist->data;
|
||||
|
||||
|
@ -396,7 +396,7 @@ close_link (GstPad *srcpad,
|
|||
|
||||
/* listen for newly created pads if this element supports that */
|
||||
if (has_dynamic_pads) {
|
||||
g_signal_connect (sinkelement, "new-pad", G_CALLBACK (cb_newpad), NULL);
|
||||
g_signal_connect (sinkelement, "pad-added", G_CALLBACK (cb_newpad), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
audio) and is called <quote>oggdemux</quote>. The second is a Vorbis
|
||||
audio decoder, it's conveniently called <quote>vorbisdec</quote>.
|
||||
Since <quote>oggdemux</quote> creates dynamic pads for each elementary
|
||||
stream, you'll need to set a <quote>new-pad</quote> event handler
|
||||
stream, you'll need to set a <quote>pad-added</quote> event handler
|
||||
on the <quote>oggdemux</quote> element, like you've learned in
|
||||
<xref linkend="section-pads-dynamic"/>, to link the Ogg parser and
|
||||
the Vorbis decoder elements together. At last, we'll also need an
|
||||
|
@ -145,10 +145,10 @@ main (int argc,
|
|||
|
||||
/* link together - note that we cannot link the parser and
|
||||
* decoder yet, becuse the parser uses dynamic pads. For that,
|
||||
* we set a new-pad signal handler. */
|
||||
* we set a pad-added signal handler. */
|
||||
gst_element_link (source, parser);
|
||||
gst_element_link_many (decoder, conv, sink, NULL);
|
||||
g_signal_connect (parser, "new-pad", G_CALLBACK (new_pad), NULL);
|
||||
g_signal_connect (parser, "pad-added", G_CALLBACK (new_pad), NULL);
|
||||
|
||||
/* put all elements in a bin */
|
||||
gst_bin_add_many (GST_BIN (pipeline),
|
||||
|
|
|
@ -105,7 +105,7 @@ main (int argc,
|
|||
gst_element_link_pads (source, "src", demux, "sink");
|
||||
|
||||
/* listen for newly created pads */
|
||||
g_signal_connect (demux, "new-pad", G_CALLBACK (cb_new_pad), NULL);
|
||||
g_signal_connect (demux, "pad-added", G_CALLBACK (cb_new_pad), NULL);
|
||||
|
||||
/* start the pipeline */
|
||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
|
||||
|
|
|
@ -42,17 +42,12 @@ API:
|
|||
- dparams: should be converted into some kind of special pad and
|
||||
object property combination.
|
||||
|
||||
- remove gst_element_yield()
|
||||
|
||||
- read/write locks on buffers
|
||||
|
||||
- be able to send events to unlinked pads (bug #114442)
|
||||
|
||||
- caps should have a flag on fields to indicate that the field is optional
|
||||
|
||||
- remove gst_pad_select() and add gst_pad_pull_many(), which pulls one
|
||||
buffer from one of many pads
|
||||
|
||||
- deprecate gst_buffer_merge() and replace with a function that takes
|
||||
ownership of the buffers. (bug #136408)
|
||||
|
||||
|
@ -65,11 +60,6 @@ API:
|
|||
|
||||
- don't install gstmarshal.h
|
||||
|
||||
- make GstPad and friends a real class heirarchy
|
||||
|
||||
- make GstBuffer/GstData a real class heirarchy, although maybe not
|
||||
as a subclass of GObject.
|
||||
|
||||
- remove unnecessary headers from gst.h (gstqueue.h in particular)
|
||||
|
||||
- make sure GstClockTime is used wherever it should (e.g. gstplay)
|
||||
|
@ -87,13 +77,8 @@ API:
|
|||
24 fps pulled down to 60 and straight video, etc) and make sure our
|
||||
video stream descriptions make sense.
|
||||
|
||||
- rename GST_TYPE_FIXED_LIST to GST_TYPE_ARRAY
|
||||
|
||||
- remove GstMemChunk
|
||||
|
||||
- remove GST_FORMATS_FUNCTION(). It doesn't work with non-c99
|
||||
compilers.
|
||||
|
||||
- do an audit to remove GtkObject-isms from gtk-1.2
|
||||
|
||||
caps:
|
||||
|
@ -138,10 +123,6 @@ bugs with interesting info:
|
|||
|
||||
|
||||
object hierarchy:
|
||||
- state_change in GstElementClass should be renamed to state_changed, since
|
||||
it's a signal triggered after state has changed
|
||||
|
||||
|
||||
- a method for elements to know when downstream elements are ignoring
|
||||
the data stream. This would allow automatic shutoff of pipelines
|
||||
whose processing is being dumped.
|
||||
|
@ -160,8 +141,3 @@ object hierarchy:
|
|||
- make this explicit by having a list of keywords instead of a fixed string
|
||||
with slashes
|
||||
- fix the editor/el browser to display this nicely
|
||||
|
||||
- optimization:
|
||||
- delay parsing caps from the registry until after startup (until they're
|
||||
first requested or maybe an idle handler for the main loop)
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ gst_element_class_init (GstElementClass * klass)
|
|||
parent_class = g_type_class_ref (GST_TYPE_OBJECT);
|
||||
|
||||
/**
|
||||
* GstElement::state-change:
|
||||
* GstElement::state-changed:
|
||||
* @gstelement: the object which received the signal
|
||||
* @int:
|
||||
* @int:
|
||||
|
@ -122,19 +122,19 @@ gst_element_class_init (GstElementClass * klass)
|
|||
* the #GstElementState of the element has been changed
|
||||
*/
|
||||
gst_element_signals[STATE_CHANGE] =
|
||||
g_signal_new ("state-change", G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstElementClass, state_change), NULL,
|
||||
g_signal_new ("state-changed", G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstElementClass, state_changed), NULL,
|
||||
NULL, gst_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
|
||||
/**
|
||||
* GstElement::new-pad:
|
||||
* GstElement::pad-added:
|
||||
* @gstelement: the object which received the signal
|
||||
* @object:
|
||||
*
|
||||
* a new #GstPad has been added to the element
|
||||
*/
|
||||
gst_element_signals[NEW_PAD] =
|
||||
g_signal_new ("new-pad", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstElementClass, new_pad), NULL, NULL,
|
||||
g_signal_new ("pad-added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstElementClass, pad_added), NULL, NULL,
|
||||
gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT);
|
||||
/**
|
||||
* GstElement::pad-removed:
|
||||
|
@ -1148,8 +1148,10 @@ gst_element_send_event (GstElement * element, GstEvent * event)
|
|||
/**
|
||||
* gst_element_seek:
|
||||
* @element: a #GstElement to send the event to.
|
||||
* @seek_type: the method to use for seeking.
|
||||
* @offset: the offset to seek to.
|
||||
* @seek_method: the method to use for seeking (GST_SEEK_METHOD_*).
|
||||
* @seek_format: the #GstFormat to use for seeking (GST_FORMAT_*).
|
||||
* @seek_flags: the flags to use for seeking (GST_SEEK_FLAG_*).
|
||||
* @offset: the offset to seek to (in the given seek_format).
|
||||
*
|
||||
* Sends a seek event to an element.
|
||||
*
|
||||
|
@ -1158,14 +1160,15 @@ gst_element_send_event (GstElement * element, GstEvent * event)
|
|||
* MT safe.
|
||||
*/
|
||||
gboolean
|
||||
gst_element_seek (GstElement * element, GstSeekType seek_type, guint64 offset)
|
||||
gst_element_seek (GstElement * element, GstSeekType seek_method,
|
||||
GstFormat seek_format, GstSeekType seek_flags, guint64 offset)
|
||||
{
|
||||
GstEvent *event;
|
||||
gboolean result;
|
||||
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
||||
|
||||
event = gst_event_new_seek (seek_type, offset);
|
||||
event = gst_event_new_seek (seek_method | seek_format | seek_flags, offset);
|
||||
result = gst_element_send_event (element, event);
|
||||
|
||||
return result;
|
||||
|
|
|
@ -89,23 +89,6 @@ typedef enum {
|
|||
#define GST_STATE_PAUSED_TO_READY ((GST_STATE_PAUSED<<8) | GST_STATE_READY)
|
||||
#define GST_STATE_READY_TO_NULL ((GST_STATE_READY<<8) | GST_STATE_NULL)
|
||||
|
||||
/* convenience functions */
|
||||
#ifdef G_HAVE_ISO_VARARGS
|
||||
#define GST_ELEMENT_QUERY_TYPE_FUNCTION(functionname, ...) \
|
||||
GST_QUERY_TYPE_FUNCTION (GstElement*, functionname, __VA_ARGS__);
|
||||
#define GST_ELEMENT_FORMATS_FUNCTION(functionname, ...) \
|
||||
GST_FORMATS_FUNCTION (GstElement*, functionname, __VA_ARGS__);
|
||||
#define GST_ELEMENT_EVENT_MASK_FUNCTION(functionname, ...) \
|
||||
GST_EVENT_MASK_FUNCTION (GstElement*, functionname, __VA_ARGS__);
|
||||
#elif defined(G_HAVE_GNUC_VARARGS)
|
||||
#define GST_ELEMENT_QUERY_TYPE_FUNCTION(functionname, a...) \
|
||||
GST_QUERY_TYPE_FUNCTION (GstElement*, functionname, a);
|
||||
#define GST_ELEMENT_FORMATS_FUNCTION(functionname, a...) \
|
||||
GST_FORMATS_FUNCTION (GstElement*, functionname, a);
|
||||
#define GST_ELEMENT_EVENT_MASK_FUNCTION(functionname, a...) \
|
||||
GST_EVENT_MASK_FUNCTION (GstElement*, functionname, a);
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/* ignore state changes from parent */
|
||||
|
@ -232,8 +215,8 @@ struct _GstElementClass
|
|||
|
||||
/*< private >*/
|
||||
/* signal callbacks */
|
||||
void (*state_change) (GstElement *element, GstElementState old, GstElementState state);
|
||||
void (*new_pad) (GstElement *element, GstPad *pad);
|
||||
void (*state_changed) (GstElement *element, GstElementState old, GstElementState state);
|
||||
void (*pad_added) (GstElement *element, GstPad *pad);
|
||||
void (*pad_removed) (GstElement *element, GstPad *pad);
|
||||
void (*no_more_pads) (GstElement *element);
|
||||
|
||||
|
@ -319,7 +302,10 @@ GstIterator * gst_element_iterate_sink_pads (GstElement * element);
|
|||
|
||||
/* event/query/format stuff */
|
||||
gboolean gst_element_send_event (GstElement *element, GstEvent *event);
|
||||
gboolean gst_element_seek (GstElement *element, GstSeekType seek_type,
|
||||
gboolean gst_element_seek (GstElement *element,
|
||||
GstSeekType seek_method,
|
||||
GstFormat seek_format,
|
||||
GstSeekType seek_flags,
|
||||
guint64 offset);
|
||||
G_CONST_RETURN GstQueryType*
|
||||
gst_element_get_query_types (GstElement *element);
|
||||
|
|
|
@ -96,30 +96,6 @@ typedef struct
|
|||
GstEventFlag flags;
|
||||
} GstEventMask;
|
||||
|
||||
#ifdef G_HAVE_ISO_VARARGS
|
||||
#define GST_EVENT_MASK_FUNCTION(type,functionname, ...) \
|
||||
static const GstEventMask* \
|
||||
functionname (type pad) \
|
||||
{ \
|
||||
static const GstEventMask masks[] = { \
|
||||
__VA_ARGS__, \
|
||||
{ 0, } \
|
||||
}; \
|
||||
return masks; \
|
||||
}
|
||||
#elif defined(G_HAVE_GNUC_VARARGS)
|
||||
#define GST_EVENT_MASK_FUNCTION(type,functionname, a...) \
|
||||
static const GstEventMask* \
|
||||
functionname (type pad) \
|
||||
{ \
|
||||
static const GstEventMask masks[] = { \
|
||||
a, \
|
||||
{ 0, } \
|
||||
}; \
|
||||
return masks; \
|
||||
}
|
||||
#endif
|
||||
|
||||
/* seek events, extends GstEventFlag */
|
||||
typedef enum {
|
||||
/* | with some format */
|
||||
|
|
|
@ -53,30 +53,6 @@ struct _GstFormatDefinition
|
|||
gchar *description;
|
||||
};
|
||||
|
||||
#ifdef G_HAVE_ISO_VARARGS
|
||||
#define GST_FORMATS_FUNCTION(type, functionname, ...) \
|
||||
static const GstFormat* \
|
||||
functionname (type object) \
|
||||
{ \
|
||||
static const GstFormat formats[] = { \
|
||||
__VA_ARGS__, \
|
||||
0 \
|
||||
}; \
|
||||
return formats; \
|
||||
}
|
||||
#elif defined(G_HAVE_GNUC_VARARGS)
|
||||
#define GST_FORMATS_FUNCTION(type, functionname, a...) \
|
||||
static const GstFormat* \
|
||||
functionname (type object) \
|
||||
{ \
|
||||
static const GstFormat formats[] = { \
|
||||
a, \
|
||||
0 \
|
||||
}; \
|
||||
return formats; \
|
||||
}
|
||||
#endif
|
||||
|
||||
void _gst_format_initialize (void);
|
||||
|
||||
/* register a new format */
|
||||
|
|
|
@ -59,30 +59,6 @@ struct _GstQueryTypeDefinition
|
|||
gchar *description;
|
||||
};
|
||||
|
||||
#ifdef G_HAVE_ISO_VARARGS
|
||||
#define GST_QUERY_TYPE_FUNCTION(type, functionname, ...) \
|
||||
static const GstQueryType* \
|
||||
functionname (type object) \
|
||||
{ \
|
||||
static const GstQueryType types[] = { \
|
||||
__VA_ARGS__, \
|
||||
0 \
|
||||
}; \
|
||||
return types; \
|
||||
}
|
||||
#elif defined(G_HAVE_GNUC_VARARGS)
|
||||
#define GST_QUERY_TYPE_FUNCTION(type, functionname, a...) \
|
||||
static const GstQueryType* \
|
||||
functionname (type object) \
|
||||
{ \
|
||||
static const GstQueryType types[] = { \
|
||||
a, \
|
||||
0 \
|
||||
}; \
|
||||
return types; \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define GST_TYPE_QUERY (gst_query_get_type())
|
||||
#define GST_IS_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_QUERY))
|
||||
#define GST_IS_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_QUERY))
|
||||
|
|
|
@ -1091,7 +1091,7 @@ static GType
|
|||
gst_structure_value_get_generic_type (GValue * val)
|
||||
{
|
||||
if (G_VALUE_TYPE (val) == GST_TYPE_LIST
|
||||
|| G_VALUE_TYPE (val) == GST_TYPE_FIXED_LIST) {
|
||||
|| G_VALUE_TYPE (val) == GST_TYPE_ARRAY) {
|
||||
GArray *array = g_value_peek_pointer (val);
|
||||
|
||||
if (array->len > 0) {
|
||||
|
@ -1328,11 +1328,11 @@ gst_structure_parse_list (gchar * s, gchar ** after, GValue * value, GType type)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_structure_parse_fixed_list (gchar * s, gchar ** after, GValue * value,
|
||||
gst_structure_parse_array (gchar * s, gchar ** after, GValue * value,
|
||||
GType type)
|
||||
{
|
||||
return gst_structure_parse_any_list (s, after, value, type,
|
||||
GST_TYPE_FIXED_LIST, '<', '>');
|
||||
GST_TYPE_ARRAY, '<', '>');
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -1439,7 +1439,7 @@ gst_structure_parse_value (gchar * str,
|
|||
} else if (*s == '{') {
|
||||
ret = gst_structure_parse_list (s, &s, value, type);
|
||||
} else if (*s == '<') {
|
||||
ret = gst_structure_parse_fixed_list (s, &s, value, type);
|
||||
ret = gst_structure_parse_array (s, &s, value, type);
|
||||
} else {
|
||||
value_s = s;
|
||||
if (!gst_structure_parse_string (s, &value_end, &s))
|
||||
|
|
100
gst/gstvalue.c
100
gst/gstvalue.c
|
@ -57,7 +57,7 @@ GType gst_type_fourcc;
|
|||
GType gst_type_int_range;
|
||||
GType gst_type_double_range;
|
||||
GType gst_type_list;
|
||||
GType gst_type_fixed_list;
|
||||
GType gst_type_array;
|
||||
GType gst_type_fraction;
|
||||
|
||||
static GArray *gst_value_table;
|
||||
|
@ -70,7 +70,7 @@ static GArray *gst_value_subtract_funcs;
|
|||
********/
|
||||
|
||||
/* two helper functions to serialize/stringify any type of list
|
||||
* regular lists are done with { }, fixed lists with < >
|
||||
* regular lists are done with { }, arrays with < >
|
||||
*/
|
||||
static char *
|
||||
gst_value_serialize_any_list (const GValue * value, const char *begin,
|
||||
|
@ -124,7 +124,32 @@ gst_value_transform_any_list_string (const GValue * src_value,
|
|||
dest_value->data[0].v_pointer = g_string_free (s, FALSE);
|
||||
}
|
||||
|
||||
/* GValue functions usable for both regular lists and fixed lists */
|
||||
/*
|
||||
* helper function to see if a type is fixed. Is used internally here and
|
||||
* there. Do not export, since it doesn't work for types where the content
|
||||
* decides the fixedness (e.g. GST_TYPE_ARRAY).
|
||||
*/
|
||||
|
||||
static gboolean
|
||||
gst_type_is_fixed (GType type)
|
||||
{
|
||||
if (type == GST_TYPE_INT_RANGE || type == GST_TYPE_DOUBLE_RANGE ||
|
||||
type == GST_TYPE_LIST) {
|
||||
return FALSE;
|
||||
}
|
||||
if (G_TYPE_FUNDAMENTAL (type) <=
|
||||
G_TYPE_MAKE_FUNDAMENTAL (G_TYPE_RESERVED_GLIB_LAST)) {
|
||||
return TRUE;
|
||||
}
|
||||
if (type == GST_TYPE_BUFFER || type == GST_TYPE_FOURCC
|
||||
|| type == GST_TYPE_ARRAY || type == GST_TYPE_FRACTION) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* GValue functions usable for both regular lists and arrays */
|
||||
static void
|
||||
gst_value_init_list (GValue * value)
|
||||
{
|
||||
|
@ -222,7 +247,7 @@ gst_value_list_prepend_value (GValue * value, const GValue * prepend_value)
|
|||
GValue val = { 0, };
|
||||
|
||||
g_return_if_fail (GST_VALUE_HOLDS_LIST (value)
|
||||
|| GST_VALUE_HOLDS_FIXED_LIST (value));
|
||||
|| GST_VALUE_HOLDS_ARRAY (value));
|
||||
|
||||
gst_value_init_and_copy (&val, prepend_value);
|
||||
g_array_prepend_vals ((GArray *) value->data[0].v_pointer, &val, 1);
|
||||
|
@ -241,7 +266,7 @@ gst_value_list_append_value (GValue * value, const GValue * append_value)
|
|||
GValue val = { 0, };
|
||||
|
||||
g_return_if_fail (GST_VALUE_HOLDS_LIST (value)
|
||||
|| GST_VALUE_HOLDS_FIXED_LIST (value));
|
||||
|| GST_VALUE_HOLDS_ARRAY (value));
|
||||
|
||||
gst_value_init_and_copy (&val, append_value);
|
||||
g_array_append_vals ((GArray *) value->data[0].v_pointer, &val, 1);
|
||||
|
@ -259,7 +284,7 @@ guint
|
|||
gst_value_list_get_size (const GValue * value)
|
||||
{
|
||||
g_return_val_if_fail (GST_VALUE_HOLDS_LIST (value)
|
||||
|| GST_VALUE_HOLDS_FIXED_LIST (value), 0);
|
||||
|| GST_VALUE_HOLDS_ARRAY (value), 0);
|
||||
|
||||
return ((GArray *) value->data[0].v_pointer)->len;
|
||||
}
|
||||
|
@ -278,7 +303,7 @@ const GValue *
|
|||
gst_value_list_get_value (const GValue * value, guint index)
|
||||
{
|
||||
g_return_val_if_fail (GST_VALUE_HOLDS_LIST (value)
|
||||
|| GST_VALUE_HOLDS_FIXED_LIST (value), NULL);
|
||||
|| GST_VALUE_HOLDS_ARRAY (value), NULL);
|
||||
g_return_val_if_fail (index < gst_value_list_get_size (value), NULL);
|
||||
|
||||
return (const GValue *) &g_array_index ((GArray *) value->data[0].v_pointer,
|
||||
|
@ -341,8 +366,7 @@ gst_value_transform_list_string (const GValue * src_value, GValue * dest_value)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_value_transform_fixed_list_string (const GValue * src_value,
|
||||
GValue * dest_value)
|
||||
gst_value_transform_array_string (const GValue * src_value, GValue * dest_value)
|
||||
{
|
||||
gst_value_transform_any_list_string (src_value, dest_value, "< ", " >");
|
||||
}
|
||||
|
@ -388,13 +412,13 @@ gst_value_deserialize_list (GValue * dest, const char *s)
|
|||
}
|
||||
|
||||
static char *
|
||||
gst_value_serialize_fixed_list (const GValue * value)
|
||||
gst_value_serialize_array (const GValue * value)
|
||||
{
|
||||
return gst_value_serialize_any_list (value, "< ", " >");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_value_deserialize_fixed_list (GValue * dest, const char *s)
|
||||
gst_value_deserialize_array (GValue * dest, const char *s)
|
||||
{
|
||||
g_warning ("unimplemented");
|
||||
return FALSE;
|
||||
|
@ -1736,7 +1760,7 @@ gst_value_intersect_list (GValue * dest, const GValue * value1,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_value_intersect_fixed_list (GValue * dest, const GValue * src1,
|
||||
gst_value_intersect_array (GValue * dest, const GValue * src1,
|
||||
const GValue * src2)
|
||||
{
|
||||
gint size, n;
|
||||
|
@ -1746,7 +1770,7 @@ gst_value_intersect_fixed_list (GValue * dest, const GValue * src1,
|
|||
size = gst_value_list_get_size (src1);
|
||||
if (size != gst_value_list_get_size (src2))
|
||||
return FALSE;
|
||||
g_value_init (dest, GST_TYPE_FIXED_LIST);
|
||||
g_value_init (dest, GST_TYPE_ARRAY);
|
||||
|
||||
for (n = 0; n < size; n++) {
|
||||
if (!gst_value_intersect (&val, gst_value_list_get_value (src1, n),
|
||||
|
@ -2544,36 +2568,6 @@ gst_value_deserialize (GValue * dest, const gchar * src)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_type_is_fixed:
|
||||
* @type: the #GType to check
|
||||
*
|
||||
* Tests if the given GType, if available in a GstStructure (or any other
|
||||
* container) will contain a "fixed" (which means: one possible value) or
|
||||
* an "unfixed" (which means: multiple possible values, such as data lists
|
||||
* or data ranges) value.
|
||||
*
|
||||
* Returns: true if the type is "fixed".
|
||||
*/
|
||||
gboolean
|
||||
gst_type_is_fixed (GType type)
|
||||
{
|
||||
if (type == GST_TYPE_INT_RANGE || type == GST_TYPE_DOUBLE_RANGE ||
|
||||
type == GST_TYPE_LIST) {
|
||||
return FALSE;
|
||||
}
|
||||
if (G_TYPE_FUNDAMENTAL (type) <=
|
||||
G_TYPE_MAKE_FUNDAMENTAL (G_TYPE_RESERVED_GLIB_LAST)) {
|
||||
return TRUE;
|
||||
}
|
||||
if (type == GST_TYPE_BUFFER || type == GST_TYPE_FOURCC
|
||||
|| type == GST_TYPE_FIXED_LIST || type == GST_TYPE_FRACTION) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_value_is_fixed:
|
||||
* @value: the #GValue to check
|
||||
|
@ -2591,7 +2585,7 @@ gst_value_is_fixed (const GValue * value)
|
|||
{
|
||||
GType type = G_VALUE_TYPE (value);
|
||||
|
||||
if (type == GST_TYPE_FIXED_LIST) {
|
||||
if (type == GST_TYPE_ARRAY) {
|
||||
gboolean fixed = TRUE;
|
||||
gint size, n;
|
||||
const GValue *kid;
|
||||
|
@ -3103,15 +3097,15 @@ _gst_value_initialize (void)
|
|||
static GstValueTable gst_value = {
|
||||
0,
|
||||
gst_value_compare_list,
|
||||
gst_value_serialize_fixed_list,
|
||||
gst_value_deserialize_fixed_list,
|
||||
gst_value_serialize_array,
|
||||
gst_value_deserialize_array,
|
||||
};
|
||||
|
||||
info.value_table = &value_table;
|
||||
gst_type_fixed_list =
|
||||
gst_type_array =
|
||||
g_type_register_fundamental (g_type_fundamental_next (),
|
||||
"GstValueFixedList", &info, &finfo, 0);
|
||||
gst_value.type = gst_type_fixed_list;
|
||||
"GstValueArray", &info, &finfo, 0);
|
||||
gst_value.type = gst_type_array;
|
||||
gst_value_register (&gst_value);
|
||||
}
|
||||
|
||||
|
@ -3207,8 +3201,8 @@ _gst_value_initialize (void)
|
|||
gst_value_transform_double_range_string);
|
||||
g_value_register_transform_func (GST_TYPE_LIST, G_TYPE_STRING,
|
||||
gst_value_transform_list_string);
|
||||
g_value_register_transform_func (GST_TYPE_FIXED_LIST, G_TYPE_STRING,
|
||||
gst_value_transform_fixed_list_string);
|
||||
g_value_register_transform_func (GST_TYPE_ARRAY, G_TYPE_STRING,
|
||||
gst_value_transform_array_string);
|
||||
g_value_register_transform_func (GST_TYPE_FRACTION, G_TYPE_STRING,
|
||||
gst_value_transform_fraction_string);
|
||||
g_value_register_transform_func (G_TYPE_STRING, GST_TYPE_FRACTION,
|
||||
|
@ -3226,8 +3220,8 @@ _gst_value_initialize (void)
|
|||
gst_value_intersect_double_double_range);
|
||||
gst_value_register_intersect_func (GST_TYPE_DOUBLE_RANGE,
|
||||
GST_TYPE_DOUBLE_RANGE, gst_value_intersect_double_range_double_range);
|
||||
gst_value_register_intersect_func (GST_TYPE_FIXED_LIST,
|
||||
GST_TYPE_FIXED_LIST, gst_value_intersect_fixed_list);
|
||||
gst_value_register_intersect_func (GST_TYPE_ARRAY,
|
||||
GST_TYPE_ARRAY, gst_value_intersect_array);
|
||||
|
||||
gst_value_register_subtract_func (G_TYPE_INT, GST_TYPE_INT_RANGE,
|
||||
gst_value_subtract_int_int_range);
|
||||
|
|
|
@ -38,8 +38,8 @@ G_BEGIN_DECLS
|
|||
#define GST_VALUE_HOLDS_FOURCC(x) (G_VALUE_HOLDS(x, gst_type_fourcc))
|
||||
#define GST_VALUE_HOLDS_INT_RANGE(x) (G_VALUE_HOLDS(x, gst_type_int_range))
|
||||
#define GST_VALUE_HOLDS_DOUBLE_RANGE(x) (G_VALUE_HOLDS(x, gst_type_double_range))
|
||||
#define GST_VALUE_HOLDS_LIST(x) (G_VALUE_HOLDS(x, gst_type_list))
|
||||
#define GST_VALUE_HOLDS_FIXED_LIST(x) (G_VALUE_HOLDS(x, gst_type_fixed_list))
|
||||
#define GST_VALUE_HOLDS_LIST(x) (G_VALUE_HOLDS(x, gst_type_list))
|
||||
#define GST_VALUE_HOLDS_ARRAY(x) (G_VALUE_HOLDS(x, gst_type_array))
|
||||
#define GST_VALUE_HOLDS_CAPS(x) (G_VALUE_HOLDS(x, GST_TYPE_CAPS))
|
||||
#define GST_VALUE_HOLDS_FRACTION(x) (G_VALUE_HOLDS(x, gst_type_fraction))
|
||||
|
||||
|
@ -47,7 +47,7 @@ G_BEGIN_DECLS
|
|||
#define GST_TYPE_INT_RANGE gst_type_int_range
|
||||
#define GST_TYPE_DOUBLE_RANGE gst_type_double_range
|
||||
#define GST_TYPE_LIST gst_type_list
|
||||
#define GST_TYPE_FIXED_LIST gst_type_fixed_list
|
||||
#define GST_TYPE_ARRAY gst_type_array
|
||||
#define GST_TYPE_FRACTION gst_type_fraction
|
||||
|
||||
#define GST_VALUE_LESS_THAN (-1)
|
||||
|
@ -85,7 +85,7 @@ GST_EXPORT GType gst_type_fourcc;
|
|||
GST_EXPORT GType gst_type_int_range;
|
||||
GST_EXPORT GType gst_type_double_range;
|
||||
GST_EXPORT GType gst_type_list;
|
||||
GST_EXPORT GType gst_type_fixed_list;
|
||||
GST_EXPORT GType gst_type_array;
|
||||
GST_EXPORT GType gst_type_fraction;
|
||||
|
||||
void gst_value_register (const GstValueTable *table);
|
||||
|
@ -181,7 +181,6 @@ void gst_value_register_subtract_func (GType minuend_type,
|
|||
GstValueSubtractFunc func);
|
||||
|
||||
/* fixation */
|
||||
gboolean gst_type_is_fixed (GType type);
|
||||
gboolean gst_value_is_fixed (const GValue *value);
|
||||
|
||||
/* private */
|
||||
|
|
Loading…
Reference in a new issue