Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Unified Diff: webrtc/media/base/videocapturer.cc

Issue 1655793003: Make cricket::VideoCapturer implement VideoSourceInterface (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added dummy capturerenderadapter.cc Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/base/videocapturer.h ('k') | webrtc/media/base/videocapturer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « webrtc/media/base/videocapturer.h ('k') | webrtc/media/base/videocapturer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698