From 673bb31a92125e926ba5587ecd16f0f7b77eff51 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 2 Nov 2003 22:54:47 +0000 Subject: [PATCH] Bla Original commit message from CVS: Bla --- gst/videofilter/gstvideobalance.c | 53 ++++++++++++++++++------------- gst/videofilter/gstvideofilter.c | 48 ++++++++++++++-------------- gst/videofilter/gstvideoflip.c | 53 ++++++++++++++++++------------- 3 files changed, 86 insertions(+), 68 deletions(-) diff --git a/gst/videofilter/gstvideobalance.c b/gst/videofilter/gstvideobalance.c index 06ed0d6dc3..41fd93f6be 100644 --- a/gst/videofilter/gstvideobalance.c +++ b/gst/videofilter/gstvideobalance.c @@ -29,11 +29,8 @@ static GstElementDetails videobalance_details = { "Video Balance control", "Filter/Video", - "LGPL", "Adjusts brightness, contrast, hue, saturation on a video stream", - VERSION, - "David Schleef ", - "(C) 2003", + "David Schleef " }; /* GstVideobalance signals and args */ @@ -52,6 +49,7 @@ enum { }; static void gst_videobalance_class_init (GstVideobalanceClass *klass); +static void gst_videobalance_base_init (GstVideobalanceClass *klass); static void gst_videobalance_init (GstVideobalance *videobalance); static void gst_videobalance_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); @@ -71,7 +69,8 @@ gst_videobalance_get_type (void) if (!videobalance_type) { static const GTypeInfo videobalance_info = { - sizeof(GstVideobalanceClass), NULL, + sizeof(GstVideobalanceClass), + (GBaseInitFunc)gst_videobalance_base_init, NULL, (GClassInitFunc)gst_videobalance_class_init, NULL, @@ -89,6 +88,21 @@ static GstVideofilterFormat gst_videobalance_formats[] = { { "I420", 12, gst_videobalance_planar411, }, }; +static GstPadTemplate *gst_videobalance_sink_template_factory (void); +static GstPadTemplate *gst_videobalance_src_template_factory (void); + +static void +gst_videobalance_base_init (GstVideobalanceClass *klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (gst_videobalance_sink_template_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (gst_videobalance_src_template_factory)); + gst_element_class_set_details (element_class, &videobalance_details); +} + static void gst_videobalance_class_init (GstVideobalanceClass *klass) { @@ -255,32 +269,27 @@ gst_videobalance_get_property (GObject *object, guint prop_id, GValue *value, GP } } -static gboolean plugin_init (GModule *module, GstPlugin *plugin) +static gboolean plugin_init (GstPlugin *plugin) { - GstElementFactory *factory; - if(!gst_library_load("gstvideofilter")) return FALSE; - /* create an elementfactory for the videobalance element */ - factory = gst_element_factory_new("videobalance",GST_TYPE_VIDEOBALANCE, - &videobalance_details); - g_return_val_if_fail(factory != NULL, FALSE); - - gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (gst_videobalance_sink_template_factory)); - gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (gst_videobalance_src_template_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); - - return TRUE; + return gst_element_register(plugin, "videobalance", + GST_RANK_NONE, GST_TYPE_VIDEOBALANCE); } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "videobalance", - plugin_init -}; + "Changes hue, saturation, brightness etc. on video images", + plugin_init, + VERSION, + "LGPL", + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) static void gst_videobalance_setup(GstVideofilter *videofilter) { diff --git a/gst/videofilter/gstvideofilter.c b/gst/videofilter/gstvideofilter.c index a4a3bae240..a7446887a9 100644 --- a/gst/videofilter/gstvideofilter.c +++ b/gst/videofilter/gstvideofilter.c @@ -29,11 +29,8 @@ static GstElementDetails videofilter_details = { "Video scaler", "Filter/Video", - "LGPL", "Resizes video", - VERSION, - "David Schleef ", - "(C) 2003", + "David Schleef " }; #endif @@ -49,7 +46,7 @@ enum { /* FILL ME */ }; -static void gst_videofilter_base_init (GstVideofilterClass *klass); +static void gst_videofilter_base_init (GstVideofilterClass *klass); static void gst_videofilter_class_init (GstVideofilterClass *klass); static void gst_videofilter_init (GstVideofilter *videofilter); @@ -88,6 +85,16 @@ gst_videofilter_get_type (void) static void gst_videofilter_base_init (GstVideofilterClass *klass) { klass->formats = g_ptr_array_new(); + +#if 0 + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (gst_videofilter_sink_template_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (gst_videofilter_src_template_factory)); + gst_element_class_set_details (element_class, &videofilter_details); +#endif } static void gst_videofilter_class_init (GstVideofilterClass *klass) @@ -565,32 +572,25 @@ void gst_videofilter_class_add_format(GstVideofilterClass *videofilterclass, } static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { #if 0 - GstElementFactory *factory; - - /* create an elementfactory for the videofilter element */ - factory = gst_element_factory_new("videofilter",GST_TYPE_VIDEOFILTER, - &videofilter_details); - g_return_val_if_fail(factory != NULL, FALSE); - - /* FIXME: we need to init the class before we can call the - * pad template factories */ - gst_element_factory_add_pad_template (factory, - GST_PAD_TEMPLATE_GET (gst_videofilter_sink_template_factory)); - gst_element_factory_add_pad_template (factory, - GST_PAD_TEMPLATE_GET (gst_videofilter_src_template_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); + return gst_element_register(plugin, "videofilter", + GST_RANK_NONE, GST_TYPE_VIDEOFILTER); #endif return TRUE; } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "gstvideofilter", - plugin_init -}; + "Video filter parent class", + plugin_init, + VERSION, + "LGPL", + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) diff --git a/gst/videofilter/gstvideoflip.c b/gst/videofilter/gstvideoflip.c index cfa2b04798..375d304093 100644 --- a/gst/videofilter/gstvideoflip.c +++ b/gst/videofilter/gstvideoflip.c @@ -35,11 +35,8 @@ static GstElementDetails videoflip_details = { "Video flipper", "Filter/Video", - "LGPL", "Flips and rotates video", - VERSION, - "David Schleef ", - "(C) 2003", + "David Schleef " }; /* GstVideoflip signals and args */ @@ -55,6 +52,7 @@ enum { }; static void gst_videoflip_class_init (GstVideoflipClass *klass); +static void gst_videoflip_base_init (GstVideoflipClass *klass); static void gst_videoflip_init (GstVideoflip *videoflip); static void gst_videoflip_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); @@ -98,7 +96,8 @@ gst_videoflip_get_type (void) if (!videoflip_type) { static const GTypeInfo videoflip_info = { - sizeof(GstVideoflipClass), NULL, + sizeof(GstVideoflipClass), + (GBaseInitFunc)gst_videoflip_base_init, NULL, (GClassInitFunc)gst_videoflip_class_init, NULL, @@ -119,6 +118,21 @@ static GstVideofilterFormat gst_videoflip_formats[] = { { "IYUV", 12, gst_videoflip_planar411, }, }; +static GstPadTemplate *gst_videoflip_sink_template_factory (void); +static GstPadTemplate *gst_videoflip_src_template_factory (void); + +static void +gst_videoflip_base_init (GstVideoflipClass *klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (gst_videoflip_sink_template_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (gst_videoflip_src_template_factory)); + gst_element_class_set_details (element_class, &videoflip_details); +} + static void gst_videoflip_class_init (GstVideoflipClass *klass) { @@ -256,32 +270,27 @@ gst_videoflip_get_property (GObject *object, guint prop_id, GValue *value, GPara } } -static gboolean plugin_init (GModule *module, GstPlugin *plugin) +static gboolean plugin_init (GstPlugin *plugin) { - GstElementFactory *factory; - if(!gst_library_load("gstvideofilter")) return FALSE; - /* create an elementfactory for the videoflip element */ - factory = gst_element_factory_new("videoflip",GST_TYPE_VIDEOFLIP, - &videoflip_details); - g_return_val_if_fail(factory != NULL, FALSE); - - gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (gst_videoflip_sink_template_factory)); - gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (gst_videoflip_src_template_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); - - return TRUE; + return gst_element_register(plugin, "videoflip", + GST_RANK_NONE, GST_TYPE_VIDEOFLIP); } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "videoflip", - plugin_init -}; + "Flips video", + plugin_init, + VERSION, + "LGPL", + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) static void gst_videoflip_flip(GstVideoflip *videoflip, unsigned char *dest,