From 6200b5be84cfda9de16ddc5d93b0eb0c9cca842d Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 1 Feb 2023 10:44:26 +1100 Subject: [PATCH] webrtcbin: Report full codec-stats for source pads 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: --- subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c index 5ff2bd6..0491733 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c @@ -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); -- 2.7.4