Clean up gstelement.h

Original commit message from CVS:
Clean up gstelement.h
GstBin cleanups, fix bug where iterator was freed.
GstElement cleanups.
Backport gstinfo from HEAD.
Fix GstIterator comparison bug.
Fix clock tests.
This commit is contained in:
Wim Taymans 2005-03-09 16:24:52 +00:00
parent b43d8f1006
commit 5d498183bc
13 changed files with 221 additions and 197 deletions

View file

@ -1,3 +1,29 @@
2005-03-09 Wim Taymans <wim@fluendo.com>
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_set_index_func),
(gst_bin_set_clock_func), (gst_bin_get_clock_func),
(gst_bin_add_func), (gst_bin_add), (gst_bin_remove_func),
(gst_bin_remove), (gst_bin_iterate_recurse),
(gst_bin_iterate_sinks), (gst_bin_iterate_all_by_interface):
* gst/gstbin.h:
* gst/gstelement.c: (gst_element_get_state_func),
(gst_element_lost_state):
* gst/gstelement.h:
* gst/gstinfo.c: (_gst_debug_init):
* gst/gstiterator.c: (find_custom_fold_func):
* gst/gstpipeline.c: (gst_pipeline_init),
(gst_pipeline_auto_clock):
* gst/gstutils.h:
* testsuite/clock/clock2.c: (gst_clock_debug), (element_wait):
* testsuite/clock/clock3.c: (ok_callback), (error_callback),
(main):
Clean up gstelement.h
GstBin cleanups, fix bug where iterator was freed.
GstElement cleanups.
Backport gstinfo from HEAD.
Fix GstIterator comparison bug.
Fix clock tests.
2005-03-09 Wim Taymans <wim@fluendo.com>
* gst/gst_private.h:

View file

