summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-06-29 11:54:26 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-06-29 11:54:26 +0200
commit166ee21b5b3348ad13f990b6bb4d697a8a982db0 (patch)
treed42e45eb19dbc02ec0404bb42d3232f53fdc5b00 /gst
parent867d51fb31527d169eb1126abb6ae579028946f3 (diff)
downloadgst-plugins-bad-166ee21b5b3348ad13f990b6bb4d697a8a982db0.tar.gz
gst-plugins-bad-166ee21b5b3348ad13f990b6bb4d697a8a982db0.tar.bz2
gst-plugins-bad-166ee21b5b3348ad13f990b6bb4d697a8a982db0.zip
frei0r: In the src plugins create the frei0r instances in create() before playback starts
Diffstat (limited to 'gst')
-rw-r--r--gst/frei0r/gstfrei0rsrc.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gst/frei0r/gstfrei0rsrc.c b/gst/frei0r/gstfrei0rsrc.c
index a713e1e9..8a4a4e2a 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 =