summaryrefslogtreecommitdiffstats
path: root/gst/frei0r/gstfrei0rfilter.c
diff options
context:
space:
mode:
authorDave Robillard <dave@drobilla.net>2009-07-03 20:01:36 -0400
committerDave Robillard <dave@drobilla.net>2009-07-03 20:01:36 -0400
commite289c875a5e0ee56dd8289e78b63f36f709b6534 (patch)
tree9bd2b450261bbc0fa522bf27d9a89d017308687e /gst/frei0r/gstfrei0rfilter.c
parented06ed3b658b49b1313df38909bcb2f907be83a7 (diff)
parentcaba48f261421d397900471b19350da2e5a4a4e5 (diff)
downloadgst-plugins-bad-e289c875a5e0ee56dd8289e78b63f36f709b6534.tar.gz
gst-plugins-bad-e289c875a5e0ee56dd8289e78b63f36f709b6534.tar.bz2
gst-plugins-bad-e289c875a5e0ee56dd8289e78b63f36f709b6534.zip
Merge branch 'fdo' into lv2
Diffstat (limited to 'gst/frei0r/gstfrei0rfilter.c')
-rw-r--r--gst/frei0r/gstfrei0rfilter.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/gst/frei0r/gstfrei0rfilter.c b/gst/frei0r/gstfrei0rfilter.c
index 43d8fc67..eda78adf 100644
--- a/gst/frei0r/gstfrei0rfilter.c
+++ b/gst/frei0r/gstfrei0rfilter.c
@@ -40,22 +40,11 @@ gst_frei0r_filter_set_caps (GstBaseTransform * trans, GstCaps * incaps,
GstCaps * outcaps)
{
GstFrei0rFilter *self = GST_FREI0R_FILTER (trans);
- GstFrei0rFilterClass *klass = GST_FREI0R_FILTER_GET_CLASS (trans);
GstVideoFormat fmt;
- gint width, height;
- if (!gst_video_format_parse_caps (incaps, &fmt, &width, &height))
+ if (!gst_video_format_parse_caps (incaps, &fmt, &self->width, &self->height))
return FALSE;
- if (self->f0r_instance) {
- klass->ftable->destruct (self->f0r_instance);
- self->f0r_instance = NULL;
- }
-
- self->f0r_instance =
- gst_frei0r_instance_construct (klass->ftable, klass->properties,
- klass->n_properties, self->property_cache, width, height);
-
return TRUE;
}
@@ -70,6 +59,8 @@ gst_frei0r_filter_stop (GstBaseTransform * trans)
self->f0r_instance = NULL;
}
+ self->width = self->height = 0;
+
return TRUE;
}
@@ -81,9 +72,17 @@ gst_frei0r_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
GstFrei0rFilterClass *klass = GST_FREI0R_FILTER_GET_CLASS (trans);
gdouble time;
- if (!self->f0r_instance)
+ if (G_UNLIKELY (self->width <= 0 || self->height <= 0))
return GST_FLOW_NOT_NEGOTIATED;
+ if (G_UNLIKELY (!self->f0r_instance)) {
+ self->f0r_instance =
+ gst_frei0r_instance_construct (klass->ftable, klass->properties,
+ klass->n_properties, self->property_cache, self->width, self->height);
+ if (G_UNLIKELY (!self->f0r_instance))
+ return GST_FLOW_ERROR;
+ }
+
time = ((gdouble) GST_BUFFER_TIMESTAMP (inbuf)) / GST_SECOND;
if (klass->ftable->update2)
@@ -195,6 +194,8 @@ gst_frei0r_filter_init (GstFrei0rFilter * self, GstFrei0rFilterClass * klass)
{
self->property_cache =
gst_frei0r_property_cache_init (klass->properties, klass->n_properties);
+ gst_pad_use_fixed_caps (GST_BASE_TRANSFORM_SINK_PAD (self));
+ gst_pad_use_fixed_caps (GST_BASE_TRANSFORM_SRC_PAD (self));
}
gboolean