| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ENCODING_EVENT_SUBSCRIBER_H_ | 5 #ifndef MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_ |
| 6 #define MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_ | 6 #define MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 PacketEventList* packet_events); | 65 PacketEventList* packet_events); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 typedef std::map<RtpTimestamp, | 68 typedef std::map<RtpTimestamp, |
| 69 linked_ptr<media::cast::proto::AggregatedFrameEvent> > | 69 linked_ptr<media::cast::proto::AggregatedFrameEvent> > |
| 70 FrameEventMap; | 70 FrameEventMap; |
| 71 typedef std::map<RtpTimestamp, | 71 typedef std::map<RtpTimestamp, |
| 72 linked_ptr<media::cast::proto::AggregatedPacketEvent> > | 72 linked_ptr<media::cast::proto::AggregatedPacketEvent> > |
| 73 PacketEventMap; | 73 PacketEventMap; |
| 74 | 74 |
| 75 bool ShouldProcessEvent(CastLoggingEvent event); | |
| 76 | |
| 77 // Transfer up to |max_num_entries| smallest entries from |frame_event_map_| | 75 // Transfer up to |max_num_entries| smallest entries from |frame_event_map_| |
| 78 // to |frame_event_storage_|. This helps keep size of |frame_event_map_| small | 76 // to |frame_event_storage_|. This helps keep size of |frame_event_map_| small |
| 79 // and lookup speed fast. | 77 // and lookup speed fast. |
| 80 void TransferFrameEvents(size_t max_num_entries); | 78 void TransferFrameEvents(size_t max_num_entries); |
| 81 // See above. | 79 // See above. |
| 82 void TransferPacketEvents(size_t max_num_entries); | 80 void TransferPacketEvents(size_t max_num_entries); |
| 83 | 81 |
| 84 void AddFrameEventToStorage( | 82 void AddFrameEventToStorage( |
| 85 const linked_ptr<media::cast::proto::AggregatedFrameEvent>& | 83 const linked_ptr<media::cast::proto::AggregatedFrameEvent>& |
| 86 frame_event_proto); | 84 frame_event_proto); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 115 // Set to RTP timestamp of first event encountered after a |Reset()|. | 113 // Set to RTP timestamp of first event encountered after a |Reset()|. |
| 116 RtpTimestamp first_rtp_timestamp_; | 114 RtpTimestamp first_rtp_timestamp_; |
| 117 | 115 |
| 118 DISALLOW_COPY_AND_ASSIGN(EncodingEventSubscriber); | 116 DISALLOW_COPY_AND_ASSIGN(EncodingEventSubscriber); |
| 119 }; | 117 }; |
| 120 | 118 |
| 121 } // namespace cast | 119 } // namespace cast |
| 122 } // namespace media | 120 } // namespace media |
| 123 | 121 |
| 124 #endif // MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_ | 122 #endif // MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_ |
| OLD | NEW |