Index: talk/media/webrtc/webrtcvideocapturer.cc |
diff --git a/talk/media/webrtc/webrtcvideocapturer.cc b/talk/media/webrtc/webrtcvideocapturer.cc |
index ee4db5b1d264208d2a7ed5d103242ceae742c3d2..1ee3d4e3e7c7174111217df73128c7d47b68ef52 100644 |
--- a/talk/media/webrtc/webrtcvideocapturer.cc |
+++ b/talk/media/webrtc/webrtcvideocapturer.cc |
@@ -220,9 +220,6 @@ bool WebRtcVideoCapturer::Init(const Device& device) { |
SetId(device.id); |
SetSupportedFormats(supported); |
- // Ensure these 2 have the same value. |
- SetApplyRotation(module_->GetApplyRotation()); |
- |
return true; |
} |
@@ -260,7 +257,8 @@ bool WebRtcVideoCapturer::GetBestCaptureFormat(const VideoFormat& desired, |
} |
return true; |
} |
-bool WebRtcVideoCapturer::SetApplyRotation(bool enable) { |
+void WebRtcVideoCapturer::OnSinkCapabilitiesChanged( |
+ const rtc::VideoSinkCapabilities& capabilities) { |
// 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. |
@@ -270,13 +268,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::OnSinkCapabilitiesChanged(capabilities); |
+ bool result = module_->SetApplyRotation(!capabilities.can_apply_rotation); |
+ RTC_CHECK(result); |
+ |
+ return; |
} |
CaptureState WebRtcVideoCapturer::Start(const VideoFormat& capture_format) { |