RTCInboundRTPStreamStats's [fir/pli/nack]_count are collected for video.
Previously this was only collected for RTCOutboundRTPStreamStats video, with no comment saying it was missing for Inbound. (nack_count should be collected vor audio as well but this is currently not available - there is already an existing comment about this in rtcstats_objects.h.) BUG=chromium:657855, chromium:657854, chromium:627816 Review-Url: https://codereview.webrtc.org/2515293002 Cr-Commit-Position: refs/heads/master@{#15185}
This commit is contained in:
parent
468da7c074
commit
820f578f2b
@ -107,6 +107,7 @@ void SetMediaStreamTrackStatsFromMediaStreamTrackInterface(
|
||||
track_stats->ended = (track.state() == MediaStreamTrackInterface::kEnded);
|
||||
}
|
||||
|
||||
// Provides the media independent counters (both audio and video).
|
||||
void SetInboundRTPStreamStatsFromMediaReceiverInfo(
|
||||
const cricket::MediaReceiverInfo& media_receiver_info,
|
||||
RTCInboundRTPStreamStats* inbound_stats) {
|
||||
@ -126,23 +127,32 @@ void SetInboundRTPStreamStatsFromMediaReceiverInfo(
|
||||
|
||||
void SetInboundRTPStreamStatsFromVoiceReceiverInfo(
|
||||
const cricket::VoiceReceiverInfo& voice_receiver_info,
|
||||
RTCInboundRTPStreamStats* inbound_stats) {
|
||||
RTCInboundRTPStreamStats* inbound_audio) {
|
||||
SetInboundRTPStreamStatsFromMediaReceiverInfo(
|
||||
voice_receiver_info, inbound_stats);
|
||||
inbound_stats->media_type = "audio";
|
||||
inbound_stats->jitter =
|
||||
voice_receiver_info, inbound_audio);
|
||||
inbound_audio->media_type = "audio";
|
||||
inbound_audio->jitter =
|
||||
static_cast<double>(voice_receiver_info.jitter_ms) /
|
||||
rtc::kNumMillisecsPerSec;
|
||||
// |fir_count|, |pli_count| and |sli_count| are only valid for video and are
|
||||
// purposefully left undefined for audio.
|
||||
}
|
||||
|
||||
void SetInboundRTPStreamStatsFromVideoReceiverInfo(
|
||||
const cricket::VideoReceiverInfo& video_receiver_info,
|
||||
RTCInboundRTPStreamStats* inbound_stats) {
|
||||
RTCInboundRTPStreamStats* inbound_video) {
|
||||
SetInboundRTPStreamStatsFromMediaReceiverInfo(
|
||||
video_receiver_info, inbound_stats);
|
||||
inbound_stats->media_type = "video";
|
||||
video_receiver_info, inbound_video);
|
||||
inbound_video->media_type = "video";
|
||||
inbound_video->fir_count =
|
||||
static_cast<uint32_t>(video_receiver_info.firs_sent);
|
||||
inbound_video->pli_count =
|
||||
static_cast<uint32_t>(video_receiver_info.plis_sent);
|
||||
inbound_video->nack_count =
|
||||
static_cast<uint32_t>(video_receiver_info.nacks_sent);
|
||||
}
|
||||
|
||||
// Provides the media independent counters (both audio and video).
|
||||
void SetOutboundRTPStreamStatsFromMediaSenderInfo(
|
||||
const cricket::MediaSenderInfo& media_sender_info,
|
||||
RTCOutboundRTPStreamStats* outbound_stats) {
|
||||
|
||||
@ -1383,6 +1383,9 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
|
||||
video_media_info.receivers[0].packets_rcvd = 2;
|
||||
video_media_info.receivers[0].bytes_rcvd = 3;
|
||||
video_media_info.receivers[0].fraction_lost = 4.5f;
|
||||
video_media_info.receivers[0].firs_sent = 5;
|
||||
video_media_info.receivers[0].plis_sent = 6;
|
||||
video_media_info.receivers[0].nacks_sent = 7;
|
||||
EXPECT_CALL(*video_media_channel, GetStats(_))
|
||||
.WillOnce(DoAll(SetArgPointee<0>(video_media_info), Return(true)));
|
||||
|
||||
@ -1404,23 +1407,26 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
|
||||
|
||||
rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport();
|
||||
|
||||
RTCInboundRTPStreamStats expected_audio(
|
||||
RTCInboundRTPStreamStats expected_video(
|
||||
"RTCInboundRTPVideoStream_1", report->timestamp_us());
|
||||
expected_audio.ssrc = "1";
|
||||
expected_audio.is_remote = false;
|
||||
expected_audio.media_type = "video";
|
||||
expected_audio.transport_id = "RTCTransport_TransportName_" +
|
||||
expected_video.ssrc = "1";
|
||||
expected_video.is_remote = false;
|
||||
expected_video.media_type = "video";
|
||||
expected_video.transport_id = "RTCTransport_TransportName_" +
|
||||
rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP);
|
||||
expected_audio.packets_received = 2;
|
||||
expected_audio.bytes_received = 3;
|
||||
expected_audio.fraction_lost = 4.5;
|
||||
expected_video.fir_count = 5;
|
||||
expected_video.pli_count = 6;
|
||||
expected_video.nack_count = 7;
|
||||
expected_video.packets_received = 2;
|
||||
expected_video.bytes_received = 3;
|
||||
expected_video.fraction_lost = 4.5;
|
||||
|
||||
ASSERT(report->Get(expected_audio.id()));
|
||||
const RTCInboundRTPStreamStats& audio = report->Get(
|
||||
expected_audio.id())->cast_to<RTCInboundRTPStreamStats>();
|
||||
EXPECT_EQ(audio, expected_audio);
|
||||
ASSERT(report->Get(expected_video.id()));
|
||||
const RTCInboundRTPStreamStats& video = report->Get(
|
||||
expected_video.id())->cast_to<RTCInboundRTPStreamStats>();
|
||||
EXPECT_EQ(video, expected_video);
|
||||
|
||||
EXPECT_TRUE(report->Get(*expected_audio.transport_id));
|
||||
EXPECT_TRUE(report->Get(*expected_video.transport_id));
|
||||
}
|
||||
|
||||
TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Audio) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user