| 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_STATS_H_ | 5 #ifndef MEDIA_CAST_LOGGING_LOGGING_STATS_H_ |
| 6 #define MEDIA_CAST_LOGGING_LOGGING_STATS_H_ | 6 #define MEDIA_CAST_LOGGING_LOGGING_STATS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 10 #include "media/cast/logging/logging_defines.h" | 11 #include "media/cast/logging/logging_defines.h" |
| 11 | 12 |
| 13 namespace base { |
| 14 class DictionaryValue; |
| 15 } |
| 16 |
| 12 namespace media { | 17 namespace media { |
| 13 namespace cast { | 18 namespace cast { |
| 14 | 19 |
| 15 class LoggingStats { | 20 class LoggingStats { |
| 16 public: | 21 public: |
| 17 LoggingStats(); | 22 LoggingStats(); |
| 18 ~LoggingStats(); | 23 ~LoggingStats(); |
| 19 | 24 |
| 20 void Reset(); | 25 void Reset(); |
| 21 | 26 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 40 CastLoggingEvent event, | 45 CastLoggingEvent event, |
| 41 uint32 rtp_timestamp, | 46 uint32 rtp_timestamp, |
| 42 uint32 frame_id, | 47 uint32 frame_id, |
| 43 uint16 packet_id, | 48 uint16 packet_id, |
| 44 uint16 max_packet_id, | 49 uint16 max_packet_id, |
| 45 size_t size); | 50 size_t size); |
| 46 | 51 |
| 47 void InsertGenericEvent(const base::TimeTicks& time_of_event, | 52 void InsertGenericEvent(const base::TimeTicks& time_of_event, |
| 48 CastLoggingEvent event, int value); | 53 CastLoggingEvent event, int value); |
| 49 | 54 |
| 50 FrameStatsMap GetFrameStatsData() const; | 55 FrameStatsMap GetFrameStatsData(EventMediaType media_type) const; |
| 51 | 56 |
| 52 PacketStatsMap GetPacketStatsData() const; | 57 PacketStatsMap GetPacketStatsData(EventMediaType media_type) const; |
| 53 | 58 |
| 54 GenericStatsMap GetGenericStatsData() const; | 59 GenericStatsMap GetGenericStatsData() const; |
| 55 | 60 |
| 56 private: | 61 private: |
| 57 void InsertBaseFrameEvent(const base::TimeTicks& time_of_event, | 62 void InsertBaseFrameEvent(const base::TimeTicks& time_of_event, |
| 58 CastLoggingEvent event, | 63 CastLoggingEvent event, |
| 59 uint32 frame_id, | 64 uint32 frame_id, |
| 60 uint32 rtp_timestamp); | 65 uint32 rtp_timestamp); |
| 61 | 66 |
| 62 FrameStatsMap frame_stats_; | 67 FrameStatsMap frame_stats_; |
| 63 PacketStatsMap packet_stats_; | 68 PacketStatsMap packet_stats_; |
| 64 GenericStatsMap generic_stats_; | 69 GenericStatsMap generic_stats_; |
| 65 | 70 |
| 66 DISALLOW_COPY_AND_ASSIGN(LoggingStats); | 71 DISALLOW_COPY_AND_ASSIGN(LoggingStats); |
| 67 }; | 72 }; |
| 68 | 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 |
| 69 } // namespace cast | 80 } // namespace cast |
| 70 } // namespace media | 81 } // namespace media |
| 71 | 82 |
| 72 #endif // MEDIA_CAST_LOGGING_LOGGING_STATS_H_ | 83 #endif // MEDIA_CAST_LOGGING_LOGGING_STATS_H_ |
| 73 | 84 |
| OLD | NEW |