Skip to content

waylandsink: config buffer pool with query size when propose_allocation

Qi Hou requested to merge hq/gstreamer:waylandsink into main

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.

Here is an example pipeline.

root@imx95evk:~# export GST_DEBUG=2
root@imx95evk:~# gst-launch-1.0 videotestsrc num-buffers=1 ! video/x-raw,format=BGR ! videoconvert ! imagefreeze ! waylandsink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.129985797  3368 0xffffac000b70 WARN               videopool gstvideopool.c:226:video_buffer_pool_set_config:<wlvideobufferpool0> Provided size is to small for the caps: 0 < 307200
0:00:00.130158780  3368 0xffffac000b70 WARN               videopool gstvideopool.c:226:video_buffer_pool_set_config:<wlvideobufferpool0> Provided size is to small for the caps: 0 < 307200
0:00:00.130245396  3368 0xffffac000b70 WARN               videopool gstvideopool.c:226:video_buffer_pool_set_config:<wlvideobufferpool0> Provided size is to small for the caps: 0 < 307200
0:00:00.130289184  3368 0xffffac000b70 WARN               videopool gstvideopool.c:226:video_buffer_pool_set_config:<wlvideobufferpool0> Provided size is to small for the caps: 0 < 307200
0:00:00.130323764  3368 0xffffac000b70 WARN           basetransform gstbasetransform.c:908:gst_base_transform_default_decide_allocation:<videoconvert0> error: Failed to configure the buffer pool
0:00:00.130371967  3368 0xffffac000b70 WARN           basetransform gstbasetransform.c:908:gst_base_transform_default_decide_allocation:<videoconvert0> error: Configuration is most likely invalid, please report this issue.
ERROR: from element /GstPipeline:pipeline0/GstVideoConvert:videoconvert0: Failed to configure the buffer pool
Additional debug info:
/usr/src/debug/gstreamer1.0/1.24.0.imx/libs/gst/base/gstbasetransform.c(908): gst_base_transform_default_decide_allocation (): /GstPipeline:pipeline0/GstVideoConvert:videoconvert0:
Configuration is most likely invalid, please report this issue.
ERROR: pipeline doesn't want to preroll.
0:00:00.130740806  3368 0xffffac000b70 WARN           basetransform gstbasetransform.c:996:gst_base_transform_do_bufferpool:<videoconvert0> Subclass failed to decide allocation
Setting pipeline to NULL ...
0:00:00.135767650  3368 0xffffac000b70 WARN                GST_PADS gstpad.c:4392:gst_pad_peer_query:<capsfilter0:src> could not send sticky events
Freeing pipeline ...

Merge request reports