Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 |
| 11 #include "webrtc/call/flexfec_receive_stream_impl.h" | 11 #include "webrtc/call/flexfec_receive_stream_impl.h" |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "webrtc/base/checks.h" | 15 #include "webrtc/base/checks.h" |
| 16 #include "webrtc/base/location.h" | 16 #include "webrtc/base/location.h" |
| 17 #include "webrtc/base/logging.h" | 17 #include "webrtc/base/logging.h" |
| 18 #include "webrtc/call/rtp_stream_receiver_controller_interface.h" | |
| 18 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" | 19 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" |
| 19 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" | 20 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" |
| 20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
| 21 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" |
| 22 #include "webrtc/modules/utility/include/process_thread.h" | 23 #include "webrtc/modules/utility/include/process_thread.h" |
| 23 #include "webrtc/system_wrappers/include/clock.h" | 24 #include "webrtc/system_wrappers/include/clock.h" |
| 24 | 25 |
| 25 namespace webrtc { | 26 namespace webrtc { |
| 26 | 27 |
| 27 std::string FlexfecReceiveStream::Stats::ToString(int64_t time_ms) const { | 28 std::string FlexfecReceiveStream::Stats::ToString(int64_t time_ms) const { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 configuration.receive_statistics = receive_statistics; | 116 configuration.receive_statistics = receive_statistics; |
| 116 configuration.outgoing_transport = rtcp_send_transport; | 117 configuration.outgoing_transport = rtcp_send_transport; |
| 117 configuration.rtt_stats = rtt_stats; | 118 configuration.rtt_stats = rtt_stats; |
| 118 std::unique_ptr<RtpRtcp> rtp_rtcp(RtpRtcp::CreateRtpRtcp(configuration)); | 119 std::unique_ptr<RtpRtcp> rtp_rtcp(RtpRtcp::CreateRtpRtcp(configuration)); |
| 119 return rtp_rtcp; | 120 return rtp_rtcp; |
| 120 } | 121 } |
| 121 | 122 |
| 122 } // namespace | 123 } // namespace |
| 123 | 124 |
| 124 FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl( | 125 FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl( |
| 126 RtpStreamReceiverControllerInterface* receiver_controller, | |
| 125 const Config& config, | 127 const Config& config, |
| 126 RecoveredPacketReceiver* recovered_packet_receiver, | 128 RecoveredPacketReceiver* recovered_packet_receiver, |
| 127 RtcpRttStats* rtt_stats, | 129 RtcpRttStats* rtt_stats, |
| 128 ProcessThread* process_thread) | 130 ProcessThread* process_thread) |
| 129 : config_(config), | 131 : config_(config), |
| 130 started_(false), | 132 started_(false), |
| 131 receiver_(MaybeCreateFlexfecReceiver(config_, recovered_packet_receiver)), | 133 receiver_(MaybeCreateFlexfecReceiver(config_, recovered_packet_receiver)), |
| 132 rtp_receive_statistics_( | 134 rtp_receive_statistics_( |
| 133 ReceiveStatistics::Create(Clock::GetRealTimeClock())), | 135 ReceiveStatistics::Create(Clock::GetRealTimeClock())), |
| 134 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(), | 136 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(), |
| 135 config_.rtcp_send_transport, | 137 config_.rtcp_send_transport, |
| 136 rtt_stats)), | 138 rtt_stats)), |
| 137 process_thread_(process_thread) { | 139 process_thread_(process_thread) { |
| 138 LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config_.ToString(); | 140 LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config_.ToString(); |
| 139 | 141 |
| 140 // RTCP reporting. | 142 // RTCP reporting. |
| 141 rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode); | 143 rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode); |
| 142 rtp_rtcp_->SetSSRC(config_.local_ssrc); | 144 rtp_rtcp_->SetSSRC(config_.local_ssrc); |
| 143 process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE); | 145 process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE); |
| 146 | |
| 147 // Register with transport. | |
| 148 // TODO(nisse): Register receiver_, and delete below OnRtpPacket method? | |
|
danilchap
2017/06/13 15:58:32
I'm not sure what you are suggesting to do in this
nisse-webrtc
2017/06/14 06:31:06
The idea is that maybe this class doesn't need to
| |
| 149 rtp_stream_receiver_ = | |
| 150 receiver_controller->CreateReceiver(config_.remote_ssrc, this); | |
| 151 for (uint32_t ssrc : config.protected_media_ssrcs) | |
| 152 receiver_controller->AddSink(ssrc, this); | |
| 144 } | 153 } |
| 145 | 154 |
| 146 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { | 155 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { |
| 147 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString(); | 156 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString(); |
| 148 Stop(); | 157 Stop(); |
| 149 process_thread_->DeRegisterModule(rtp_rtcp_.get()); | 158 process_thread_->DeRegisterModule(rtp_rtcp_.get()); |
| 150 } | 159 } |
| 151 | 160 |
| 152 void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) { | 161 void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) { |
| 153 { | 162 { |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 182 started_ = false; | 191 started_ = false; |
| 183 } | 192 } |
| 184 | 193 |
| 185 // TODO(brandtr): Implement this member function when we have designed the | 194 // TODO(brandtr): Implement this member function when we have designed the |
| 186 // stats for FlexFEC. | 195 // stats for FlexFEC. |
| 187 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { | 196 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { |
| 188 return FlexfecReceiveStream::Stats(); | 197 return FlexfecReceiveStream::Stats(); |
| 189 } | 198 } |
| 190 | 199 |
| 191 } // namespace webrtc | 200 } // namespace webrtc |
| OLD | NEW |