| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 rtp_payload_registry_(rtp_payload_registry), | 61 rtp_payload_registry_(rtp_payload_registry), |
| 62 rtp_media_receiver_(rtp_media_receiver), | 62 rtp_media_receiver_(rtp_media_receiver), |
| 63 cb_rtp_feedback_(incoming_messages_callback), | 63 cb_rtp_feedback_(incoming_messages_callback), |
| 64 last_receive_time_(0), | 64 last_receive_time_(0), |
| 65 last_received_payload_length_(0), | 65 last_received_payload_length_(0), |
| 66 ssrc_(0), | 66 ssrc_(0), |
| 67 num_csrcs_(0), | 67 num_csrcs_(0), |
| 68 current_remote_csrc_(), | 68 current_remote_csrc_(), |
| 69 last_received_timestamp_(0), | 69 last_received_timestamp_(0), |
| 70 last_received_frame_time_ms_(-1), | 70 last_received_frame_time_ms_(-1), |
| 71 last_received_sequence_number_(0), | 71 last_received_sequence_number_(0) { |
| 72 nack_method_(kNackOff) { | |
| 73 assert(incoming_messages_callback); | 72 assert(incoming_messages_callback); |
| 74 | 73 |
| 75 memset(current_remote_csrc_, 0, sizeof(current_remote_csrc_)); | 74 memset(current_remote_csrc_, 0, sizeof(current_remote_csrc_)); |
| 76 } | 75 } |
| 77 | 76 |
| 78 RtpReceiverImpl::~RtpReceiverImpl() { | 77 RtpReceiverImpl::~RtpReceiverImpl() { |
| 79 for (int i = 0; i < num_csrcs_; ++i) { | 78 for (int i = 0; i < num_csrcs_; ++i) { |
| 80 cb_rtp_feedback_->OnIncomingCSRCChanged(current_remote_csrc_[i], false); | 79 cb_rtp_feedback_->OnIncomingCSRCChanged(current_remote_csrc_[i], false); |
| 81 } | 80 } |
| 82 } | 81 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 106 } | 105 } |
| 107 return result; | 106 return result; |
| 108 } | 107 } |
| 109 | 108 |
| 110 int32_t RtpReceiverImpl::DeRegisterReceivePayload( | 109 int32_t RtpReceiverImpl::DeRegisterReceivePayload( |
| 111 const int8_t payload_type) { | 110 const int8_t payload_type) { |
| 112 rtc::CritScope lock(&critical_section_rtp_receiver_); | 111 rtc::CritScope lock(&critical_section_rtp_receiver_); |
| 113 return rtp_payload_registry_->DeRegisterReceivePayload(payload_type); | 112 return rtp_payload_registry_->DeRegisterReceivePayload(payload_type); |
| 114 } | 113 } |
| 115 | 114 |
| 116 NACKMethod RtpReceiverImpl::NACK() const { | |
| 117 rtc::CritScope lock(&critical_section_rtp_receiver_); | |
| 118 return nack_method_; | |
| 119 } | |
| 120 | |
| 121 // Turn negative acknowledgment requests on/off. | |
| 122 void RtpReceiverImpl::SetNACKStatus(const NACKMethod method) { | |
| 123 rtc::CritScope lock(&critical_section_rtp_receiver_); | |
| 124 nack_method_ = method; | |
| 125 } | |
| 126 | |
| 127 uint32_t RtpReceiverImpl::SSRC() const { | 115 uint32_t RtpReceiverImpl::SSRC() const { |
| 128 rtc::CritScope lock(&critical_section_rtp_receiver_); | 116 rtc::CritScope lock(&critical_section_rtp_receiver_); |
| 129 return ssrc_; | 117 return ssrc_; |
| 130 } | 118 } |
| 131 | 119 |
| 132 // Get remote CSRC. | 120 // Get remote CSRC. |
| 133 int32_t RtpReceiverImpl::CSRCs(uint32_t array_of_csrcs[kRtpCsrcSize]) const { | 121 int32_t RtpReceiverImpl::CSRCs(uint32_t array_of_csrcs[kRtpCsrcSize]) const { |
| 134 rtc::CritScope lock(&critical_section_rtp_receiver_); | 122 rtc::CritScope lock(&critical_section_rtp_receiver_); |
| 135 | 123 |
| 136 assert(num_csrcs_ <= kRtpCsrcSize); | 124 assert(num_csrcs_ <= kRtpCsrcSize); |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 // implementations might have CSRC 0 as a valid value. | 456 // implementations might have CSRC 0 as a valid value. |
| 469 if (num_csrcs_diff > 0) { | 457 if (num_csrcs_diff > 0) { |
| 470 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true); | 458 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true); |
| 471 } else if (num_csrcs_diff < 0) { | 459 } else if (num_csrcs_diff < 0) { |
| 472 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false); | 460 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false); |
| 473 } | 461 } |
| 474 } | 462 } |
| 475 } | 463 } |
| 476 | 464 |
| 477 } // namespace webrtc | 465 } // namespace webrtc |
| OLD | NEW |