GstBufferPool *pool = NULL;
GstStructure *config;
GstCaps *caps;
+ GstVideoInfo info;
guint size = 0;
gboolean need_pool;
-
if (!GST_AGGREGATOR_CLASS (gst_gl_mixer_parent_class)->propose_allocation
(agg, agg_pad, decide_query, query))
return FALSE;
if (caps == NULL)
goto no_caps;
- if (need_pool) {
- GstVideoInfo info;
+ if (!gst_video_info_from_caps (&info, caps))
+ goto invalid_caps;
- if (!gst_video_info_from_caps (&info, caps))
- goto invalid_caps;
+ /* the normal size of a frame */
+ size = info.size;
+ if (need_pool) {
GST_DEBUG_OBJECT (mix, "create new pool");
pool = gst_gl_buffer_pool_new (context);
- /* the normal size of a frame */
- size = info.size;
-
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
g_object_unref (pool);
goto config_failed;
}
+ }
- gst_query_add_allocation_pool (query, pool, size, 1, 0);
+ gst_query_add_allocation_pool (query, pool, size, 1, 0);
+ if (pool)
g_object_unref (pool);
- }
/* we also support various metadata */
if (context->gl_vtable->FenceSync)