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

Side by Side Diff: media/cast/logging/logging_defines.h

Issue 136903003: cast: Wire upp logging to be sent over RTCP between receiver and sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge TOT Created 6 years, 11 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 | « media/cast/audio_sender/audio_sender_unittest.cc ('k') | media/cast/logging/logging_defines.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_ 5 #ifndef MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_
6 #define MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_ 6 #define MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/memory/linked_ptr.h" 12 #include "base/memory/linked_ptr.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 14
15 namespace media { 15 namespace media {
16 namespace cast { 16 namespace cast {
17 17
18 static const uint32 kFrameIdUnknown = 0xFFFF; 18 static const uint32 kFrameIdUnknown = 0xFFFF;
19 19
20 struct CastLoggingConfig { 20 struct CastLoggingConfig {
21 CastLoggingConfig(); 21 CastLoggingConfig(bool sender);
22 ~CastLoggingConfig(); 22 ~CastLoggingConfig();
23 23
24 bool is_sender;
24 bool enable_raw_data_collection; 25 bool enable_raw_data_collection;
25 bool enable_stats_data_collection; 26 bool enable_stats_data_collection;
26 bool enable_uma_stats; 27 bool enable_uma_stats;
27 bool enable_tracing; 28 bool enable_tracing;
28 }; 29 };
29 30
30 // By default, enable raw and stats data collection. Disable tracing and UMA. 31 // By default, enable raw and stats data collection. Disable tracing and UMA.
31 CastLoggingConfig GetDefaultCastLoggingConfig(); 32 CastLoggingConfig GetDefaultCastSenderLoggingConfig();
33 CastLoggingConfig GetDefaultCastReceiverLoggingConfig();
32 34
33 enum CastLoggingEvent { 35 enum CastLoggingEvent {
34 // Generic events. 36 // Generic events.
35 kUnknown, 37 kUnknown,
36 kRttMs, 38 kRttMs,
37 kPacketLoss, 39 kPacketLoss,
38 kJitterMs, 40 kJitterMs,
39 kAckReceived, 41 kVideoAckReceived,
40 kRembBitrate, 42 kRembBitrate,
41 kAckSent, 43 kAudioAckSent,
44 kVideoAckSent,
42 // Audio sender. 45 // Audio sender.
43 kAudioFrameReceived, 46 kAudioFrameReceived,
44 kAudioFrameCaptured, 47 kAudioFrameCaptured,
45 kAudioFrameEncoded, 48 kAudioFrameEncoded,
46 // Audio receiver. 49 // Audio receiver.
47 kAudioPlayoutDelay, 50 kAudioPlayoutDelay,
48 kAudioFrameDecoded, 51 kAudioFrameDecoded,
49 // Video sender. 52 // Video sender.
50 kVideoFrameCaptured, 53 kVideoFrameCaptured,
51 kVideoFrameReceived, 54 kVideoFrameReceived,
52 kVideoFrameSentToEncoder, 55 kVideoFrameSentToEncoder,
53 kVideoFrameEncoded, 56 kVideoFrameEncoded,
54 // Video receiver. 57 // Video receiver.
55 kVideoFrameDecoded, 58 kVideoFrameDecoded,
56 kVideoRenderDelay, 59 kVideoRenderDelay,
57 // Send-side packet events. 60 // Send-side packet events.
58 kPacketSentToPacer, 61 kPacketSentToPacer,
59 kPacketSentToNetwork, 62 kPacketSentToNetwork,
60 kPacketRetransmitted, 63 kPacketRetransmitted,
61 // Receive-side packet events. 64 // Receive-side packet events.
62 kPacketReceived, 65 kAudioPacketReceived,
66 kVideoPacketReceived,
63 kDuplicatePacketReceived, 67 kDuplicatePacketReceived,
64 68
65 kNumOfLoggingEvents, 69 kNumOfLoggingEvents,
66 }; 70 };
67 71
68 std::string CastLoggingToString(CastLoggingEvent event); 72 std::string CastLoggingToString(CastLoggingEvent event);
69 73
70 struct FrameEvent { 74 struct FrameEvent {
71 FrameEvent(); 75 FrameEvent();
72 ~FrameEvent(); 76 ~FrameEvent();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 FrameLogStats(); 113 FrameLogStats();
110 ~FrameLogStats(); 114 ~FrameLogStats();
111 115
112 double framerate_fps; 116 double framerate_fps;
113 double bitrate_kbps; 117 double bitrate_kbps;
114 int max_delay_ms; 118 int max_delay_ms;
115 int min_delay_ms; 119 int min_delay_ms;
116 int avg_delay_ms; 120 int avg_delay_ms;
117 }; 121 };
118 122
123 struct ReceiverRtcpEvent {
124 ReceiverRtcpEvent();
125 ~ReceiverRtcpEvent();
126
127 CastLoggingEvent type;
128 base::TimeTicks timestamp;
129 base::TimeDelta delay_delta; // Render/playout delay.
130 uint16 packet_id;
131 };
132
119 // Store all log types in a map based on the event. 133 // Store all log types in a map based on the event.
120 typedef std::map<uint32, FrameEvent> FrameRawMap; 134 typedef std::map<uint32, FrameEvent> FrameRawMap;
121 typedef std::map<uint32, PacketEvent> PacketRawMap; 135 typedef std::map<uint32, PacketEvent> PacketRawMap;
122 typedef std::map<CastLoggingEvent, GenericEvent> GenericRawMap; 136 typedef std::map<CastLoggingEvent, GenericEvent> GenericRawMap;
123 137
138 typedef std::multimap<uint32, ReceiverRtcpEvent> AudioRtcpRawMap;
139 typedef std::multimap<uint32, ReceiverRtcpEvent> VideoRtcpRawMap;
140
124 typedef std::map<CastLoggingEvent, linked_ptr<FrameLogStats > > FrameStatsMap; 141 typedef std::map<CastLoggingEvent, linked_ptr<FrameLogStats > > FrameStatsMap;
125 typedef std::map<CastLoggingEvent, double> PacketStatsMap; 142 typedef std::map<CastLoggingEvent, double> PacketStatsMap;
126 typedef std::map<CastLoggingEvent, double> GenericStatsMap; 143 typedef std::map<CastLoggingEvent, double> GenericStatsMap;
127 144
128 } // namespace cast 145 } // namespace cast
129 } // namespace media 146 } // namespace media
130 147
131 #endif // MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_ 148 #endif // MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_
OLDNEW
« no previous file with comments | « media/cast/audio_sender/audio_sender_unittest.cc ('k') | media/cast/logging/logging_defines.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698