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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3900>
This commit is contained in:
Jan Schmidt 2023-02-01 10:44:26 +11:00
parent acb8f2ee5d
commit 615a019457

View file

@ -792,6 +792,9 @@ _get_codec_stats_from_pad (GstWebRTCBin * webrtc, GstPad * pad,
if (wpad->received_caps) if (wpad->received_caps)
caps = gst_caps_ref (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); GST_DEBUG_OBJECT (pad, "Pad caps are: %" GST_PTR_FORMAT, caps);
if (caps && gst_caps_is_fixed (caps)) { if (caps && gst_caps_is_fixed (caps)) {
GstStructure *caps_s = gst_caps_get_structure (caps, 0); GstStructure *caps_s = gst_caps_get_structure (caps, 0);