| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef MEDIA_CAST_LOGGING_LOGGING_STATS_H_ | |
| 6 #define MEDIA_CAST_LOGGING_LOGGING_STATS_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/time/time.h" | |
| 11 #include "media/cast/logging/logging_defines.h" | |
| 12 | |
| 13 namespace base { | |
| 14 class DictionaryValue; | |
| 15 } | |
| 16 | |
| 17 namespace media { | |
| 18 namespace cast { | |
| 19 | |
| 20 class LoggingStats { | |
| 21 public: | |
| 22 LoggingStats(); | |
| 23 ~LoggingStats(); | |
| 24 | |
| 25 void Reset(); | |
| 26 | |
| 27 void InsertFrameEvent(const base::TimeTicks& time_of_event, | |
| 28 CastLoggingEvent event, | |
| 29 uint32 rtp_timestamp, | |
| 30 uint32 frame_id); | |
| 31 | |
| 32 void InsertFrameEventWithSize(const base::TimeTicks& time_of_event, | |
| 33 CastLoggingEvent event, | |
| 34 uint32 rtp_timestamp, | |
| 35 uint32 frame_id, | |
| 36 int frame_size); | |
| 37 | |
| 38 void InsertFrameEventWithDelay(const base::TimeTicks& time_of_event, | |
| 39 CastLoggingEvent event, | |
| 40 uint32 rtp_timestamp, | |
| 41 uint32 frame_id, | |
| 42 base::TimeDelta delay); | |
| 43 | |
| 44 void InsertPacketEvent(const base::TimeTicks& time_of_event, | |
| 45 CastLoggingEvent event, | |
| 46 uint32 rtp_timestamp, | |
| 47 uint32 frame_id, | |
| 48 uint16 packet_id, | |
| 49 uint16 max_packet_id, | |
| 50 size_t size); | |
| 51 | |
| 52 void InsertGenericEvent(const base::TimeTicks& time_of_event, | |
| 53 CastLoggingEvent event, int value); | |
| 54 | |
| 55 FrameStatsMap GetFrameStatsData(EventMediaType media_type) const; | |
| 56 | |
| 57 PacketStatsMap GetPacketStatsData(EventMediaType media_type) const; | |
| 58 | |
| 59 GenericStatsMap GetGenericStatsData() const; | |
| 60 | |
| 61 private: | |
| 62 void InsertBaseFrameEvent(const base::TimeTicks& time_of_event, | |
| 63 CastLoggingEvent event, | |
| 64 uint32 frame_id, | |
| 65 uint32 rtp_timestamp); | |
| 66 | |
| 67 FrameStatsMap frame_stats_; | |
| 68 PacketStatsMap packet_stats_; | |
| 69 GenericStatsMap generic_stats_; | |
| 70 | |
| 71 DISALLOW_COPY_AND_ASSIGN(LoggingStats); | |
| 72 }; | |
| 73 | |
| 74 // Converts stats provided in |frame_stats_map| and |packet_stats_map| to | |
| 75 // base::DictionaryValue format. See .cc file for the exact structure. | |
| 76 scoped_ptr<base::DictionaryValue> ConvertStats( | |
| 77 const FrameStatsMap& frame_stats_map, | |
| 78 const PacketStatsMap& packet_stats_map); | |
| 79 | |
| 80 } // namespace cast | |
| 81 } // namespace media | |
| 82 | |
| 83 #endif // MEDIA_CAST_LOGGING_LOGGING_STATS_H_ | |
| 84 | |
| OLD | NEW |