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
3 // found in the LICENSE file.
5 #include "media/cast/logging/logging_defines.h"
7 #include "base/logging.h"
9 #define ENUM_TO_STRING(enum) \
16 CastLoggingConfig::CastLoggingConfig()
17 : enable_raw_data_collection(false),
18 enable_stats_data_collection(false),
19 enable_tracing(false) {}
21 CastLoggingConfig::~CastLoggingConfig() {}
23 CastLoggingConfig
GetDefaultCastSenderLoggingConfig() {
24 return CastLoggingConfig();
27 CastLoggingConfig
GetDefaultCastReceiverLoggingConfig() {
28 return CastLoggingConfig();
31 CastLoggingConfig
GetLoggingConfigWithRawEventsAndStatsEnabled() {
32 CastLoggingConfig config
;
33 config
.enable_raw_data_collection
= true;
34 config
.enable_stats_data_collection
= true;
38 std::string
CastLoggingToString(CastLoggingEvent event
) {
40 // Can happen if the sender and receiver of RTCP log messages are not
42 ENUM_TO_STRING(Unknown
);
43 ENUM_TO_STRING(RttMs
);
44 ENUM_TO_STRING(PacketLoss
);
45 ENUM_TO_STRING(JitterMs
);
46 ENUM_TO_STRING(VideoAckReceived
);
47 ENUM_TO_STRING(RembBitrate
);
48 ENUM_TO_STRING(AudioAckSent
);
49 ENUM_TO_STRING(VideoAckSent
);
50 ENUM_TO_STRING(AudioFrameReceived
);
51 ENUM_TO_STRING(AudioFrameCaptured
);
52 ENUM_TO_STRING(AudioFrameEncoded
);
53 ENUM_TO_STRING(AudioPlayoutDelay
);
54 ENUM_TO_STRING(AudioFrameDecoded
);
55 ENUM_TO_STRING(VideoFrameCaptured
);
56 ENUM_TO_STRING(VideoFrameReceived
);
57 ENUM_TO_STRING(VideoFrameSentToEncoder
);
58 ENUM_TO_STRING(VideoFrameEncoded
);
59 ENUM_TO_STRING(VideoFrameDecoded
);
60 ENUM_TO_STRING(VideoRenderDelay
);
61 ENUM_TO_STRING(PacketSentToPacer
);
62 ENUM_TO_STRING(PacketSentToNetwork
);
63 ENUM_TO_STRING(PacketRetransmitted
);
64 ENUM_TO_STRING(AudioPacketReceived
);
65 ENUM_TO_STRING(VideoPacketReceived
);
66 ENUM_TO_STRING(DuplicatePacketReceived
);
67 case kNumOfLoggingEvents
:
75 FrameEvent::FrameEvent()
76 : rtp_timestamp(0u), frame_id(kFrameIdUnknown
), size(0u), type(kUnknown
) {}
77 FrameEvent::~FrameEvent() {}
79 PacketEvent::PacketEvent()
81 frame_id(kFrameIdUnknown
),
86 PacketEvent::~PacketEvent() {}
88 GenericEvent::GenericEvent() : type(kUnknown
), value(0) {}
89 GenericEvent::~GenericEvent() {}
91 FrameLogStats::FrameLogStats()
94 FrameLogStats::~FrameLogStats() {}
96 PacketLogStats::PacketLogStats()
99 PacketLogStats::~PacketLogStats() {}
101 GenericLogStats::GenericLogStats()
107 GenericLogStats::~GenericLogStats() {}