From: David Schleef Date: Sat, 8 Nov 2003 02:48:59 +0000 (+0000) Subject: Update the videofilter template X-Git-Tag: CAPS-ROOT~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd2c86e953767ebb957510ec6a4ea5859e568a46;p=platform%2Fupstream%2Fgst-plugins-good.git Update the videofilter template Original commit message from CVS: Update the videofilter template --- diff --git a/gst/videofilter/gstvideotemplate.c b/gst/videofilter/gstvideotemplate.c index cc06b94..0422e15 100644 --- a/gst/videofilter/gstvideotemplate.c +++ b/gst/videofilter/gstvideotemplate.c @@ -18,12 +18,18 @@ * Boston, MA 02111-1307, USA. */ +/* + * This file was (probably) generated from gstvideotemplate.c, + * $Id$ + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif /*#define DEBUG_ENABLED */ #include +#include /* GstVideotemplate signals and args */ enum { @@ -37,8 +43,8 @@ enum { }; static void gst_videotemplate_base_init (gpointer g_class); -static void gst_videotemplate_class_init (GstVideotemplateClass *klass); -static void gst_videotemplate_init (GstVideotemplate *videotemplate); +static void gst_videotemplate_class_init (gpointer g_class, gpointer class_data); +static void gst_videotemplate_init (GTypeInstance *instance, gpointer g_class); static void gst_videotemplate_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gst_videotemplate_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); @@ -46,10 +52,6 @@ static void gst_videotemplate_get_property (GObject *object, guint prop_id, GVa static void gst_videotemplate_planar411(GstVideofilter *videofilter, void *dest, void *src); static void gst_videotemplate_setup(GstVideofilter *videofilter); -static GstVideotemplateClass *this_class = NULL; -static GstVideofilterClass *parent_class = NULL; -static GstElementClass *element_class = NULL; - GType gst_videotemplate_get_type (void) { @@ -60,12 +62,12 @@ gst_videotemplate_get_type (void) sizeof(GstVideotemplateClass), gst_videotemplate_base_init, NULL, - (GClassInitFunc)gst_videotemplate_class_init, + gst_videotemplate_class_init, NULL, NULL, sizeof(GstVideotemplate), 0, - (GInstanceInitFunc)gst_videotemplate_init, + gst_videotemplate_init, }; videotemplate_type = g_type_register_static(GST_TYPE_VIDEOFILTER, "GstVideotemplate", &videotemplate_info, 0); @@ -88,106 +90,52 @@ gst_videotemplate_base_init (gpointer g_class) "David Schleef " ); GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + GstVideofilterClass *videofilter_class = GST_VIDEOFILTER_CLASS (g_class); + int i; gst_element_class_set_details (element_class, &videotemplate_details); + + for(i=0;iset_property = gst_videotemplate_set_property; gobject_class->get_property = gst_videotemplate_get_property; - gstvideofilter_class->setup = gst_videotemplate_setup; - - for(i=0;isetup = gst_videotemplate_setup; } static void -gst_videotemplate_init (GstVideotemplate *videotemplate) +gst_videotemplate_init (GTypeInstance *instance, gpointer g_class) { + GstVideotemplate *videotemplate = GST_VIDEOTEMPLATE (instance); GstVideofilter *videofilter; GST_DEBUG("gst_videotemplate_init"); videofilter = GST_VIDEOFILTER(videotemplate); - videofilter->sinkpad = gst_pad_new_from_template ( - GST_PAD_TEMPLATE_GET (gst_videotemplate_sink_template_factory), - "sink"); - - videofilter->srcpad = gst_pad_new_from_template ( - GST_PAD_TEMPLATE_GET (gst_videotemplate_src_template_factory), - "src"); - - gst_videofilter_postinit(GST_VIDEOFILTER(videotemplate)); + /* do stuff */ } static void @@ -237,7 +185,8 @@ static gboolean plugin_init (GstPlugin *plugin) if(!gst_library_load("gstvideofilter")) return FALSE; - return gst_element_register (plugin, "videotemplate", GST_RANK_NONE, GST_TYPE_VIDEOTEMPLATE); + return gst_element_register (plugin, "videotemplate", GST_RANK_NONE, + GST_TYPE_VIDEOTEMPLATE); } GST_PLUGIN_DEFINE ( @@ -268,10 +217,14 @@ static void gst_videotemplate_planar411(GstVideofilter *videofilter, void *dest, void *src) { GstVideotemplate *videotemplate; + int width = gst_videofilter_get_input_width(videofilter); + int height = gst_videofilter_get_input_height(videofilter); g_return_if_fail(GST_IS_VIDEOTEMPLATE(videofilter)); videotemplate = GST_VIDEOTEMPLATE(videofilter); - /* do something interesting here */ + /* do something interesting here. This simply copies the source + * to the destination. */ + memcpy(dest,src,width * height + (width/2) * (height/2) * 2); }