diff --git a/ext/gl/gstglbasemixer.c b/ext/gl/gstglbasemixer.c index afa16a843c..516dd1f16f 100644 --- a/ext/gl/gstglbasemixer.c +++ b/ext/gl/gstglbasemixer.c @@ -455,15 +455,10 @@ static gboolean gst_gl_base_mixer_decide_allocation (GstAggregator * agg, GstQuery * query) { GstGLBaseMixer *mix = GST_GL_BASE_MIXER (agg); - GstGLBaseMixerClass *mix_class = GST_GL_BASE_MIXER_GET_CLASS (mix); if (!_get_gl_context (mix)) return FALSE; - if (mix_class->decide_allocation) - if (!mix_class->decide_allocation (mix, query)) - return FALSE; - return TRUE; } diff --git a/ext/gl/gstglbasemixer.h b/ext/gl/gstglbasemixer.h index 91bd8ef902..087b634d46 100644 --- a/ext/gl/gstglbasemixer.h +++ b/ext/gl/gstglbasemixer.h @@ -92,7 +92,6 @@ struct _GstGLBaseMixerClass GstGLAPI supported_gl_api; gboolean (*propose_allocation) (GstGLBaseMixer * mix, GstGLBaseMixerPad * pad, GstQuery * decide_query, GstQuery *query); - gboolean (*decide_allocation) (GstGLBaseMixer * mix, GstQuery * decide_query); gpointer _padding[GST_PADDING]; }; diff --git a/ext/gl/gstglmixer.c b/ext/gl/gstglmixer.c index f1aa0b1028..cdf76269b8 100644 --- a/ext/gl/gstglmixer.c +++ b/ext/gl/gstglmixer.c @@ -334,7 +334,7 @@ static void gst_gl_mixer_set_property (GObject * object, guint prop_id, static void gst_gl_mixer_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static gboolean gst_gl_mixer_decide_allocation (GstGLBaseMixer * mix, +static gboolean gst_gl_mixer_decide_allocation (GstAggregator * agg, GstQuery * query); static void gst_gl_mixer_finalize (GObject * object); @@ -367,12 +367,12 @@ gst_gl_mixer_class_init (GstGLMixerClass * klass) agg_class->stop = gst_gl_mixer_stop; agg_class->start = gst_gl_mixer_start; agg_class->negotiated_src_caps = _negotiated_caps; + agg_class->decide_allocation = gst_gl_mixer_decide_allocation; videoaggregator_class->aggregate_frames = gst_gl_mixer_aggregate_frames; videoaggregator_class->find_best_format = _find_best_format; mix_class->propose_allocation = gst_gl_mixer_propose_allocation; - mix_class->decide_allocation = gst_gl_mixer_decide_allocation; /* Register the pad class */ g_type_class_ref (GST_TYPE_GL_MIXER_PAD); @@ -475,17 +475,24 @@ _mixer_create_fbo (GstGLContext * context, GstGLMixer * mix) } static gboolean -gst_gl_mixer_decide_allocation (GstGLBaseMixer * base_mix, GstQuery * query) +gst_gl_mixer_decide_allocation (GstAggregator * agg, GstQuery * query) { + GstGLBaseMixer *base_mix = GST_GL_BASE_MIXER (agg); GstGLMixer *mix = GST_GL_MIXER (base_mix); GstGLMixerClass *mixer_class = GST_GL_MIXER_GET_CLASS (mix); - GstGLContext *context = base_mix->context; + GstGLContext *context; GstBufferPool *pool = NULL; GstStructure *config; GstCaps *caps; guint min, max, size; gboolean update_pool; + if (!GST_AGGREGATOR_CLASS (gst_gl_mixer_parent_class)->decide_allocation (agg, + query)) + return FALSE; + + context = base_mix->context; + g_mutex_lock (&mix->priv->gl_resource_lock); mix->priv->gl_resource_ready = FALSE; if (mix->fbo)