@ -58,16 +58,18 @@ static GstElementStateReturn gst_bin_change_state (GstElement * element);
static GstElementStateReturn gst_bin_get_state (GstElement * element,
GstElementState * state, GstElementState * pending, GTimeVal * timeout);
static gboolean gst_bin_add_func (GstBin * bin, GstElement * element);
static gboolean gst_bin_remove_func (GstBin * bin, GstElement * element);
#ifndef GST_DISABLE_INDEX
static void gst_bin_set_index (GstElement * element, GstIndex * index);
static void gst_bin_set_index_func (GstElement * element, GstIndex * index);
#endif
static void gst_bin_set_clock (GstElement * element, GstClock * clock);
static GstClock *gst_bin_get_clock (GstElement * element);
static GstClock *gst_bin_get_clock_func (GstElement * element);
static void gst_bin_set_clock_func (GstElement * element, GstClock * clock);
static void gst_bin_set_bus (GstElement * element, GstBus * bus);
static void gst_bin_set_scheduler (GstElement * element, GstScheduler * sched);
static gboolean gst_bin_add_func (GstBin * bin, GstElement * element);
static gboolean gst_bin_remove_func (GstBin * bin, GstElement * element);
#ifndef GST_DISABLE_LOADSAVE
static xmlNodePtr gst_bin_save_thyself (GstObject * object, xmlNodePtr parent);
@ -167,10 +169,10 @@ gst_bin_class_init (GstBinClass * klass)
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_bin_change_state);
gstelement_class->get_state = GST_DEBUG_FUNCPTR (gst_bin_get_state);
#ifndef GST_DISABLE_INDEX
gstelement_class->set_index = GST_DEBUG_FUNCPTR (gst_bin_set_index);
gstelement_class->set_index = GST_DEBUG_FUNCPTR (gst_bin_set_index_func);
#endif
gstelement_class->get_clock = GST_DEBUG_FUNCPTR (gst_bin_get_clock);
gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_bin_set_clock);
gstelement_class->get_clock = GST_DEBUG_FUNCPTR (gst_bin_get_clock_func);
gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_bin_set_clock_func);
gstelement_class->set_bus = GST_DEBUG_FUNCPTR (gst_bin_set_bus);
gstelement_class->set_scheduler = GST_DEBUG_FUNCPTR (gst_bin_set_scheduler);
@ -206,7 +208,7 @@ gst_bin_new (const gchar * name)
*/
#ifndef GST_DISABLE_INDEX
static void
gst_bin_set_index (GstElement * element, GstIndex * index)
gst_bin_set_index_func (GstElement * element, GstIndex * index)
{
GstBin *bin;
GList *children;
@ -228,7 +230,7 @@ gst_bin_set_index (GstElement * element, GstIndex * index)
* MT safe
*/
static void
gst_bin_set_clock (GstElement * element, GstClock * clock)
gst_bin_set_clock_func (GstElement * element, GstClock * clock)
{
GList *children;
GstBin *bin;
@ -249,7 +251,7 @@ gst_bin_set_clock (GstElement * element, GstClock * clock)
* MT safe
*/
static GstClock *
gst_bin_get_clock (GstElement * element)
gst_bin_get_clock_func (GstElement * element)
{
GstClock *result = NULL;
GstBin *bin;
@ -354,7 +356,7 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
gst_element_set_manager (element, GST_ELEMENT (bin)->manager);
gst_element_set_bus (element, GST_ELEMENT (bin)->bus);
gst_element_set_scheduler (element, GST_ELEMENT (bin)->scheduler);
gst_element_set_scheduler (element, GST_ELEMENT_SCHEDULER (bin));
GST_UNLOCK (bin);
@ -368,23 +370,27 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
/* ERROR handling here */
adding_itself:
GST_LOCK (bin);
g_warning ("Cannot add bin %s to itself", GST_ELEMENT_NAME (bin));
GST_UNLOCK (bin);
return FALSE;
{
GST_LOCK (bin);
g_warning ("Cannot add bin %s to itself", GST_ELEMENT_NAME (bin));
GST_UNLOCK (bin);
return FALSE;
}
duplicate_name:
g_warning ("Name %s is not unique in bin %s, not adding",
elem_name, GST_ELEMENT_NAME (bin));
GST_UNLOCK (bin);
g_free (elem_name);
return FALSE;
{
g_warning ("Name %s is not unique in bin %s, not adding",
elem_name, GST_ELEMENT_NAME (bin));
GST_UNLOCK (bin);
g_free (elem_name);
return FALSE;
}
had_parent:
g_warning ("Element %s already has parent", elem_name);
GST_UNLOCK (bin);
g_free (elem_name);
return FALSE;
{
g_warning ("Element %s already has parent", elem_name);
GST_UNLOCK (bin);
g_free (elem_name);
return FALSE;
}
}
/**
@ -421,10 +427,13 @@ gst_bin_add (GstBin * bin, GstElement * element)
return result;
/* ERROR handling */
no_function:
g_warning ("adding elements to bin %s is not supported",
GST_ELEMENT_NAME (bin));
return FALSE;
{
g_warning ("adding elements to bin %s is not supported",
GST_ELEMENT_NAME (bin));
return FALSE;
}
}
/* remove an element from the bin
@ -471,11 +480,15 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
return TRUE;
/* ERROR handling */
not_in_bin:
g_warning ("Element %s is not in bin %s", elem_name, GST_ELEMENT_NAME (bin));
GST_UNLOCK (bin);
g_free (elem_name);
return FALSE;
{
g_warning ("Element %s is not in bin %s", elem_name,
GST_ELEMENT_NAME (bin));
GST_UNLOCK (bin);
g_free (elem_name);
return FALSE;
}
}
/**
@ -516,10 +529,13 @@ gst_bin_remove (GstBin * bin, GstElement * element)
return result;
/* ERROR handling */
no_function:
g_warning ("removing elements from bin %s is not supported",
GST_ELEMENT_NAME (bin));
return FALSE;
{
g_warning ("removing elements from bin %s is not supported",
GST_ELEMENT_NAME (bin));
return FALSE;
}
}
static GstIteratorItem
@ -611,7 +627,6 @@ gst_bin_iterate_recurse (GstBin * bin)
GST_UNLOCK (bin);
return result;
return NULL;
}
GstIterator *
@ -718,7 +733,6 @@ gst_bin_iterate_sinks (GstBin * bin)
children = gst_bin_iterate_elements (bin);
result = gst_iterator_filter (children,
(GCompareFunc) bin_element_is_sink, bin);
gst_iterator_free (children);
return result;
}
@ -1168,7 +1182,6 @@ gst_bin_iterate_all_by_interface (GstBin * bin, GType interface)
children = gst_bin_iterate_recurse (bin);
result = gst_iterator_filter (children, (GCompareFunc) compare_interface,
GINT_TO_POINTER (interface));
gst_iterator_free (children);
return result;
}

