| Index: webrtc/media/engine/webrtcvideocapturer.cc
|
| diff --git a/webrtc/media/engine/webrtcvideocapturer.cc b/webrtc/media/engine/webrtcvideocapturer.cc
|
| index 6dc5a1185969d1ba1f5af67d97f29ca7a2edb569..114556411c63870ddccfdd90df42938e21a2c956 100644
|
| --- a/webrtc/media/engine/webrtcvideocapturer.cc
|
| +++ b/webrtc/media/engine/webrtcvideocapturer.cc
|
| @@ -14,7 +14,6 @@
|
| #include <config.h>
|
| #endif
|
|
|
| -#ifdef HAVE_WEBRTC_VIDEO
|
| #include "webrtc/base/arraysize.h"
|
| #include "webrtc/base/bind.h"
|
| #include "webrtc/base/checks.h"
|
| @@ -203,9 +202,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 +239,7 @@ bool WebRtcVideoCapturer::GetBestCaptureFormat(const VideoFormat& desired,
|
| }
|
| return true;
|
| }
|
| -bool WebRtcVideoCapturer::SetApplyRotation(bool enable) {
|
| +void WebRtcVideoCapturer::OnSinkWantsChanged(const rtc::VideoSinkWants& wants) {
|
| // 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 +249,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::OnSinkWantsChanged(wants);
|
| + bool result = module_->SetApplyRotation(wants.rotation_applied);
|
| + RTC_CHECK(result);
|
| +
|
| + return;
|
| }
|
|
|
| CaptureState WebRtcVideoCapturer::Start(const VideoFormat& capture_format) {
|
| @@ -427,5 +424,3 @@ WebRtcCapturedFrame::WebRtcCapturedFrame(const webrtc::VideoFrame& sample,
|
| }
|
|
|
| } // namespace cricket
|
| -
|
| -#endif // HAVE_WEBRTC_VIDEO
|
|
|