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 #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> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 BasePacketMap packet_map; | 102 BasePacketMap packet_map; |
103 }; | 103 }; |
104 | 104 |
105 struct GenericEvent { | 105 struct GenericEvent { |
106 GenericEvent(); | 106 GenericEvent(); |
107 ~GenericEvent(); | 107 ~GenericEvent(); |
108 std::vector<int> value; | 108 std::vector<int> value; |
109 std::vector<base::TimeTicks> timestamp; | 109 std::vector<base::TimeTicks> timestamp; |
110 }; | 110 }; |
111 | 111 |
112 // Generic statistics given the raw data. More specific data (e.g. frame rate | |
113 // and bit rate) can be computed given the basic metrics. | |
114 // Some of the metrics will only be set when applicable, e.g. delay and size. | |
imcheng
2014/01/22 21:03:37
For metrics that aren't always set, could you be m
mikhal1
2014/01/23 19:53:11
Done.
| |
112 struct FrameLogStats { | 115 struct FrameLogStats { |
113 FrameLogStats(); | 116 FrameLogStats(); |
114 ~FrameLogStats(); | 117 ~FrameLogStats(); |
118 base::TimeTicks first_event_time; | |
119 base::TimeTicks last_event_time; | |
120 int event_counter; | |
121 int size_sum; | |
imcheng
2014/01/22 21:03:37
size_t?
mikhal1
2014/01/23 19:53:11
Done.
| |
122 base::TimeDelta min_delay; | |
123 base::TimeDelta max_delay; | |
124 base::TimeDelta sum_delay; | |
125 }; | |
115 | 126 |
116 double framerate_fps; | 127 struct PacketLogStats { |
117 double bitrate_kbps; | 128 PacketLogStats(); |
118 int max_delay_ms; | 129 ~PacketLogStats(); |
119 int min_delay_ms; | 130 base::TimeTicks first_event_time; |
120 int avg_delay_ms; | 131 base::TimeTicks last_event_time; |
132 int event_counter; | |
133 size_t size_sum; | |
hguihot1
2014/01/22 21:13:05
|size_sum| here, but FrameLogStats uses |sum_delay
mikhal1
2014/01/23 19:53:11
Done.
| |
134 }; | |
135 | |
136 struct GenericLogStats { | |
137 GenericLogStats(); | |
138 ~GenericLogStats(); | |
139 base::TimeTicks first_event_time; | |
140 base::TimeTicks last_event_time; | |
141 int event_counter; | |
142 int sum; | |
hguihot1
2014/01/22 21:13:05
Potential overflow? Should we use 64-bit for all s
mikhal1
2014/01/23 19:53:11
Depends on how often you'll reset it. Let's stick
| |
143 int min; | |
144 int max; | |
hguihot1
2014/01/22 21:13:05
Having sum of squares as well would allow the call
mikhal1
2014/01/23 19:53:11
On the granularity of every time you poll it. If y
| |
121 }; | 145 }; |
122 | 146 |
123 struct ReceiverRtcpEvent { | 147 struct ReceiverRtcpEvent { |
124 ReceiverRtcpEvent(); | 148 ReceiverRtcpEvent(); |
125 ~ReceiverRtcpEvent(); | 149 ~ReceiverRtcpEvent(); |
126 | 150 |
127 CastLoggingEvent type; | 151 CastLoggingEvent type; |
128 base::TimeTicks timestamp; | 152 base::TimeTicks timestamp; |
129 base::TimeDelta delay_delta; // Render/playout delay. | 153 base::TimeDelta delay_delta; // Render/playout delay. |
130 uint16 packet_id; | 154 uint16 packet_id; |
131 }; | 155 }; |
132 | 156 |
133 // Store all log types in a map based on the event. | 157 // Store all log types in a map based on the event. |
134 typedef std::map<uint32, FrameEvent> FrameRawMap; | 158 typedef std::map<uint32, FrameEvent> FrameRawMap; |
135 typedef std::map<uint32, PacketEvent> PacketRawMap; | 159 typedef std::map<uint32, PacketEvent> PacketRawMap; |
136 typedef std::map<CastLoggingEvent, GenericEvent> GenericRawMap; | 160 typedef std::map<CastLoggingEvent, GenericEvent> GenericRawMap; |
137 | 161 |
138 typedef std::multimap<uint32, ReceiverRtcpEvent> AudioRtcpRawMap; | 162 typedef std::multimap<uint32, ReceiverRtcpEvent> AudioRtcpRawMap; |
139 typedef std::multimap<uint32, ReceiverRtcpEvent> VideoRtcpRawMap; | 163 typedef std::multimap<uint32, ReceiverRtcpEvent> VideoRtcpRawMap; |
140 | 164 |
141 typedef std::map<CastLoggingEvent, linked_ptr<FrameLogStats > > FrameStatsMap; | 165 typedef std::map<CastLoggingEvent, linked_ptr<FrameLogStats > > FrameStatsMap; |
imcheng
2014/01/22 21:03:37
Question: Why do stats maps use linked_ptrs but th
mikhal1
2014/01/23 19:53:11
Done.
| |
142 typedef std::map<CastLoggingEvent, double> PacketStatsMap; | 166 typedef std::map<CastLoggingEvent, linked_ptr<PacketLogStats > > PacketStatsMap; |
143 typedef std::map<CastLoggingEvent, double> GenericStatsMap; | 167 typedef std::map<CastLoggingEvent, linked_ptr<GenericLogStats > > |
168 GenericStatsMap; | |
144 | 169 |
145 } // namespace cast | 170 } // namespace cast |
146 } // namespace media | 171 } // namespace media |
147 | 172 |
148 #endif // MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_ | 173 #endif // MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_ |
OLD | NEW |