View file

@ -60,8 +60,6 @@ GST_EXPORT GType _gst_bin_type;
* and (un)set using GST_FLAG_SET () and GST_FLAG_UNSET ().
*/
typedef enum {
GST_BIN_FLAG_FIXED_CLOCK = GST_ELEMENT_FLAG_LAST,
/* padding */
GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 5
} GstBinFlags;

View file

@ -26,16 +26,15 @@
#include <gobject/gvaluecollector.h>
#include "gstelement.h"
#include "gstbus.h"
#include "gstmarshal.h"
#include "gsterror.h"
#include "gstscheduler.h"
#include "gstevent.h"
#include "gstutils.h"
#include "gstinfo.h"
#include "gst-i18n-lib.h"
#include "gstscheduler.h"
#include "gstbus.h"
/* Element signals and args */
enum
{
@ -872,7 +871,7 @@ iterate_pad (GstIterator * it, GstPad * pad)
*
* Retrieves an iterattor of @element's pads.
*
* Returns: the #GstIterator of pads.
* Returns: the #GstIterator of #GstPad. unref each pad after usage.
*
* MT safe.
*/

View file

@ -183,201 +183,194 @@ typedef struct _GstElementFactoryClass GstElementFactoryClass;
struct _GstElement
{
GstObject object;
GstObject object;
/*< public > *//* with STATE_LOCK */
/*< public >*/ /* with STATE_LOCK */
/* element state */
GMutex *state_lock;
GCond *state_cond;
guint8 current_state;
guint8 pending_state;
gboolean state_error; /* flag is set when the element has an error in the last state
change. it is cleared when doing another state change. */
/*< public > *//* with LOCK */
GMutex *state_lock;
GCond *state_cond;
guint8 current_state;
guint8 pending_state;
gboolean state_error; /* flag is set when the element has an error in the last state
change. it is cleared when doing another state change. */
/*< public >*/ /* with LOCK */
/* element manager */
GstPipeline *manager;
GstBus *bus;
GstScheduler *scheduler;
GstScheduler *scheduler;
/* private pointer for the scheduler */
gpointer sched_private;
gpointer sched_private;
/* allocated clock */
GstClock *clock;
GstClockTimeDiff base_time; /* NULL/READY: 0 - PAUSED: current time - PLAYING: difference to clock */
GstClock *clock;
GstClockTimeDiff base_time; /* NULL/READY: 0 - PAUSED: current time - PLAYING: difference to clock */
/* element pads, these lists can only be iterated while holding
* the LOCK or checking the cookie after each LOCK. */
guint16 numpads;
GList *pads;
guint16 numsrcpads;
GList *srcpads;
guint16 numsinkpads;
GList *sinkpads;
guint32 pads_cookie;
guint16 numpads;
GList *pads;
guint16 numsrcpads;
GList *srcpads;
guint16 numsinkpads;
GList *sinkpads;
guint32 pads_cookie;
/*< private > */
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
struct _GstElementClass
{
GstObjectClass parent_class;
GstObjectClass parent_class;
/*< public > */
/*< public >*/
/* the element details */
GstElementDetails details;
GstElementDetails details;
/* factory that the element was created from */
GstElementFactory *elementfactory;
GstElementFactory *elementfactory;
/* templates for our pads */
GList *padtemplates;
gint numpadtemplates;
guint32 pad_templ_cookie;
GList *padtemplates;
gint numpadtemplates;
guint32 pad_templ_cookie;
/* signal callbacks */
void (*state_change) (GstElement * element, GstElementState old,
GstElementState state);
void (*new_pad) (GstElement * element, GstPad * pad);
void (*pad_removed) (GstElement * element, GstPad * pad);
void (*no_more_pads) (GstElement * element);
void (*state_change) (GstElement *element, GstElementState old, GstElementState state);
void (*new_pad) (GstElement *element, GstPad *pad);
void (*pad_removed) (GstElement *element, GstPad *pad);
void (*no_more_pads) (GstElement *element);
/*< protected > */
/*< protected >*/
/* vtable */
/* request/release pads */
GstPad *(*request_new_pad) (GstElement * element, GstPadTemplate * templ,
const gchar * name);
void (*release_pad) (GstElement * element, GstPad * pad);
GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ, const gchar* name);
void (*release_pad) (GstElement *element, GstPad *pad);
/* state changes */
GstElementStateReturn (*get_state) (GstElement * element, GstElementState * state,
GstElementState * pending, GTimeVal * timeout);
GstElementStateReturn (*change_state) (GstElement * element);
GstElementStateReturn (*change_state) (GstElement *element);
/* manager */
void (*set_manager) (GstElement * element, GstPipeline * pipeline);
void (*set_bus) (GstElement * element, GstBus * bus);
void (*set_scheduler) (GstElement * element, GstScheduler * scheduler);
void (*set_scheduler) (GstElement *element, GstScheduler *scheduler);
/* set/get clocks */
GstClock * (*get_clock) (GstElement * element);
void (*set_clock) (GstElement * element, GstClock * clock);
GstClock* (*get_clock) (GstElement *element);
void (*set_clock) (GstElement *element, GstClock *clock);
/* index */
GstIndex * (*get_index) (GstElement * element);
void (*set_index) (GstElement * element, GstIndex * index);
GstIndex* (*get_index) (GstElement *element);
void (*set_index) (GstElement *element, GstIndex *index);
/* query/convert/events functions */
const GstEventMask *(*get_event_masks) (GstElement * element);
gboolean (*send_event) (GstElement * element, GstEvent * event);
const GstFormat *(*get_formats) (GstElement * element);
gboolean (*convert) (GstElement * element,
GstFormat src_format, gint64 src_value,
GstFormat * dest_format, gint64 * dest_value);
const GstQueryType *(*get_query_types) (GstElement * element);
gboolean (*query) (GstElement * element, GstQueryType type,
GstFormat * format, gint64 * value);
const GstEventMask* (*get_event_masks) (GstElement *element);
gboolean (*send_event) (GstElement *element, GstEvent *event);
const GstFormat* (*get_formats) (GstElement *element);
gboolean (*convert) (GstElement *element,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
const GstQueryType* (*get_query_types) (GstElement *element);
gboolean (*query) (GstElement *element, GstQueryType type,
GstFormat *format, gint64 *value);
/*< private > */
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
/* class stuff */
void gst_element_class_add_pad_template (GstElementClass * klass,
GstPadTemplate * templ);
void gst_element_class_set_details (GstElementClass * klass,
const GstElementDetails * details);
GstPadTemplate *gst_element_class_get_pad_template (GstElementClass *
element_class, const gchar * name);
GList *gst_element_class_get_pad_template_list (GstElementClass *
element_class);
/* element class pad templates */
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);
GstPadTemplate* gst_element_class_get_pad_template (GstElementClass *element_class, const gchar *name);
GList* gst_element_class_get_pad_template_list (GstElementClass *element_class);
void gst_element_class_set_details (GstElementClass *klass,
const GstElementDetails *details);
/* element instance */
GType gst_element_get_type (void);
GType gst_element_get_type (void);
#define gst_element_get_name(elem) gst_object_get_name(GST_OBJECT(elem))
#define gst_element_set_name(elem,name) gst_object_set_name(GST_OBJECT(elem),name)
#define gst_element_get_parent(elem) gst_object_get_parent(GST_OBJECT(elem))
/* basic name and parentage stuff from GstObject */
#define gst_element_get_name(elem) gst_object_get_name(GST_OBJECT(elem))
#define gst_element_set_name(elem,name) gst_object_set_name(GST_OBJECT(elem),name)
#define gst_element_get_parent(elem) gst_object_get_parent(GST_OBJECT(elem))
#define gst_element_set_parent(elem,parent) gst_object_set_parent(GST_OBJECT(elem),parent)
/* clocking */
gboolean gst_element_requires_clock (GstElement * element);
gboolean gst_element_provides_clock (GstElement * element);
GstClock *gst_element_get_clock (GstElement * element);
void gst_element_set_clock (GstElement * element, GstClock * clock);
gboolean gst_element_requires_clock (GstElement *element);
gboolean gst_element_provides_clock (GstElement *element);
GstClock* gst_element_get_clock (GstElement *element);
void gst_element_set_clock (GstElement *element, GstClock *clock);
/* indexes */
gboolean gst_element_is_indexable (GstElement * element);
void gst_element_set_index (GstElement * element, GstIndex * index);
GstIndex *gst_element_get_index (GstElement * element);
gboolean gst_element_is_indexable (GstElement *element);
void gst_element_set_index (GstElement *element, GstIndex *index);
GstIndex* gst_element_get_index (GstElement *element);
/* manager and tasks */
void gst_element_set_manager (GstElement * element, GstPipeline * pipeline);
GstPipeline *gst_element_get_manager (GstElement * element);
void gst_element_set_bus (GstElement * element, GstBus * bus);
GstBus *gst_element_get_bus (GstElement * element);
void gst_element_set_scheduler (GstElement * element, GstScheduler * scheduler);
GstScheduler *gst_element_get_scheduler (GstElement * element);
void gst_element_set_scheduler (GstElement *element, GstScheduler *sched);
GstScheduler* gst_element_get_scheduler (GstElement *element);
/* pad management */
gboolean gst_element_add_pad (GstElement * element, GstPad * pad);
gboolean gst_element_remove_pad (GstElement * element, GstPad * pad);
GstPad *gst_element_add_ghost_pad (GstElement * element, GstPad * pad,
const gchar * name);
void gst_element_no_more_pads (GstElement * element);
gboolean gst_element_add_pad (GstElement *element, GstPad *pad);
gboolean gst_element_remove_pad (GstElement *element, GstPad *pad);
GstPad * gst_element_add_ghost_pad (GstElement *element, GstPad *pad, const gchar *name);
void gst_element_no_more_pads (GstElement *element);
GstPad *gst_element_get_pad (GstElement * element, const gchar * name);
GstPad *gst_element_get_static_pad (GstElement * element, const gchar * name);
GstPad *gst_element_get_request_pad (GstElement * element, const gchar * name);
void gst_element_release_request_pad (GstElement * element, GstPad * pad);
GstPad* gst_element_get_pad (GstElement *element, const gchar *name);
GstPad* gst_element_get_static_pad (GstElement *element, const gchar *name);
GstPad* gst_element_get_request_pad (GstElement *element, const gchar *name);
void gst_element_release_request_pad (GstElement *element, GstPad *pad);
GstIterator *gst_element_iterate_pads (GstElement * element);
GstIterator * gst_element_iterate_pads (GstElement * element);
/* event/query/format stuff */
G_CONST_RETURN GstEventMask *gst_element_get_event_masks (GstElement * element);
gboolean gst_element_send_event (GstElement * element, GstEvent * event);
gboolean gst_element_seek (GstElement * element, GstSeekType seek_type,
guint64 offset);
G_CONST_RETURN GstQueryType *gst_element_get_query_types (GstElement * element);
gboolean gst_element_query (GstElement * element, GstQueryType type,
GstFormat * format, gint64 * value);
G_CONST_RETURN GstFormat *gst_element_get_formats (GstElement * element);
gboolean gst_element_convert (GstElement * element,
GstFormat src_format, gint64 src_value,
GstFormat * dest_format, gint64 * dest_value);
G_CONST_RETURN GstEventMask*
gst_element_get_event_masks (GstElement *element);
gboolean gst_element_send_event (GstElement *element, GstEvent *event);
gboolean gst_element_seek (GstElement *element, GstSeekType seek_type,
guint64 offset);
G_CONST_RETURN GstQueryType*
gst_element_get_query_types (GstElement *element);
gboolean gst_element_query (GstElement *element, GstQueryType type,
GstFormat *format, gint64 *value);
G_CONST_RETURN GstFormat*
gst_element_get_formats (GstElement *element);
gboolean gst_element_convert (GstElement *element,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
/* messages */
gboolean gst_element_post_message (GstElement * element, GstMessage * message);
/* error handling */
gchar *_gst_element_error_printf (const gchar * format, ...);
gchar * _gst_element_error_printf (const gchar *format, ...);
void gst_element_message_full (GstElement * element, GstMessageType type,
GQuark domain, gint code, gchar * text, gchar * debug, const gchar * file,
const gchar * function, gint line);
/* state management */
gboolean gst_element_is_locked_state (GstElement * element);
gboolean gst_element_set_locked_state (GstElement * element,
gboolean locked_state);
gboolean gst_element_sync_state_with_parent (GstElement * element);
gboolean gst_element_is_locked_state (GstElement *element);
gboolean gst_element_set_locked_state (GstElement *element, gboolean locked_state);
gboolean gst_element_sync_state_with_parent (GstElement *element);
GstElementStateReturn gst_element_get_state (GstElement * element,
GstElementState * state,
GstElementState * pending,
GTimeVal * timeout);
GstElementStateReturn gst_element_set_state (GstElement * element,
GstElementState state);
GstElementStateReturn gst_element_set_state (GstElement *element, GstElementState state);
void gst_element_abort_state (GstElement * element);
void gst_element_commit_state (GstElement * element);
void gst_element_lost_state (GstElement * element);
/* factory management */
GstElementFactory *gst_element_get_factory (GstElement * element);
GstElementFactory* gst_element_get_factory (GstElement *element);
/*
*
@ -393,58 +386,52 @@ GstElementFactory *gst_element_get_factory (GstElement * element);
#define GST_IS_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
#define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
struct _GstElementFactory
{
GstPluginFeature parent;
struct _GstElementFactory {
GstPluginFeature parent;
GType type; /* unique GType of element or 0 if not loaded */
GType type; /* unique GType of element or 0 if not loaded */
GstElementDetails details;
GstElementDetails details;
GList *padtemplates;
guint numpadtemplates;
GList * padtemplates;
guint numpadtemplates;
/* URI interface stuff */
guint uri_type;
gchar **uri_protocols;
GList *interfaces; /* interfaces this element implements */
guint uri_type;
gchar ** uri_protocols;
GList * interfaces; /* interfaces this element implements */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstElementFactoryClass
{
struct _GstElementFactoryClass {
GstPluginFeatureClass parent_class;
gpointer _gst_reserved[GST_PADDING];
};
GType gst_element_factory_get_type (void);
GType gst_element_factory_get_type (void);
gboolean gst_element_register (GstPlugin * plugin,
const gchar * name, guint rank, GType type);
gboolean gst_element_register (GstPlugin *plugin,
const gchar *name,
guint rank,
GType type);
GstElementFactory *gst_element_factory_find (const gchar * name);
GType gst_element_factory_get_element_type (GstElementFactory * factory);
G_CONST_RETURN gchar *gst_element_factory_get_longname (GstElementFactory *
factory);
G_CONST_RETURN gchar *gst_element_factory_get_klass (GstElementFactory *
factory);
G_CONST_RETURN gchar *gst_element_factory_get_description (GstElementFactory *
factory);
G_CONST_RETURN gchar *gst_element_factory_get_author (GstElementFactory *
factory);
guint gst_element_factory_get_num_pad_templates (GstElementFactory * factory);
G_CONST_RETURN GList *gst_element_factory_get_pad_templates (GstElementFactory *
factory);
guint gst_element_factory_get_uri_type (GstElementFactory * factory);
gchar **gst_element_factory_get_uri_protocols (GstElementFactory * factory);
GstElementFactory * gst_element_factory_find (const gchar *name);
GType gst_element_factory_get_element_type (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_longname (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory);
guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
G_CONST_RETURN GList * gst_element_factory_get_pad_templates (GstElementFactory *factory);
guint gst_element_factory_get_uri_type (GstElementFactory *factory);
gchar ** gst_element_factory_get_uri_protocols (GstElementFactory *factory);
GstElement *gst_element_factory_create (GstElementFactory * factory,
const gchar * name);
GstElement *gst_element_factory_make (const gchar * factoryname,
const gchar * name);
GstElement* gst_element_factory_create (GstElementFactory *factory,
const gchar *name);
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
void __gst_element_factory_add_pad_template (GstElementFactory *elementfactory,
GstPadTemplate *templ);
@ -452,4 +439,5 @@ void __gst_element_factory_add_interface (GstElementFacto
const gchar *interfacename);
G_END_DECLS
#endif /* __GST_ELEMENT_H__ */

View file

@ -283,13 +283,14 @@ _gst_debug_init (void)
GST_DEBUG_BOLD | GST_DEBUG_FG_RED | GST_DEBUG_BG_WHITE, NULL);
GST_CAT_EVENT = _gst_debug_category_new ("GST_EVENT",
GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED, NULL);
GST_DEBUG_BOLD | GST_DEBUG_FG_BLUE, NULL);
GST_CAT_MESSAGE = _gst_debug_category_new ("GST_MESSAGE",
GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED, NULL);
GST_CAT_PARAMS = _gst_debug_category_new ("GST_PARAMS",
GST_DEBUG_BOLD | GST_DEBUG_FG_BLACK | GST_DEBUG_BG_YELLOW, NULL);
GST_CAT_CALL_TRACE = _gst_debug_category_new ("GST_CALL_TRACE",
GST_DEBUG_BOLD, NULL);
/* FIXME: fold back to GST_CAT_EVENT in 0.9 */
GST_CAT_SEEK = _gst_debug_category_new ("GST_SEEK",
GST_DEBUG_BOLD | GST_DEBUG_FG_BLUE, "plugins reacting to seek events");
GST_CAT_SIGNAL = _gst_debug_category_new ("GST_SIGNAL",

View file

@ -506,7 +506,7 @@ typedef struct
static gboolean
find_custom_fold_func (gpointer item, GValue * ret, FindCustomFoldData * data)
{
if (data->func (item, data->user_data)) {
if (data->func (item, data->user_data) == 0) {
g_value_set_pointer (ret, item);
return FALSE;
} else {

View file

@ -136,9 +136,9 @@ gst_pipeline_class_init (gpointer g_class, gpointer class_data)
static void
gst_pipeline_init (GTypeInstance * instance, gpointer g_class)
{
GstScheduler *scheduler;
GstPipeline *pipeline = GST_PIPELINE (instance);
GstBus *bus;
GstScheduler *scheduler;
/* get an instance of the default scheduler */
scheduler = gst_scheduler_factory_make (NULL, GST_ELEMENT (pipeline));
@ -562,9 +562,9 @@ gst_pipeline_auto_clock (GstPipeline * pipeline)
g_return_if_fail (pipeline != NULL);
g_return_if_fail (GST_IS_PIPELINE (pipeline));
GST_LOCK (pipeline);
GST_FLAG_UNSET (pipeline, GST_PIPELINE_FLAG_FIXED_CLOCK);
GST_LOCK (pipeline);
gst_object_replace ((GstObject **) & pipeline->fixed_clock, NULL);
GST_UNLOCK (pipeline);

View file

@ -277,7 +277,6 @@ void gst_bin_remove_many (GstBin *bin, GstElement *eleme
/* buffer functions */
GstBuffer * gst_buffer_merge (GstBuffer * buf1, GstBuffer * buf2);
void gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src);
void gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src);
G_END_DECLS

View file

@ -27,8 +27,8 @@ element_wait (GstElement * element, GstClockTime time)
GstClockID id;
id = gst_clock_new_single_shot_id (clock, time + element->base_time);
gst_clock_id_wait (id, NULL);
gst_clock_id_unref (id);
}
int

View file

@ -97,8 +97,8 @@ main (int argc, char *argv[])
g_usleep (G_USEC_PER_SEC / 2);
g_print ("cancel id %p after 0.5 seconds\n", id2);
gst_clock_id_unschedule (id2);
gst_clock_id_unref (id2);
g_print ("canceled id %p\n", id2);
gst_clock_id_unref (id2);
g_usleep (2 * G_USEC_PER_SEC);

View file

@ -27,8 +27,8 @@ element_wait (GstElement * element, GstClockTime time)
GstClockID id;
id = gst_clock_new_single_shot_id (clock, time + element->base_time);
gst_clock_id_wait (id, NULL);
gst_clock_id_unref (id);
}
int

View file

@ -97,8 +97,8 @@ main (int argc, char *argv[])
g_usleep (G_USEC_PER_SEC / 2);
g_print ("cancel id %p after 0.5 seconds\n", id2);
gst_clock_id_unschedule (id2);
gst_clock_id_unref (id2);
g_print ("canceled id %p\n", id2);
gst_clock_id_unref (id2);
g_usleep (2 * G_USEC_PER_SEC);