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

Unified Diff: webrtc/media/webrtc/webrtcvideocapturer.cc

Issue 1655793003: Make cricket::VideoCapturer implement VideoSourceInterface (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments. 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
Index: webrtc/media/webrtc/webrtcvideocapturer.cc
diff --git a/webrtc/media/webrtc/webrtcvideocapturer.cc b/webrtc/media/webrtc/webrtcvideocapturer.cc
index c5eb1adadc6af0925989da019c9252112316fdb5..2a6147c87d80c646d9bd84ce3f73e41d0fc15267 100644
--- a/webrtc/media/webrtc/webrtcvideocapturer.cc
+++ b/webrtc/media/webrtc/webrtcvideocapturer.cc
@@ -203,9 +203,6 @@ bool WebRtcVideoCapturer::Init(const Device& device) {
SetId(device.id);
SetSupportedFormats(supported);
- // Ensure these 2 have the same value.
- SetApplyRotation(module_->GetApplyRotation());
-
return true;
}
@@ -243,7 +240,8 @@ bool WebRtcVideoCapturer::GetBestCaptureFormat(const VideoFormat& desired,
}
return true;
}
-bool WebRtcVideoCapturer::SetApplyRotation(bool enable) {
+void WebRtcVideoCapturer::OnSourceChangeRequested(
+ const rtc::VideoSinkHints& hints) {
// Can't take lock here as this will cause deadlock with
// OnIncomingCapturedFrame. In fact, the whole method, including methods it
// calls, can't take lock.
@@ -253,13 +251,14 @@ bool WebRtcVideoCapturer::SetApplyRotation(bool enable) {
webrtc::field_trial::FindFullName("WebRTC-CVO");
if (group_name == "Disabled") {
- return true;
+ return;
}
- if (!VideoCapturer::SetApplyRotation(enable)) {
- return false;
- }
- return module_->SetApplyRotation(enable);
+ VideoCapturer::OnSourceChangeRequested(hints);
+ bool result = module_->SetApplyRotation(!hints.can_apply_rotation);
+ RTC_CHECK(result);
+
+ return;
}
CaptureState WebRtcVideoCapturer::Start(const VideoFormat& capture_format) {

Powered by Google App Engine
This is Rietveld 408576698