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

Issue 2500883004: Add DesktopFrame rotation functions (Closed)

Created:
4 years, 1 month ago by Hzj_jie
Modified:
4 years, 1 month ago
Reviewers:
Sergey Ulanov, Jamie
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Add DesktopFrame rotation functions This change adds RotateDesktopFrame(), RotateRect(), RotateSize(), ReverseRotate() functions, so an implementation can use these free functions to rotate and copy pixels from one DesktopFrame to another at the same time. This is the first part of the change to support rotation in DirectX capturer. In a coming change, these functions will be used in DxgiOutputDuplicator to do the rotation and copying. Background, DirectX APIs always return unrotated data buffer, so we need to rotate it to match the user-selected rotation. What worse is except for the data buffer, other variables return by these APIs are all rotated, e.g. output size, monitor position. So we will eventually not be able to capture the rotated monitors, because we cannot set their position and size correctly. Though DXGI_OUTDUPL_DESC provides a DXGI_MODE_ROTATION enumeration to indicate the output rotation, it does not provide a simple way to rotate an IDXGIResource, which is the only thing we can get from duplication APIs. A typical user case here is to use a matrix to transform the IDXGIResource and render it to a surface. But since we do not render the IDXGIResource at all, we need to manually rotate it. BUG=314516 Committed: https://crrev.com/90ea7362fc81db6a677d129a9161ee3d49b77ec1 Cr-Commit-Position: refs/heads/master@{#15205}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Resolve review comments #

Total comments: 32

Patch Set 3 : Resolve review comments #

Total comments: 32

Patch Set 4 : Resolve review comments #

Total comments: 10

Patch Set 5 : Resolve review comments #

Total comments: 2

Patch Set 6 : Resolve review comments #

Total comments: 6

Patch Set 7 : Resolve review comments #

Patch Set 8 : Sync latest changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+811 lines, -0 lines) Patch
M webrtc/modules/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M webrtc/modules/desktop_capture/BUILD.gn View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M webrtc/modules/desktop_capture/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/desktop_frame_rotation.h View 1 2 3 4 5 1 chunk +53 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/desktop_frame_rotation.cc View 1 2 3 4 5 1 chunk +120 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/desktop_frame_rotation_unittest.cc View 1 2 3 4 5 1 chunk +447 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/test_utils.h View 1 2 3 4 1 chunk +27 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/test_utils.cc View 1 2 3 4 5 6 1 chunk +49 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/test_utils_unittest.cc View 1 2 3 4 1 chunk +107 lines, -0 lines 0 comments Download

Messages

