diff options
author | Olivier Crête <olivier.crete@collabora.com> | 2017-05-20 17:35:43 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2017-12-09 19:32:28 +0000 |
commit | 5bb22d8f123f3920056712510ab06b8009152bf3 (patch) | |
tree | 6f7249c3fd541decf40a051e94e8fe1d62abd589 /ext | |
parent | 7eaafa62a8e0f6e5bb79b51c4a0f0f2b75db5eaf (diff) |
glbasemixer: Remove own decide_allocation, use GstAggregator's
https://bugzilla.gnome.org/show_bug.cgi?id=746529
Diffstat (limited to 'ext')
-rw-r--r-- | ext/gl/gstglbasemixer.c | 5 | ||||
-rw-r--r-- | ext/gl/gstglbasemixer.h | 1 | ||||
-rw-r--r-- | ext/gl/gstglmixer.c | 15 |
3 files changed, 11 insertions, 10 deletions
diff --git a/ext/gl/gstglbasemixer.c b/ext/gl/gstglbasemixer.c index afa16a843..516dd1f16 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 91bd8ef90..087b634d4 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 f1aa0b102..cdf76269b 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) |