Index: webrtc/api/rtpsender.cc |
diff --git a/webrtc/api/rtpsender.cc b/webrtc/api/rtpsender.cc |
index 1ca8fc1d0a8e16034772f567164367bcfecd7439..2477dc9c03b92645857d3f2c9744194cbd769393 100644 |
--- a/webrtc/api/rtpsender.cc |
+++ b/webrtc/api/rtpsender.cc |
@@ -268,6 +268,9 @@ bool VideoRtpSender::SetTrack(MediaStreamTrackInterface* track) { |
// Update video provider. |
if (can_send_track()) { |
+ // TODO(nisse): GetSource should return a VideoTrackSource, which |
+ // implements rtc::VideoSourceInterface, and can be passed |
+ // directly to SetSource. |
VideoSourceInterface* 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 |
@@ -275,11 +278,11 @@ bool VideoRtpSender::SetTrack(MediaStreamTrackInterface* track) { |
// SetVideoSend |
// to be combined into one atomic operation, all the way down to |
// WebRtcVideoSendStream. |
- provider_->SetCaptureDevice(ssrc_, |
- source ? source->GetVideoCapturer() : nullptr); |
+ provider_->SetSource(ssrc_, |
+ source ? source->GetVideoCapturer() : nullptr); |
SetVideoSend(); |
} else if (prev_can_send_track) { |
- provider_->SetCaptureDevice(ssrc_, nullptr); |
+ provider_->SetSource(ssrc_, nullptr); |
provider_->SetVideoSend(ssrc_, false, nullptr); |
} |
return true; |
@@ -291,14 +294,14 @@ 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()) { |
VideoSourceInterface* source = track_->GetSource(); |
- provider_->SetCaptureDevice(ssrc_, |
- source ? source->GetVideoCapturer() : nullptr); |
+ provider_->SetSource(ssrc_, |
+ source ? source->GetVideoCapturer() : nullptr); |
SetVideoSend(); |
} |
} |
@@ -312,7 +315,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; |