Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: webrtc/logging/rtc_event_log/rtc_event_log_parser.cc

Issue 2808833002: Delay based logging. (Closed)
Patch Set: Unittest fix. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 RTC_CHECK(loss_event.has_fraction_loss()); 483 RTC_CHECK(loss_event.has_fraction_loss());
484 if (fraction_loss != nullptr) { 484 if (fraction_loss != nullptr) {
485 *fraction_loss = loss_event.fraction_loss(); 485 *fraction_loss = loss_event.fraction_loss();
486 } 486 }
487 RTC_CHECK(loss_event.has_total_packets()); 487 RTC_CHECK(loss_event.has_total_packets());
488 if (total_packets != nullptr) { 488 if (total_packets != nullptr) {
489 *total_packets = loss_event.total_packets(); 489 *total_packets = loss_event.total_packets();
490 } 490 }
491 } 491 }
492 492
493 void ParsedRtcEventLog::GetDelayBasedBweUpdate( 493 ParsedRtcEventLog::BweDelayBasedUpdate
494 size_t index, 494 ParsedRtcEventLog::GetDelayBasedBweUpdate(size_t index) const {
495 int32_t* bitrate_bps,
496 BandwidthUsage* detector_state) const {
497 RTC_CHECK_LT(index, GetNumberOfEvents()); 495 RTC_CHECK_LT(index, GetNumberOfEvents());
498 const rtclog::Event& event = events_[index]; 496 const rtclog::Event& event = events_[index];
499 RTC_CHECK(event.has_type()); 497 RTC_CHECK(event.has_type());
500 RTC_CHECK_EQ(event.type(), rtclog::Event::DELAY_BASED_BWE_UPDATE); 498 RTC_CHECK_EQ(event.type(), rtclog::Event::DELAY_BASED_BWE_UPDATE);
501 RTC_CHECK(event.has_delay_based_bwe_update()); 499 RTC_CHECK(event.has_delay_based_bwe_update());
502 const rtclog::DelayBasedBweUpdate& delay_event = 500 const rtclog::DelayBasedBweUpdate& delay_event =
503 event.delay_based_bwe_update(); 501 event.delay_based_bwe_update();
502
503 BweDelayBasedUpdate res;
504 res.timestamp = GetTimestamp(index);
504 RTC_CHECK(delay_event.has_bitrate_bps()); 505 RTC_CHECK(delay_event.has_bitrate_bps());
505 if (bitrate_bps != nullptr) { 506 res.bitrate_bps = delay_event.bitrate_bps();
506 *bitrate_bps = delay_event.bitrate_bps();
507 }
508 RTC_CHECK(delay_event.has_detector_state()); 507 RTC_CHECK(delay_event.has_detector_state());
509 if (detector_state != nullptr) { 508 res.detector_state = GetRuntimeDetectorState(delay_event.detector_state());
510 *detector_state = GetRuntimeDetectorState(delay_event.detector_state()); 509 return res;
511 }
512 } 510 }
513 511
514 void ParsedRtcEventLog::GetAudioNetworkAdaptation( 512 void ParsedRtcEventLog::GetAudioNetworkAdaptation(
515 size_t index, 513 size_t index,
516 AudioEncoderRuntimeConfig* config) const { 514 AudioEncoderRuntimeConfig* config) const {
517 RTC_CHECK_LT(index, GetNumberOfEvents()); 515 RTC_CHECK_LT(index, GetNumberOfEvents());
518 const rtclog::Event& event = events_[index]; 516 const rtclog::Event& event = events_[index];
519 RTC_CHECK(event.has_type()); 517 RTC_CHECK(event.has_type());
520 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT); 518 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT);
521 RTC_CHECK(event.has_audio_network_adaptation()); 519 RTC_CHECK(event.has_audio_network_adaptation());
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 rtc::Optional<ProbeFailureReason>(kInvalidSendReceiveRatio); 582 rtc::Optional<ProbeFailureReason>(kInvalidSendReceiveRatio);
585 } else if (pr_event.result() == rtclog::BweProbeResult::TIMEOUT) { 583 } else if (pr_event.result() == rtclog::BweProbeResult::TIMEOUT) {
586 res.failure_reason = rtc::Optional<ProbeFailureReason>(kTimeout); 584 res.failure_reason = rtc::Optional<ProbeFailureReason>(kTimeout);
587 } else { 585 } else {
588 RTC_NOTREACHED(); 586 RTC_NOTREACHED();
589 } 587 }
590 588
591 return res; 589 return res;
592 } 590 }
593 } // namespace webrtc 591 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log_parser.h ('k') | webrtc/logging/rtc_event_log/rtc_event_log_unittest_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698