Total messages: 97 (77 generated)
Hzj_jie
Do not be nervous, less than 250 lines of this change are real logic change, ...
4 years, 1 month ago (2016-11-15 01:48:17 UTC) #19
Sergey Ulanov
https://codereview.webrtc.org/2500883004/diff/40001/webrtc/modules/desktop_capture/desktop_frame.h File webrtc/modules/desktop_capture/desktop_frame.h (right): https://codereview.webrtc.org/2500883004/diff/40001/webrtc/modules/desktop_capture/desktop_frame.h#newcode81 webrtc/modules/desktop_capture/desktop_frame.h:81: void Paint(DesktopVector pos, RgbaColor color); Do we really need ...
4 years, 1 month ago (2016-11-15 02:28:10 UTC) #20
Hzj_jie
https://codereview.webrtc.org/2500883004/diff/40001/webrtc/modules/desktop_capture/desktop_frame.h File webrtc/modules/desktop_capture/desktop_frame.h (right): https://codereview.webrtc.org/2500883004/diff/40001/webrtc/modules/desktop_capture/desktop_frame.h#newcode81 webrtc/modules/desktop_capture/desktop_frame.h:81: void Paint(DesktopVector pos, RgbaColor color); On 2016/11/15 02:28:10, Sergey ...
4 years, 1 month ago (2016-11-15 05:17:03 UTC) #31
Sergey Ulanov
https://codereview.webrtc.org/2500883004/diff/120001/webrtc/modules/desktop_capture/desktop_frame_rotator.cc File webrtc/modules/desktop_capture/desktop_frame_rotator.cc (right): https://codereview.webrtc.org/2500883004/diff/120001/webrtc/modules/desktop_capture/desktop_frame_rotator.cc#newcode25 webrtc/modules/desktop_capture/desktop_frame_rotator.cc:25: DesktopRect Rotate(DesktopRect rect, DesktopSize size, Rotation rotation) { Maybe ...
4 years, 1 month ago (2016-11-15 20:50:23 UTC) #35
Hzj_jie
https://codereview.webrtc.org/2500883004/diff/120001/webrtc/modules/desktop_capture/desktop_frame_rotator.cc File webrtc/modules/desktop_capture/desktop_frame_rotator.cc (right): https://codereview.webrtc.org/2500883004/diff/120001/webrtc/modules/desktop_capture/desktop_frame_rotator.cc#newcode25 webrtc/modules/desktop_capture/desktop_frame_rotator.cc:25: DesktopRect Rotate(DesktopRect rect, DesktopSize size, Rotation rotation) { On ...
4 years, 1 month ago (2016-11-16 01:18:33 UTC) #40
Sergey Ulanov
https://codereview.webrtc.org/2500883004/diff/160001/webrtc/modules/desktop_capture/desktop_frame_rotator.cc File webrtc/modules/desktop_capture/desktop_frame_rotator.cc (right): https://codereview.webrtc.org/2500883004/diff/160001/webrtc/modules/desktop_capture/desktop_frame_rotator.cc#newcode30 webrtc/modules/desktop_capture/desktop_frame_rotator.cc:30: return DesktopRect::MakeLTRB(size.height() - rect.bottom(), rect.left(), MakeXYWH() here for consistency. ...
4 years, 1 month ago (2016-11-17 02:07:39 UTC) #46
Hzj_jie
https://codereview.webrtc.org/2500883004/diff/160001/webrtc/modules/desktop_capture/desktop_frame_rotator.cc File webrtc/modules/desktop_capture/desktop_frame_rotator.cc (right): https://codereview.webrtc.org/2500883004/diff/160001/webrtc/modules/desktop_capture/desktop_frame_rotator.cc#newcode30 webrtc/modules/desktop_capture/desktop_frame_rotator.cc:30: return DesktopRect::MakeLTRB(size.height() - rect.bottom(), rect.left(), On 2016/11/17 02:07:39, Sergey ...
4 years, 1 month ago (2016-11-17 07:14:55 UTC) #51
Sergey Ulanov
https://codereview.webrtc.org/2500883004/diff/160001/webrtc/modules/desktop_capture/desktop_frame_rotator.h File webrtc/modules/desktop_capture/desktop_frame_rotator.h (right): https://codereview.webrtc.org/2500883004/diff/160001/webrtc/modules/desktop_capture/desktop_frame_rotator.h#newcode31 webrtc/modules/desktop_capture/desktop_frame_rotator.h:31: // coordinate. On 2016/11/17 07:14:55, Hzj_jie wrote: > On ...
4 years, 1 month ago (2016-11-19 02:11:40 UTC) #53
Hzj_jie
https://codereview.webrtc.org/2500883004/diff/160001/webrtc/modules/desktop_capture/desktop_frame_rotator.h File webrtc/modules/desktop_capture/desktop_frame_rotator.h (right): https://codereview.webrtc.org/2500883004/diff/160001/webrtc/modules/desktop_capture/desktop_frame_rotator.h#newcode31 webrtc/modules/desktop_capture/desktop_frame_rotator.h:31: // coordinate. On 2016/11/19 02:11:40, Sergey Ulanov wrote: > ...
4 years, 1 month ago (2016-11-19 05:10:59 UTC) #58
Sergey Ulanov
lgtm https://codereview.webrtc.org/2500883004/diff/180001/webrtc/modules/desktop_capture/desktop_frame_rotation.cc File webrtc/modules/desktop_capture/desktop_frame_rotation.cc (right): https://codereview.webrtc.org/2500883004/diff/180001/webrtc/modules/desktop_capture/desktop_frame_rotation.cc#newcode95 webrtc/modules/desktop_capture/desktop_frame_rotation.cc:95: RTC_DCHECK(DesktopRect::MakeSize(target->size()).ContainsRect(rect)); On 2016/11/19 05:10:59, Hzj_jie wrote: > On ...
4 years, 1 month ago (2016-11-21 21:01:12 UTC) #59
Hzj_jie
https://codereview.webrtc.org/2500883004/diff/180001/webrtc/modules/desktop_capture/desktop_frame_rotation.cc File webrtc/modules/desktop_capture/desktop_frame_rotation.cc (right): https://codereview.webrtc.org/2500883004/diff/180001/webrtc/modules/desktop_capture/desktop_frame_rotation.cc#newcode95 webrtc/modules/desktop_capture/desktop_frame_rotation.cc:95: RTC_DCHECK(DesktopRect::MakeSize(target->size()).ContainsRect(rect)); On 2016/11/21 21:01:12, Sergey Ulanov wrote: > On ...
4 years, 1 month ago (2016-11-21 23:33:30 UTC) #69
Sergey Ulanov
still lgtm. Couple more comments about test_utils.cc https://codereview.webrtc.org/2500883004/diff/240001/webrtc/modules/desktop_capture/test_utils.cc File webrtc/modules/desktop_capture/test_utils.cc (right): https://codereview.webrtc.org/2500883004/diff/240001/webrtc/modules/desktop_capture/test_utils.cc#newcode21 webrtc/modules/desktop_capture/test_utils.cc:21: memset(frame->data(), 0, ...
4 years, 1 month ago (2016-11-22 20:33:08 UTC) #70
Hzj_jie
https://codereview.webrtc.org/2500883004/diff/240001/webrtc/modules/desktop_capture/test_utils.cc File webrtc/modules/desktop_capture/test_utils.cc (right): https://codereview.webrtc.org/2500883004/diff/240001/webrtc/modules/desktop_capture/test_utils.cc#newcode21 webrtc/modules/desktop_capture/test_utils.cc:21: memset(frame->data(), 0, frame->stride() * frame->size().height()); On 2016/11/22 20:33:07, Sergey ...
4 years, 1 month ago (2016-11-22 21:56:02 UTC) #73
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2500883004/260001
4 years, 1 month ago (2016-11-22 23:45:15 UTC) #78
commit-bot: I haz the power
Try jobs failed on following builders: android_more_configs on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_more_configs/builds/633)
4 years, 1 month ago (2016-11-22 23:56:04 UTC) #81
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2500883004/260001
4 years, 1 month ago (2016-11-23 00:17:51 UTC) #83
commit-bot: I haz the power
Try jobs failed on following builders: android_more_configs on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_more_configs/builds/636)
4 years, 1 month ago (2016-11-23 00:20:01 UTC) #85
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2500883004/280001
4 years, 1 month ago (2016-11-23 01:12:53 UTC) #92
commit-bot: I haz the power
Committed patchset #8 (id:280001)
4 years, 1 month ago (2016-11-23 01:17:15 UTC) #95
commit-bot: I haz the power
4 years, 1 month ago (2016-11-23 01:17:23 UTC) #97
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/90ea7362fc81db6a677d129a9161ee3d49b77ec1
Cr-Commit-Position: refs/heads/master@{#15205}

Powered by Google App Engine
This is Rietveld 408576698