stats: fix remote-outbound-rtp id for video
which was using the audio type to generate the id. Safe change
since the id is supposed to be random.
BUG=webrtc:12529
Change-Id: I9909c6d320f6f9239f0466599eba1f0eacf00adf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347683
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42142}
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index 06dc922..b7126ce 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -517,7 +517,7 @@
CreateRemoteOutboundMediaStreamStats(
const cricket::MediaReceiverInfo& media_receiver_info,
const std::string& mid,
- const std::string& kind,
+ cricket::MediaType media_type,
const RTCInboundRtpStreamStats& inbound_audio_stats,
const std::string& transport_id) {
if (!media_receiver_info.last_sender_report_timestamp_ms.has_value()) {
@@ -531,13 +531,13 @@
// Create.
auto stats = std::make_unique<RTCRemoteOutboundRtpStreamStats>(
/*id=*/RTCRemoteOutboundRTPStreamStatsIDFromSSRC(
- cricket::MEDIA_TYPE_AUDIO, media_receiver_info.ssrc()),
+ media_type, media_receiver_info.ssrc()),
Timestamp::Millis(*media_receiver_info.last_sender_report_timestamp_ms));
// Populate.
// - RTCRtpStreamStats.
stats->ssrc = media_receiver_info.ssrc();
- stats->kind = kind;
+ stats->kind = cricket::MediaTypeToString(media_type);
stats->transport_id = transport_id;
if (inbound_audio_stats.codec_id.has_value()) {
stats->codec_id = *inbound_audio_stats.codec_id;
@@ -1711,7 +1711,8 @@
}
// Remote-outbound.
auto remote_outbound_audio = CreateRemoteOutboundMediaStreamStats(
- voice_receiver_info, mid, "audio", *inbound_audio_ptr, transport_id);
+ voice_receiver_info, mid, cricket::MEDIA_TYPE_AUDIO, *inbound_audio_ptr,
+ transport_id);
// Add stats.
if (remote_outbound_audio) {
// When the remote outbound stats are available, the remote ID for the
@@ -1804,7 +1805,8 @@
}
// Remote-outbound.
auto remote_outbound_video = CreateRemoteOutboundMediaStreamStats(
- video_receiver_info, mid, "video", *inbound_video_ptr, transport_id);
+ video_receiver_info, mid, cricket::MEDIA_TYPE_VIDEO, *inbound_video_ptr,
+ transport_id);
// Add stats.
if (remote_outbound_video) {
// When the remote outbound stats are available, the remote ID for the