gst/: Backport HEAD changes, mostly docs.

Original commit message from CVS:
* gst/gst_private.h:
* gst/gstbin.c: (gst_bin_get_by_name_recurse_up):
* gst/gstbuffer.h:
* gst/gstclock.c: (gst_clock_id_ref), (gst_clock_id_unref),
(gst_clock_id_compare_func), (gst_clock_id_wait),
(gst_clock_id_wait_async), (gst_clock_init),
(gst_clock_adjust_unlocked), (gst_clock_get_time):
* gst/gstclock.h:
* gst/gstelement.c: (gst_element_class_init),
(gst_element_get_random_pad), (gst_element_get_state_func),
(gst_element_lost_state):
* gst/gstelement.h:
* gst/gstelementfactory.c: (gst_element_register):
* gst/gstiterator.c:
* gst/gstobject.c: (gst_object_set_parent):
* gst/gstobject.h:
* gst/gstpad.c: (gst_pad_push), (gst_pad_pull_range),
(gst_pad_query):
* gst/gstpad.h:
* gst/gstplugin.h:
* gst/gstprobe.h:
* gst/parse/parse.l:
* gst/registries/gstxmlregistry.c: (gst_xml_registry_load):
Backport HEAD changes, mostly docs.
Fix possible deadlock in _get_random_pad.
This commit is contained in:
Wim Taymans 2005-03-09 11:05:00 +00:00
parent c10560ebec
commit b43d8f1006
17 changed files with 234 additions and 158 deletions

View file

@ -1,3 +1,31 @@
2005-03-09 Wim Taymans <wim@fluendo.com>
* gst/gst_private.h:
* gst/gstbin.c: (gst_bin_get_by_name_recurse_up):
* gst/gstbuffer.h:
* gst/gstclock.c: (gst_clock_id_ref), (gst_clock_id_unref),
(gst_clock_id_compare_func), (gst_clock_id_wait),
(gst_clock_id_wait_async), (gst_clock_init),
(gst_clock_adjust_unlocked), (gst_clock_get_time):
* gst/gstclock.h:
* gst/gstelement.c: (gst_element_class_init),
(gst_element_get_random_pad), (gst_element_get_state_func),
(gst_element_lost_state):
* gst/gstelement.h:
* gst/gstelementfactory.c: (gst_element_register):
* gst/gstiterator.c:
* gst/gstobject.c: (gst_object_set_parent):
* gst/gstobject.h:
* gst/gstpad.c: (gst_pad_push), (gst_pad_pull_range),
(gst_pad_query):
* gst/gstpad.h:
* gst/gstplugin.h:
* gst/gstprobe.h:
* gst/parse/parse.l:
* gst/registries/gstxmlregistry.c: (gst_xml_registry_load):
Backport HEAD changes, mostly docs.
Fix possible deadlock in _get_random_pad.
2005-03-08 Wim Taymans <wim@fluendo.com>
* MAINTAINERS:

View file

@ -37,12 +37,6 @@ extern const char *g_log_domain_gstreamer;
#include <stdlib.h>
#include <string.h>
#define GST_UNLOCK_RETURN(obj,val) \
G_STMT_START { \
GST_UNLOCK(obj); \
return val; \
} G_STMT_END
gboolean __gst_in_valgrind (void);
/*** debugging categories *****************************************************/

View file

@ -1085,11 +1085,12 @@ gst_bin_get_by_name_recurse_up (GstBin * bin, const gchar * name)
GstObject *parent;
parent = gst_object_get_parent (GST_OBJECT_CAST (bin));
if (parent && GST_IS_BIN (parent)) {
result = gst_bin_get_by_name_recurse_up (GST_BIN_CAST (parent), name);
if (parent) {
if (GST_IS_BIN (parent)) {
result = gst_bin_get_by_name_recurse_up (GST_BIN_CAST (parent), name);
}
gst_object_unref (parent);
}
gst_object_unref (parent);
}
return result;

View file

@ -81,11 +81,9 @@ extern GType _gst_buffer_type;
* @GST_BUFFER_ORIGINAL: buffer is not a copy of another buffer.
* @GST_BUFFER_DONTFREE: do not try to free the data when this buffer is
* unreferenced.
* @GST_BUFFER_KEY_UNIT: the buffer holds a key unit, a unit that can be
* decoded independently of other buffers.
* This flag has been deprecated, see #GST_BUFFER_DELTA_UNIT.
* @GST_BUFFER_DONTKEEP: the buffer should not be ref()ed, but copied instead
* before doing anything with it (for specially allocated hw buffers and such)
* @GST_BUFFER_PREROLL: the buffer is part of a preroll and should not be
* displayed.
* @GST_BUFFER_DISCONT: the buffer marks a discontinuity in the stream.
* @GST_BUFFER_IN_CAPS: the buffer has been added as a field in a #GstCaps.
* @GST_BUFFER_GAP: the buffer has been created to fill a gap in the stream.
* @GST_BUFFER_DELTA_UNIT: this unit cannot be decoded independently.

