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

Issue 2202443002: [WebRTC] Add ScreenCapturerDifferWrapper to share Differ across ScreenCapturers (Closed)

Created:
4 years, 4 months ago by Hzj_jie
Modified:
4 years, 3 months ago
Reviewers:
Sergey Ulanov, Jamie
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, Jamie
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

An early analysis shows in DirectX based capturer, Windows API returns larger dirty region than the real screen change. A similar behavior may happen on other platforms with damage notification support. So it's better to have an individual layer to handle the Differ logic, and remove capturing independent logic out of each ScreenCapturer* implementation. So this change does following things, 1. Update differ_block to handle variable height. differ_block_sse2 has been renamed to differ_vector_sse2. 2. A new ScreenCapturerDifferWrapper implementation to help set DesktopFrame::updated_region(). It uses an underlying ScreenCapturer to do the real capture work, and updates the updated region of DesktopFrame returned from OnCaptureResult function. 3. FakeDesktopCapturer and FakeScreenCapturer to generate controllable DesktopFrame by using DesktopFrameGenerator and DesktopFramePainter. 4. Test ScreenCapturerDifferWrapper by using FakeScreenCapturer. After this change, we can eventually remove all Differ logic from ScreenCapturer* implementations, and fix a potential crash bug in ScreenCapturerLinux class. It wrongly assumes previous_frame() has a same size as current_frame(). https://goo.gl/3nSqOC BUG=633802 TBR=kjellander@webrtc.org Committed: https://crrev.com/fef8653c5adcd7c5b7fc2c49ae1a0f6927ddb37f Cr-Commit-Position: refs/heads/master@{#14076}

Patch Set 1 #

Total comments: 48

Patch Set 2 : Resolve review comments #

Patch Set 3 : Move Differ logic into ScreenCapturerDifferWrapper #

Patch Set 4 : Disable perf test without SSE2 #

Total comments: 28

Patch Set 5 : Resolve review comments #

Patch Set 6 : Resolve review comments #

Total comments: 22

Patch Set 7 : Resolve review comments #

Patch Set 8 : Sync latest changes #

Total comments: 20

Patch Set 9 : Resolve review comments #

Total comments: 4

Patch Set 10 : Resolve review comments #

Patch Set 11 : Sync latest changes #

