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

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

Issue 1748403002: Move RtcEventLog object from inside VoiceEngine to Call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Another rebase and accompanying changes. Created 4 years, 5 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
« no previous file with comments | « webrtc/call/rtc_event_log.h ('k') | webrtc/media/base/mediaengine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 20 matching lines...) Expand all
31 // Files generated at build-time by the protobuf compiler. 31 // Files generated at build-time by the protobuf compiler.
32 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD 32 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
33 #include "external/webrtc/webrtc/call/rtc_event_log.pb.h" 33 #include "external/webrtc/webrtc/call/rtc_event_log.pb.h"
34 #else 34 #else
35 #include "webrtc/call/rtc_event_log.pb.h" 35 #include "webrtc/call/rtc_event_log.pb.h"
36 #endif 36 #endif
37 #endif 37 #endif
38 38
39 namespace webrtc { 39 namespace webrtc {
40 40
41 #ifndef ENABLE_RTC_EVENT_LOG 41 // No-op implementation is used if flag is not set, or in tests.
42
43 // No-op implementation if flag is not set.
44 class RtcEventLogNullImpl final : public RtcEventLog { 42 class RtcEventLogNullImpl final : public RtcEventLog {
45 public: 43 public:
46 bool StartLogging(const std::string& file_name, 44 bool StartLogging(const std::string& file_name,
47 int64_t max_size_bytes) override { 45 int64_t max_size_bytes) override {
48 return false; 46 return false;
49 } 47 }
50 bool StartLogging(rtc::PlatformFile platform_file, 48 bool StartLogging(rtc::PlatformFile platform_file,
51 int64_t max_size_bytes) override { 49 int64_t max_size_bytes) override {
52 // The platform_file is open and needs to be closed. 50 // The platform_file is open and needs to be closed.
53 if (!rtc::ClosePlatformFile(platform_file)) { 51 if (!rtc::ClosePlatformFile(platform_file)) {
(...skipping 13 matching lines...) Expand all
67 void LogRtcpPacket(PacketDirection direction, 65 void LogRtcpPacket(PacketDirection direction,
68 MediaType media_type, 66 MediaType media_type,
69 const uint8_t* packet, 67 const uint8_t* packet,
70 size_t length) override {} 68 size_t length) override {}
71 void LogAudioPlayout(uint32_t ssrc) override {} 69 void LogAudioPlayout(uint32_t ssrc) override {}
72 void LogBwePacketLossEvent(int32_t bitrate, 70 void LogBwePacketLossEvent(int32_t bitrate,
73 uint8_t fraction_loss, 71 uint8_t fraction_loss,
74 int32_t total_packets) override {} 72 int32_t total_packets) override {}
75 }; 73 };
76 74
77 #else // ENABLE_RTC_EVENT_LOG is defined 75 #ifdef ENABLE_RTC_EVENT_LOG
78 76
79 class RtcEventLogImpl final : public RtcEventLog { 77 class RtcEventLogImpl final : public RtcEventLog {
80 public: 78 public:
81 explicit RtcEventLogImpl(const Clock* clock); 79 explicit RtcEventLogImpl(const Clock* clock);
82 ~RtcEventLogImpl() override; 80 ~RtcEventLogImpl() override;
83 81
84 bool StartLogging(const std::string& file_name, 82 bool StartLogging(const std::string& file_name,
85 int64_t max_size_bytes) override; 83 int64_t max_size_bytes) override;
86 bool StartLogging(rtc::PlatformFile platform_file, 84 bool StartLogging(rtc::PlatformFile platform_file,
87 int64_t max_size_bytes) override; 85 int64_t max_size_bytes) override;
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 456
459 // RtcEventLog member functions. 457 // RtcEventLog member functions.
460 std::unique_ptr<RtcEventLog> RtcEventLog::Create(const Clock* clock) { 458 std::unique_ptr<RtcEventLog> RtcEventLog::Create(const Clock* clock) {
461 #ifdef ENABLE_RTC_EVENT_LOG 459 #ifdef ENABLE_RTC_EVENT_LOG
462 return std::unique_ptr<RtcEventLog>(new RtcEventLogImpl(clock)); 460 return std::unique_ptr<RtcEventLog>(new RtcEventLogImpl(clock));
463 #else 461 #else
464 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 462 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
465 #endif // ENABLE_RTC_EVENT_LOG 463 #endif // ENABLE_RTC_EVENT_LOG
466 } 464 }
467 465
466 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() {
467 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
468 }
469
468 } // namespace webrtc 470 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/rtc_event_log.h ('k') | webrtc/media/base/mediaengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698