| 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 18 matching lines...) Expand all Loading... |
| 29 using RtpUtility::Payload; | 29 using RtpUtility::Payload; |
| 30 | 30 |
| 31 // Only return the sources in the last 10 seconds. | 31 // Only return the sources in the last 10 seconds. |
| 32 const int64_t kGetSourcesTimeoutMs = 10000; | 32 const int64_t kGetSourcesTimeoutMs = 10000; |
| 33 | 33 |
| 34 RtpReceiver* RtpReceiver::CreateVideoReceiver( | 34 RtpReceiver* RtpReceiver::CreateVideoReceiver( |
| 35 Clock* clock, | 35 Clock* clock, |
| 36 RtpData* incoming_payload_callback, | 36 RtpData* incoming_payload_callback, |
| 37 RtpFeedback* incoming_messages_callback, | 37 RtpFeedback* incoming_messages_callback, |
| 38 RTPPayloadRegistry* rtp_payload_registry) { | 38 RTPPayloadRegistry* rtp_payload_registry) { |
| 39 if (!incoming_payload_callback) | 39 RTC_DCHECK(incoming_payload_callback != nullptr); |
| 40 incoming_payload_callback = NullObjectRtpData(); | |
| 41 if (!incoming_messages_callback) | 40 if (!incoming_messages_callback) |
| 42 incoming_messages_callback = NullObjectRtpFeedback(); | 41 incoming_messages_callback = NullObjectRtpFeedback(); |
| 43 return new RtpReceiverImpl( | 42 return new RtpReceiverImpl( |
| 44 clock, incoming_messages_callback, rtp_payload_registry, | 43 clock, incoming_messages_callback, rtp_payload_registry, |
| 45 RTPReceiverStrategy::CreateVideoStrategy(incoming_payload_callback)); | 44 RTPReceiverStrategy::CreateVideoStrategy(incoming_payload_callback)); |
| 46 } | 45 } |
| 47 | 46 |
| 48 RtpReceiver* RtpReceiver::CreateAudioReceiver( | 47 RtpReceiver* RtpReceiver::CreateAudioReceiver( |
| 49 Clock* clock, | 48 Clock* clock, |
| 50 RtpData* incoming_payload_callback, | 49 RtpData* incoming_payload_callback, |
| 51 RtpFeedback* incoming_messages_callback, | 50 RtpFeedback* incoming_messages_callback, |
| 52 RTPPayloadRegistry* rtp_payload_registry) { | 51 RTPPayloadRegistry* rtp_payload_registry) { |
| 53 if (!incoming_payload_callback) | 52 RTC_DCHECK(incoming_payload_callback != nullptr); |
| 54 incoming_payload_callback = NullObjectRtpData(); | |
| 55 if (!incoming_messages_callback) | 53 if (!incoming_messages_callback) |
| 56 incoming_messages_callback = NullObjectRtpFeedback(); | 54 incoming_messages_callback = NullObjectRtpFeedback(); |
| 57 return new RtpReceiverImpl( | 55 return new RtpReceiverImpl( |
| 58 clock, incoming_messages_callback, rtp_payload_registry, | 56 clock, incoming_messages_callback, rtp_payload_registry, |
| 59 RTPReceiverStrategy::CreateAudioStrategy(incoming_payload_callback)); | 57 RTPReceiverStrategy::CreateAudioStrategy(incoming_payload_callback)); |
| 60 } | 58 } |
| 61 | 59 |
| 62 RtpReceiverImpl::RtpReceiverImpl(Clock* clock, | 60 RtpReceiverImpl::RtpReceiverImpl(Clock* clock, |
| 63 RtpFeedback* incoming_messages_callback, | 61 RtpFeedback* incoming_messages_callback, |
| 64 RTPPayloadRegistry* rtp_payload_registry, | 62 RTPPayloadRegistry* rtp_payload_registry, |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 for (vec_it = ssrc_sources_.begin(); vec_it != ssrc_sources_.end(); | 544 for (vec_it = ssrc_sources_.begin(); vec_it != ssrc_sources_.end(); |
| 547 ++vec_it) { | 545 ++vec_it) { |
| 548 if ((now_ms - vec_it->timestamp_ms()) <= kGetSourcesTimeoutMs) { | 546 if ((now_ms - vec_it->timestamp_ms()) <= kGetSourcesTimeoutMs) { |
| 549 break; | 547 break; |
| 550 } | 548 } |
| 551 } | 549 } |
| 552 ssrc_sources_.erase(ssrc_sources_.begin(), vec_it); | 550 ssrc_sources_.erase(ssrc_sources_.begin(), vec_it); |
| 553 } | 551 } |
| 554 | 552 |
| 555 } // namespace webrtc | 553 } // namespace webrtc |
| OLD | NEW |