#include <gst/gstobject.h>
#include <gst/gstpad.h>
#include <gst/gstclock.h>
+#include <gst/gstplugin.h>
#include <gst/gstpluginfeature.h>
#include <gst/gstindex.h>
+#include <gst/gsttag.h>
G_BEGIN_DECLS
+typedef struct _GstElementDetails GstElementDetails;
+
+/* FIXME: need translatable stuff in here (how handle in registry)? */
+struct _GstElementDetails {
+ gchar *longname; /* long, english name */
+ gchar *klass; /* type of element, as hierarchy */
+ gchar *description; /* insights of one form or another */
+ gchar *author; /* who wrote this thing? */
+
+ gpointer _gst_reserved[GST_PADDING];
+};
+#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) \
+ && ((details)->description != NULL) && ((details)->author != NULL))
+
#define GST_NUM_STATES 4
/* NOTE: this probably should be done with an #ifdef to decide
extern GType _gst_element_type;
#define GST_TYPE_ELEMENT (_gst_element_type)
-
-#define GST_ELEMENT_CAST(obj) ((GstElement*)(obj))
-#define GST_ELEMENT_CLASS_CAST(klass) ((GstElementClass*)(klass))
#define GST_IS_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_ELEMENT))
#define GST_IS_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_ELEMENT))
#define GST_ELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ELEMENT, GstElementClass))
-
-#ifdef GST_TYPE_PARANOID
-# define GST_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ELEMENT, GstElement))
-# define GST_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ELEMENT, GstElementClass))
-#else
-# define GST_ELEMENT GST_ELEMENT_CAST
-# define GST_ELEMENT_CLASS GST_ELEMENT_CLASS_CAST
-#endif
+#define GST_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ELEMENT, GstElement))
+#define GST_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_ELEMENT, GstElementClass))
/* convenience functions */
#ifdef G_HAVE_ISO_VARARGS
} GstElementFlags;
#define GST_ELEMENT_IS_THREAD_SUGGESTED(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_THREAD_SUGGESTED))
-#define GST_ELEMENT_IS_EOS(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_EOS))
#define GST_ELEMENT_IS_EVENT_AWARE(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_EVENT_AWARE))
#define GST_ELEMENT_IS_DECOUPLED(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_DECOUPLED))
GAsyncQueue *prop_value_queue;
GMutex *property_mutex;
- gpointer dummy[8];
+ gpointer _gst_reserved[GST_PADDING];
};
struct _GstElementClass {
GstObjectClass parent_class;
- /* the elementfactory that created us */
- GstElementFactory *elementfactory;
+ /* the element details */
+ GstElementDetails details;
+
+ /* factory that the element was created from */
+ GstElementFactory *elementfactory;
+
/* templates for our pads */
GList *padtemplates;
gint numpadtemplates;
void (*pad_removed) (GstElement *element, GstPad *pad);
void (*error) (GstElement *element, GstElement *source, gchar *error);
void (*eos) (GstElement *element);
+ void (*found_tag) (GstElement *element, GstElement *source, GstTagList *tag_list);
/* local pointers for get/set */
void (*set_property) (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
GstIndex* (*get_index) (GstElement *element);
void (*set_index) (GstElement *element, GstIndex *index);
- /* padding */
- gpointer dummy[8];
+ gpointer _gst_reserved[GST_PADDING];
};
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);
void gst_element_class_install_std_props (GstElementClass *klass,
const gchar *first_name, ...);
+void gst_element_class_set_details (GstElementClass *klass,
+ const GstElementDetails *details);
#define gst_element_default_deep_notify gst_object_default_deep_notify
void gst_element_default_error (GObject *object, GstObject *orig, gchar *error);
GType gst_element_get_type (void);
-
void gst_element_set_loop_function (GstElement *element,
GstElementLoopFunction loop);
GstPad* gst_element_get_request_pad (GstElement *element, const gchar *name);
void gst_element_release_request_pad (GstElement *element, GstPad *pad);
-const GList* gst_element_get_pad_list (GstElement *element);
+G_CONST_RETURN GList*
+ gst_element_get_pad_list (GstElement *element);
GstPad* gst_element_get_compatible_pad (GstElement *element, GstPad *pad);
GstPad* gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad,
- GstCaps *filtercaps);
+ const GstCaps *filtercaps);
+GstPadTemplate* gst_element_class_get_pad_template (GstElementClass *element_class, const gchar *name);
+GList* gst_element_class_get_pad_template_list (GstElementClass *element_class);
GstPadTemplate* gst_element_get_pad_template (GstElement *element, const gchar *name);
GList* gst_element_get_pad_template_list (GstElement *element);
GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl);
gboolean gst_element_link_many (GstElement *element_1,
GstElement *element_2, ...);
gboolean gst_element_link_filtered (GstElement *src, GstElement *dest,
- GstCaps *filtercaps);
+ const GstCaps *filtercaps);
void gst_element_unlink (GstElement *src, GstElement *dest);
void gst_element_unlink_many (GstElement *element_1,
GstElement *element_2, ...);
GstElement *dest, const gchar *destpadname);
gboolean gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname,
- GstCaps *filtercaps);
+ const GstCaps *filtercaps);
void gst_element_unlink_pads (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname);
-const GstEventMask* gst_element_get_event_masks (GstElement *element);
+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);
-const GstQueryType* gst_element_get_query_types (GstElement *element);
+G_CONST_RETURN GstQueryType*
+ gst_element_get_query_types (GstElement *element);
gboolean gst_element_query (GstElement *element, GstQueryType type,
GstFormat *format, gint64 *value);
-const GstFormat* gst_element_get_formats (GstElement *element);
+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);
+void gst_element_found_tags (GstElement *element, GstTagList *tag_list);
+void gst_element_found_tags_for_pad (GstElement *element, GstPad *pad, GstClockTime timestamp,
+ GstTagList *list);
+
void gst_element_set_eos (GstElement *element);
void gst_element_error (GstElement *element, const gchar *error, ...);
void gst_element_wait_state_change (GstElement *element);
-const gchar* gst_element_state_get_name (GstElementState state);
+G_CONST_RETURN gchar* gst_element_state_get_name (GstElementState state);
GstElementFactory* gst_element_get_factory (GstElement *element);
* factories stuff
*
**/
-typedef struct _GstElementDetails GstElementDetails;
-
-struct _GstElementDetails {
- gchar *longname; /* long, english name */
- gchar *klass; /* type of element, as hierarchy */
- gchar *license; /* license element is under */
- gchar *description; /* insights of one form or another */
- gchar *version; /* version of the element */
- gchar *author; /* who wrote this thing? */
- gchar *copyright; /* copyright details (year, etc.) */
-};
#define GST_TYPE_ELEMENT_FACTORY (gst_element_factory_get_type())
#define GST_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\
#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))
-#define GST_ELEMENT_RANK_PRIMARY 256
-#define GST_ELEMENT_RANK_SECONDARY 128
-#define GST_ELEMENT_RANK_MARGINAL 64
-#define GST_ELEMENT_RANK_NONE 0
-
struct _GstElementFactory {
- GstPluginFeature feature;
+ GstPluginFeature parent;
- GType type; /* unique GType of element */
+ GType type; /* unique GType of element or 0 if not loaded */
- guint details_dynamic : 1;
+ GstElementDetails details;
- GstElementDetails *details; /* pointer to details struct */
+ GList * padtemplates;
+ guint numpadtemplates;
- GList *padtemplates;
- guint16 numpadtemplates;
+ /* URI interface stuff */
+ guint uri_type;
+ gchar ** uri_protocols;
+
+ GList * interfaces; /* interfaces this element implements */
- guint16 rank; /* used by autoplug to prioritise elements to try */
+ gpointer _gst_reserved[GST_PADDING];
};
struct _GstElementFactoryClass {
GstPluginFeatureClass parent_class;
+
+ gpointer _gst_reserved[GST_PADDING];
};
GType gst_element_factory_get_type (void);
-GstElementFactory* gst_element_factory_new (const gchar *name, GType type,
- GstElementDetails *details);
-GstElementFactory* gst_element_factory_find (const gchar *name);
+gboolean gst_element_register (GstPlugin *plugin,
+ const gchar *elementname,
+ 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_version (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);
-void gst_element_factory_add_pad_template (GstElementFactory *elementfactory,
- GstPadTemplate *templ);
+GstElement* gst_element_factory_create (GstElementFactory *factory,
+ const gchar *name);
+GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
gboolean gst_element_factory_can_src_caps (GstElementFactory *factory,
- GstCaps *caps);
+ const GstCaps *caps);
gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory,
- GstCaps *caps);
+ const GstCaps *caps);
-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_make_or_warn (const gchar *factoryname, const gchar *name);
+void __gst_element_factory_add_pad_template (GstElementFactory *elementfactory,
+ GstPadTemplate *templ);
+void __gst_element_factory_add_interface (GstElementFactory *elementfactory,
+ const gchar *interfacename);
-void gst_element_factory_set_rank (GstElementFactory *factory, guint16 rank);
G_END_DECLS