Commit 3caad1a9 authored by David Schleef's avatar David Schleef

Convert to new caps

Original commit message from CVS:
Convert to new caps
parent 6ef95281
......@@ -105,7 +105,7 @@ static void gst_bpwsinc_get_property (GObject * object, guint prop_id,
static void gst_bpwsinc_chain (GstPad * pad, GstData *_data);
static GstPadLinkReturn
gst_bpwsinc_sink_connect (GstPad * pad, GstCaps * caps);
gst_bpwsinc_sink_connect (GstPad * pad, const GstCaps2 * caps);
static GstElementClass *parent_class = NULL;
/*static guint gst_bpwsinc_signals[LAST_SIGNAL] = { 0 }; */
......@@ -136,8 +136,10 @@ gst_bpwsinc_base_init (gpointer g_class)
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
/* register src pads */
gst_element_class_add_pad_template (element_class, gst_filter_src_factory ());
gst_element_class_add_pad_template (element_class, gst_filter_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_filter_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_filter_sink_template));
gst_element_class_set_details (element_class, &gst_bpwsinc_details);
}
......@@ -176,12 +178,14 @@ gst_bpwsinc_class_init (GstBPWSincClass * klass)
static void
gst_bpwsinc_init (GstBPWSinc * filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_filter_sink_factory (), "sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_filter_sink_template), "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_bpwsinc_chain);
gst_pad_set_link_function (filter->sinkpad, gst_bpwsinc_sink_connect);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_filter_src_factory (), "src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_filter_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
filter->wing_size = 50;
......@@ -191,7 +195,7 @@ gst_bpwsinc_init (GstBPWSinc * filter)
}
static GstPadLinkReturn
gst_bpwsinc_sink_connect (GstPad * pad, GstCaps * caps)
gst_bpwsinc_sink_connect (GstPad * pad, const GstCaps2 * caps)
{
int i = 0;
double sum = 0.0;
......@@ -204,10 +208,7 @@ gst_bpwsinc_sink_connect (GstPad * pad, GstCaps * caps)
g_assert (GST_IS_PAD (pad));
g_assert (caps != NULL);
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
set_retval = gst_pad_try_set_caps (filter->srcpad, gst_caps_ref (caps));
set_retval = gst_pad_try_set_caps (filter->srcpad, caps);
if (set_retval > 0)
{
......
......@@ -102,7 +102,7 @@ static void gst_lpwsinc_get_property (GObject * object, guint prop_id,
static void gst_lpwsinc_chain (GstPad * pad, GstData *_data);
static GstPadLinkReturn
gst_lpwsinc_sink_connect (GstPad * pad, GstCaps * caps);
gst_lpwsinc_sink_connect (GstPad * pad, const GstCaps2 * caps);
static GstElementClass *parent_class = NULL;
/*static guint gst_lpwsinc_signals[LAST_SIGNAL] = { 0 }; */
......@@ -133,8 +133,10 @@ gst_lpwsinc_base_init (gpointer g_class)
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
/* register src pads */
gst_element_class_add_pad_template (element_class, gst_filter_src_factory ());
gst_element_class_add_pad_template (element_class, gst_filter_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_filter_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_filter_sink_template));
gst_element_class_set_details (element_class, &gst_lpwsinc_details);
}
......@@ -168,12 +170,14 @@ gst_lpwsinc_class_init (GstLPWSincClass * klass)
static void
gst_lpwsinc_init (GstLPWSinc * filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_filter_sink_factory (), "sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_filter_sink_template), "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_lpwsinc_chain);
gst_pad_set_link_function (filter->sinkpad, gst_lpwsinc_sink_connect);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_filter_src_factory (), "src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_filter_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
filter->wing_size = 50;
......@@ -182,7 +186,7 @@ gst_lpwsinc_init (GstLPWSinc * filter)
}
static GstPadLinkReturn
gst_lpwsinc_sink_connect (GstPad * pad, GstCaps * caps)
gst_lpwsinc_sink_connect (GstPad * pad, const GstCaps2 * caps)
{
int i = 0;
double sum = 0.0;
......@@ -193,10 +197,7 @@ gst_lpwsinc_sink_connect (GstPad * pad, GstCaps * caps)
g_assert (GST_IS_PAD (pad));
g_assert (caps != NULL);
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
set_retval = gst_pad_try_set_caps(filter->srcpad, gst_caps_ref (caps));
set_retval = gst_pad_try_set_caps(filter->srcpad, caps);
if (set_retval > 0)
{
......
......@@ -142,8 +142,10 @@ gst_agingtv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get(&gst_effectv_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get(&gst_effectv_sink_template));
gst_element_class_set_details (element_class, &gst_agingtv_details);
}
......@@ -164,34 +166,36 @@ gst_agingtv_class_init (GstAgingTVClass * klass)
}
static GstPadLinkReturn
gst_agingtv_sinkconnect (GstPad * pad, GstCaps * caps)
gst_agingtv_sinkconnect (GstPad * pad, const GstCaps2 * caps)
{
GstAgingTV *filter;
GstStructure *structure;
filter = GST_AGINGTV (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
structure = gst_caps2_get_nth_cap (caps, 0);
gst_caps_get_int (caps, "width", &filter->width);
gst_caps_get_int (caps, "height", &filter->height);
gst_structure_get_int (structure, "width", &filter->width);
gst_structure_get_int (structure, "height", &filter->height);
filter->video_size = filter->width * filter->height;
filter->aging_mode = 0;
aging_mode_switch (filter);
return gst_pad_try_set_caps (filter->srcpad, gst_caps_ref (caps));
return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_agingtv_init (GstAgingTV * filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_effectv_sink_factory (), "sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get(&gst_effectv_sink_template), "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_agingtv_chain);
gst_pad_set_link_function (filter->sinkpad, gst_agingtv_sinkconnect);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_effectv_src_factory (), "src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get(&gst_effectv_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
}
......
......@@ -132,8 +132,10 @@ gst_dicetv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_effectv_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_effectv_sink_template));
gst_element_class_set_details (element_class, &gst_dicetv_details);
}
......@@ -169,34 +171,36 @@ gst_dicetv_class_init (GstDiceTVClass * klass)
}
static GstPadLinkReturn
gst_dicetv_sinkconnect (GstPad * pad, GstCaps * caps)
gst_dicetv_sinkconnect (GstPad * pad, const GstCaps2 * caps)
{
GstDiceTV *filter;
GstStructure *structure;
filter = GST_DICETV (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
structure = gst_caps2_get_nth_cap (caps, 0);
gst_caps_get_int (caps, "width", &filter->width);
gst_caps_get_int (caps, "height", &filter->height);
gst_structure_get_int (structure, "width", &filter->width);
gst_structure_get_int (structure, "height", &filter->height);
g_free (filter->dicemap);
filter->dicemap = (gchar *) g_malloc (filter->height * filter->width * sizeof(char));
gst_dicetv_create_map (filter);
return gst_pad_try_set_caps (filter->srcpad, gst_caps_ref (caps));
return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_dicetv_init (GstDiceTV * filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_effectv_sink_factory (), "sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_effectv_sink_template), "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_dicetv_chain);
gst_pad_set_link_function (filter->sinkpad, gst_dicetv_sinkconnect);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_effectv_src_factory (), "src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_effectv_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
filter->dicemap = NULL;
......
......@@ -121,8 +121,10 @@ gst_edgetv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get(&gst_effectv_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get(&gst_effectv_sink_template));
gst_element_class_set_details (element_class, &gst_edgetv_details);
}
......@@ -143,17 +145,17 @@ gst_edgetv_class_init (GstEdgeTVClass * klass)
}
static GstPadLinkReturn
gst_edgetv_sinkconnect (GstPad * pad, GstCaps * caps)
gst_edgetv_sinkconnect (GstPad * pad, const GstCaps2 * caps)
{
GstEdgeTV *filter;
GstStructure *structure;
filter = GST_EDGETV (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
structure = gst_caps2_get_nth_cap (caps, 0);
gst_caps_get_int (caps, "width", &filter->width);
gst_caps_get_int (caps, "height", &filter->height);
gst_structure_get_int (structure, "width", &filter->width);
gst_structure_get_int (structure, "height", &filter->height);
filter->map_width = filter->width / 4;
filter->map_height = filter->height / 4;
......@@ -163,18 +165,20 @@ gst_edgetv_sinkconnect (GstPad * pad, GstCaps * caps)
filter->map = (guint32 *)g_malloc (filter->map_width * filter->map_height * sizeof(guint32) * 2);
bzero(filter->map, filter->map_width * filter->map_height * sizeof(guint32) * 2);
return gst_pad_try_set_caps (filter->srcpad, gst_caps_ref (caps));
return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_edgetv_init (GstEdgeTV * filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_effectv_sink_factory (), "sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get(&gst_effectv_sink_template), "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_edgetv_chain);
gst_pad_set_link_function (filter->sinkpad, gst_edgetv_sinkconnect);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_effectv_src_factory (), "src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get(&gst_effectv_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
filter->map = NULL;
......
......@@ -49,43 +49,21 @@ static struct _elements_entry _elements[] = {
};
GstPadTemplate*
gst_effectv_src_factory (void)
{
static GstPadTemplate *templ = NULL;
if (!templ) {
templ = GST_PAD_TEMPLATE_NEW (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
gst_caps_new (
"effectv_src",
"video/x-raw-rgb",
GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
)
);
}
return templ;
}
GstStaticPadTemplate gst_effectv_src_template =
GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ( GST_VIDEO_RGB_PAD_TEMPLATE_CAPS_32 )
);
GstPadTemplate*
gst_effectv_sink_factory (void)
{
static GstPadTemplate *templ = NULL;
if (!templ) {
templ = GST_PAD_TEMPLATE_NEW (
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
gst_caps_new (
"effectv_sink",
"video/x-raw-rgb",
GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
)
);
}
return templ;
}
GstStaticPadTemplate gst_effectv_sink_template =
GST_STATIC_PAD_TEMPLATE (
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ( GST_VIDEO_RGB_PAD_TEMPLATE_CAPS_32 )
);
static gboolean
plugin_init (GstPlugin * plugin)
......@@ -94,7 +72,7 @@ plugin_init (GstPlugin * plugin)
while (_elements[i].name) {
if (!gst_element_register (plugin, _elements[i].name,
GST_RANK_NONE, (_elements[i].type) ()))
GST_RANK_NONE, (_elements[i].type) ()))
return FALSE;
i++;
}
......
......@@ -32,5 +32,5 @@ GType gst_vertigotv_get_type (void);
GType gst_revtv_get_type (void);
GType gst_quarktv_get_type (void);
extern GstPadTemplate *gst_effectv_sink_factory ();
extern GstPadTemplate *gst_effectv_src_factory ();
extern GstStaticPadTemplate gst_effectv_sink_template;
extern GstStaticPadTemplate gst_effectv_src_template;
......@@ -138,8 +138,10 @@ gst_quarktv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_effectv_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_effectv_sink_template));
gst_element_class_set_details (element_class, &gst_quarktv_details);
}
......@@ -166,18 +168,18 @@ gst_quarktv_class_init (GstQuarkTVClass * klass)
}
static GstPadLinkReturn
gst_quarktv_sinkconnect (GstPad * pad, GstCaps * caps)
gst_quarktv_sinkconnect (GstPad * pad, const GstCaps2 * caps)
{
GstQuarkTV *filter;
gint i;
GstStructure *structure;
filter = GST_QUARKTV (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
structure = gst_caps2_get_nth_cap (caps, 0);
gst_caps_get_int (caps, "width", &filter->width);
gst_caps_get_int (caps, "height", &filter->height);
gst_structure_get_int (structure, "width", &filter->width);
gst_structure_get_int (structure, "height", &filter->height);
filter->area = filter->width * filter->height;
......@@ -188,18 +190,20 @@ gst_quarktv_sinkconnect (GstPad * pad, GstCaps * caps)
filter->planetable[i] = NULL;
}
return gst_pad_try_set_caps (filter->srcpad, gst_caps_ref (caps));
return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_quarktv_init (GstQuarkTV * filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_effectv_sink_factory (), "sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get(&gst_effectv_sink_template), "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_quarktv_chain);
gst_pad_set_link_function (filter->sinkpad, gst_quarktv_sinkconnect);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_effectv_src_factory (), "src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get(&gst_effectv_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
filter->planes = PLANES;
......
......@@ -149,8 +149,10 @@ gst_revtv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_effectv_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_effectv_sink_template));
gst_element_class_set_details (element_class, &gst_revtv_details);
}
......@@ -181,30 +183,32 @@ gst_revtv_class_init (GstRevTVClass * klass)
}
static GstPadLinkReturn
gst_revtv_sinkconnect (GstPad * pad, GstCaps * caps)
gst_revtv_sinkconnect (GstPad * pad, const GstCaps2 * caps)
{
GstRevTV *filter;
GstStructure *structure;
filter = GST_REVTV (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
structure = gst_caps2_get_nth_cap (caps, 0);
gst_caps_get_int (caps, "width", &filter->width);
gst_caps_get_int (caps, "height", &filter->height);
gst_structure_get_int (structure, "width", &filter->width);
gst_structure_get_int (structure, "height", &filter->height);
return gst_pad_try_set_caps (filter->srcpad, gst_caps_ref (caps));
return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_revtv_init (GstRevTV * filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_effectv_sink_factory (), "sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_effectv_sink_template), "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_revtv_chain);
gst_pad_set_link_function (filter->sinkpad, gst_revtv_sinkconnect);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_effectv_src_factory (), "src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_effectv_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
filter->vgrabtime = 1;
......
......@@ -130,8 +130,10 @@ gst_shagadelictv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get(&gst_effectv_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get(&gst_effectv_sink_template));
gst_element_class_set_details (element_class, &gst_shagadelictv_details);
}
......@@ -152,18 +154,18 @@ gst_shagadelictv_class_init (GstShagadelicTVClass * klass)
}
static GstPadLinkReturn
gst_shagadelictv_sinkconnect (GstPad * pad, GstCaps * caps)
gst_shagadelictv_sinkconnect (GstPad * pad, const GstCaps2 * caps)
{
GstShagadelicTV *filter;
gint area;
GstStructure *structure;
filter = GST_SHAGADELICTV (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
structure = gst_caps2_get_nth_cap (caps, 0);
gst_caps_get_int (caps, "width", &filter->width);
gst_caps_get_int (caps, "height", &filter->height);
gst_structure_get_int (structure, "width", &filter->width);
gst_structure_get_int (structure, "height", &filter->height);
area = filter->width * filter->height;
......@@ -175,18 +177,20 @@ gst_shagadelictv_sinkconnect (GstPad * pad, GstCaps * caps)
gst_shagadelic_initialize (filter);
return gst_pad_try_set_caps (filter->srcpad, gst_caps_ref (caps));
return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_shagadelictv_init (GstShagadelicTV * filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_effectv_sink_factory (), "sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get(&gst_effectv_sink_template), "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_shagadelictv_chain);
gst_pad_set_link_function (filter->sinkpad, gst_shagadelictv_sinkconnect);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_effectv_src_factory (), "src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get(&gst_effectv_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
filter->ripple = NULL;
......
......@@ -135,8 +135,10 @@ gst_vertigotv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_effectv_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_effectv_sink_template));
gst_element_class_set_details (element_class, &gst_vertigotv_details);
}
......@@ -186,18 +188,18 @@ gst_vertigotv_reset_handler (GstElement *element)
static GstPadLinkReturn
gst_vertigotv_sinkconnect (GstPad * pad, GstCaps * caps)
gst_vertigotv_sinkconnect (GstPad * pad, const GstCaps2 * caps)
{
GstVertigoTV *filter;
gint area;
GstStructure *structure;
filter = GST_VERTIGOTV (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
structure = gst_caps2_get_nth_cap (caps, 0);
gst_caps_get_int (caps, "width", &filter->width);
gst_caps_get_int (caps, "height", &filter->height);
gst_structure_get_int (structure, "width", &filter->width);
gst_structure_get_int (structure, "height", &filter->height);
area = filter->width * filter->height;
......@@ -209,18 +211,20 @@ gst_vertigotv_sinkconnect (GstPad * pad, GstCaps * caps)
filter->alt_buffer = filter->buffer + area;
filter->phase = 0;
return gst_pad_try_set_caps (filter->srcpad, gst_caps_ref (caps));
return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_vertigotv_init (GstVertigoTV * filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_effectv_sink_factory (), "sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_effectv_sink_template), "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_vertigotv_chain);
gst_pad_set_link_function (filter->sinkpad, gst_vertigotv_sinkconnect);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad = gst_pad_new_from_template (gst_effectv_src_factory (), "src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get (&gst_effectv_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
filter->buffer = NULL;
......
......@@ -136,8 +136,10 @@ gst_warptv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);