Patch Set 12 : Sync latest changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1242 lines, -179 lines) Patch
M webrtc/modules/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
M webrtc/modules/desktop_capture/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -2 lines 0 comments Download
M webrtc/modules/desktop_capture/desktop_capture.gypi View 1 2 3 4 5 6 7 3 chunks +4 lines, -3 lines 0 comments Download
A webrtc/modules/desktop_capture/desktop_frame_generator.h View 1 2 3 4 5 6 1 chunk +121 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/desktop_frame_generator.cc View 1 2 3 4 5 6 1 chunk +179 lines, -0 lines 0 comments Download
M webrtc/modules/desktop_capture/desktop_geometry.h View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M webrtc/modules/desktop_capture/desktop_geometry.cc View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M webrtc/modules/desktop_capture/differ_block.h View 1 2 3 4 5 1 chunk +11 lines, -0 lines 0 comments Download
M webrtc/modules/desktop_capture/differ_block.cc View 1 2 3 4 5 6 1 chunk +31 lines, -21 lines 0 comments Download
D webrtc/modules/desktop_capture/differ_block_sse2.h View 1 2 3 4 5 1 chunk +0 lines, -33 lines 0 comments Download
D webrtc/modules/desktop_capture/differ_block_sse2.cc View 1 2 3 4 5 1 chunk +0 lines, -120 lines 0 comments Download
A webrtc/modules/desktop_capture/differ_vector_sse2.h View 1 2 3 4 5 6 1 chunk +31 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/differ_vector_sse2.cc View 1 2 3 4 5 1 chunk +102 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/fake_desktop_capturer.h View 1 2 3 4 5 6 1 chunk +95 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/fake_screen_capturer.h View 1 2 3 4 1 chunk +35 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/fake_screen_capturer.cc View 1 2 3 4 5 6 7 8 1 chunk +34 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h View 1 2 3 4 5 6 1 chunk +58 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc View 1 2 3 4 5 6 7 8 9 1 chunk +214 lines, -0 lines 0 comments Download
A webrtc/modules/desktop_capture/screen_capturer_differ_wrapper_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +291 lines, -0 lines 0 comments Download
M webrtc/modules/modules.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 64 (33 generated)
Hzj_jie
4 years, 4 months ago (2016-08-03 01:13:14 UTC) #9
Sergey Ulanov
https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.h File webrtc/modules/desktop_capture/differ.h (right): https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.h#newcode31 webrtc/modules/desktop_capture/differ.h:31: class Differ { I would prefer cleaning up this ...
4 years, 4 months ago (2016-08-03 23:19:12 UTC) #17
Jamie
https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.cc File webrtc/modules/desktop_capture/differ.cc (right): https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.cc#newcode40 webrtc/modules/desktop_capture/differ.cc:40: DesktopRegion* region) { Maybe just call through to CalcDirtyRegionWithHints() ...
4 years, 4 months ago (2016-08-03 23:52:26 UTC) #19
Hzj_jie
https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.cc File webrtc/modules/desktop_capture/differ.cc (right): https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.cc#newcode40 webrtc/modules/desktop_capture/differ.cc:40: DesktopRegion* region) { On 2016/08/03 23:52:25, Jamie wrote: > ...
4 years, 4 months ago (2016-08-04 02:28:08 UTC) #21
Hzj_jie
https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h File webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h (right): https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h#newcode28 webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h:28: : public ScreenCapturer, public DesktopCapturer::Callback { On 2016/08/04 02:28:07, ...
4 years, 4 months ago (2016-08-04 03:28:43 UTC) #22
Sergey Ulanov
On 2016/08/04 03:28:43, Hzj_jie wrote: > https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h > File webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h (right): > > https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h#newcode28 > ...
4 years, 4 months ago (2016-08-08 18:26:57 UTC) #23
Sergey Ulanov
https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.h File webrtc/modules/desktop_capture/differ.h (right): https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.h#newcode31 webrtc/modules/desktop_capture/differ.h:31: class Differ { On 2016/08/04 02:28:07, Hzj_jie wrote: > ...
4 years, 4 months ago (2016-08-08 18:42:42 UTC) #24
Hzj_jie
On 2016/08/08 18:26:57, Sergey Ulanov wrote: > On 2016/08/04 03:28:43, Hzj_jie wrote: > > > ...
4 years, 4 months ago (2016-08-08 18:55:22 UTC) #25
Hzj_jie
On 2016/08/08 18:42:42, Sergey Ulanov wrote: > https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.h > File webrtc/modules/desktop_capture/differ.h (right): > > https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/differ.h#newcode31 ...
4 years, 4 months ago (2016-08-08 18:55:58 UTC) #26
Hzj_jie
I have moved Differ logic into ScreenCapturerDifferWrapper class. And I added several performance tests, but ...
4 years, 4 months ago (2016-08-10 22:49:02 UTC) #28
Sergey Ulanov
https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h File webrtc/modules/desktop_capture/screen_capturer_mock_objects.h (right): https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h#newcode26 webrtc/modules/desktop_capture/screen_capturer_mock_objects.h:26: class MockScreenCapturer : public ScreenCapturer { On 2016/08/04 02:28:07, ...
4 years, 4 months ago (2016-08-12 05:25:51 UTC) #29
Hzj_jie
https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h File webrtc/modules/desktop_capture/screen_capturer_mock_objects.h (right): https://codereview.chromium.org/2202443002/diff/80001/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h#newcode26 webrtc/modules/desktop_capture/screen_capturer_mock_objects.h:26: class MockScreenCapturer : public ScreenCapturer { On 2016/08/12 05:25:50, ...
4 years, 4 months ago (2016-08-15 00:38:06 UTC) #31
Sergey Ulanov
https://codereview.chromium.org/2202443002/diff/180001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc File webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc (right): https://codereview.chromium.org/2202443002/diff/180001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc#newcode33 webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc:33: int stride, On 2016/08/15 00:38:06, Hzj_jie wrote: > On ...
4 years, 4 months ago (2016-08-15 22:04:50 UTC) #32
Hzj_jie
https://codereview.chromium.org/2202443002/diff/180001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc File webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc (right): https://codereview.chromium.org/2202443002/diff/180001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc#newcode33 webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc:33: int stride, On 2016/08/15 22:04:50, Sergey Ulanov wrote: > ...
4 years, 4 months ago (2016-08-16 07:10:04 UTC) #33
Sergey Ulanov
https://codereview.chromium.org/2202443002/diff/240001/webrtc/modules/desktop_capture/desktop_frame_generator.cc File webrtc/modules/desktop_capture/desktop_frame_generator.cc (right): https://codereview.chromium.org/2202443002/diff/240001/webrtc/modules/desktop_capture/desktop_frame_generator.cc#newcode46 webrtc/modules/desktop_capture/desktop_frame_generator.cc:46: rect.bottom() + random.Rand(enlarge_range)); There are several other places where ...
4 years, 4 months ago (2016-08-18 05:07:58 UTC) #34
Hzj_jie
Hi, Sergey, I will be OOO on Thursday and Friday. I have replied one of ...
4 years, 4 months ago (2016-08-18 08:50:31 UTC) #35
Sergey Ulanov
On 2016/08/18 08:50:31, Hzj_jie wrote: > Hi, Sergey, I will be OOO on Thursday and ...
4 years, 4 months ago (2016-08-20 04:48:13 UTC) #36
Hzj_jie
On 2016/08/20 04:48:13, Sergey Ulanov wrote: > On 2016/08/18 08:50:31, Hzj_jie wrote: > > Hi, ...
4 years, 4 months ago (2016-08-22 17:59:47 UTC) #37
Hzj_jie
Hi, Jamie, would you mind to have a look at this change during Sergey's absence? ...
4 years, 4 months ago (2016-08-23 00:54:59 UTC) #39
Hzj_jie
https://codereview.chromium.org/2202443002/diff/240001/webrtc/modules/desktop_capture/desktop_frame_generator.cc File webrtc/modules/desktop_capture/desktop_frame_generator.cc (right): https://codereview.chromium.org/2202443002/diff/240001/webrtc/modules/desktop_capture/desktop_frame_generator.cc#newcode75 webrtc/modules/desktop_capture/desktop_frame_generator.cc:75: memcpy(&frame->data()[row + column], &color, sizeof(color)); On 2016/08/23 00:54:58, Hzj_jie ...
4 years, 3 months ago (2016-08-25 18:20:12 UTC) #40
Sergey Ulanov
https://codereview.chromium.org/2202443002/diff/240001/webrtc/modules/desktop_capture/desktop_frame_generator.cc File webrtc/modules/desktop_capture/desktop_frame_generator.cc (right): https://codereview.chromium.org/2202443002/diff/240001/webrtc/modules/desktop_capture/desktop_frame_generator.cc#newcode75 webrtc/modules/desktop_capture/desktop_frame_generator.cc:75: memcpy(&frame->data()[row + column], &color, sizeof(color)); On 2016/08/25 18:20:12, Hzj_jie ...
4 years, 3 months ago (2016-09-01 19:27:56 UTC) #43
Hzj_jie
https://codereview.chromium.org/2202443002/diff/240001/webrtc/modules/desktop_capture/desktop_frame_generator.cc File webrtc/modules/desktop_capture/desktop_frame_generator.cc (right): https://codereview.chromium.org/2202443002/diff/240001/webrtc/modules/desktop_capture/desktop_frame_generator.cc#newcode75 webrtc/modules/desktop_capture/desktop_frame_generator.cc:75: memcpy(&frame->data()[row + column], &color, sizeof(color)); On 2016/09/01 19:27:56, Sergey ...
4 years, 3 months ago (2016-09-01 23:26:43 UTC) #45
Sergey Ulanov
LGTM when my comments are addressed https://codereview.chromium.org/2202443002/diff/320001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc File webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc (right): https://codereview.chromium.org/2202443002/diff/320001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc#newcode56 webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc:56: const int last_block_width, ...
4 years, 3 months ago (2016-09-02 19:23:03 UTC) #46
Hzj_jie
https://codereview.chromium.org/2202443002/diff/320001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc File webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc (right): https://codereview.chromium.org/2202443002/diff/320001/webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc#newcode56 webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.cc:56: const int last_block_width, On 2016/09/02 19:23:03, Sergey Ulanov wrote: ...
4 years, 3 months ago (2016-09-02 21:46:30 UTC) #47
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/2202443002/400001
4 years, 3 months ago (2016-09-05 21:24:36 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/8061)
4 years, 3 months ago (2016-09-05 21:27:06 UTC) #52
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/2202443002/420001
4 years, 3 months ago (2016-09-05 22:01:57 UTC) #55
commit-bot: I haz the power
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/8065)
4 years, 3 months ago (2016-09-05 22:16:27 UTC) #57
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/2202443002/420001
4 years, 3 months ago (2016-09-05 22:18:37 UTC) #60
commit-bot: I haz the power
Committed patchset #12 (id:420001)
4 years, 3 months ago (2016-09-05 22:26:37 UTC) #62
commit-bot: I haz the power
4 years, 3 months ago (2016-09-05 22:26:47 UTC) #64
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/fef8653c5adcd7c5b7fc2c49ae1a0f6927ddb37f
Cr-Commit-Position: refs/heads/master@{#14076}

Powered by Google App Engine
This is Rietveld 408576698