mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
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
This commit is contained in:
parent
94ffe88b65
commit
eea3bc22b7
1 changed files with 1 additions and 1 deletions
|
|
@ -376,7 +376,7 @@ handle_video_fields (ConvertData *d)
|
||||||
}
|
}
|
||||||
|
|
||||||
idx = gst_video_format_from_string (v);
|
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]);
|
spa_pod_builder_id (&d->b, video_format_map[idx]);
|
||||||
}
|
}
|
||||||
choice = spa_pod_builder_pop(&d->b, &f);
|
choice = spa_pod_builder_pop(&d->b, &f);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue