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 |
11 #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h" | 11 #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h" |
12 | 12 |
13 #include <stdint.h> | 13 #include <stdint.h> |
14 #include <string.h> | 14 #include <string.h> |
15 | 15 |
16 #include <algorithm> | 16 #include <algorithm> |
17 #include <fstream> | 17 #include <fstream> |
18 #include <istream> | 18 #include <istream> |
19 #include <utility> | 19 #include <utility> |
20 | 20 |
21 #include "webrtc/base/checks.h" | 21 #include "webrtc/base/checks.h" |
22 #include "webrtc/base/logging.h" | 22 #include "webrtc/base/logging.h" |
23 #include "webrtc/call/call.h" | 23 #include "webrtc/call/call.h" |
24 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 24 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
| 25 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ
k_adaptor.h" |
25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
26 | 27 |
27 namespace webrtc { | 28 namespace webrtc { |
28 | 29 |
29 namespace { | 30 namespace { |
30 MediaType GetRuntimeMediaType(rtclog::MediaType media_type) { | 31 MediaType GetRuntimeMediaType(rtclog::MediaType media_type) { |
31 switch (media_type) { | 32 switch (media_type) { |
32 case rtclog::MediaType::ANY: | 33 case rtclog::MediaType::ANY: |
33 return MediaType::ANY; | 34 return MediaType::ANY; |
34 case rtclog::MediaType::AUDIO: | 35 case rtclog::MediaType::AUDIO: |
(...skipping 469 matching lines...) Loading... |
504 *bitrate_bps = delay_event.bitrate_bps(); | 505 *bitrate_bps = delay_event.bitrate_bps(); |
505 } | 506 } |
506 RTC_CHECK(delay_event.has_detector_state()); | 507 RTC_CHECK(delay_event.has_detector_state()); |
507 if (detector_state != nullptr) { | 508 if (detector_state != nullptr) { |
508 *detector_state = GetRuntimeDetectorState(delay_event.detector_state()); | 509 *detector_state = GetRuntimeDetectorState(delay_event.detector_state()); |
509 } | 510 } |
510 } | 511 } |
511 | 512 |
512 void ParsedRtcEventLog::GetAudioNetworkAdaptation( | 513 void ParsedRtcEventLog::GetAudioNetworkAdaptation( |
513 size_t index, | 514 size_t index, |
514 AudioNetworkAdaptor::EncoderRuntimeConfig* config) const { | 515 AudioEncoderRuntimeConfig* config) const { |
515 RTC_CHECK_LT(index, GetNumberOfEvents()); | 516 RTC_CHECK_LT(index, GetNumberOfEvents()); |
516 const rtclog::Event& event = events_[index]; | 517 const rtclog::Event& event = events_[index]; |
517 RTC_CHECK(event.has_type()); | 518 RTC_CHECK(event.has_type()); |
518 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT); | 519 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT); |
519 RTC_CHECK(event.has_audio_network_adaptation()); | 520 RTC_CHECK(event.has_audio_network_adaptation()); |
520 const rtclog::AudioNetworkAdaptation& ana_event = | 521 const rtclog::AudioNetworkAdaptation& ana_event = |
521 event.audio_network_adaptation(); | 522 event.audio_network_adaptation(); |
522 if (ana_event.has_bitrate_bps()) | 523 if (ana_event.has_bitrate_bps()) |
523 config->bitrate_bps = rtc::Optional<int>(ana_event.bitrate_bps()); | 524 config->bitrate_bps = rtc::Optional<int>(ana_event.bitrate_bps()); |
524 if (ana_event.has_enable_fec()) | 525 if (ana_event.has_enable_fec()) |
525 config->enable_fec = rtc::Optional<bool>(ana_event.enable_fec()); | 526 config->enable_fec = rtc::Optional<bool>(ana_event.enable_fec()); |
526 if (ana_event.has_enable_dtx()) | 527 if (ana_event.has_enable_dtx()) |
527 config->enable_dtx = rtc::Optional<bool>(ana_event.enable_dtx()); | 528 config->enable_dtx = rtc::Optional<bool>(ana_event.enable_dtx()); |
528 if (ana_event.has_frame_length_ms()) | 529 if (ana_event.has_frame_length_ms()) |
529 config->frame_length_ms = rtc::Optional<int>(ana_event.frame_length_ms()); | 530 config->frame_length_ms = rtc::Optional<int>(ana_event.frame_length_ms()); |
530 if (ana_event.has_num_channels()) | 531 if (ana_event.has_num_channels()) |
531 config->num_channels = rtc::Optional<size_t>(ana_event.num_channels()); | 532 config->num_channels = rtc::Optional<size_t>(ana_event.num_channels()); |
532 if (ana_event.has_uplink_packet_loss_fraction()) | 533 if (ana_event.has_uplink_packet_loss_fraction()) |
533 config->uplink_packet_loss_fraction = | 534 config->uplink_packet_loss_fraction = |
534 rtc::Optional<float>(ana_event.uplink_packet_loss_fraction()); | 535 rtc::Optional<float>(ana_event.uplink_packet_loss_fraction()); |
535 } | 536 } |
536 | 537 |
537 } // namespace webrtc | 538 } // namespace webrtc |
OLD | NEW |