| 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 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); |
| 232 RTC_CHECK_EQ(0, vie_channel_.EnableSendTimestampOffset(id)); | 233 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 233 } else if (extension == RtpExtension::kAbsSendTime) { | 234 RTC_CHECK_EQ(0, rtp_rtcp->RegisterSendRtpHeaderExtension( |
| 234 RTC_CHECK_EQ(0, vie_channel_.EnableSendAbsoluteSendTime(id)); | 235 StringToRtpExtensionType(extension), 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 } | 236 } |
| 242 } | 237 } |
| 243 | 238 |
| 244 remb_->AddRembSender(rtp_rtcp_modules_[0]); | 239 remb_->AddRembSender(rtp_rtcp_modules_[0]); |
| 245 rtp_rtcp_modules_[0]->SetREMBStatus(true); | 240 rtp_rtcp_modules_[0]->SetREMBStatus(true); |
| 246 | 241 |
| 247 // Enable NACK, FEC or both. | 242 // Enable NACK, FEC or both. |
| 248 const bool enable_protection_nack = config_.rtp.nack.rtp_history_ms > 0; | 243 const bool enable_protection_nack = config_.rtp.nack.rtp_history_ms > 0; |
| 249 bool enable_protection_fec = config_.rtp.fec.red_payload_type != -1; | 244 bool enable_protection_fec = config_.rtp.fec.red_payload_type != -1; |
| 250 // Payload types without picture ID cannot determine that a stream is complete | 245 // 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; | 612 return false; |
| 618 } | 613 } |
| 619 | 614 |
| 620 // Restart the media flow | 615 // Restart the media flow |
| 621 vie_encoder_.Restart(); | 616 vie_encoder_.Restart(); |
| 622 | 617 |
| 623 return true; | 618 return true; |
| 624 } | 619 } |
| 625 } // namespace internal | 620 } // namespace internal |
| 626 } // namespace webrtc | 621 } // namespace webrtc |
| OLD | NEW |