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 |
11 #include "webrtc/video/video_send_stream.h" | 11 #include "webrtc/video/video_send_stream.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <sstream> | 14 #include <sstream> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
19 #include "webrtc/base/logging.h" | 19 #include "webrtc/base/logging.h" |
20 #include "webrtc/base/trace_event.h" | 20 #include "webrtc/base/trace_event.h" |
21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
22 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 22 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
23 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" | 23 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" |
24 #include "webrtc/modules/pacing/packet_router.h" | 24 #include "webrtc/modules/pacing/packet_router.h" |
25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | |
25 #include "webrtc/modules/utility/include/process_thread.h" | 26 #include "webrtc/modules/utility/include/process_thread.h" |
26 #include "webrtc/video/call_stats.h" | 27 #include "webrtc/video/call_stats.h" |
27 #include "webrtc/video/video_capture_input.h" | 28 #include "webrtc/video/video_capture_input.h" |
28 #include "webrtc/video/vie_remb.h" | 29 #include "webrtc/video/vie_remb.h" |
29 #include "webrtc/video_send_stream.h" | 30 #include "webrtc/video_send_stream.h" |
30 | 31 |
31 namespace webrtc { | 32 namespace webrtc { |
32 | 33 |
33 class RtcpIntraFrameObserver; | 34 class RtcpIntraFrameObserver; |
34 class TransportFeedbackObserver; | 35 class TransportFeedbackObserver; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 vcm_->RegisterProtectionCallback(vie_channel_.vcm_protection_callback()); | 222 vcm_->RegisterProtectionCallback(vie_channel_.vcm_protection_callback()); |
222 | 223 |
223 call_stats_->RegisterStatsObserver(vie_channel_.GetStatsObserver()); | 224 call_stats_->RegisterStatsObserver(vie_channel_.GetStatsObserver()); |
224 | 225 |
225 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { | 226 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { |
226 const std::string& extension = config_.rtp.extensions[i].name; | 227 const std::string& extension = config_.rtp.extensions[i].name; |
227 int id = config_.rtp.extensions[i].id; | 228 int id = config_.rtp.extensions[i].id; |
228 // One-byte-extension local identifiers are in the range 1-14 inclusive. | 229 // One-byte-extension local identifiers are in the range 1-14 inclusive. |
229 RTC_DCHECK_GE(id, 1); | 230 RTC_DCHECK_GE(id, 1); |
230 RTC_DCHECK_LE(id, 14); | 231 RTC_DCHECK_LE(id, 14); |
231 if (extension == RtpExtension::kTOffset) { | 232 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
232 RTC_CHECK_EQ(0, vie_channel_.EnableSendTimestampOffset(id)); | 233 RTC_CHECK_EQ(0, rtp_rtcp->RegisterSendRtpHeaderExtension( |
233 } else if (extension == RtpExtension::kAbsSendTime) { | 234 StringToRtpExtensionType(extension), id)); |
stefan-webrtc
2016/02/26 14:54:11
Should we no longer fail on trying to set audio ex
pbos-webrtc
2016/02/26 15:01:04
Done.
| |
234 RTC_CHECK_EQ(0, vie_channel_.EnableSendAbsoluteSendTime(id)); | |
235 } else if (extension == RtpExtension::kVideoRotation) { | |
236 RTC_CHECK_EQ(0, vie_channel_.EnableSendVideoRotation(id)); | |
237 } else if (extension == RtpExtension::kTransportSequenceNumber) { | |
238 RTC_CHECK_EQ(0, vie_channel_.EnableSendTransportSequenceNumber(id)); | |
239 } else { | |
240 RTC_NOTREACHED() << "Registering unsupported RTP extension."; | |
241 } | 235 } |
242 } | 236 } |
243 | 237 |
244 remb_->AddRembSender(rtp_rtcp_modules_[0]); | 238 remb_->AddRembSender(rtp_rtcp_modules_[0]); |
245 rtp_rtcp_modules_[0]->SetREMBStatus(true); | 239 rtp_rtcp_modules_[0]->SetREMBStatus(true); |
246 | 240 |
247 // Enable NACK, FEC or both. | 241 // Enable NACK, FEC or both. |
248 const bool enable_protection_nack = config_.rtp.nack.rtp_history_ms > 0; | 242 const bool enable_protection_nack = config_.rtp.nack.rtp_history_ms > 0; |
249 bool enable_protection_fec = config_.rtp.fec.red_payload_type != -1; | 243 bool enable_protection_fec = config_.rtp.fec.red_payload_type != -1; |
250 // Payload types without picture ID cannot determine that a stream is complete | 244 // Payload types without picture ID cannot determine that a stream is complete |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
617 return false; | 611 return false; |
618 } | 612 } |
619 | 613 |
620 // Restart the media flow | 614 // Restart the media flow |
621 vie_encoder_.Restart(); | 615 vie_encoder_.Restart(); |
622 | 616 |
623 return true; | 617 return true; |
624 } | 618 } |
625 } // namespace internal | 619 } // namespace internal |
626 } // namespace webrtc | 620 } // namespace webrtc |
OLD | NEW |