pipewiresrc: Fix renegotiation

Some downstream elements trigger re-negotiations when the stream is
running, e.g. due to output window resizing for the below pipeline.

gst-launch-1.0 pipewiresrc ! videoconvert ! video/x-raw ! gtk4paintablesink

This fails due to a side effect introduced by commit 77143e54 with
handle_format_change() setting `is_video` to `false` when param was
NULL. Fix this by explicitly tracking media type and not just video
using a boolean.
This commit is contained in:
Barnabás Pőcze 2025-11-03 16:52:33 +05:30 committed by Wim Taymans
parent d3368ee0d5
commit fa8b0ba018
2 changed files with 9 additions and 6 deletions

View file

@ -15,6 +15,7 @@
#include <gst/video/video.h>
#include <pipewire/pipewire.h>
#include <spa/param/format.h>
#include <gst/gstpipewirepool.h>
#include <gst/gstpipewirecore.h>
@ -63,7 +64,7 @@ struct _GstPipeWireSrc {
GstCaps *caps;
GstCaps *possible_caps;
gboolean is_video;
enum spa_media_type media_type;
gboolean is_rawvideo;
GstVideoInfo video_info;
#ifdef HAVE_GSTREAMER_DMA_DRM