| 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 #include "webrtc/video/video_send_stream.h" | 10 #include "webrtc/video/video_send_stream.h" |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 VieRemb* remb, | 622 VieRemb* remb, |
| 623 RtcEventLog* event_log, | 623 RtcEventLog* event_log, |
| 624 VideoSendStream::Config config, | 624 VideoSendStream::Config config, |
| 625 VideoEncoderConfig encoder_config, | 625 VideoEncoderConfig encoder_config, |
| 626 const std::map<uint32_t, RtpState>& suspended_ssrcs) | 626 const std::map<uint32_t, RtpState>& suspended_ssrcs) |
| 627 : worker_queue_(worker_queue), | 627 : worker_queue_(worker_queue), |
| 628 thread_sync_event_(false /* manual_reset */, false), | 628 thread_sync_event_(false /* manual_reset */, false), |
| 629 stats_proxy_(Clock::GetRealTimeClock(), | 629 stats_proxy_(Clock::GetRealTimeClock(), |
| 630 config, | 630 config, |
| 631 encoder_config.content_type), | 631 encoder_config.content_type), |
| 632 config_(std::move(config)) { | 632 config_(std::move(config)), |
| 633 content_type_(encoder_config.content_type) { |
| 633 vie_encoder_.reset(new ViEEncoder( | 634 vie_encoder_.reset(new ViEEncoder( |
| 634 num_cpu_cores, &stats_proxy_, config_.encoder_settings, | 635 num_cpu_cores, &stats_proxy_, config_.encoder_settings, |
| 635 config_.pre_encode_callback, config_.post_encode_callback)); | 636 config_.pre_encode_callback, config_.post_encode_callback)); |
| 636 worker_queue_->PostTask(std::unique_ptr<rtc::QueuedTask>(new ConstructionTask( | 637 worker_queue_->PostTask(std::unique_ptr<rtc::QueuedTask>(new ConstructionTask( |
| 637 &send_stream_, &thread_sync_event_, &stats_proxy_, vie_encoder_.get(), | 638 &send_stream_, &thread_sync_event_, &stats_proxy_, vie_encoder_.get(), |
| 638 module_process_thread, call_stats, congestion_controller, packet_router, | 639 module_process_thread, call_stats, congestion_controller, packet_router, |
| 639 bitrate_allocator, send_delay_stats, remb, event_log, &config_, | 640 bitrate_allocator, send_delay_stats, remb, event_log, &config_, |
| 640 encoder_config.max_bitrate_bps, suspended_ssrcs))); | 641 encoder_config.max_bitrate_bps, suspended_ssrcs))); |
| 641 | 642 |
| 642 // Wait for ConstructionTask to complete so that |send_stream_| can be used. | 643 // Wait for ConstructionTask to complete so that |send_stream_| can be used. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 rtc::VideoSourceInterface<webrtc::VideoFrame>* source, | 686 rtc::VideoSourceInterface<webrtc::VideoFrame>* source, |
| 686 const DegradationPreference& degradation_preference) { | 687 const DegradationPreference& degradation_preference) { |
| 687 RTC_DCHECK_RUN_ON(&thread_checker_); | 688 RTC_DCHECK_RUN_ON(&thread_checker_); |
| 688 vie_encoder_->SetSource(source, degradation_preference); | 689 vie_encoder_->SetSource(source, degradation_preference); |
| 689 } | 690 } |
| 690 | 691 |
| 691 void VideoSendStream::ReconfigureVideoEncoder(VideoEncoderConfig config) { | 692 void VideoSendStream::ReconfigureVideoEncoder(VideoEncoderConfig config) { |
| 692 // TODO(perkj): Some test cases in VideoSendStreamTest call | 693 // TODO(perkj): Some test cases in VideoSendStreamTest call |
| 693 // ReconfigureVideoEncoder from the network thread. | 694 // ReconfigureVideoEncoder from the network thread. |
| 694 // RTC_DCHECK_RUN_ON(&thread_checker_); | 695 // RTC_DCHECK_RUN_ON(&thread_checker_); |
| 696 RTC_DCHECK(content_type_ == config.content_type); |
| 695 vie_encoder_->ConfigureEncoder(std::move(config), config_.rtp.max_packet_size, | 697 vie_encoder_->ConfigureEncoder(std::move(config), config_.rtp.max_packet_size, |
| 696 config_.rtp.nack.rtp_history_ms > 0); | 698 config_.rtp.nack.rtp_history_ms > 0); |
| 697 } | 699 } |
| 698 | 700 |
| 699 VideoSendStream::Stats VideoSendStream::GetStats() { | 701 VideoSendStream::Stats VideoSendStream::GetStats() { |
| 700 // TODO(perkj, solenberg): Some test cases in EndToEndTest call GetStats from | 702 // TODO(perkj, solenberg): Some test cases in EndToEndTest call GetStats from |
| 701 // a network thread. See comment in Call::GetStats(). | 703 // a network thread. See comment in Call::GetStats(). |
| 702 // RTC_DCHECK_RUN_ON(&thread_checker_); | 704 // RTC_DCHECK_RUN_ON(&thread_checker_); |
| 703 return stats_proxy_.GetStats(); | 705 return stats_proxy_.GetStats(); |
| 704 } | 706 } |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 std::min(config_->rtp.max_packet_size, | 1337 std::min(config_->rtp.max_packet_size, |
| 1336 kPathMTU - transport_overhead_bytes_per_packet_); | 1338 kPathMTU - transport_overhead_bytes_per_packet_); |
| 1337 | 1339 |
| 1338 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 1340 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 1339 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); | 1341 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); |
| 1340 } | 1342 } |
| 1341 } | 1343 } |
| 1342 | 1344 |
| 1343 } // namespace internal | 1345 } // namespace internal |
| 1344 } // namespace webrtc | 1346 } // namespace webrtc |
| OLD | NEW |