View file

@ -60,7 +60,7 @@ G_STMT_START { \
#define GST_TIME_TO_TIMESPEC(t,ts) \
G_STMT_START { \
(ts).tv_sec = (t) / GST_SECOND; \
(ts).tv_usec = ((t) - (ts).tv_sec * GST_SECOND) / GST_NSECOND; \
(ts).tv_nsec = ((t) - (ts).tv_sec * GST_SECOND) / GST_NSECOND; \
} G_STMT_END
/* timestamp debugging macros */

View file

@ -119,18 +119,46 @@ gst_element_class_init (GstElementClass * klass)
parent_class = g_type_class_ref (GST_TYPE_OBJECT);
/**
* GstElement::state-change:
* @gstelement: the object which received the signal
* @int:
* @int:
*
* 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,
NULL, gst_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
/**
* GstElement::new-pad:
* @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,
gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT);
/**
* GstElement::pad-removed:
* @gstelement: the object which received the signal
* @object:
*
* a #GstPad has been removed from the element
*/
gst_element_signals[PAD_REMOVED] =
g_signal_new ("pad-removed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, pad_removed), NULL, NULL,
gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT);
/**
* GstElement::no-more-pads:
* @gstelement: the object which received the signal
*
* ?
*/
gst_element_signals[NO_MORE_PADS] =
g_signal_new ("no-more-pads", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstElementClass, no_more_pads), NULL,
@ -975,17 +1003,17 @@ gst_element_get_random_pad (GstElement * element, GstPadDirection dir)
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "getting a random pad");
GST_LOCK (element);
switch (dir) {
case GST_PAD_SRC:
GST_LOCK (element);
pads = element->srcpads;
break;
case GST_PAD_SINK:
GST_LOCK (element);
pads = element->sinkpads;
break;
default:
g_warning ("unknown pad direction");
return NULL;
goto wrong_direction;
}
for (; pads; pads = g_list_next (pads)) {
GstPad *pad = GST_PAD (pads->data);
@ -1010,6 +1038,13 @@ gst_element_get_random_pad (GstElement * element, GstPadDirection dir)
GST_UNLOCK (element);
return result;
/* ERROR handling */
wrong_direction:
{
g_warning ("unknown pad direction");
return NULL;
}
}
/**

View file

@ -1,7 +1,6 @@
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
* 2004 Wim Taymans <wim@fluendo.com>
* 2000,2004 Wim Taymans <wim@fluendo.com>
*
* gstelement.h: Header for GstElement
*
@ -37,7 +36,9 @@
#include <gst/gstmessage.h>
#include <gst/gsttag.h>
G_BEGIN_DECLS typedef struct _GstElementDetails GstElementDetails;
G_BEGIN_DECLS
typedef struct _GstElementDetails GstElementDetails;
/* FIXME: need translatable stuff in here (how handle in registry)? */
struct _GstElementDetails
@ -52,7 +53,7 @@ struct _GstElementDetails
gpointer _gst_reserved[GST_PADDING];
};
#define GST_ELEMENT_DETAILS(longname,klass,description,author) \
#define GST_ELEMENT_DETAILS(longname,klass,description,author) \
{ longname, klass, description, author, GST_PADDING_INIT }
#define GST_IS_ELEMENT_DETAILS(details) ( \
(details) && ((details)->longname != NULL) && ((details)->klass != NULL) \
@ -113,9 +114,11 @@ typedef enum
GST_ELEMENT_LOCKED_STATE,
/* use some padding for future expansion */
GST_ELEMENT_FLAG_LAST = GST_OBJECT_FLAG_LAST + 16
GST_ELEMENT_FLAG_LAST = GST_OBJECT_FLAG_LAST + 16
} GstElementFlags;
#define GST_ELEMENT_IS_LOCKED_STATE(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_LOCKED_STATE))
#define GST_ELEMENT_NAME(obj) (GST_OBJECT_NAME(obj))
#define GST_ELEMENT_PARENT(obj) (GST_ELEMENT_CAST(GST_OBJECT_PARENT(obj)))
#define GST_ELEMENT_MANAGER(obj) (GST_ELEMENT_CAST(obj)->manager)
@ -124,7 +127,18 @@ typedef enum
#define GST_ELEMENT_CLOCK(obj) (GST_ELEMENT_CAST(obj)->clock)
#define GST_ELEMENT_PADS(obj) (GST_ELEMENT_CAST(obj)->pads)
/* log a (fatal) error message and post it on the bus */
/**
* GST_ELEMENT_ERROR:
* @el: the element that throws the error
* @domain: like CORE, LIBRARY, RESOURCE or STREAM (see #GstError)
* @code: error code defined for that domain (see #GstError)
* @message: the message to display (format string and args enclosed in round brackets)
* @debug: debugging information for the message (format string and args enclosed in round brackets)
*
* Utility function that elements can use in case they encountered a fatal
* data processing error. The pipeline will throw an error signal and the
* application will be requested to stop further media processing.
*/
#define GST_ELEMENT_ERROR(el, domain, code, text, debug) \
G_STMT_START { \
gchar *__txt = _gst_element_error_printf text; \
@ -135,7 +149,7 @@ G_STMT_START { \
GST_ERROR_OBJECT (el, "%s", __dbg); \
gst_element_message_full (GST_ELEMENT(el), GST_MESSAGE_ERROR, \
GST_ ## domain ## _ERROR, GST_ ## domain ## _ERROR_ ## code, \
__txt, __dbg, __FILE__, GST_FUNCTION, __LINE__); \
__txt, __dbg, __FILE__, GST_FUNCTION, __LINE__); \
} G_STMT_END
/* log a (non-fatal) warning message and post it on the bus */
@ -160,7 +174,7 @@ G_STMT_START { \
#define GST_STATE_GET_COND(elem) (GST_ELEMENT_CAST(elem)->state_cond)
#define GST_STATE_WAIT(elem) g_cond_wait (GST_STATE_GET_COND (elem), GST_STATE_GET_LOCK (elem))
#define GST_STATE_TIMED_WAIT(elem, timeval) g_cond_timed_wait (GST_STATE_GET_COND (elem), GST_STATE_GET_LOCK (elem),\
timeval)
timeval)
#define GST_STATE_SIGNAL(elem) g_cond_signal (GST_STATE_GET_COND (elem));
#define GST_STATE_BROADCAST(elem) g_cond_broadcast (GST_STATE_GET_COND (elem));
@ -267,7 +281,7 @@ struct _GstElementClass
GstFormat * format, gint64 * value);
/*< private > */
gpointer _gst_reserved[GST_PADDING - 1];
gpointer _gst_reserved[GST_PADDING];
};
/* class stuff */

