OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/cast/logging/logging_defines.h" | 5 #include "media/cast/logging/logging_defines.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 #define ENUM_TO_STRING(enum) \ | 9 #define ENUM_TO_STRING(enum) \ |
10 case k##enum: \ | 10 case k##enum: \ |
11 return #enum | 11 return #enum |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 namespace cast { | 14 namespace cast { |
15 | 15 |
16 CastLoggingConfig::CastLoggingConfig() | |
17 : enable_raw_data_collection(false), | |
18 enable_stats_data_collection(false) {} | |
19 | |
20 CastLoggingConfig::~CastLoggingConfig() {} | |
21 | |
22 CastLoggingConfig GetDefaultCastSenderLoggingConfig() { | |
23 return CastLoggingConfig(); | |
24 } | |
25 | |
26 CastLoggingConfig GetDefaultCastReceiverLoggingConfig() { | |
27 return CastLoggingConfig(); | |
28 } | |
29 | |
30 CastLoggingConfig GetLoggingConfigWithRawEventsAndStatsEnabled() { | |
31 CastLoggingConfig config; | |
32 config.enable_raw_data_collection = true; | |
33 config.enable_stats_data_collection = true; | |
34 return config; | |
35 } | |
36 | |
37 const char* CastLoggingToString(CastLoggingEvent event) { | 16 const char* CastLoggingToString(CastLoggingEvent event) { |
38 switch (event) { | 17 switch (event) { |
39 // Can happen if the sender and receiver of RTCP log messages are not | 18 // Can happen if the sender and receiver of RTCP log messages are not |
40 // aligned. | 19 // aligned. |
41 ENUM_TO_STRING(Unknown); | 20 ENUM_TO_STRING(Unknown); |
42 ENUM_TO_STRING(RttMs); | 21 ENUM_TO_STRING(RttMs); |
43 ENUM_TO_STRING(PacketLoss); | 22 ENUM_TO_STRING(PacketLoss); |
44 ENUM_TO_STRING(JitterMs); | 23 ENUM_TO_STRING(JitterMs); |
45 ENUM_TO_STRING(VideoAckReceived); | 24 ENUM_TO_STRING(VideoAckReceived); |
46 ENUM_TO_STRING(RembBitrate); | 25 ENUM_TO_STRING(RembBitrate); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 118 |
140 GenericLogStats::GenericLogStats() | 119 GenericLogStats::GenericLogStats() |
141 : event_counter(0), | 120 : event_counter(0), |
142 sum(0), | 121 sum(0), |
143 sum_squared(0), | 122 sum_squared(0), |
144 min(0), | 123 min(0), |
145 max(0) {} | 124 max(0) {} |
146 GenericLogStats::~GenericLogStats() {} | 125 GenericLogStats::~GenericLogStats() {} |
147 } // namespace cast | 126 } // namespace cast |
148 } // namespace media | 127 } // namespace media |
OLD | NEW |