OLD | NEW |
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 case rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT: | 67 case rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT: |
68 return ParsedRtcEventLog::EventType::AUDIO_RECEIVER_CONFIG_EVENT; | 68 return ParsedRtcEventLog::EventType::AUDIO_RECEIVER_CONFIG_EVENT; |
69 case rtclog::Event::AUDIO_SENDER_CONFIG_EVENT: | 69 case rtclog::Event::AUDIO_SENDER_CONFIG_EVENT: |
70 return ParsedRtcEventLog::EventType::AUDIO_SENDER_CONFIG_EVENT; | 70 return ParsedRtcEventLog::EventType::AUDIO_SENDER_CONFIG_EVENT; |
71 case rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT: | 71 case rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT: |
72 return ParsedRtcEventLog::EventType::AUDIO_NETWORK_ADAPTATION_EVENT; | 72 return ParsedRtcEventLog::EventType::AUDIO_NETWORK_ADAPTATION_EVENT; |
73 case rtclog::Event::BWE_PROBE_CLUSTER_CREATED_EVENT: | 73 case rtclog::Event::BWE_PROBE_CLUSTER_CREATED_EVENT: |
74 return ParsedRtcEventLog::EventType::BWE_PROBE_CLUSTER_CREATED_EVENT; | 74 return ParsedRtcEventLog::EventType::BWE_PROBE_CLUSTER_CREATED_EVENT; |
75 case rtclog::Event::BWE_PROBE_RESULT_EVENT: | 75 case rtclog::Event::BWE_PROBE_RESULT_EVENT: |
76 return ParsedRtcEventLog::EventType::BWE_PROBE_RESULT_EVENT; | 76 return ParsedRtcEventLog::EventType::BWE_PROBE_RESULT_EVENT; |
| 77 case rtclog::Event::BWE_ACKED_BITRATE_EVENT: |
| 78 return ParsedRtcEventLog::EventType::BWE_ACKED_BITRATE_EVENT; |
| 79 case rtclog::Event::ALR_STATE_EVENT: |
| 80 return ParsedRtcEventLog::EventType::ALR_STATE_EVENT; |
| 81 case rtclog::Event::PACKET_QUEUE_TIME: |
| 82 return ParsedRtcEventLog::EventType::PACKET_QUEUE_TIME; |
77 } | 83 } |
78 RTC_NOTREACHED(); | 84 RTC_NOTREACHED(); |
79 return ParsedRtcEventLog::EventType::UNKNOWN_EVENT; | 85 return ParsedRtcEventLog::EventType::UNKNOWN_EVENT; |
80 } | 86 } |
81 | 87 |
82 BandwidthUsage GetRuntimeDetectorState( | 88 BandwidthUsage GetRuntimeDetectorState( |
83 rtclog::DelayBasedBweUpdate::DetectorState detector_state) { | 89 rtclog::DelayBasedBweUpdate::DetectorState detector_state) { |
84 switch (detector_state) { | 90 switch (detector_state) { |
85 case rtclog::DelayBasedBweUpdate::BWE_NORMAL: | 91 case rtclog::DelayBasedBweUpdate::BWE_NORMAL: |
86 return BandwidthUsage::kBwNormal; | 92 return BandwidthUsage::kBwNormal; |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 rtc::Optional<ProbeFailureReason>(kInvalidSendReceiveRatio); | 642 rtc::Optional<ProbeFailureReason>(kInvalidSendReceiveRatio); |
637 } else if (pr_event.result() == rtclog::BweProbeResult::TIMEOUT) { | 643 } else if (pr_event.result() == rtclog::BweProbeResult::TIMEOUT) { |
638 res.failure_reason = rtc::Optional<ProbeFailureReason>(kTimeout); | 644 res.failure_reason = rtc::Optional<ProbeFailureReason>(kTimeout); |
639 } else { | 645 } else { |
640 RTC_NOTREACHED(); | 646 RTC_NOTREACHED(); |
641 } | 647 } |
642 | 648 |
643 return res; | 649 return res; |
644 } | 650 } |
645 | 651 |
| 652 ParsedRtcEventLog::BweAckedBitrateEvent ParsedRtcEventLog::GetAckedBitrate( |
| 653 size_t index) const { |
| 654 RTC_CHECK_LT(index, GetNumberOfEvents()); |
| 655 const rtclog::Event& event = events_[index]; |
| 656 RTC_CHECK(event.has_type()); |
| 657 RTC_CHECK_EQ(event.type(), rtclog::Event::BWE_ACKED_BITRATE_EVENT); |
| 658 RTC_CHECK(event.has_acked_bitrate()); |
| 659 const rtclog::BweAckedBitrate& ab_event = event.acked_bitrate(); |
| 660 BweAckedBitrateEvent res; |
| 661 res.timestamp = GetTimestamp(index); |
| 662 RTC_CHECK(ab_event.has_bitrate_bps()); |
| 663 res.bitrate_bps = ab_event.bitrate_bps(); |
| 664 |
| 665 return res; |
| 666 } |
| 667 |
| 668 ParsedRtcEventLog::AlrStateEvent ParsedRtcEventLog::GetAlrState( |
| 669 size_t index) const { |
| 670 RTC_CHECK_LT(index, GetNumberOfEvents()); |
| 671 const rtclog::Event& event = events_[index]; |
| 672 RTC_CHECK(event.has_type()); |
| 673 RTC_CHECK_EQ(event.type(), rtclog::Event::ALR_STATE_EVENT); |
| 674 RTC_CHECK(event.has_alr_state()); |
| 675 const rtclog::AlrState& alr_event = event.alr_state(); |
| 676 AlrStateEvent res; |
| 677 res.timestamp = GetTimestamp(index); |
| 678 RTC_CHECK(alr_event.has_in_alr()); |
| 679 res.in_alr = alr_event.in_alr(); |
| 680 RTC_CHECK(alr_event.has_usage_bps()); |
| 681 res.usage_bps = alr_event.usage_bps(); |
| 682 |
| 683 return res; |
| 684 } |
| 685 |
| 686 ParsedRtcEventLog::PacketQueueTime ParsedRtcEventLog::GetQueueTime( |
| 687 size_t index) const { |
| 688 RTC_CHECK_LT(index, GetNumberOfEvents()); |
| 689 const rtclog::Event& event = events_[index]; |
| 690 RTC_CHECK(event.has_type()); |
| 691 RTC_CHECK_EQ(event.type(), rtclog::Event::PACKET_QUEUE_TIME); |
| 692 RTC_CHECK(event.has_packet_queue_time()); |
| 693 const rtclog::PacketQueueTime& queue_event = event.packet_queue_time(); |
| 694 PacketQueueTime res; |
| 695 res.timestamp = GetTimestamp(index); |
| 696 RTC_CHECK(queue_event.has_queue_time_ms()); |
| 697 res.queue_time_ms = queue_event.queue_time_ms(); |
| 698 RTC_CHECK(queue_event.has_ssrc()); |
| 699 res.ssrc = queue_event.ssrc(); |
| 700 return res; |
| 701 } |
| 702 |
646 // Returns the MediaType for registered SSRCs. Search from the end to use last | 703 // Returns the MediaType for registered SSRCs. Search from the end to use last |
647 // registered types first. | 704 // registered types first. |
648 ParsedRtcEventLog::MediaType ParsedRtcEventLog::GetMediaType( | 705 ParsedRtcEventLog::MediaType ParsedRtcEventLog::GetMediaType( |
649 uint32_t ssrc, | 706 uint32_t ssrc, |
650 PacketDirection direction) const { | 707 PacketDirection direction) const { |
651 for (auto rit = streams_.rbegin(); rit != streams_.rend(); ++rit) { | 708 for (auto rit = streams_.rbegin(); rit != streams_.rend(); ++rit) { |
652 if (rit->ssrc == ssrc && rit->direction == direction) | 709 if (rit->ssrc == ssrc && rit->direction == direction) |
653 return rit->media_type; | 710 return rit->media_type; |
654 } | 711 } |
655 return MediaType::ANY; | 712 return MediaType::ANY; |
656 } | 713 } |
657 } // namespace webrtc | 714 } // namespace webrtc |
OLD | NEW |