GstCaps *caps;
guint size;
gboolean need_pool;
+ GstStructure *allocation_meta = NULL;
if (!_ensure_gl_setup (glimage_sink))
return FALSE;
if (glimage_sink->context->gl_vtable->FenceSync)
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
+ if (glimage_sink->window_width != 0 && glimage_sink->window_height != 0) {
+ allocation_meta =
+ gst_structure_new ("GstVideoOverlayCompositionMeta",
+ "width", G_TYPE_UINT, glimage_sink->window_width,
+ "height", G_TYPE_UINT, glimage_sink->window_height, NULL);
+ GST_DEBUG ("sending alloc query with size %dx%d",
+ glimage_sink->window_width, glimage_sink->window_height);
+ }
+
+ gst_query_add_allocation_meta (query,
+ GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE, allocation_meta);
+
return TRUE;
/* ERRORS */
_gst_gl_upload_element_propose_allocation (GstBaseTransform * bt,
GstQuery * decide_query, GstQuery * query)
{
+ guint alloc_index;
+ gboolean alloc_has_overlay_meta;
GstGLUploadElement *upload = GST_GL_UPLOAD_ELEMENT (bt);
if (!upload->upload)
return FALSE;
+ alloc_has_overlay_meta =
+ gst_query_find_allocation_meta (decide_query,
+ GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE, &alloc_index);
+
+ if (alloc_has_overlay_meta) {
+ const GstStructure *params;
+ GST_DEBUG ("adding allocation meta in upload for textoverlay");
+
+ /* read window size from decide_query */
+ gst_query_parse_nth_allocation_meta (decide_query, alloc_index, ¶ms);
+
+ if (params)
+ gst_query_add_allocation_meta (query,
+ GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE, params);
+
+ }
+
gst_gl_upload_propose_allocation (upload->upload, decide_query, query);
return TRUE;