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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 sent_video_rate_bps, sent_nack_rate_bps, | 72 sent_video_rate_bps, sent_nack_rate_bps, |
73 sent_fec_rate_bps); | 73 sent_fec_rate_bps); |
74 } | 74 } |
75 private: | 75 private: |
76 ViEChannel* owner_; | 76 ViEChannel* owner_; |
77 }; | 77 }; |
78 | 78 |
79 ViEChannel::ViEChannel(Transport* transport, | 79 ViEChannel::ViEChannel(Transport* transport, |
80 ProcessThread* module_process_thread, | 80 ProcessThread* module_process_thread, |
81 PayloadRouter* send_payload_router, | 81 PayloadRouter* send_payload_router, |
82 VideoCodingModule* vcm, | |
83 RtcpIntraFrameObserver* intra_frame_observer, | 82 RtcpIntraFrameObserver* intra_frame_observer, |
84 RtcpBandwidthObserver* bandwidth_observer, | 83 RtcpBandwidthObserver* bandwidth_observer, |
85 TransportFeedbackObserver* transport_feedback_observer, | 84 TransportFeedbackObserver* transport_feedback_observer, |
86 RemoteBitrateEstimator* remote_bitrate_estimator, | 85 RemoteBitrateEstimator* remote_bitrate_estimator, |
87 RtcpRttStats* rtt_stats, | 86 RtcpRttStats* rtt_stats, |
88 PacedSender* paced_sender, | 87 PacedSender* paced_sender, |
89 PacketRouter* packet_router, | 88 PacketRouter* packet_router, |
90 size_t max_rtp_streams, | 89 size_t max_rtp_streams, |
91 bool sender) | 90 bool sender) |
92 : sender_(sender), | 91 : sender_(sender), |
93 module_process_thread_(module_process_thread), | 92 module_process_thread_(module_process_thread), |
94 send_payload_router_(send_payload_router), | 93 send_payload_router_(send_payload_router), |
95 vcm_protection_callback_(new ViEChannelProtectionCallback(this)), | 94 vcm_protection_callback_(new ViEChannelProtectionCallback(this)), |
96 vcm_(vcm), | 95 vcm_(sender_ ? nullptr |
97 vie_receiver_(vcm_, remote_bitrate_estimator, this), | 96 : VideoCodingModule::Create(Clock::GetRealTimeClock(), |
98 vie_sync_(vcm_), | 97 nullptr, |
98 nullptr)), | |
99 vie_receiver_(vcm_.get(), remote_bitrate_estimator, this), | |
100 vie_sync_(vcm_.get()), | |
99 stats_observer_(new ChannelStatsObserver(this)), | 101 stats_observer_(new ChannelStatsObserver(this)), |
100 receive_stats_callback_(nullptr), | 102 receive_stats_callback_(nullptr), |
101 incoming_video_stream_(nullptr), | 103 incoming_video_stream_(nullptr), |
102 intra_frame_observer_(intra_frame_observer), | 104 intra_frame_observer_(intra_frame_observer), |
103 rtt_stats_(rtt_stats), | 105 rtt_stats_(rtt_stats), |
104 paced_sender_(paced_sender), | 106 paced_sender_(paced_sender), |
105 packet_router_(packet_router), | 107 packet_router_(packet_router), |
106 bandwidth_observer_(bandwidth_observer), | 108 bandwidth_observer_(bandwidth_observer), |
107 transport_feedback_observer_(transport_feedback_observer), | 109 transport_feedback_observer_(transport_feedback_observer), |
108 nack_history_size_sender_(kMinSendSidePacketHistorySize), | 110 nack_history_size_sender_(kMinSendSidePacketHistorySize), |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 if (paced_sender_) { | 154 if (paced_sender_) { |
153 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | 155 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
154 rtp_rtcp->SetStorePacketsStatus(true, nack_history_size_sender_); | 156 rtp_rtcp->SetStorePacketsStatus(true, nack_history_size_sender_); |
155 } | 157 } |
156 packet_router_->AddRtpModule(rtp_rtcp_modules_[0], sender_); | 158 packet_router_->AddRtpModule(rtp_rtcp_modules_[0], sender_); |
157 if (sender_) { | 159 if (sender_) { |
158 send_payload_router_->SetSendingRtpModules( | 160 send_payload_router_->SetSendingRtpModules( |
159 std::vector<RtpRtcp*>(1, rtp_rtcp_modules_[0])); | 161 std::vector<RtpRtcp*>(1, rtp_rtcp_modules_[0])); |
160 RTC_DCHECK(!send_payload_router_->active()); | 162 RTC_DCHECK(!send_payload_router_->active()); |
161 } else { | 163 } else { |
162 if (vcm_->RegisterReceiveCallback(this) != 0) { | 164 if (vcm_->RegisterReceiveCallback(this) != 0) { |
danilchap
2016/02/15 12:25:09
Can it make sense to join this callbacks initializ
pbos-webrtc
2016/02/15 13:04:24
Done.
| |
163 return -1; | 165 return -1; |
164 } | 166 } |
165 vcm_->RegisterFrameTypeCallback(this); | 167 vcm_->RegisterFrameTypeCallback(this); |
166 vcm_->RegisterReceiveStatisticsCallback(this); | 168 vcm_->RegisterReceiveStatisticsCallback(this); |
167 vcm_->RegisterDecoderTimingCallback(this); | 169 vcm_->RegisterDecoderTimingCallback(this); |
168 vcm_->SetRenderDelay(kDefaultRenderDelayMs); | 170 vcm_->SetRenderDelay(kDefaultRenderDelayMs); |
169 module_process_thread_->RegisterModule(&vie_sync_); | 171 module_process_thread_->RegisterModule(&vie_sync_); |
170 } | 172 } |
171 return 0; | 173 return 0; |
172 } | 174 } |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 return 0; | 812 return 0; |
811 } | 813 } |
812 | 814 |
813 int32_t ViEChannel::SetMTU(uint16_t mtu) { | 815 int32_t ViEChannel::SetMTU(uint16_t mtu) { |
814 RTC_DCHECK(sender_); | 816 RTC_DCHECK(sender_); |
815 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | 817 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
816 rtp_rtcp->SetMaxTransferUnit(mtu); | 818 rtp_rtcp->SetMaxTransferUnit(mtu); |
817 return 0; | 819 return 0; |
818 } | 820 } |
819 | 821 |
822 VideoCodingModule* ViEChannel::vcm() { | |
823 return vcm_.get(); | |
824 } | |
825 | |
820 RtpRtcp* ViEChannel::rtp_rtcp() { | 826 RtpRtcp* ViEChannel::rtp_rtcp() { |
821 return rtp_rtcp_modules_[0]; | 827 return rtp_rtcp_modules_[0]; |
822 } | 828 } |
823 | 829 |
824 ViEReceiver* ViEChannel::vie_receiver() { | 830 ViEReceiver* ViEChannel::vie_receiver() { |
825 return &vie_receiver_; | 831 return &vie_receiver_; |
826 } | 832 } |
827 | 833 |
828 VCMProtectionCallback* ViEChannel::vcm_protection_callback() { | 834 VCMProtectionCallback* ViEChannel::vcm_protection_callback() { |
829 return vcm_protection_callback_.get(); | 835 return vcm_protection_callback_.get(); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1048 rtc::CritScope lock(&crit_); | 1054 rtc::CritScope lock(&crit_); |
1049 receive_stats_callback_ = receive_statistics_proxy; | 1055 receive_stats_callback_ = receive_statistics_proxy; |
1050 } | 1056 } |
1051 | 1057 |
1052 void ViEChannel::SetIncomingVideoStream( | 1058 void ViEChannel::SetIncomingVideoStream( |
1053 IncomingVideoStream* incoming_video_stream) { | 1059 IncomingVideoStream* incoming_video_stream) { |
1054 rtc::CritScope lock(&crit_); | 1060 rtc::CritScope lock(&crit_); |
1055 incoming_video_stream_ = incoming_video_stream; | 1061 incoming_video_stream_ = incoming_video_stream; |
1056 } | 1062 } |
1057 } // namespace webrtc | 1063 } // namespace webrtc |
OLD | NEW |