OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ss << ", target_delay_ms: " << target_delay_ms; | 56 ss << ", target_delay_ms: " << target_delay_ms; |
57 ss << '}'; | 57 ss << '}'; |
58 | 58 |
59 return ss.str(); | 59 return ss.str(); |
60 } | 60 } |
61 | 61 |
62 std::string VideoReceiveStream::Config::Rtp::ToString() const { | 62 std::string VideoReceiveStream::Config::Rtp::ToString() const { |
63 std::stringstream ss; | 63 std::stringstream ss; |
64 ss << "{remote_ssrc: " << remote_ssrc; | 64 ss << "{remote_ssrc: " << remote_ssrc; |
65 ss << ", local_ssrc: " << local_ssrc; | 65 ss << ", local_ssrc: " << local_ssrc; |
66 ss << ", rtcp_mode: " << (rtcp_mode == newapi::kRtcpCompound | 66 ss << ", rtcp_mode: " |
67 ? "kRtcpCompound" | 67 << (rtcp_mode == RtcpMode::kCompound ? "RtcpMode::kCompound" |
68 : "kRtcpReducedSize"); | 68 : "RtcpMode::kReducedSize"); |
69 ss << ", rtcp_xr: "; | 69 ss << ", rtcp_xr: "; |
70 ss << "{receiver_reference_time_report: " | 70 ss << "{receiver_reference_time_report: " |
71 << (rtcp_xr.receiver_reference_time_report ? "on" : "off"); | 71 << (rtcp_xr.receiver_reference_time_report ? "on" : "off"); |
72 ss << '}'; | 72 ss << '}'; |
73 ss << ", remb: " << (remb ? "on" : "off"); | 73 ss << ", remb: " << (remb ? "on" : "off"); |
74 ss << ", nack: {rtp_history_ms: " << nack.rtp_history_ms << '}'; | 74 ss << ", nack: {rtp_history_ms: " << nack.rtp_history_ms << '}'; |
75 ss << ", fec: " << fec.ToString(); | 75 ss << ", fec: " << fec.ToString(); |
76 ss << ", rtx: {"; | 76 ss << ", rtx: {"; |
77 for (auto& kv : rtx) { | 77 for (auto& kv : rtx) { |
78 ss << kv.first << " -> "; | 78 ss << kv.first << " -> "; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 channel_id_(channel_id) { | 141 channel_id_(channel_id) { |
142 RTC_CHECK(channel_group_->CreateReceiveChannel( | 142 RTC_CHECK(channel_group_->CreateReceiveChannel( |
143 channel_id_, &transport_adapter_, num_cpu_cores, config)); | 143 channel_id_, &transport_adapter_, num_cpu_cores, config)); |
144 | 144 |
145 vie_channel_ = channel_group_->GetChannel(channel_id_); | 145 vie_channel_ = channel_group_->GetChannel(channel_id_); |
146 | 146 |
147 // TODO(pbos): This is not fine grained enough... | 147 // TODO(pbos): This is not fine grained enough... |
148 vie_channel_->SetProtectionMode(config_.rtp.nack.rtp_history_ms > 0, false, | 148 vie_channel_->SetProtectionMode(config_.rtp.nack.rtp_history_ms > 0, false, |
149 -1, -1); | 149 -1, -1); |
150 vie_channel_->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); | 150 vie_channel_->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp); |
151 SetRtcpMode(config_.rtp.rtcp_mode); | 151 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) |
| 152 << "A stream should not be configured with RTCP disabled. This value is " |
| 153 "reserved for internal usage."; |
| 154 vie_channel_->SetRTCPMode(config_.rtp.rtcp_mode); |
152 | 155 |
153 RTC_DCHECK(config_.rtp.remote_ssrc != 0); | 156 RTC_DCHECK(config_.rtp.remote_ssrc != 0); |
154 // TODO(pbos): What's an appropriate local_ssrc for receive-only streams? | 157 // TODO(pbos): What's an appropriate local_ssrc for receive-only streams? |
155 RTC_DCHECK(config_.rtp.local_ssrc != 0); | 158 RTC_DCHECK(config_.rtp.local_ssrc != 0); |
156 RTC_DCHECK(config_.rtp.remote_ssrc != config_.rtp.local_ssrc); | 159 RTC_DCHECK(config_.rtp.remote_ssrc != config_.rtp.local_ssrc); |
157 | 160 |
158 vie_channel_->SetSSRC(config_.rtp.local_ssrc, kViEStreamTypeNormal, 0); | 161 vie_channel_->SetSSRC(config_.rtp.local_ssrc, kViEStreamTypeNormal, 0); |
159 // TODO(pbos): Support multiple RTX, per video payload. | 162 // TODO(pbos): Support multiple RTX, per video payload. |
160 Config::Rtp::RtxMap::const_iterator it = config_.rtp.rtx.begin(); | 163 Config::Rtp::RtxMap::const_iterator it = config_.rtp.rtx.begin(); |
161 for (; it != config_.rtp.rtx.end(); ++it) { | 164 for (; it != config_.rtp.rtx.end(); ++it) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 config_.renderer->RenderFrame( | 321 config_.renderer->RenderFrame( |
319 video_frame, | 322 video_frame, |
320 video_frame.render_time_ms() - clock_->TimeInMilliseconds()); | 323 video_frame.render_time_ms() - clock_->TimeInMilliseconds()); |
321 | 324 |
322 stats_proxy_->OnRenderedFrame(video_frame.width(), video_frame.height()); | 325 stats_proxy_->OnRenderedFrame(video_frame.width(), video_frame.height()); |
323 | 326 |
324 return 0; | 327 return 0; |
325 } | 328 } |
326 | 329 |
327 void VideoReceiveStream::SignalNetworkState(NetworkState state) { | 330 void VideoReceiveStream::SignalNetworkState(NetworkState state) { |
328 if (state == kNetworkUp) | 331 vie_channel_->SetRTCPMode(state == kNetworkUp ? config_.rtp.rtcp_mode |
329 SetRtcpMode(config_.rtp.rtcp_mode); | 332 : RtcpMode::kOff); |
330 if (state == kNetworkDown) | |
331 vie_channel_->SetRTCPMode(kRtcpOff); | |
332 } | 333 } |
333 | 334 |
334 void VideoReceiveStream::SetRtcpMode(newapi::RtcpMode mode) { | |
335 switch (mode) { | |
336 case newapi::kRtcpCompound: | |
337 vie_channel_->SetRTCPMode(kRtcpCompound); | |
338 break; | |
339 case newapi::kRtcpReducedSize: | |
340 vie_channel_->SetRTCPMode(kRtcpNonCompound); | |
341 break; | |
342 } | |
343 } | |
344 } // namespace internal | 335 } // namespace internal |
345 } // namespace webrtc | 336 } // namespace webrtc |
OLD | NEW |