summaryrefslogtreecommitdiffstats
path: root/gst/effectv/gstdice.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/effectv/gstdice.c')
-rw-r--r--gst/effectv/gstdice.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gst/effectv/gstdice.c b/gst/effectv/gstdice.c
index 4f58a8fb..c2c2de73 100644
--- a/gst/effectv/gstdice.c
+++ b/gst/effectv/gstdice.c
@@ -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 GstCaps * 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_caps_get_structure (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;