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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 for (int i = 0; i < num_csrcs_; ++i) { | 92 for (int i = 0; i < num_csrcs_; ++i) { |
93 cb_rtp_feedback_->OnIncomingCSRCChanged(id_, current_remote_csrc_[i], | 93 cb_rtp_feedback_->OnIncomingCSRCChanged(id_, current_remote_csrc_[i], |
94 false); | 94 false); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 int32_t RtpReceiverImpl::RegisterReceivePayload( | 98 int32_t RtpReceiverImpl::RegisterReceivePayload( |
99 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 99 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
100 const int8_t payload_type, | 100 const int8_t payload_type, |
101 const uint32_t frequency, | 101 const uint32_t frequency, |
102 const uint8_t channels, | 102 const size_t channels, |
103 const uint32_t rate) { | 103 const uint32_t rate) { |
104 CriticalSectionScoped lock(critical_section_rtp_receiver_.get()); | 104 CriticalSectionScoped lock(critical_section_rtp_receiver_.get()); |
105 | 105 |
106 // TODO(phoglund): Try to streamline handling of the RED codec and some other | 106 // TODO(phoglund): Try to streamline handling of the RED codec and some other |
107 // cases which makes it necessary to keep track of whether we created a | 107 // cases which makes it necessary to keep track of whether we created a |
108 // payload or not. | 108 // payload or not. |
109 bool created_new_payload = false; | 109 bool created_new_payload = false; |
110 int32_t result = rtp_payload_registry_->RegisterReceivePayload( | 110 int32_t result = rtp_payload_registry_->RegisterReceivePayload( |
111 payload_name, payload_type, frequency, channels, rate, | 111 payload_name, payload_type, frequency, channels, rate, |
112 &created_new_payload); | 112 &created_new_payload); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 bool RtpReceiverImpl::HaveReceivedFrame() const { | 249 bool RtpReceiverImpl::HaveReceivedFrame() const { |
250 return last_received_frame_time_ms_ >= 0; | 250 return last_received_frame_time_ms_ >= 0; |
251 } | 251 } |
252 | 252 |
253 // Implementation note: must not hold critsect when called. | 253 // Implementation note: must not hold critsect when called. |
254 void RtpReceiverImpl::CheckSSRCChanged(const RTPHeader& rtp_header) { | 254 void RtpReceiverImpl::CheckSSRCChanged(const RTPHeader& rtp_header) { |
255 bool new_ssrc = false; | 255 bool new_ssrc = false; |
256 bool re_initialize_decoder = false; | 256 bool re_initialize_decoder = false; |
257 char payload_name[RTP_PAYLOAD_NAME_SIZE]; | 257 char payload_name[RTP_PAYLOAD_NAME_SIZE]; |
258 uint8_t channels = 1; | 258 size_t channels = 1; |
259 uint32_t rate = 0; | 259 uint32_t rate = 0; |
260 | 260 |
261 { | 261 { |
262 CriticalSectionScoped lock(critical_section_rtp_receiver_.get()); | 262 CriticalSectionScoped lock(critical_section_rtp_receiver_.get()); |
263 | 263 |
264 int8_t last_received_payload_type = | 264 int8_t last_received_payload_type = |
265 rtp_payload_registry_->last_received_payload_type(); | 265 rtp_payload_registry_->last_received_payload_type(); |
266 if (ssrc_ != rtp_header.ssrc || | 266 if (ssrc_ != rtp_header.ssrc || |
267 (last_received_payload_type == -1 && ssrc_ == 0)) { | 267 (last_received_payload_type == -1 && ssrc_ == 0)) { |
268 // We need the payload_type_ to make the call if the remote SSRC is 0. | 268 // 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... |
482 // implementations might have CSRC 0 as a valid value. | 482 // implementations might have CSRC 0 as a valid value. |
483 if (num_csrcs_diff > 0) { | 483 if (num_csrcs_diff > 0) { |
484 cb_rtp_feedback_->OnIncomingCSRCChanged(id_, 0, true); | 484 cb_rtp_feedback_->OnIncomingCSRCChanged(id_, 0, true); |
485 } else if (num_csrcs_diff < 0) { | 485 } else if (num_csrcs_diff < 0) { |
486 cb_rtp_feedback_->OnIncomingCSRCChanged(id_, 0, false); | 486 cb_rtp_feedback_->OnIncomingCSRCChanged(id_, 0, false); |
487 } | 487 } |
488 } | 488 } |
489 } | 489 } |
490 | 490 |
491 } // namespace webrtc | 491 } // namespace webrtc |
OLD | NEW |