diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-12-15 14:32:39 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-12-15 14:32:39 +0000 |
commit | c5567107c3f34f66b560e3b43b1ffa5a3cefdfcb (patch) | |
tree | 5a51a06d67e63c14b3ad4d9d20aed5ac6ea483de | |
parent | 0eded786d494c792ae6f23f99edf08f7b2edec22 (diff) |
Update for new plugin loading system and several other changesMOVE-TO-FDO
Original commit message from CVS:
Update for new plugin loading system and several other changes
m--------- | common | 0 | ||||
-rw-r--r-- | gst-plugin/configure.ac | 19 | ||||
-rw-r--r-- | gst-plugin/src/gstplugin.c | 70 | ||||
-rw-r--r-- | gst-plugin/src/gstplugin.h | 8 |
4 files changed, 43 insertions, 54 deletions
diff --git a/common b/common -Subproject b7abb510aa14e8692df39ea8c2c758e37d8a8d8 +Subproject 9f37b3e515260c7b294222a502b2cc75dd0983b diff --git a/gst-plugin/configure.ac b/gst-plugin/configure.ac index 26467d3..a9c50f2 100644 --- a/gst-plugin/configure.ac +++ b/gst-plugin/configure.ac @@ -28,24 +28,15 @@ fi dnl Now we're ready to ask for gstreamer libs and cflags dnl And we can also ask for the right version of gstreamer -GST_REQUIRED=0.6.0 - -dnl start with 0.6 -GST_MAJORMINOR=0.6 +GST_REQUIRED=0.7.2 + +dnl 0.7 required, 0.6 is too old +GST_MAJORMINOR=0.7 PKG_CHECK_MODULES(GST, \ gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED \ gstreamer-control-$GST_MAJORMINOR >= $GST_REQUIRED, HAVE_GST=yes,HAVE_GST=no) - -dnl fail back to 0.7 -if test "x$HAVE_GST" = "xno"; then - GST_MAJORMINOR=0.7 - PKG_CHECK_MODULES(GST, \ - gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED \ - gstreamer-control-$GST_MAJORMINOR >= $GST_REQUIRED, - HAVE_GST=yes,HAVE_GST=no) -fi - + dnl Give error and exit if we don't have gstreamer if test "x$HAVE_GST" = "xno"; then AC_MSG_ERROR(you need gstreamer development packages installed !) diff --git a/gst-plugin/src/gstplugin.c b/gst-plugin/src/gstplugin.c index 7357191..7005938 100644 --- a/gst-plugin/src/gstplugin.c +++ b/gst-plugin/src/gstplugin.c @@ -27,16 +27,6 @@ #include "gstplugin.h" -static GstElementDetails plugin_details = { - "PluginTemplate", - "Generic/PluginTemplate", - "LGPL", - "Generic Template Plugin", - VERSION, - "Thomas Vander Stichele <thomas@apestaart.org>", - "(C) 2002, 2003" -}; - /* Filter signals and args */ enum { /* FILL ME */ @@ -63,6 +53,7 @@ GST_PAD_TEMPLATE_FACTORY (gst_plugin_template_src_factory, ); static void gst_plugin_template_class_init (GstPluginTemplateClass *klass); +static void gst_plugin_template_base_init (GstPluginTemplateClass *klass); static void gst_plugin_template_init (GstPluginTemplate *filter); static void gst_plugin_template_set_property(GObject *object, guint prop_id, @@ -77,7 +68,7 @@ static void gst_plugin_template_update_plugin(const GValue *value, static void gst_plugin_template_update_mute (const GValue *value, gpointer data); -static void gst_plugin_template_chain (GstPad *pad, GstBuffer *buf); +static void gst_plugin_template_chain (GstPad *pad, GstData *in); static GstElementClass *parent_class = NULL; @@ -119,7 +110,7 @@ gst_gst_plugin_template_get_type (void) static const GTypeInfo plugin_info = { sizeof (GstPluginTemplateClass), - NULL, + (GBaseInitFunc) gst_plugin_template_base_init, NULL, (GClassInitFunc) gst_plugin_template_class_init, NULL, @@ -135,6 +126,24 @@ gst_gst_plugin_template_get_type (void) return plugin_type; } +static void +gst_plugin_template_base_init (GstPluginTemplateClass *klass) +{ + static GstElementDetails plugin_details = { + "PluginTemplate", + "Generic/PluginTemplate", + "Generic Template Plugin", + "Thomas Vander Stichele <thomas@apestaart.org>" + }; + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (gst_plugin_template_src_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (gst_plugin_template_sink_factory)); + gst_element_class_set_details (element_class, &plugin_details); +} + /* initialize the plugin's class */ static void gst_plugin_template_class_init (GstPluginTemplateClass *klass) @@ -182,10 +191,10 @@ gst_plugin_template_init (GstPluginTemplate *filter) */ static void -gst_plugin_template_chain (GstPad *pad, GstBuffer *buf) +gst_plugin_template_chain (GstPad *pad, GstData *in) { GstPluginTemplate *filter; - GstBuffer *out_buf; + GstBuffer *out_buf, *buf = GST_BUFFER (in); gfloat *data; gint i, num_samples; @@ -199,7 +208,7 @@ gst_plugin_template_chain (GstPad *pad, GstBuffer *buf) g_print ("I'm plugged, therefore I'm in.\n"); /* just push out the incoming buffer without touching it */ - gst_pad_push (filter->srcpad, buf); + gst_pad_push (filter->srcpad, GST_DATA (buf)); } static void @@ -247,30 +256,23 @@ gst_plugin_template_get_property (GObject *object, guint prop_id, * register the features */ static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - GstElementFactory *factory; - - factory = gst_element_factory_new ("plugin", GST_TYPE_PLUGIN_TEMPLATE, - &plugin_details); - g_return_val_if_fail (factory != NULL, FALSE); - - gst_element_factory_add_pad_template (factory, - gst_plugin_template_src_factory ()); - gst_element_factory_add_pad_template (factory, - gst_plugin_template_sink_factory ()); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); - - /* plugin initialisation succeeded */ - return TRUE; + return gst_element_register (plugin, "plugin", + GST_RANK_NONE, + GST_TYPE_PLUGIN_TEMPLATE); } /* this is the structure that gst-register looks for * so keep the name plugin_desc, or you cannot get your plug-in registered */ -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "plugin", - plugin_init -}; + "Template plugin", + plugin_init, + VERSION, + "LGPL", + "GStreamer", + "http://gstreamer.net/" +) diff --git a/gst-plugin/src/gstplugin.h b/gst-plugin/src/gstplugin.h index 3947765..5f37076 100644 --- a/gst-plugin/src/gstplugin.h +++ b/gst-plugin/src/gstplugin.h @@ -7,9 +7,7 @@ #include <gst/gst.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS /* #define's don't like whitespacey bits */ #define GST_TYPE_PLUGIN_TEMPLATE \ @@ -42,8 +40,6 @@ struct _GstPluginTemplateClass GType gst_gst_plugin_template_get_type (void); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __GST_PLUGIN_TEMPLATE_H__ */ |