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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // This helps keep memory usage bounded. | 45 // This helps keep memory usage bounded. |
46 // Every time one of |OnReceive[Frame,Packet]Event()| is | 46 // Every time one of |OnReceive[Frame,Packet]Event()| is |
47 // called, it will check if the respective map size has exceeded |max_frames|. | 47 // called, it will check if the respective map size has exceeded |max_frames|. |
48 // If so, it will remove the oldest aggregated entry (ordered by RTP | 48 // If so, it will remove the oldest aggregated entry (ordered by RTP |
49 // timestamp). | 49 // timestamp). |
50 EncodingEventSubscriber(EventMediaType event_media_type, size_t max_frames); | 50 EncodingEventSubscriber(EventMediaType event_media_type, size_t max_frames); |
51 | 51 |
52 virtual ~EncodingEventSubscriber(); | 52 virtual ~EncodingEventSubscriber(); |
53 | 53 |
54 // RawReventSubscriber implementations. | 54 // RawReventSubscriber implementations. |
55 virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) OVERRIDE; | 55 virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) override; |
56 virtual void OnReceivePacketEvent(const PacketEvent& packet_event) OVERRIDE; | 56 virtual void OnReceivePacketEvent(const PacketEvent& packet_event) override; |
57 | 57 |
58 // Assigns frame events and packet events received so far to |frame_events| | 58 // Assigns frame events and packet events received so far to |frame_events| |
59 // and |packet_events| and resets the internal state. | 59 // and |packet_events| and resets the internal state. |
60 // In addition, assign metadata associated with these events to |metadata|. | 60 // In addition, assign metadata associated with these events to |metadata|. |
61 // The protos in |frame_events| and |packets_events| are sorted in | 61 // The protos in |frame_events| and |packets_events| are sorted in |
62 // ascending RTP timestamp order. | 62 // ascending RTP timestamp order. |
63 void GetEventsAndReset(media::cast::proto::LogMetadata* metadata, | 63 void GetEventsAndReset(media::cast::proto::LogMetadata* metadata, |
64 FrameEventList* frame_events, | 64 FrameEventList* frame_events, |
65 PacketEventList* packet_events); | 65 PacketEventList* packet_events); |
66 | 66 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // Set to RTP timestamp of first event encountered after a |Reset()|. | 113 // Set to RTP timestamp of first event encountered after a |Reset()|. |
114 RtpTimestamp first_rtp_timestamp_; | 114 RtpTimestamp first_rtp_timestamp_; |
115 | 115 |
116 DISALLOW_COPY_AND_ASSIGN(EncodingEventSubscriber); | 116 DISALLOW_COPY_AND_ASSIGN(EncodingEventSubscriber); |
117 }; | 117 }; |
118 | 118 |
119 } // namespace cast | 119 } // namespace cast |
120 } // namespace media | 120 } // namespace media |
121 | 121 |
122 #endif // MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_ | 122 #endif // MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_ |
OLD | NEW |