meta-digi/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0079-waylandsink-config-buf...

40 lines
1.2 KiB
Diff

From ec3edddc3a734784ada9f6a98481c80195b90e75 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 17 Apr 2024 10:58:00 +0900
Subject: [PATCH 6/7] waylandsink: config buffer pool with query size when
propose_allocation
If propose_allocation comes before set_caps, self->video_info
has not been extracted from caps and self->video_info.size is 0.
It causes buffer pool fail to set config . So need to use info
size got from query instead when propose_allocation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6666>
Upstream-Status: Backport
---
ext/wayland/gstwaylandsink.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c
index 4e6a459..066f05e 100644
--- a/ext/wayland/gstwaylandsink.c
+++ b/ext/wayland/gstwaylandsink.c
@@ -764,6 +764,13 @@ gst_wayland_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
gst_query_parse_allocation (query, &caps, &need_pool);
+ if (caps == NULL)
+ return FALSE;
+
+ /* extract info from caps */
+ if (!gst_video_info_from_caps (&self->video_info, caps))
+ return FALSE;
+
if (need_pool) {
GstStructure *config;
pool = gst_wl_video_buffer_pool_new ();
--
2.25.1