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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 thread_sync_event_.Wait(rtc::Event::kForever); | 538 thread_sync_event_.Wait(rtc::Event::kForever); |
539 } | 539 } |
540 | 540 |
541 void VideoSendStream::Stop() { | 541 void VideoSendStream::Stop() { |
542 RTC_DCHECK_RUN_ON(&thread_checker_); | 542 RTC_DCHECK_RUN_ON(&thread_checker_); |
543 LOG(LS_INFO) << "VideoSendStream::Stop"; | 543 LOG(LS_INFO) << "VideoSendStream::Stop"; |
544 VideoSendStreamImpl* send_stream = send_stream_.get(); | 544 VideoSendStreamImpl* send_stream = send_stream_.get(); |
545 worker_queue_->PostTask([send_stream] { send_stream->Stop(); }); | 545 worker_queue_->PostTask([send_stream] { send_stream->Stop(); }); |
546 } | 546 } |
547 | 547 |
548 VideoCaptureInput* VideoSendStream::Input() { | 548 void VideoSendStream::SetSource( |
549 // Input() will be called on the thread that deliverers video frames from | 549 rtc::VideoSourceInterface<webrtc::VideoFrame>* source) { |
550 // libjingle. | 550 RTC_DCHECK_RUN_ON(&thread_checker_); |
551 // TODO(perkj): Refactor ViEEncoder to register directly as a VideoSink to the | 551 vie_encoder_->SetSource(source); |
552 // VideoSource. | |
553 return vie_encoder_.get(); | |
554 } | 552 } |
555 | 553 |
556 void VideoSendStream::ReconfigureVideoEncoder(VideoEncoderConfig config) { | 554 void VideoSendStream::ReconfigureVideoEncoder(VideoEncoderConfig config) { |
557 // ReconfigureVideoEncoder will be called on the thread that deliverers video | 555 // ReconfigureVideoEncoder will be called on the thread that deliverers video |
558 // frames. We must change the encoder settings immediately so that | 556 // frames. We must change the encoder settings immediately so that |
559 // the codec settings matches the next frame. | 557 // the codec settings matches the next frame. |
560 // TODO(perkj): Move logic for reconfiguration the encoder due to frame size | 558 // TODO(perkj): Move logic for reconfiguration the encoder due to frame size |
561 // change from WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame to | 559 // change from WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame to |
562 // be internally handled by ViEEncoder. | 560 // be internally handled by ViEEncoder. |
563 vie_encoder_->ConfigureEncoder(config, config_.rtp.max_packet_size); | 561 vie_encoder_->ConfigureEncoder(config, config_.rtp.max_packet_size); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 &module_nack_rate); | 1055 &module_nack_rate); |
1058 *sent_video_rate_bps += module_video_rate; | 1056 *sent_video_rate_bps += module_video_rate; |
1059 *sent_nack_rate_bps += module_nack_rate; | 1057 *sent_nack_rate_bps += module_nack_rate; |
1060 *sent_fec_rate_bps += module_fec_rate; | 1058 *sent_fec_rate_bps += module_fec_rate; |
1061 } | 1059 } |
1062 return 0; | 1060 return 0; |
1063 } | 1061 } |
1064 | 1062 |
1065 } // namespace internal | 1063 } // namespace internal |
1066 } // namespace webrtc | 1064 } // namespace webrtc |
OLD | NEW |