From: David Schleef Date: Mon, 10 Nov 2003 18:42:32 +0000 (+0000) Subject: Update for videofilter changes X-Git-Tag: 1.19.3~511^2~15123 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf680721dfe19ea3a405b69800a4e6e8816b04fb;p=platform%2Fupstream%2Fgstreamer.git Update for videofilter changes Original commit message from CVS: Update for videofilter changes --- diff --git a/ext/pango/gsttimeoverlay.c b/ext/pango/gsttimeoverlay.c index ea0c38d..b13ff1e 100644 --- a/ext/pango/gsttimeoverlay.c +++ b/ext/pango/gsttimeoverlay.c @@ -27,27 +27,22 @@ * Copyright (C) 2001 Sun Microsystems */ +/* + * This file was (probably) generated from gsttimeoverlay.c, + * gsttimeoverlay.c,v 1.7 2003/11/08 02:48:59 dschleef Exp + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif /*#define DEBUG_ENABLED */ #include - +#include +#include #include #include -#include - - - -/* elementfactory information */ -static GstElementDetails timeoverlay_details = { - "Video Filter Template", - "Filter/Video", - "Template for a video filter", - "David Schleef ", -}; /* GstTimeoverlay signals and args */ enum { @@ -60,9 +55,9 @@ enum { /* FILL ME */ }; -static void gst_timeoverlay_base_init (gpointer g_class); -static void gst_timeoverlay_class_init (GstTimeoverlayClass *klass); -static void gst_timeoverlay_init (GstTimeoverlay *timeoverlay); +static void gst_timeoverlay_base_init (gpointer g_class); +static void gst_timeoverlay_class_init (gpointer g_class, gpointer class_data); +static void gst_timeoverlay_init (GTypeInstance *instance, gpointer g_class); static void gst_timeoverlay_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gst_timeoverlay_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); @@ -70,10 +65,6 @@ static void gst_timeoverlay_get_property (GObject *object, guint prop_id, GValu static void gst_timeoverlay_planar411(GstVideofilter *videofilter, void *dest, void *src); static void gst_timeoverlay_setup(GstVideofilter *videofilter); -static GstTimeoverlayClass *this_class = NULL; -static GstVideofilterClass *parent_class = NULL; -static GstElementClass *element_class = NULL; - GType gst_timeoverlay_get_type (void) { @@ -84,14 +75,15 @@ gst_timeoverlay_get_type (void) sizeof(GstTimeoverlayClass), gst_timeoverlay_base_init, NULL, - (GClassInitFunc)gst_timeoverlay_class_init, + gst_timeoverlay_class_init, NULL, NULL, sizeof(GstTimeoverlay), 0, - (GInstanceInitFunc)gst_timeoverlay_init, + gst_timeoverlay_init, }; - timeoverlay_type = g_type_register_static(GST_TYPE_VIDEOFILTER, "GstTimeoverlay", &timeoverlay_info, 0); + timeoverlay_type = g_type_register_static(GST_TYPE_VIDEOFILTER, + "GstTimeoverlay", &timeoverlay_info, 0); } return timeoverlay_type; } @@ -100,112 +92,63 @@ static GstVideofilterFormat gst_timeoverlay_formats[] = { { "I420", 12, gst_timeoverlay_planar411, }, }; -static GstCaps *gst_timeoverlay_get_capslist(void) -{ - GstVideofilterClass *klass; - - klass = g_type_class_ref(GST_TYPE_VIDEOFILTER); - - return gst_videofilter_class_get_capslist(klass); -} - -static GstPadTemplate * -gst_timeoverlay_src_template_factory(void) -{ - static GstPadTemplate *templ = NULL; - - if(!templ){ - GstCaps *caps = GST_CAPS_NEW("src","video/x-raw-yuv", - "width", GST_PROPS_INT_RANGE (1, G_MAXINT), - "height", GST_PROPS_INT_RANGE (1, G_MAXINT), - "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT)); - - caps = gst_caps_intersect(caps, gst_timeoverlay_get_capslist ()); - - templ = GST_PAD_TEMPLATE_NEW("src", GST_PAD_SRC, GST_PAD_ALWAYS, caps); - } - return templ; -} - -static GstPadTemplate * -gst_timeoverlay_sink_template_factory(void) -{ - static GstPadTemplate *templ = NULL; - - if(!templ){ - GstCaps *caps = GST_CAPS_NEW("sink","video/x-raw-yuv", - "width", GST_PROPS_INT_RANGE (1, G_MAXINT), - "height", GST_PROPS_INT_RANGE (1, G_MAXINT), - "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT)); - - caps = gst_caps_intersect(caps, gst_timeoverlay_get_capslist ()); - - templ = GST_PAD_TEMPLATE_NEW("src", GST_PAD_SINK, GST_PAD_ALWAYS, caps); - } - return templ; -} - + static void gst_timeoverlay_base_init (gpointer g_class) { + static GstElementDetails timeoverlay_details = GST_ELEMENT_DETAILS ( + "Time Overlay", + "Filter/Video", + "Overlays the time on a video stream", + "David Schleef " + ); GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (gst_timeoverlay_sink_template_factory)); - gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (gst_timeoverlay_src_template_factory)); + GstVideofilterClass *videofilter_class = GST_VIDEOFILTER_CLASS (g_class); + int i; + gst_element_class_set_details (element_class, &timeoverlay_details); + for(i=0;iset_property = gst_timeoverlay_set_property; gobject_class->get_property = gst_timeoverlay_get_property; - gstvideofilter_class->setup = gst_timeoverlay_setup; - - for(i=0;isetup = gst_timeoverlay_setup; } static void -gst_timeoverlay_init (GstTimeoverlay *timeoverlay) +gst_timeoverlay_init (GTypeInstance *instance, gpointer g_class) { + GstTimeoverlay *timeoverlay = GST_TIMEOVERLAY (instance); GstVideofilter *videofilter; GST_DEBUG("gst_timeoverlay_init"); videofilter = GST_VIDEOFILTER(timeoverlay); - videofilter->sinkpad = gst_pad_new_from_template ( - GST_PAD_TEMPLATE_GET (gst_timeoverlay_sink_template_factory), - "sink"); - - videofilter->srcpad = gst_pad_new_from_template ( - GST_PAD_TEMPLATE_GET (gst_timeoverlay_src_template_factory), - "src"); + /* do stuff */ } static void @@ -255,10 +198,8 @@ static gboolean plugin_init (GstPlugin *plugin) if(!gst_library_load("gstvideofilter")) return FALSE; - if (!gst_element_register (plugin, "timeoverlay", GST_RANK_NONE, GST_TYPE_TIMEOVERLAY)) - return FALSE; - - return TRUE; + return gst_element_register (plugin, "timeoverlay", GST_RANK_NONE, + GST_TYPE_TIMEOVERLAY); } GST_PLUGIN_DEFINE ( @@ -268,10 +209,11 @@ GST_PLUGIN_DEFINE ( "Time overlay", plugin_init, VERSION, - "LGPL", + GST_LICENSE, GST_COPYRIGHT, GST_PACKAGE, - GST_ORIGIN) + GST_ORIGIN +) static void gst_timeoverlay_setup(GstVideofilter *videofilter) { @@ -330,8 +272,8 @@ static void gst_timeoverlay_planar411(GstVideofilter *videofilter, void *dest, void *src) { GstTimeoverlay *timeoverlay; - int height; int width; + int height; PangoRectangle logical_rect; PangoLayout *layout; int b_height, b_width; @@ -345,6 +287,9 @@ static void gst_timeoverlay_planar411(GstVideofilter *videofilter, width = gst_videofilter_get_input_width(videofilter); height = gst_videofilter_get_input_height(videofilter); + width = gst_videofilter_get_input_width(videofilter); + height = gst_videofilter_get_input_height(videofilter); + layout = pango_layout_new (timeoverlay->context); string = gst_timeoverlay_print_smpte_time(GST_BUFFER_TIMESTAMP(videofilter->in_buf)); pango_layout_set_text (layout, string, strlen(string)); @@ -367,7 +312,7 @@ static void gst_timeoverlay_planar411(GstVideofilter *videofilter, for(i=0;i