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

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

Issue 2745473003: Resolve cyclic dependency between audio network adaptor and event log api (Closed)
Patch Set: Revert "Activated checks for rtc_event_log_api" 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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.h" 11 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
12 12
13 #include <limits> 13 #include <limits>
14 #include <vector> 14 #include <vector>
15 15
16 #include "webrtc/base/checks.h" 16 #include "webrtc/base/checks.h"
17 #include "webrtc/base/constructormagic.h" 17 #include "webrtc/base/constructormagic.h"
18 #include "webrtc/base/event.h" 18 #include "webrtc/base/event.h"
19 #include "webrtc/base/swap_queue.h" 19 #include "webrtc/base/swap_queue.h"
20 #include "webrtc/base/thread_checker.h" 20 #include "webrtc/base/thread_checker.h"
21 #include "webrtc/base/timeutils.h" 21 #include "webrtc/base/timeutils.h"
22 #include "webrtc/call/call.h" 22 #include "webrtc/call/call.h"
23 #include "webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.h" 23 #include "webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.h"
24 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ k_adaptor.h"
24 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
25 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 26 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h" 27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h"
27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h"
28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h"
29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h" 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h"
30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h"
32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h"
31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" 33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h"
32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h"
33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rtpfb.h" 34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rtpfb.h"
34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" 35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h"
35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" 36 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h"
36 #include "webrtc/system_wrappers/include/file_wrapper.h" 37 #include "webrtc/system_wrappers/include/file_wrapper.h"
37 #include "webrtc/system_wrappers/include/logging.h" 38 #include "webrtc/system_wrappers/include/logging.h"
38 39
39 #ifdef ENABLE_RTC_EVENT_LOG 40 #ifdef ENABLE_RTC_EVENT_LOG
40 // Files generated at build-time by the protobuf compiler. 41 // Files generated at build-time by the protobuf compiler.
41 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD 42 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
42 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h" 43 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 MediaType media_type, 79 MediaType media_type,
79 const uint8_t* packet, 80 const uint8_t* packet,
80 size_t length) override; 81 size_t length) override;
81 void LogAudioPlayout(uint32_t ssrc) override; 82 void LogAudioPlayout(uint32_t ssrc) override;
82 void LogLossBasedBweUpdate(int32_t bitrate_bps, 83 void LogLossBasedBweUpdate(int32_t bitrate_bps,
83 uint8_t fraction_loss, 84 uint8_t fraction_loss,
84 int32_t total_packets) override; 85 int32_t total_packets) override;
85 void LogDelayBasedBweUpdate(int32_t bitrate_bps, 86 void LogDelayBasedBweUpdate(int32_t bitrate_bps,
86 BandwidthUsage detector_state) override; 87 BandwidthUsage detector_state) override;
87 void LogAudioNetworkAdaptation( 88 void LogAudioNetworkAdaptation(
88 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) override; 89 const AudioEncoderRuntimeConfig& config) override;
89 void LogProbeClusterCreated(int id, 90 void LogProbeClusterCreated(int id,
90 int bitrate_bps, 91 int bitrate_bps,
91 int min_probes, 92 int min_probes,
92 int min_bytes) override; 93 int min_bytes) override;
93 void LogProbeResultSuccess(int id, int bitrate_bps) override; 94 void LogProbeResultSuccess(int id, int bitrate_bps) override;
94 void LogProbeResultFailure(int id, 95 void LogProbeResultFailure(int id,
95 ProbeFailureReason failure_reason) override; 96 ProbeFailureReason failure_reason) override;
96 97
97 private: 98 private:
98 void StoreEvent(std::unique_ptr<rtclog::Event>* event); 99 void StoreEvent(std::unique_ptr<rtclog::Event>* event);
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); 498 std::unique_ptr<rtclog::Event> event(new rtclog::Event());
498 event->set_timestamp_us(rtc::TimeMicros()); 499 event->set_timestamp_us(rtc::TimeMicros());
499 event->set_type(rtclog::Event::DELAY_BASED_BWE_UPDATE); 500 event->set_type(rtclog::Event::DELAY_BASED_BWE_UPDATE);
500 auto bwe_event = event->mutable_delay_based_bwe_update(); 501 auto bwe_event = event->mutable_delay_based_bwe_update();
501 bwe_event->set_bitrate_bps(bitrate_bps); 502 bwe_event->set_bitrate_bps(bitrate_bps);
502 bwe_event->set_detector_state(ConvertDetectorState(detector_state)); 503 bwe_event->set_detector_state(ConvertDetectorState(detector_state));
503 StoreEvent(&event); 504 StoreEvent(&event);
504 } 505 }
505 506
506 void RtcEventLogImpl::LogAudioNetworkAdaptation( 507 void RtcEventLogImpl::LogAudioNetworkAdaptation(
507 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) { 508 const AudioEncoderRuntimeConfig& config) {
508 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); 509 std::unique_ptr<rtclog::Event> event(new rtclog::Event());
509 event->set_timestamp_us(rtc::TimeMicros()); 510 event->set_timestamp_us(rtc::TimeMicros());
510 event->set_type(rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT); 511 event->set_type(rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT);
511 auto audio_network_adaptation = event->mutable_audio_network_adaptation(); 512 auto audio_network_adaptation = event->mutable_audio_network_adaptation();
512 if (config.bitrate_bps) 513 if (config.bitrate_bps)
513 audio_network_adaptation->set_bitrate_bps(*config.bitrate_bps); 514 audio_network_adaptation->set_bitrate_bps(*config.bitrate_bps);
514 if (config.frame_length_ms) 515 if (config.frame_length_ms)
515 audio_network_adaptation->set_frame_length_ms(*config.frame_length_ms); 516 audio_network_adaptation->set_frame_length_ms(*config.frame_length_ms);
516 if (config.uplink_packet_loss_fraction) { 517 if (config.uplink_packet_loss_fraction) {
517 audio_network_adaptation->set_uplink_packet_loss_fraction( 518 audio_network_adaptation->set_uplink_packet_loss_fraction(
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 #else 610 #else
610 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 611 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
611 #endif // ENABLE_RTC_EVENT_LOG 612 #endif // ENABLE_RTC_EVENT_LOG
612 } 613 }
613 614
614 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { 615 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() {
615 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 616 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
616 } 617 }
617 618
618 } // namespace webrtc 619 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log.h ('k') | webrtc/logging/rtc_event_log/rtc_event_log_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698