| 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 12 matching lines...) Expand all Loading... |
| 23 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 23 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
| 24 #include "webrtc/modules/pacing/packet_router.h" | 24 #include "webrtc/modules/pacing/packet_router.h" |
| 25 #include "webrtc/modules/utility/include/process_thread.h" | 25 #include "webrtc/modules/utility/include/process_thread.h" |
| 26 #include "webrtc/video/call_stats.h" | 26 #include "webrtc/video/call_stats.h" |
| 27 #include "webrtc/video/video_capture_input.h" | 27 #include "webrtc/video/video_capture_input.h" |
| 28 #include "webrtc/video/vie_remb.h" | 28 #include "webrtc/video/vie_remb.h" |
| 29 #include "webrtc/video_send_stream.h" | 29 #include "webrtc/video_send_stream.h" |
| 30 | 30 |
| 31 namespace webrtc { | 31 namespace webrtc { |
| 32 | 32 |
| 33 class PacedSender; | |
| 34 class RtcpIntraFrameObserver; | 33 class RtcpIntraFrameObserver; |
| 35 class TransportFeedbackObserver; | 34 class TransportFeedbackObserver; |
| 36 | 35 |
| 37 std::string | 36 std::string |
| 38 VideoSendStream::Config::EncoderSettings::ToString() const { | 37 VideoSendStream::Config::EncoderSettings::ToString() const { |
| 39 std::stringstream ss; | 38 std::stringstream ss; |
| 40 ss << "{payload_name: " << payload_name; | 39 ss << "{payload_name: " << payload_name; |
| 41 ss << ", payload_type: " << payload_type; | 40 ss << ", payload_type: " << payload_type; |
| 42 ss << ", encoder: " << (encoder != nullptr ? "(VideoEncoder)" : "nullptr"); | 41 ss << ", encoder: " << (encoder != nullptr ? "(VideoEncoder)" : "nullptr"); |
| 43 ss << '}'; | 42 ss << '}'; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 CallStats* call_stats, | 152 CallStats* call_stats, |
| 154 CongestionController* congestion_controller, | 153 CongestionController* congestion_controller, |
| 155 VieRemb* remb, | 154 VieRemb* remb, |
| 156 BitrateAllocator* bitrate_allocator, | 155 BitrateAllocator* bitrate_allocator, |
| 157 const VideoSendStream::Config& config, | 156 const VideoSendStream::Config& config, |
| 158 const VideoEncoderConfig& encoder_config, | 157 const VideoEncoderConfig& encoder_config, |
| 159 const std::map<uint32_t, RtpState>& suspended_ssrcs) | 158 const std::map<uint32_t, RtpState>& suspended_ssrcs) |
| 160 : stats_proxy_(Clock::GetRealTimeClock(), | 159 : stats_proxy_(Clock::GetRealTimeClock(), |
| 161 config, | 160 config, |
| 162 encoder_config.content_type), | 161 encoder_config.content_type), |
| 163 transport_adapter_(config.send_transport), | |
| 164 encoded_frame_proxy_(config.post_encode_callback), | 162 encoded_frame_proxy_(config.post_encode_callback), |
| 165 config_(config), | 163 config_(config), |
| 166 suspended_ssrcs_(suspended_ssrcs), | 164 suspended_ssrcs_(suspended_ssrcs), |
| 167 module_process_thread_(module_process_thread), | 165 module_process_thread_(module_process_thread), |
| 168 call_stats_(call_stats), | 166 call_stats_(call_stats), |
| 169 congestion_controller_(congestion_controller), | 167 congestion_controller_(congestion_controller), |
| 170 remb_(remb), | 168 remb_(remb), |
| 171 overuse_detector_( | 169 overuse_detector_( |
| 172 Clock::GetRealTimeClock(), | 170 Clock::GetRealTimeClock(), |
| 173 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), | 171 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 325 |
| 328 congestion_controller_->GetRemoteBitrateEstimator(false)->RemoveStream( | 326 congestion_controller_->GetRemoteBitrateEstimator(false)->RemoveStream( |
| 329 vie_receiver_->GetRemoteSsrc()); | 327 vie_receiver_->GetRemoteSsrc()); |
| 330 } | 328 } |
| 331 | 329 |
| 332 VideoCaptureInput* VideoSendStream::Input() { | 330 VideoCaptureInput* VideoSendStream::Input() { |
| 333 return &input_; | 331 return &input_; |
| 334 } | 332 } |
| 335 | 333 |
| 336 void VideoSendStream::Start() { | 334 void VideoSendStream::Start() { |
| 337 transport_adapter_.Enable(); | |
| 338 vie_encoder_.Pause(); | 335 vie_encoder_.Pause(); |
| 339 if (vie_channel_.StartSend() == 0) { | 336 if (vie_channel_.StartSend() == 0) { |
| 340 // Was not already started, trigger a keyframe. | 337 // Was not already started, trigger a keyframe. |
| 341 vie_encoder_.SendKeyFrame(); | 338 vie_encoder_.SendKeyFrame(); |
| 342 } | 339 } |
| 343 vie_encoder_.Restart(); | 340 vie_encoder_.Restart(); |
| 344 vie_receiver_->StartReceive(); | 341 vie_receiver_->StartReceive(); |
| 345 } | 342 } |
| 346 | 343 |
| 347 void VideoSendStream::Stop() { | 344 void VideoSendStream::Stop() { |
| 348 // TODO(pbos): Make sure the encoder stops here. | 345 // TODO(pbos): Make sure the encoder stops here. |
| 349 vie_channel_.StopSend(); | 346 vie_channel_.StopSend(); |
| 350 vie_receiver_->StopReceive(); | 347 vie_receiver_->StopReceive(); |
| 351 transport_adapter_.Disable(); | |
| 352 } | 348 } |
| 353 | 349 |
| 354 bool VideoSendStream::ReconfigureVideoEncoder( | 350 bool VideoSendStream::ReconfigureVideoEncoder( |
| 355 const VideoEncoderConfig& config) { | 351 const VideoEncoderConfig& config) { |
| 356 TRACE_EVENT0("webrtc", "VideoSendStream::(Re)configureVideoEncoder"); | 352 TRACE_EVENT0("webrtc", "VideoSendStream::(Re)configureVideoEncoder"); |
| 357 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString(); | 353 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString(); |
| 358 const std::vector<VideoStream>& streams = config.streams; | 354 const std::vector<VideoStream>& streams = config.streams; |
| 359 RTC_DCHECK(!streams.empty()); | 355 RTC_DCHECK(!streams.empty()); |
| 360 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), streams.size()); | 356 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), streams.size()); |
| 361 | 357 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 used_ssrcs.resize(static_cast<size_t>(video_codec.numberOfSimulcastStreams)); | 624 used_ssrcs.resize(static_cast<size_t>(video_codec.numberOfSimulcastStreams)); |
| 629 vie_encoder_.SetSsrcs(used_ssrcs); | 625 vie_encoder_.SetSsrcs(used_ssrcs); |
| 630 | 626 |
| 631 // Restart the media flow | 627 // Restart the media flow |
| 632 vie_encoder_.Restart(); | 628 vie_encoder_.Restart(); |
| 633 | 629 |
| 634 return true; | 630 return true; |
| 635 } | 631 } |
| 636 } // namespace internal | 632 } // namespace internal |
| 637 } // namespace webrtc | 633 } // namespace webrtc |
| OLD | NEW |