webrtcbin: Report full codec-stats for source pads
authorJan Schmidt <jan@centricular.com>
Tue, 31 Jan 2023 23:44:26 +0000 (10:44 +1100)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 19 Feb 2023 10:43:33 +0000 (10:43 +0000)
Use the current caps for webrtcbin srcpads, as received_caps
are only stored for sink pads based on incoming caps events.

Makes it so that webrtcbin stats reports contain fuller
codec information.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3994>

subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c

index 5ff2bd6..0491733 100644 (file)
@@ -792,6 +792,9 @@ _get_codec_stats_from_pad (GstWebRTCBin * webrtc, GstPad * pad,
 
   if (wpad->received_caps)
     caps = gst_caps_ref (wpad->received_caps);
+  else
+    caps = gst_pad_get_current_caps (pad);
+
   GST_DEBUG_OBJECT (pad, "Pad caps are: %" GST_PTR_FORMAT, caps);
   if (caps && gst_caps_is_fixed (caps)) {
     GstStructure *caps_s = gst_caps_get_structure (caps, 0);