View file

@ -254,7 +254,7 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank,
interfaces = g_type_interfaces (type, &n_interfaces);
for (i = 0; i < n_interfaces; i++) {
//__gst_element_factory_add_interface (factory, g_type_name (interfaces[i]));
__gst_element_factory_add_interface (factory, g_type_name (interfaces[i]));
}
g_free (interfaces);

View file

@ -52,6 +52,9 @@ gst_iterator_init (GstIterator * it,
*
* Create a new iterator. This function is mainly used for objects
* implementing the next/resync/free function to iterate a data structure.
*
* For each item retrieved, the @item function is called with the lock
* held. The @free function is called when the iterator is freed.
*
* Returns: the new #GstIterator.
*
@ -124,9 +127,8 @@ gst_list_iterator_free (GstListIterator * it)
* @master_cookie: pointer to a guint32 to protect the list.
* @list: pointer to the list
* @owner: object owning the list
* @ref: function to ref each item
* @unref: function to unref each item
* @free: function to free the owner of the list
* @item: function to call for each item
* @free: function to call when the iterator is freed
*
* Create a new iterator designed for iterating @list.
*

View file

@ -344,9 +344,7 @@ gst_object_unref (GstObject * object)
* creating a new object to symbolically 'take ownership' of the object.
* Use #gst_object_set_parent to have this done for you.
*
* This function takes the object lock.
*
* MT safe.
* MT safe. This function grabs and releases the object lock.
*/
void
gst_object_sink (GstObject * object)
@ -375,6 +373,9 @@ gst_object_sink (GstObject * object)
* function, it does not take any locks. You might want to lock
* the object owning the oldobj pointer before calling this
* function.
*
* Make sure not to LOCK the oldobj because it might be unreffed
* which could cause a deadlock when it is disposed.
*/
void
gst_object_replace (GstObject ** oldobj, GstObject * newobj)
@ -530,13 +531,13 @@ gst_object_dispatch_properties_changed (GObject * object,
* @excluded_props: a set of user-specified properties to exclude or
* NULL to show all changes.
*
* Adds a default deep_notify signal callback to an
* element. The user data should contain a pointer to an array of
* strings that should be excluded from the notify.
* The default handler will print the new value of the property
* A default deep_notify signal callback for an element. The user data
* should contain a pointer to an array of strings that should be excluded
* from the notify. The default handler will print the new value of the property
* using g_print.
*
* MT safe.
* MT safe. This function grabs and releases the object's LOCK or getting the
* path string of the object.
*/
void
gst_object_default_deep_notify (GObject * object, GstObject * orig,
@ -673,7 +674,7 @@ had_parent:
*
* Returns: the name of the object. g_free() after usage.
*
* MT safe.
* MT safe. This function grabs and releases the object's LOCK.
*/
gchar *
gst_object_get_name (GstObject * object)
@ -722,7 +723,7 @@ gst_object_set_name_prefix (GstObject * object, const gchar * name_prefix)
*
* Returns: the name prefix of the object. g_free() after usage.
*
* MT safe.
* MT safe. This function grabs and releases the object's LOCK.
*/
gchar *
gst_object_get_name_prefix (GstObject * object)
@ -746,15 +747,13 @@ gst_object_get_name_prefix (GstObject * object)
* Sets the parent of @object. The object's reference count will be incremented,
* and any floating reference will be removed (see gst_object_sink()).
*
* This function takes the object lock.
*
* Causes the parent-set signal to be emitted.
*
* Returns: TRUE if the parent could be set or FALSE when the object
* already had a parent, the object and parent are the same or wrong
* parameters were provided.
*
* MT safe.
* MT safe. Grabs and releases the object's LOCK.
*/
gboolean
gst_object_set_parent (GstObject * object, GstObject * parent)
@ -782,9 +781,10 @@ gst_object_set_parent (GstObject * object, GstObject * parent)
}
g_signal_emit (G_OBJECT (object), gst_object_signals[PARENT_SET], 0, parent);
return TRUE;
/* ERROR */
/* ERROR handling */
had_parent:
{
GST_UNLOCK (object);
@ -802,7 +802,7 @@ had_parent:
* Returns: parent of the object, this can be NULL if the object has no
* parent. unref after usage.
*
* MT safe.
* MT safe. Grabs and releases the object's LOCK.
*/
GstObject *
gst_object_get_parent (GstObject * object)
@ -828,7 +828,7 @@ gst_object_get_parent (GstObject * object)
* This function decreases the refcount of the object so the object
* might not point to valid memory anymore after calling this function.
*
* MT safe.
* MT safe. Grabs and releases the object's lock.
*/
void
gst_object_unparent (GstObject * object)
@ -867,7 +867,7 @@ gst_object_unparent (GstObject * object)
*
* Returns: TRUE if the name does not appear in the list, FALSE if it does.
*
* MT safe.
* MT safe. Grabs and releases the LOCK of each object in the list.
*/
gboolean
gst_object_check_uniqueness (GList * list, const gchar * name)
@ -1001,7 +1001,8 @@ gst_object_get_property (GObject * object, guint prop_id,
* Returns: a string describing the path of the object. You must
* g_free() the string after usage.
*
* MT safe.
* MT safe. Grabs and releases the object's LOCK for all objects
* in the hierarchy.
*/
gchar *
gst_object_get_path_string (GstObject * object)

View file

@ -1,7 +1,7 @@
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
* 2004 Wim Taymans <wim@fluendo.com>
* 2005 Wim Taymans <wim@fluendo.com>
*
* gstobject.h: Header for base GstObject
*
@ -21,7 +21,6 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_OBJECT_H__
#define __GST_OBJECT_H__
@ -42,8 +41,8 @@ GST_EXPORT GType _gst_object_type;
#define GST_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_OBJECT, GstObjectClass))
#define GST_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_OBJECT, GstObject))
#define GST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_OBJECT, GstObjectClass))
#define GST_OBJECT_CAST(obj) ((GstObject*)(obj))
#define GST_OBJECT_CLASS_CAST(klass) ((GstObjectClass*)(klass))
#define GST_OBJECT_CAST(obj) ((GstObject*)(obj))
#define GST_OBJECT_CLASS_CAST(klass) ((GstObjectClass*)(klass))
/* make sure we don't change the object size but stil make it compile
* without libxml */
@ -65,47 +64,45 @@ typedef enum
/* we do a GST_OBJECT_CAST to avoid type checking, better call these
* function with a valid object! */
#define GST_LOCK(obj) (g_mutex_lock(GST_OBJECT_CAST(obj)->lock))
#define GST_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT_CAST(obj)->lock))
#define GST_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT_CAST(obj)->lock))
#define GST_GET_LOCK(obj) (GST_OBJECT_CAST(obj)->lock)
#define GST_LOCK(obj) (g_mutex_lock(GST_OBJECT_CAST(obj)->lock))
#define GST_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT_CAST(obj)->lock))
#define GST_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT_CAST(obj)->lock))
#define GST_GET_LOCK(obj) (GST_OBJECT_CAST(obj)->lock)
#define GST_OBJECT_NAME(obj) (GST_OBJECT_CAST(obj)->name)
#define GST_OBJECT_PARENT(obj) (GST_OBJECT_CAST(obj)->parent)
#define GST_OBJECT_NAME(obj) (GST_OBJECT_CAST(obj)->name)
#define GST_OBJECT_PARENT(obj) (GST_OBJECT_CAST(obj)->parent)
/* for the flags we double-not to make them comparable to TRUE and FALSE */
#define GST_FLAGS(obj) (GST_OBJECT_CAST (obj)->flags)
#define GST_FLAG_IS_SET(obj,flag) (!!(GST_FLAGS (obj) & (1<<(flag))))
#define GST_FLAG_SET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) |= (1<<(flag))); }G_STMT_END
#define GST_FLAG_UNSET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) &= ~(1<<(flag))); }G_STMT_END
#define GST_FLAGS(obj) (GST_OBJECT_CAST (obj)->flags)
#define GST_FLAG_IS_SET(obj,flag) (!!(GST_FLAGS (obj) & (1<<(flag))))
#define GST_FLAG_SET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) |= (1<<(flag))); }G_STMT_END
#define GST_FLAG_UNSET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) &= ~(1<<(flag))); }G_STMT_END
#define GST_OBJECT_IS_DESTROYED(obj) (GST_FLAG_IS_SET (obj, GST_OBJECT_DESTROYED))
#define GST_OBJECT_IS_FLOATING(obj) (GST_FLAG_IS_SET (obj, GST_OBJECT_FLOATING))
#define GST_OBJECT_IS_DISPOSING(obj) (GST_FLAG_IS_SET (obj, GST_OBJECT_DISPOSING))
#define GST_OBJECT_IS_DESTROYED(obj) (GST_FLAG_IS_SET (obj, GST_OBJECT_DESTROYED))
#define GST_OBJECT_IS_FLOATING(obj) (GST_FLAG_IS_SET (obj, GST_OBJECT_FLOATING))
struct _GstObject {
GObject object;
GObject object;
/*< public >*/
GstAtomicInt refcount;
GstAtomicInt refcount;
/*< public >*/ /* with LOCK */
GMutex *lock; /* object LOCK */
gchar *name; /* object name */
GstObject *parent; /* this object's parent, weak ref */
guint32 flags;
/* FIXME: in padding, move on up */
gchar *name_prefix; /* used for debugging */
GMutex *lock; /* object LOCK */
gchar *name; /* object name */
gchar *name_prefix; /* used for debugging */
GstObject *parent; /* this object's parent, weak ref */
guint32 flags;
/*< private >*/
gpointer _gst_reserved[GST_PADDING - 1];
gpointer _gst_reserved[GST_PADDING];
};
#define GST_CLASS_LOCK(obj) (g_mutex_lock(GST_OBJECT_CLASS_CAST(obj)->lock))
#define GST_CLASS_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT_CLASS_CAST(obj)->lock))
#define GST_CLASS_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT_CLASS_CAST(obj)->lock))
#define GST_CLASS_GET_LOCK(obj) (GST_OBJECT_CLASS_CAST(obj)->lock)
#define GST_CLASS_LOCK(obj) (g_mutex_lock(GST_OBJECT_CLASS_CAST(obj)->lock))
#define GST_CLASS_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT_CLASS_CAST(obj)->lock))
#define GST_CLASS_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT_CLASS_CAST(obj)->lock))
#define GST_CLASS_GET_LOCK(obj) (GST_OBJECT_CLASS_CAST(obj)->lock)
/* signal_object is used to signal to the whole class */
struct _GstObjectClass {
@ -114,7 +111,7 @@ struct _GstObjectClass {
gchar *path_string_separator;
GObject *signal_object;
GMutex *lock;
GMutex *lock;
/* signals */
void (*parent_set) (GstObject *object, GstObject *parent);

View file

@ -2867,19 +2867,22 @@ not_linked:
{
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"pushing, but it was not linked");
GST_UNLOCK_RETURN (pad, GST_FLOW_NOT_CONNECTED);
GST_UNLOCK (pad);
return GST_FLOW_NOT_CONNECTED;
}
not_active:
{
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"pushing, but it was inactive");
GST_UNLOCK_RETURN (pad, GST_FLOW_WRONG_STATE);
GST_UNLOCK (pad);
return GST_FLOW_WRONG_STATE;
}
flushing:
{
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"pushing, but pad was flushing");
GST_UNLOCK_RETURN (pad, GST_FLOW_UNEXPECTED);
GST_UNLOCK (pad);
return GST_FLOW_UNEXPECTED;
}
not_negotiated:
{
@ -2955,7 +2958,8 @@ not_connected:
{
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"pulling range, but it was not linked");
GST_UNLOCK_RETURN (pad, GST_FLOW_NOT_CONNECTED);
GST_UNLOCK (pad);
return GST_FLOW_NOT_CONNECTED;
}
no_function:
{
@ -3789,7 +3793,7 @@ gst_pad_query (GstPad * pad, GstQueryType type,
g_return_val_if_fail (rpad, FALSE);
if (GST_RPAD_QUERYFUNC (rpad))
return GST_RPAD_QUERYFUNC (rpad) (GST_PAD (pad), type, format, value);
return GST_RPAD_QUERYFUNC (rpad) (GST_PAD_CAST (rpad), type, format, value);
return FALSE;
}

View file

@ -41,10 +41,10 @@ GST_EXPORT GType _gst_pad_type;
GST_EXPORT GType _gst_real_pad_type;
GST_EXPORT GType _gst_ghost_pad_type;
/*
/*
* Pad base class
*/
#define GST_TYPE_PAD (_gst_pad_type)
#define GST_TYPE_PAD (_gst_pad_type)
#define GST_IS_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
#define GST_IS_PAD_FAST(obj) (G_OBJECT_TYPE(obj) == GST_TYPE_REAL_PAD || \
G_OBJECT_TYPE(obj) == GST_TYPE_GHOST_PAD)
@ -64,7 +64,7 @@ GST_EXPORT GType _gst_ghost_pad_type;
#define GST_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD, GstRealPadClass))
#define GST_REAL_PAD_CAST(obj) ((GstRealPad*)(obj))
/*
/*
* Ghost Pads
*/
#define GST_TYPE_GHOST_PAD (_gst_ghost_pad_type)
@ -119,11 +119,11 @@ typedef enum {
/* convenience functions */
#ifdef G_HAVE_ISO_VARARGS
#define GST_PAD_QUERY_TYPE_FUNCTION(functionname, ...) GST_QUERY_TYPE_FUNCTION (GstPad *, functionname, __VA_ARGS__);
#define GST_PAD_FORMATS_FUNCTION(functionname, ...) GST_FORMATS_FUNCTION (GstPad *, functionname, __VA_ARGS__);
#define GST_PAD_EVENT_MASK_FUNCTION(functionname, ...) GST_EVENT_MASK_FUNCTION (GstPad *, functionname, __VA_ARGS__);
#define GST_PAD_FORMATS_FUNCTION(functionname, ...) GST_FORMATS_FUNCTION (GstPad *, functionname, __VA_ARGS__);
#define GST_PAD_EVENT_MASK_FUNCTION(functionname, ...) GST_EVENT_MASK_FUNCTION (GstPad *, functionname, __VA_ARGS__);
#elif defined(G_HAVE_GNUC_VARARGS)
#define GST_PAD_QUERY_TYPE_FUNCTION(functionname, a...) GST_QUERY_TYPE_FUNCTION (GstPad *, functionname, a);
#define GST_PAD_FORMATS_FUNCTION(functionname, a...) GST_FORMATS_FUNCTION (GstPad *, functionname, a);
#define GST_PAD_FORMATS_FUNCTION(functionname, a...) GST_FORMATS_FUNCTION (GstPad *, functionname, a);
#define GST_PAD_EVENT_MASK_FUNCTION(functionname, a...) GST_EVENT_MASK_FUNCTION (GstPad *, functionname, a);
#endif
@ -139,11 +139,11 @@ typedef GstFlowReturn (*GstPadGetRangeFunction) (GstPad *pad, guint64 offset,
typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event);
/* convert/query/format functions */
typedef gboolean (*GstPadConvertFunction) (GstPad *pad,
GstFormat src_format, gint64 src_value,
typedef gboolean (*GstPadConvertFunction) (GstPad *pad,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstQueryType type,
GstFormat *format, gint64 *value);
GstFormat *format, gint64 *value);
typedef GList* (*GstPadIntLinkFunction) (GstPad *pad);
typedef const GstFormat* (*GstPadFormatsFunction) (GstPad *pad);
typedef const GstEventMask* (*GstPadEventMaskFunction) (GstPad *pad);
@ -182,11 +182,11 @@ typedef enum {
} GstPadFlags;
struct _GstPad {
GstObject object;
GstObject object;
gpointer element_private;
gpointer element_private;
GstPadTemplate *padtemplate; /* the template for this pad */
GstPadTemplate *padtemplate; /* the template for this pad */
gpointer _gst_reserved[GST_PADDING];
};
@ -198,7 +198,7 @@ struct _GstPadClass {
};
struct _GstRealPad {
GstPad pad;
GstPad pad;
/* direction cannot change after creating the pad */
GstPadDirection direction;
@ -255,20 +255,21 @@ struct _GstRealPad {
GstPadBufferAllocFunction bufferallocfunc;
GstProbeDispatcher probedisp;
GstProbeDispatcher probedisp;
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
struct _GstRealPadClass {
GstPadClass parent_class;
GstPadClass parent_class;
/* signal callbacks */
void (*linked) (GstPad *pad, GstPad *peer);
void (*unlinked) (GstPad *pad, GstPad *peer);
void (*linked) (GstPad *pad, GstPad *peer);
void (*unlinked) (GstPad *pad, GstPad *peer);
void (*request_link) (GstPad *pad);
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
@ -536,7 +537,7 @@ gboolean gst_pad_pause_task (GstPad *pad);
gboolean gst_pad_stop_task (GstPad *pad);
/* convert/query/format functions */
void gst_pad_set_formats_function (GstPad *pad,
void gst_pad_set_formats_function (GstPad *pad,
GstPadFormatsFunction formats);
G_CONST_RETURN GstFormat*
gst_pad_get_formats (GstPad *pad);
@ -544,11 +545,11 @@ G_CONST_RETURN GstFormat*
gst_pad_get_formats_default (GstPad *pad);
void gst_pad_set_convert_function (GstPad *pad, GstPadConvertFunction convert);
gboolean gst_pad_convert (GstPad *pad,
GstFormat src_format, gint64 src_value,
gboolean gst_pad_convert (GstPad *pad,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
gboolean gst_pad_convert_default (GstPad *pad,
GstFormat src_format, gint64 src_value,
gboolean gst_pad_convert_default (GstPad *pad,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query);
@ -559,22 +560,22 @@ G_CONST_RETURN GstQueryType*
gst_pad_get_query_types_default (GstPad *pad);
gboolean gst_pad_query (GstPad *pad, GstQueryType type,
GstFormat *format, gint64 *value);
gboolean gst_pad_query_default (GstPad *pad, GstQueryType type,
GstFormat *format, gint64 *value);
gboolean gst_pad_query_default (GstPad *pad, GstQueryType type,
GstFormat *format, gint64 *value);
void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink);
GList* gst_pad_get_internal_links (GstPad *pad);
GList* gst_pad_get_internal_links_default (GstPad *pad);
GList* gst_pad_get_internal_links_default (GstPad *pad);
/* misc helper functions */
gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch,
gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch,
gpointer data);
/* probes */
#define gst_pad_add_probe(pad, probe) \
(gst_probe_dispatcher_add_probe (&(GST_REAL_PAD (pad)->probedisp), probe))
(gst_probe_dispatcher_add_probe (&(GST_PAD_REALIZE (pad)->probedisp), probe))
#define gst_pad_remove_probe(pad, probe) \
(gst_probe_dispatcher_remove_probe (&(GST_REAL_PAD (pad)->probedisp), probe))
(gst_probe_dispatcher_remove_probe (&(GST_PAD_REALIZE (pad)->probedisp), probe))
#ifndef GST_DISABLE_LOADSAVE
void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent);
@ -589,19 +590,18 @@ GstPad* gst_ghost_pad_new (const gchar *name, GstPad *pad);
GType gst_pad_template_get_type (void);
GstPadTemplate* gst_pad_template_new (const gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
GstPadDirection direction, GstPadPresence presence,
GstCaps *caps);
GstPadTemplate * gst_static_pad_template_get (GstStaticPadTemplate *pad_template);
const GstCaps* gst_pad_template_get_caps (GstPadTemplate *templ);
#ifndef GST_DISABLE_LOADSAVE
xmlNodePtr gst_ghost_pad_save_thyself (GstPad *pad,
xmlNodePtr parent);
xmlNodePtr gst_ghost_pad_save_thyself (GstPad *pad,
xmlNodePtr parent);
#endif
G_END_DECLS
#endif /* __GST_PAD_H__ */

View file

@ -63,7 +63,7 @@ struct _GstPluginDesc {
gchar *license; /* effective license of plugin */
gchar *package; /* package plugin belongs to */
gchar *origin; /* URL to provider of plugin */
gpointer _gst_reserved[GST_PADDING];
};
@ -71,25 +71,25 @@ struct _GstPlugin {
GstPluginDesc desc;
gchar * filename;
GList * features; /* list of features provided */
gint numfeatures;
GList * features; /* list of features provided */
gint numfeatures;
gpointer manager; /* managing registry */
GModule * module; /* contains the module if the plugin is loaded */
gpointer manager; /* managing registry */
GModule * module; /* contains the module if plugin is loaded */
gpointer _gst_reserved[GST_PADDING];
};
#define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,package,origin) \
GST_PLUGIN_EXPORT GstPluginDesc gst_plugin_desc = { \
GST_PLUGIN_EXPORT GstPluginDesc gst_plugin_desc = { \
major, \
minor, \
name, \
description, \
description, \
init, \
NULL, \
version, \
license, \
license, \
package, \
origin, \
GST_PADDING_INIT \
@ -102,18 +102,18 @@ _gst_plugin_static_init__ ##init (void) \
static GstPluginDesc plugin_desc_ = { \
major, \
minor, \
name, \
description, \
init, \
NULL, \
name, \
description, \
init, \
NULL, \
version, \
license, \
license, \
package, \
origin, \
GST_PADDING_INIT \
}; \
_gst_plugin_register_static (&plugin_desc_); \
}
}
#define GST_LICENSE_UNKNOWN "unknown"
@ -125,7 +125,7 @@ typedef gboolean (*GstPluginFilter) (GstPlugin *plugin,
#define GST_TYPE_PLUGIN (gst_plugin_get_type())
GType gst_plugin_get_type (void);
void _gst_plugin_initialize (void);
void _gst_plugin_register_static (GstPluginDesc *desc);
void _gst_plugin_register_static (GstPluginDesc *desc);
G_CONST_RETURN gchar* gst_plugin_get_name (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_description (GstPlugin *plugin);
@ -133,15 +133,15 @@ G_CONST_RETURN gchar* gst_plugin_get_filename (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_version (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_license (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_package (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_origin (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_origin (GstPlugin *plugin);
GModule * gst_plugin_get_module (GstPlugin *plugin);
gboolean gst_plugin_is_loaded (GstPlugin *plugin);
GList* gst_plugin_feature_filter (GstPlugin *plugin,
GList* gst_plugin_feature_filter (GstPlugin *plugin,
GstPluginFeatureFilter filter,
gboolean first,
gpointer user_data);
GList* gst_plugin_list_feature_filter (GList *list,
GList* gst_plugin_list_feature_filter (GList *list,
GstPluginFeatureFilter filter,
gboolean first,
gpointer user_data);
@ -150,15 +150,15 @@ gboolean gst_plugin_name_filter (GstPlugin *plugin, const gchar *name);
GList* gst_plugin_get_feature_list (GstPlugin *plugin);
GstPluginFeature* gst_plugin_find_feature (GstPlugin *plugin, const gchar *name, GType type);
gboolean gst_plugin_check_file (const gchar *filename, GError** error);
GstPlugin * gst_plugin_load_file (const gchar *filename, GError** error);
gboolean gst_plugin_unload_plugin (GstPlugin *plugin);
gboolean gst_plugin_check_file (const gchar *filename, GError** error);
GstPlugin * gst_plugin_load_file (const gchar *filename, GError** error);
gboolean gst_plugin_unload_plugin (GstPlugin *plugin);
void gst_plugin_add_feature (GstPlugin *plugin, GstPluginFeature *feature);
/* shortcuts to load from the registry pool */
gboolean gst_plugin_load (const gchar *name);
gboolean gst_library_load (const gchar *name);
gboolean gst_plugin_load (const gchar *name);
gboolean gst_library_load (const gchar *name);
G_END_DECLS

View file

@ -35,37 +35,38 @@ G_BEGIN_DECLS
typedef struct _GstProbe GstProbe;
GType gst_probe_get_type (void) G_GNUC_CONST;
/* the callback should return FALSE if the data should be discarded */
typedef gboolean (*GstProbeCallback) (GstProbe *probe,
GstData **data,
gpointer user_data);
typedef gboolean (*GstProbeCallback) (GstProbe *probe,
GstData **data,
gpointer user_data);
struct _GstProbe {
gboolean single_shot;
GstProbeCallback callback;
gpointer user_data;
GstProbeCallback callback;
gpointer user_data;
};
GstProbe* gst_probe_new (gboolean single_shot,
GstProbeCallback callback,
GstProbe* gst_probe_new (gboolean single_shot,
GstProbeCallback callback,
gpointer user_data);
void gst_probe_destroy (GstProbe *probe);
gboolean gst_probe_perform (GstProbe *probe, GstData **data);
gboolean gst_probe_perform (GstProbe *probe, GstData **data);
typedef struct _GstProbeDispatcher GstProbeDispatcher;
struct _GstProbeDispatcher {
gboolean active;
GSList *probes;
};
GstProbeDispatcher* gst_probe_dispatcher_new (void);
void gst_probe_dispatcher_destroy (GstProbeDispatcher *disp);
void gst_probe_dispatcher_init (GstProbeDispatcher *disp);
GstProbeDispatcher* gst_probe_dispatcher_new (void);
void gst_probe_dispatcher_destroy (GstProbeDispatcher *disp);
void gst_probe_dispatcher_init (GstProbeDispatcher *disp);
void gst_probe_dispatcher_set_active (GstProbeDispatcher *disp, gboolean active);
void gst_probe_dispatcher_add_probe (GstProbeDispatcher *disp, GstProbe *probe);

View file

@ -39,7 +39,7 @@ _comma [[:space:]]*","[[:space:]]*
_assign [[:space:]]*"="[[:space:]]*
_protocol [[:alpha:]][[:alnum:]+-\.]*
_url {_protocol}"://"{_string}|["."{_identifier}]?"/"{_string}
_url ({_protocol}"://"{_string}|["."{_identifier}]?"/"{_string})|({_protocol}"://")
/* we must do this here, because nearly everything matches a {_string} */
_assignment {_identifier}{_assign}{_string}

View file

@ -319,7 +319,7 @@ get_time (const char *path, gboolean * is_dir)
return statbuf.st_ctime;
}
#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(__MINGW32__)
#define xmkdir(dirname) _mkdir (dirname)
#else
#define xmkdir(dirname) mkdir (dirname, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
@ -698,6 +698,7 @@ gst_xml_registry_load (GstRegistry * registry)
CLASS (xmlregistry)->close_func (xmlregistry);
g_markup_parse_context_free (xmlregistry->context);
return TRUE;
}