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 16 matching lines...) Expand all Loading... |
27 RtpReceiver* RtpReceiver::CreateVideoReceiver( | 27 RtpReceiver* RtpReceiver::CreateVideoReceiver( |
28 Clock* clock, | 28 Clock* clock, |
29 RtpData* incoming_payload_callback, | 29 RtpData* incoming_payload_callback, |
30 RtpFeedback* incoming_messages_callback, | 30 RtpFeedback* incoming_messages_callback, |
31 RTPPayloadRegistry* rtp_payload_registry) { | 31 RTPPayloadRegistry* rtp_payload_registry) { |
32 if (!incoming_payload_callback) | 32 if (!incoming_payload_callback) |
33 incoming_payload_callback = NullObjectRtpData(); | 33 incoming_payload_callback = NullObjectRtpData(); |
34 if (!incoming_messages_callback) | 34 if (!incoming_messages_callback) |
35 incoming_messages_callback = NullObjectRtpFeedback(); | 35 incoming_messages_callback = NullObjectRtpFeedback(); |
36 return new RtpReceiverImpl( | 36 return new RtpReceiverImpl( |
37 clock, NullObjectRtpAudioFeedback(), incoming_messages_callback, | 37 clock, incoming_messages_callback, rtp_payload_registry, |
38 rtp_payload_registry, | |
39 RTPReceiverStrategy::CreateVideoStrategy(incoming_payload_callback)); | 38 RTPReceiverStrategy::CreateVideoStrategy(incoming_payload_callback)); |
40 } | 39 } |
41 | 40 |
42 RtpReceiver* RtpReceiver::CreateAudioReceiver( | 41 RtpReceiver* RtpReceiver::CreateAudioReceiver( |
43 Clock* clock, | 42 Clock* clock, |
| 43 RtpData* incoming_payload_callback, |
| 44 RtpFeedback* incoming_messages_callback, |
| 45 RTPPayloadRegistry* rtp_payload_registry) { |
| 46 if (!incoming_payload_callback) |
| 47 incoming_payload_callback = NullObjectRtpData(); |
| 48 if (!incoming_messages_callback) |
| 49 incoming_messages_callback = NullObjectRtpFeedback(); |
| 50 return new RtpReceiverImpl( |
| 51 clock, incoming_messages_callback, rtp_payload_registry, |
| 52 RTPReceiverStrategy::CreateAudioStrategy(incoming_payload_callback)); |
| 53 } |
| 54 |
| 55 // TODO(solenberg): Remove, after updating downstream code. |
| 56 RtpReceiver* RtpReceiver::CreateAudioReceiver( |
| 57 Clock* clock, |
44 RtpAudioFeedback* incoming_audio_feedback, | 58 RtpAudioFeedback* incoming_audio_feedback, |
45 RtpData* incoming_payload_callback, | 59 RtpData* incoming_payload_callback, |
46 RtpFeedback* incoming_messages_callback, | 60 RtpFeedback* incoming_messages_callback, |
47 RTPPayloadRegistry* rtp_payload_registry) { | 61 RTPPayloadRegistry* rtp_payload_registry) { |
48 if (!incoming_audio_feedback) | 62 return CreateAudioReceiver(clock, |
49 incoming_audio_feedback = NullObjectRtpAudioFeedback(); | 63 incoming_payload_callback, |
50 if (!incoming_payload_callback) | 64 incoming_messages_callback, |
51 incoming_payload_callback = NullObjectRtpData(); | 65 rtp_payload_registry); |
52 if (!incoming_messages_callback) | |
53 incoming_messages_callback = NullObjectRtpFeedback(); | |
54 return new RtpReceiverImpl( | |
55 clock, incoming_audio_feedback, incoming_messages_callback, | |
56 rtp_payload_registry, | |
57 RTPReceiverStrategy::CreateAudioStrategy(incoming_payload_callback, | |
58 incoming_audio_feedback)); | |
59 } | 66 } |
60 | 67 |
61 RtpReceiverImpl::RtpReceiverImpl( | 68 RtpReceiverImpl::RtpReceiverImpl( |
62 Clock* clock, | 69 Clock* clock, |
63 RtpAudioFeedback* incoming_audio_messages_callback, | |
64 RtpFeedback* incoming_messages_callback, | 70 RtpFeedback* incoming_messages_callback, |
65 RTPPayloadRegistry* rtp_payload_registry, | 71 RTPPayloadRegistry* rtp_payload_registry, |
66 RTPReceiverStrategy* rtp_media_receiver) | 72 RTPReceiverStrategy* rtp_media_receiver) |
67 : clock_(clock), | 73 : clock_(clock), |
68 rtp_payload_registry_(rtp_payload_registry), | 74 rtp_payload_registry_(rtp_payload_registry), |
69 rtp_media_receiver_(rtp_media_receiver), | 75 rtp_media_receiver_(rtp_media_receiver), |
70 cb_rtp_feedback_(incoming_messages_callback), | 76 cb_rtp_feedback_(incoming_messages_callback), |
71 critical_section_rtp_receiver_( | 77 critical_section_rtp_receiver_( |
72 CriticalSectionWrapper::CreateCriticalSection()), | 78 CriticalSectionWrapper::CreateCriticalSection()), |
73 last_receive_time_(0), | 79 last_receive_time_(0), |
74 last_received_payload_length_(0), | 80 last_received_payload_length_(0), |
75 ssrc_(0), | 81 ssrc_(0), |
76 num_csrcs_(0), | 82 num_csrcs_(0), |
77 current_remote_csrc_(), | 83 current_remote_csrc_(), |
78 last_received_timestamp_(0), | 84 last_received_timestamp_(0), |
79 last_received_frame_time_ms_(-1), | 85 last_received_frame_time_ms_(-1), |
80 last_received_sequence_number_(0), | 86 last_received_sequence_number_(0), |
81 nack_method_(kNackOff) { | 87 nack_method_(kNackOff) { |
82 assert(incoming_audio_messages_callback); | |
83 assert(incoming_messages_callback); | 88 assert(incoming_messages_callback); |
84 | 89 |
85 memset(current_remote_csrc_, 0, sizeof(current_remote_csrc_)); | 90 memset(current_remote_csrc_, 0, sizeof(current_remote_csrc_)); |
86 } | 91 } |
87 | 92 |
88 RtpReceiverImpl::~RtpReceiverImpl() { | 93 RtpReceiverImpl::~RtpReceiverImpl() { |
89 for (int i = 0; i < num_csrcs_; ++i) { | 94 for (int i = 0; i < num_csrcs_; ++i) { |
90 cb_rtp_feedback_->OnIncomingCSRCChanged(current_remote_csrc_[i], false); | 95 cb_rtp_feedback_->OnIncomingCSRCChanged(current_remote_csrc_[i], false); |
91 } | 96 } |
92 } | 97 } |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 // implementations might have CSRC 0 as a valid value. | 483 // implementations might have CSRC 0 as a valid value. |
479 if (num_csrcs_diff > 0) { | 484 if (num_csrcs_diff > 0) { |
480 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true); | 485 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true); |
481 } else if (num_csrcs_diff < 0) { | 486 } else if (num_csrcs_diff < 0) { |
482 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false); | 487 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false); |
483 } | 488 } |
484 } | 489 } |
485 } | 490 } |
486 | 491 |
487 } // namespace webrtc | 492 } // namespace webrtc |
OLD | NEW |