OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 RtpReceiverImpl::~RtpReceiverImpl() { | 89 RtpReceiverImpl::~RtpReceiverImpl() { |
90 for (int i = 0; i < num_csrcs_; ++i) { | 90 for (int i = 0; i < num_csrcs_; ++i) { |
91 cb_rtp_feedback_->OnIncomingCSRCChanged(current_remote_csrc_[i], false); | 91 cb_rtp_feedback_->OnIncomingCSRCChanged(current_remote_csrc_[i], false); |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 int32_t RtpReceiverImpl::RegisterReceivePayload( | 95 int32_t RtpReceiverImpl::RegisterReceivePayload( |
96 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 96 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
97 const int8_t payload_type, | 97 const int8_t payload_type, |
98 const uint32_t frequency, | 98 const uint32_t frequency, |
99 const uint8_t channels, | 99 const size_t channels, |
100 const uint32_t rate) { | 100 const uint32_t rate) { |
101 CriticalSectionScoped lock(critical_section_rtp_receiver_.get()); | 101 CriticalSectionScoped lock(critical_section_rtp_receiver_.get()); |
102 | 102 |
103 // TODO(phoglund): Try to streamline handling of the RED codec and some other | 103 // TODO(phoglund): Try to streamline handling of the RED codec and some other |
104 // cases which makes it necessary to keep track of whether we created a | 104 // cases which makes it necessary to keep track of whether we created a |
105 // payload or not. | 105 // payload or not. |
106 bool created_new_payload = false; | 106 bool created_new_payload = false; |
107 int32_t result = rtp_payload_registry_->RegisterReceivePayload( | 107 int32_t result = rtp_payload_registry_->RegisterReceivePayload( |
108 payload_name, payload_type, frequency, channels, rate, | 108 payload_name, payload_type, frequency, channels, rate, |
109 &created_new_payload); | 109 &created_new_payload); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 bool RtpReceiverImpl::HaveReceivedFrame() const { | 246 bool RtpReceiverImpl::HaveReceivedFrame() const { |
247 return last_received_frame_time_ms_ >= 0; | 247 return last_received_frame_time_ms_ >= 0; |
248 } | 248 } |
249 | 249 |
250 // Implementation note: must not hold critsect when called. | 250 // Implementation note: must not hold critsect when called. |
251 void RtpReceiverImpl::CheckSSRCChanged(const RTPHeader& rtp_header) { | 251 void RtpReceiverImpl::CheckSSRCChanged(const RTPHeader& rtp_header) { |
252 bool new_ssrc = false; | 252 bool new_ssrc = false; |
253 bool re_initialize_decoder = false; | 253 bool re_initialize_decoder = false; |
254 char payload_name[RTP_PAYLOAD_NAME_SIZE]; | 254 char payload_name[RTP_PAYLOAD_NAME_SIZE]; |
255 uint8_t channels = 1; | 255 size_t channels = 1; |
256 uint32_t rate = 0; | 256 uint32_t rate = 0; |
257 | 257 |
258 { | 258 { |
259 CriticalSectionScoped lock(critical_section_rtp_receiver_.get()); | 259 CriticalSectionScoped lock(critical_section_rtp_receiver_.get()); |
260 | 260 |
261 int8_t last_received_payload_type = | 261 int8_t last_received_payload_type = |
262 rtp_payload_registry_->last_received_payload_type(); | 262 rtp_payload_registry_->last_received_payload_type(); |
263 if (ssrc_ != rtp_header.ssrc || | 263 if (ssrc_ != rtp_header.ssrc || |
264 (last_received_payload_type == -1 && ssrc_ == 0)) { | 264 (last_received_payload_type == -1 && ssrc_ == 0)) { |
265 // We need the payload_type_ to make the call if the remote SSRC is 0. | 265 // We need the payload_type_ to make the call if the remote SSRC is 0. |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 // implementations might have CSRC 0 as a valid value. | 479 // implementations might have CSRC 0 as a valid value. |
480 if (num_csrcs_diff > 0) { | 480 if (num_csrcs_diff > 0) { |
481 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true); | 481 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true); |
482 } else if (num_csrcs_diff < 0) { | 482 } else if (num_csrcs_diff < 0) { |
483 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false); | 483 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false); |
484 } | 484 } |
485 } | 485 } |
486 } | 486 } |
487 | 487 |
488 } // namespace webrtc | 488 } // namespace webrtc |
OLD | NEW |