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_RTCP_RECEIVER_RTCP_EVENT_SUBSCRIBER_H_ | 5 #ifndef MEDIA_CAST_RTCP_RECEIVER_RTCP_EVENT_SUBSCRIBER_H_ |
6 #define MEDIA_CAST_RTCP_RECEIVER_RTCP_EVENT_SUBSCRIBER_H_ | 6 #define MEDIA_CAST_RTCP_RECEIVER_RTCP_EVENT_SUBSCRIBER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // in the map. Once threshold has been reached, an event with the smallest | 33 // in the map. Once threshold has been reached, an event with the smallest |
34 // RTP timestamp will be removed. | 34 // RTP timestamp will be removed. |
35 // |type|: Determines whether the subscriber will process only audio or video | 35 // |type|: Determines whether the subscriber will process only audio or video |
36 // events. | 36 // events. |
37 ReceiverRtcpEventSubscriber(const size_t max_size_to_retain, | 37 ReceiverRtcpEventSubscriber(const size_t max_size_to_retain, |
38 EventMediaType type); | 38 EventMediaType type); |
39 | 39 |
40 virtual ~ReceiverRtcpEventSubscriber(); | 40 virtual ~ReceiverRtcpEventSubscriber(); |
41 | 41 |
42 // RawEventSubscriber implementation. | 42 // RawEventSubscriber implementation. |
43 virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) OVERRIDE; | 43 virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) override; |
44 virtual void OnReceivePacketEvent(const PacketEvent& packet_event) OVERRIDE; | 44 virtual void OnReceivePacketEvent(const PacketEvent& packet_event) override; |
45 | 45 |
46 // Assigns events collected to |rtcp_events| and clears them from this | 46 // Assigns events collected to |rtcp_events| and clears them from this |
47 // object. | 47 // object. |
48 void GetRtcpEventsAndReset(RtcpEventMultiMap* rtcp_events); | 48 void GetRtcpEventsAndReset(RtcpEventMultiMap* rtcp_events); |
49 | 49 |
50 private: | 50 private: |
51 // If |rtcp_events_.size()| exceeds |max_size_to_retain_|, remove an oldest | 51 // If |rtcp_events_.size()| exceeds |max_size_to_retain_|, remove an oldest |
52 // entry (determined by RTP timestamp) so its size no greater than | 52 // entry (determined by RTP timestamp) so its size no greater than |
53 // |max_size_to_retain_|. | 53 // |max_size_to_retain_|. |
54 void TruncateMapIfNeeded(); | 54 void TruncateMapIfNeeded(); |
(...skipping 15 matching lines...) Expand all Loading... |
70 // Ensures methods are only called on the main thread. | 70 // Ensures methods are only called on the main thread. |
71 base::ThreadChecker thread_checker_; | 71 base::ThreadChecker thread_checker_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(ReceiverRtcpEventSubscriber); | 73 DISALLOW_COPY_AND_ASSIGN(ReceiverRtcpEventSubscriber); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace cast | 76 } // namespace cast |
77 } // namespace media | 77 } // namespace media |
78 | 78 |
79 #endif // MEDIA_CAST_RTCP_RECEIVER_RTCP_EVENT_SUBSCRIBER_H_ | 79 #endif // MEDIA_CAST_RTCP_RECEIVER_RTCP_EVENT_SUBSCRIBER_H_ |
OLD | NEW |