onvif-media: Error for streams that have EMPTY/ANY caps

Don't silently fail to put a stream in the SDP if the caps are
empty or ANY

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
This commit is contained in:
Jan Schmidt 2025-01-24 18:03:10 +11:00 committed by GStreamer Marge Bot
parent c83c7f9a92
commit 1a4b683225

View file

@ -111,6 +111,13 @@ gst_rtsp_onvif_media_setup_sdp (GstRTSPMedia * media, GstSDPMessage * sdp,
}
n_caps = gst_caps_get_size (caps);
if (n_caps == 0) {
GST_ERROR ("media caps for stream %p are %" GST_PTR_FORMAT, stream, caps);
res = FALSE;
gst_caps_unref (caps);
break;
}
for (j = 0; res && j < n_caps; j++) {
GstStructure *s = gst_caps_get_structure (caps, j);
GstCaps *media_caps = gst_caps_new_full (gst_structure_copy (s), NULL);