diff options
author | Dave Robillard <dave@drobilla.net> | 2009-07-03 20:01:36 -0400 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-07-03 20:01:36 -0400 |
commit | e289c875a5e0ee56dd8289e78b63f36f709b6534 (patch) | |
tree | 9bd2b450261bbc0fa522bf27d9a89d017308687e /gst/frei0r/gstfrei0rsrc.c | |
parent | ed06ed3b658b49b1313df38909bcb2f907be83a7 (diff) | |
parent | caba48f261421d397900471b19350da2e5a4a4e5 (diff) | |
download | gst-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/gstfrei0rsrc.c')
-rw-r--r-- | gst/frei0r/gstfrei0rsrc.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/gst/frei0r/gstfrei0rsrc.c b/gst/frei0r/gstfrei0rsrc.c index a713e1e9..2d637f95 100644 --- a/gst/frei0r/gstfrei0rsrc.c +++ b/gst/frei0r/gstfrei0rsrc.c @@ -39,22 +39,12 @@ static gboolean gst_frei0r_src_set_caps (GstBaseSrc * src, GstCaps * caps) { GstFrei0rSrc *self = GST_FREI0R_SRC (src); - GstFrei0rSrcClass *klass = GST_FREI0R_SRC_GET_CLASS (src); if (!gst_video_format_parse_caps (caps, &self->fmt, &self->width, &self->height) || !gst_video_parse_caps_framerate (caps, &self->fps_n, &self->fps_d)) 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, self->width, self->height); - return TRUE; } @@ -80,9 +70,18 @@ gst_frei0r_src_create (GstPushSrc * src, GstBuffer ** buf) *buf = NULL; - if (G_UNLIKELY (!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; + } + newsize = gst_video_format_get_size (self->fmt, self->width, self->height); ret = @@ -147,6 +146,11 @@ gst_frei0r_src_stop (GstBaseSrc * basesrc) self->f0r_instance = NULL; } + self->fmt = GST_VIDEO_FORMAT_UNKNOWN; + self->width = self->height = 0; + self->fps_n = self->fps_d = 0; + self->n_frames = 0; + return TRUE; } |