webrtcstats: Use our own caps instead of the sticky event

The sticky event seems to get cleared sometimes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1448>
This commit is contained in:
Olivier Crête 2021-12-14 11:28:42 -05:00
parent 29befed685
commit 4e32d6bf3e

View file

@ -763,8 +763,9 @@ static void
_get_codec_stats_from_pad (GstWebRTCBin * webrtc, GstPad * pad,
GstStructure * s, gchar ** out_id, guint * out_ssrc, guint * out_clock_rate)
{
GstWebRTCBinPad *wpad = GST_WEBRTC_BIN_PAD (pad);
GstStructure *stats;
GstCaps *caps;
GstCaps *caps = NULL;
gchar *id;
double ts;
guint ssrc = 0;
@ -776,7 +777,8 @@ _get_codec_stats_from_pad (GstWebRTCBin * webrtc, GstPad * pad,
id = g_strdup_printf ("codec-stats-%s", GST_OBJECT_NAME (pad));
_set_base_stats (stats, GST_WEBRTC_STATS_CODEC, ts, id);
caps = gst_pad_get_current_caps (pad);
if (wpad->received_caps)
caps = gst_caps_ref (wpad->received_caps);
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);