glbasemixer: Remove own decide_allocation, use GstAggregator's
authorOlivier Crête <olivier.crete@collabora.com>
Sat, 20 May 2017 15:35:43 +0000 (17:35 +0200)
committerOlivier Crête <olivier.crete@collabora.com>
Sun, 21 May 2017 11:24:29 +0000 (13:24 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=746529

ext/gl/gstglbasemixer.c
ext/gl/gstglbasemixer.h
ext/gl/gstglmixer.c

index afa16a8..516dd1f 100644 (file)
@@ -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;
 }
 
index 91bd8ef..087b634 100644 (file)
@@ -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];
 };
index f1aa0b1..cdf7626 100644 (file)
@@ -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)