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 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h" | 5 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 namespace media { | 9 namespace media { |
10 namespace cast { | 10 namespace cast { |
11 | 11 |
12 ReceiverRtcpEventSubscriber::ReceiverRtcpEventSubscriber( | 12 ReceiverRtcpEventSubscriber::ReceiverRtcpEventSubscriber( |
13 const size_t max_size_to_retain, EventMediaType type) | 13 const size_t max_size_to_retain, EventMediaType type) |
14 : max_size_to_retain_( | 14 : max_size_to_retain_( |
15 max_size_to_retain * (kResendDelay * kNumResends + 1)), | 15 max_size_to_retain * (kResendDelay * kNumResends + 1)), |
16 type_(type) { | 16 type_(type), |
| 17 popped_events_(0) { |
17 DCHECK(max_size_to_retain_ > 0u); | 18 DCHECK(max_size_to_retain_ > 0u); |
18 DCHECK(type_ == AUDIO_EVENT || type_ == VIDEO_EVENT); | 19 DCHECK(type_ == AUDIO_EVENT || type_ == VIDEO_EVENT); |
19 for (size_t i = 0; i < kNumResends; i++) { | 20 for (size_t i = 0; i < kNumResends; i++) { |
20 send_ptrs_[i] = 0; | 21 send_ptrs_[i] = 0; |
21 } | 22 } |
22 } | 23 } |
23 | 24 |
24 ReceiverRtcpEventSubscriber::~ReceiverRtcpEventSubscriber() { | 25 ReceiverRtcpEventSubscriber::~ReceiverRtcpEventSubscriber() { |
25 DCHECK(thread_checker_.CalledOnValidThread()); | 26 DCHECK(thread_checker_.CalledOnValidThread()); |
26 } | 27 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 130 |
130 bool ReceiverRtcpEventSubscriber::ShouldProcessEvent( | 131 bool ReceiverRtcpEventSubscriber::ShouldProcessEvent( |
131 CastLoggingEvent event_type, EventMediaType event_media_type) { | 132 CastLoggingEvent event_type, EventMediaType event_media_type) { |
132 return type_ == event_media_type && | 133 return type_ == event_media_type && |
133 (event_type == FRAME_ACK_SENT || event_type == FRAME_DECODED || | 134 (event_type == FRAME_ACK_SENT || event_type == FRAME_DECODED || |
134 event_type == FRAME_PLAYOUT || event_type == PACKET_RECEIVED); | 135 event_type == FRAME_PLAYOUT || event_type == PACKET_RECEIVED); |
135 } | 136 } |
136 | 137 |
137 } // namespace cast | 138 } // namespace cast |
138 } // namespace media | 139 } // namespace media |
OLD | NEW |