From eea3bc22b7c0b9cc032f02d2ea7a179267f98698 Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Fri, 23 Aug 2019 10:50:54 +0200 Subject: [PATCH] gst: do not send UNKNOWN format If the video format cannot be detected, GStreamer will return the UNKNOWN format, which is translated into the Id 0 in the Spa:Interface:TypeMap, which is added to the pod. When the pipewire server receives the pod and tries to unmarshal the pod, it will detect the Id 0. Unable to distinguish Id 0 from a missing id, the server discards the message as invalid and closes the connection. Use the following gstreamer pipeline to reproduce (note the wrong nv12 instead of a correct NV12 format): gst-launch-1.0 pipewiresrc ! video/x-raw,format=nv12 ! fakesink --- src/gst/gstpipewireformat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gst/gstpipewireformat.c b/src/gst/gstpipewireformat.c index f546158fe..9e54d41b7 100644 --- a/src/gst/gstpipewireformat.c +++ b/src/gst/gstpipewireformat.c @@ -376,7 +376,7 @@ handle_video_fields (ConvertData *d) } idx = gst_video_format_from_string (v); - if (idx < (int)SPA_N_ELEMENTS (video_format_map)) + if (idx != GST_VIDEO_FORMAT_UNKNOWN && idx < (int)SPA_N_ELEMENTS (video_format_map)) spa_pod_builder_id (&d->b, video_format_map[idx]); } choice = spa_pod_builder_pop(&d->b, &f);