Apply the changes of the commits c80132e4a3fb1fda6d196effe0e6d12dfcc75f25 and 23261bccbba84abb1334ffc4dea0514f74a5f2af Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5032>
Apply the changes of the commits c80132e4a3fb1fda6d196effe0e6d12dfcc75f25 and 23261bccbba84abb1334ffc4dea0514f74a5f2af Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5032>