Index: webrtc/media/base/videocapturer.cc |
diff --git a/webrtc/media/base/videocapturer.cc b/webrtc/media/base/videocapturer.cc |
index df78ed469554c6a006bcee27083a9d530c3857fa..36a5579580bb995680ed567ac65e6722ff37f4b2 100644 |
--- a/webrtc/media/base/videocapturer.cc |
+++ b/webrtc/media/base/videocapturer.cc |
@@ -226,16 +226,6 @@ bool VideoCapturer::MuteToBlackThenPause(bool muted) { |
return Pause(false); |
} |
-// Note that the last caller decides whether rotation should be applied if there |
-// are multiple send streams using the same camera. |
-bool VideoCapturer::SetApplyRotation(bool enable) { |
- apply_rotation_ = enable; |
- if (frame_factory_) { |
- frame_factory_->SetApplyRotation(apply_rotation_); |
- } |
- return true; |
-} |
- |
void VideoCapturer::SetSupportedFormats( |
const std::vector<VideoFormat>& formats) { |
supported_formats_ = formats; |
@@ -323,6 +313,25 @@ void VideoCapturer::GetStats(VariableInfo<int>* adapt_drops_stats, |
frame_time_data_.Reset(); |
} |
+void VideoCapturer::RemoveSink( |
+ rtc::VideoSinkInterface<cricket::VideoFrame>* sink) { |
+ broadcaster_.RemoveSink(sink); |
+} |
+ |
+void VideoCapturer::AddOrUpdateSink( |
+ rtc::VideoSinkInterface<cricket::VideoFrame>* sink, |
+ const rtc::VideoSinkWants& wants) { |
+ broadcaster_.AddOrUpdateSink(sink, wants); |
+ OnSinkWantsChanged(broadcaster_.wants()); |
+} |
+ |
+void VideoCapturer::OnSinkWantsChanged(const rtc::VideoSinkWants& wants) { |
+ apply_rotation_ = wants.rotation_applied; |
+ if (frame_factory_) { |
+ frame_factory_->SetApplyRotation(apply_rotation_); |
+ } |
+} |
+ |
void VideoCapturer::OnFrameCaptured(VideoCapturer*, |
const CapturedFrame* captured_frame) { |
if (muted_) { |
@@ -333,7 +342,7 @@ void VideoCapturer::OnFrameCaptured(VideoCapturer*, |
} |
} |
- if (SignalVideoFrame.is_empty()) { |
+ if (!broadcaster_.frame_wanted()) { |
return; |
} |
@@ -516,8 +525,7 @@ void VideoCapturer::OnFrameCaptured(VideoCapturer*, |
// TODO(pthatcher): Use frame_factory_->CreateBlackFrame() instead. |
adapted_frame->SetToBlack(); |
} |
- SignalVideoFrame(this, adapted_frame.get()); |
- |
+ broadcaster_.OnFrame(*adapted_frame.get()); |
UpdateStats(captured_frame); |
} |