From 97825e9b17cf564594b2717483817b6cf06f8f83 Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Thu, 27 Jul 2023 17:08:07 +0900 Subject: [PATCH] webrtcstats: Fix duplicated set of codec-id, kind in inbound-rtp Change-Id: I8b4c595058793896f16ea1a2353a7be56339cc13 Signed-off-by: Sangchul Lee --- subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c index 0b27620..2c66444 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcstats.c @@ -884,6 +884,9 @@ struct transport_stream_stats guint clock_rate; GValueArray *source_stats; GstStructure *s; +#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION + guint mline; +#endif }; static gboolean @@ -906,9 +909,19 @@ webrtc_stats_get_from_transport (SsrcMapItem * entry, /* skip foreign sources */ if (gst_structure_get_uint (stats, "ssrc", &stats_ssrc) && entry->ssrc == stats_ssrc) +#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION + { + if (g_strrstr (ts_stats->codec_id, "src") && + entry->media_idx != ts_stats->mline) + continue; + /* FIXME: add condition to make 'kind' value valid in outbound-rtp */ +#endif _get_stats_from_rtp_source_stats (ts_stats->webrtc, ts_stats->stream, stats, ts_stats->codec_id, ts_stats->kind, ts_stats->transport_id, ts_stats->s); +#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION + } +#endif else if (gst_structure_get_uint (stats, "rb-ssrc", &stats_ssrc) && entry->ssrc == stats_ssrc) _get_stats_from_remote_rtp_source_stats (ts_stats->webrtc, @@ -961,6 +974,9 @@ _get_stats_from_pad (GstWebRTCBin * webrtc, GstPad * pad, GstStructure * s) if (!ts_stats.stream->transport) goto out; +#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION + ts_stats.mline = wpad->trans->mline; +#endif g_signal_emit_by_name (webrtc->rtpbin, "get-internal-session", ts_stats.stream->session_id, &rtp_session); g_object_get (rtp_session, "stats", &rtp_stats, NULL); -- 2.7.4