diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-03-12 09:13:00 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-03-16 09:58:26 +0000 |
commit | 03561cae90f1d99b5c54b1ef3be69f10e882b25e (patch) | |
tree | cc5f0958e823c044e7ae51cc0117fe51432abe5e /chromium/media/capture/video/win/video_capture_device_win.cc | |
parent | fa98118a45f7e169f8846086dc2c22c49a8ba310 (diff) | |
download | qtwebengine-chromium-03561cae90f1d99b5c54b1ef3be69f10e882b25e.tar.gz |
BASELINE: Update Chromium to 88.0.4324.208
Change-Id: I3ae87d23e4eff4b4a469685658740a213600c667
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/media/capture/video/win/video_capture_device_win.cc')
-rw-r--r-- | chromium/media/capture/video/win/video_capture_device_win.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chromium/media/capture/video/win/video_capture_device_win.cc b/chromium/media/capture/video/win/video_capture_device_win.cc index 53f44af0164..5f6d211a2f4 100644 --- a/chromium/media/capture/video/win/video_capture_device_win.cc +++ b/chromium/media/capture/video/win/video_capture_device_win.cc @@ -857,6 +857,11 @@ void VideoCaptureDeviceWin::FrameReceived(const uint8_t* buffer, if (timestamp == kNoTimestamp) timestamp = base::TimeTicks::Now() - first_ref_time_; + // We always calculate camera rotation for the first frame. We also cache the + // latest value to use when AutoRotation is turned off. + if (!camera_rotation_.has_value() || IsAutoRotationEnabled()) + camera_rotation_ = GetCameraRotation(device_descriptor_.facing); + // TODO(julien.isorce): retrieve the color space information using the // DirectShow api, AM_MEDIA_TYPE::VIDEOINFOHEADER2::dwControlFlags. If // AMCONTROL_COLORINFO_PRESENT, then reinterpret dwControlFlags as a @@ -864,8 +869,8 @@ void VideoCaptureDeviceWin::FrameReceived(const uint8_t* buffer, // DXVA_VideoTransferMatrix, DXVA_VideoTransferFunction and // DXVA_NominalRangeto build a gfx::ColorSpace. See http://crbug.com/959992. client_->OnIncomingCapturedData(buffer, length, format, gfx::ColorSpace(), - GetCameraRotation(device_descriptor_.facing), - flip_y, base::TimeTicks::Now(), timestamp); + camera_rotation_.value(), flip_y, + base::TimeTicks::Now(), timestamp); while (!take_photo_callbacks_.empty()) { TakePhotoCallback cb = std::move(take_photo_callbacks_.front()); |