Populate jitter stats for video RTP streams
Trying to take my first stab at contributing to WebRTC and I chose to populate jitter stats for video RTP streams. Please yell at me if this isn't something I'm not supposed to pick up. Appreciate a review, thanks! Bug: webrtc:12487 Change-Id: Ifda985e9e20b1d87e4a7268f34ef2e45b1cbefa3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208360 Commit-Queue: Henrik Boström <hbos@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33325}
This commit is contained in:
parent
373bb7bec4
commit
8af6b4928a
1
AUTHORS
1
AUTHORS
@ -36,6 +36,7 @@ David Porter <david@porter.me>
|
||||
Dax Booysen <dax@younow.com>
|
||||
Dennis Angelo <dennis.angelo@gmail.com>
|
||||
Dharmesh Chauhan <dharmesh.r.chauhan@gmail.com>
|
||||
Di Wu <meetwudi@gmail.com>
|
||||
Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
Dmitry Lizin <sdkdimon@gmail.com>
|
||||
Eike Rathke <erathke@redhat.com>
|
||||
|
||||
@ -417,8 +417,6 @@ class RTC_EXPORT RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
|
||||
RTCStatsMember<uint64_t> header_bytes_received;
|
||||
RTCStatsMember<int32_t> packets_lost; // Signed per RFC 3550
|
||||
RTCStatsMember<double> last_packet_received_timestamp;
|
||||
// TODO(hbos): Collect and populate this value for both "audio" and "video",
|
||||
// currently not collected for "video". https://bugs.webrtc.org/7065
|
||||
RTCStatsMember<double> jitter;
|
||||
RTCStatsMember<double> jitter_buffer_delay;
|
||||
RTCStatsMember<uint64_t> jitter_buffer_emitted_count;
|
||||
|
||||
@ -616,6 +616,7 @@ struct VideoReceiverInfo : public MediaReceiverInfo {
|
||||
uint32_t total_pauses_duration_ms = 0;
|
||||
uint32_t total_frames_duration_ms = 0;
|
||||
double sum_squared_frame_durations = 0.0;
|
||||
uint32_t jitter_ms = 0;
|
||||
|
||||
webrtc::VideoContentType content_type = webrtc::VideoContentType::UNSPECIFIED;
|
||||
|
||||
|
||||
@ -3057,6 +3057,7 @@ WebRtcVideoChannel::WebRtcVideoReceiveStream::GetVideoReceiverInfo(
|
||||
stats.rtp_stats.packet_counter.padding_bytes;
|
||||
info.packets_rcvd = stats.rtp_stats.packet_counter.packets;
|
||||
info.packets_lost = stats.rtp_stats.packets_lost;
|
||||
info.jitter_ms = stats.rtp_stats.jitter;
|
||||
|
||||
info.framerate_rcvd = stats.network_frame_rate;
|
||||
info.framerate_decoded = stats.decode_frame_rate;
|
||||
|
||||
@ -374,6 +374,8 @@ void SetInboundRTPStreamStatsFromVideoReceiverInfo(
|
||||
inbound_video->codec_id = RTCCodecStatsIDFromMidDirectionAndPayload(
|
||||
mid, true, *video_receiver_info.codec_payload_type);
|
||||
}
|
||||
inbound_video->jitter = static_cast<double>(video_receiver_info.jitter_ms) /
|
||||
rtc::kNumMillisecsPerSec;
|
||||
inbound_video->fir_count =
|
||||
static_cast<uint32_t>(video_receiver_info.firs_sent);
|
||||
inbound_video->pli_count =
|
||||
|
||||
@ -1895,6 +1895,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
|
||||
video_media_info.receivers[0].total_decode_time_ms = 9000;
|
||||
video_media_info.receivers[0].total_inter_frame_delay = 0.123;
|
||||
video_media_info.receivers[0].total_squared_inter_frame_delay = 0.00456;
|
||||
video_media_info.receivers[0].jitter_ms = 1199;
|
||||
|
||||
video_media_info.receivers[0].last_packet_received_timestamp_ms =
|
||||
absl::nullopt;
|
||||
@ -1942,6 +1943,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
|
||||
expected_video.total_decode_time = 9.0;
|
||||
expected_video.total_inter_frame_delay = 0.123;
|
||||
expected_video.total_squared_inter_frame_delay = 0.00456;
|
||||
expected_video.jitter = 1.199;
|
||||
// |expected_video.last_packet_received_timestamp| should be undefined.
|
||||
// |expected_video.content_type| should be undefined.
|
||||
// |expected_video.decoder_implementation| should be undefined.
|
||||
|
||||
@ -836,7 +836,7 @@ class RTCStatsReportVerifier {
|
||||
verifier.TestMemberIsUndefined(inbound_stream.frame_bit_depth);
|
||||
if (inbound_stream.media_type.is_defined() &&
|
||||
*inbound_stream.media_type == "video") {
|
||||
verifier.TestMemberIsUndefined(inbound_stream.jitter);
|
||||
verifier.TestMemberIsNonNegative<double>(inbound_stream.jitter);
|
||||
verifier.TestMemberIsUndefined(inbound_stream.jitter_buffer_delay);
|
||||
verifier.TestMemberIsUndefined(
|
||||
inbound_stream.jitter_buffer_emitted_count);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user