| Index: webrtc/api/rtpsender.cc
|
| diff --git a/webrtc/api/rtpsender.cc b/webrtc/api/rtpsender.cc
|
| index 94cea6c2c99e47cb27df5043b95193a0552f7665..214b4a39ec3a69ea1a0ff4c9c809e2a0b1bd5aa4 100644
|
| --- a/webrtc/api/rtpsender.cc
|
| +++ b/webrtc/api/rtpsender.cc
|
| @@ -276,18 +276,16 @@ bool VideoRtpSender::SetTrack(MediaStreamTrackInterface* track) {
|
|
|
| // Update video provider.
|
| if (can_send_track()) {
|
| - VideoTrackSourceInterface* source = track_->GetSource();
|
| // TODO(deadbeef): If SetTrack is called with a disabled track, and the
|
| // previous track was enabled, this could cause a frame from the new track
|
| - // to slip out. Really, what we need is for SetCaptureDevice and
|
| - // SetVideoSend
|
| + // to slip out. Really, what we need is for SetSource and SetVideoSend
|
| // to be combined into one atomic operation, all the way down to
|
| // WebRtcVideoSendStream.
|
| - provider_->SetCaptureDevice(ssrc_,
|
| - source ? source->GetVideoCapturer() : nullptr);
|
| +
|
| + provider_->SetSource(ssrc_, track_);
|
| SetVideoSend();
|
| } else if (prev_can_send_track) {
|
| - provider_->SetCaptureDevice(ssrc_, nullptr);
|
| + provider_->SetSource(ssrc_, nullptr);
|
| provider_->SetVideoSend(ssrc_, false, nullptr);
|
| }
|
| return true;
|
| @@ -299,14 +297,12 @@ void VideoRtpSender::SetSsrc(uint32_t ssrc) {
|
| }
|
| // If we are already sending with a particular SSRC, stop sending.
|
| if (can_send_track()) {
|
| - provider_->SetCaptureDevice(ssrc_, nullptr);
|
| + provider_->SetSource(ssrc_, nullptr);
|
| provider_->SetVideoSend(ssrc_, false, nullptr);
|
| }
|
| ssrc_ = ssrc;
|
| if (can_send_track()) {
|
| - VideoTrackSourceInterface* source = track_->GetSource();
|
| - provider_->SetCaptureDevice(ssrc_,
|
| - source ? source->GetVideoCapturer() : nullptr);
|
| + provider_->SetSource(ssrc_, track_);
|
| SetVideoSend();
|
| }
|
| }
|
| @@ -320,7 +316,7 @@ void VideoRtpSender::Stop() {
|
| track_->UnregisterObserver(this);
|
| }
|
| if (can_send_track()) {
|
| - provider_->SetCaptureDevice(ssrc_, nullptr);
|
| + provider_->SetSource(ssrc_, nullptr);
|
| provider_->SetVideoSend(ssrc_, false, nullptr);
|
| }
|
| stopped_ = true;
|
|
|