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

Issue 12090109: Tab Capture: Backing store readbacks to YV12 VideoFrames. (Closed)

Created:
7 years, 10 months ago by ncarter (slow)
Modified:
7 years, 10 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, jam, penghuang+watch_chromium.org, sail+watch_chromium.org, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, James Su, Alpha Left Google
Visibility:
Public.

Description

Tab Capture: Backing store readbacks to YV12 VideoFrames. Goal here is performance; in tab capture there are significant benefits to doing the readback as YV12: it's less data to copy back, and it's cheap to do on the GPU. VideoFrame is used because it's the most capable YV12 container. [render_widget_host.h] Add a new flavor of CopyFromBackingStore, called CopyFromBackingStoreToVideoFrame. The semantics are slightly different from the RGBA copy in ways that are video-appropriate: aspect ratio is preserved via letterboxing, meaning the output is returned at the target's allocated size, no matter what (whereas CopyFromBackingStore returns whatever it wants, treating |dst_size| as a hint). Callers may only call CopyFromBackingStoreToVideoFrame after checking the result of CanCopyToVideoFrame(). Support is only on Windows now, and only while accelerated compositing is active. But the interface defined here should make it possible to implement VideoFrame readbacks on other platforms without having to touch the callers. [video_capture_controller.h] Amend the interface to allow a VideoFrame to be passed in, as an alternative to void*. The buffer-based interface was inadequate for our needs since stride was not handled. Using VideoFrame allows strides to be accomodated, and paves the way for the interface to pre-reserve the VideoFrames. [web_contents_video_capture_device.cc] Start using CopyFromBackingStoreToVideoFrame. Handling both copy flavors requires a bifurcation of much of the processing pipeline. When dealing with a VideoFrame, the Render stage can is bypassed completely. [accelerated_surface_win.h] Implementation of VideoFrame YV12 readback, using AcceleratedSurfaceTransformer's d3d-accelerated routines. BUG=161537 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=181785

Patch Set 1 #

Patch Set 2 : Pass CopyMachine to BackingStoreCopier. #

Patch Set 3 : More self-review changes. #

Patch Set 4 : Document more things. #

Patch Set 5 : Clean up unrelated diffs. #

Patch Set 6 : Rebase #

Patch Set 7 : Merge. #

Patch Set 8 : Fix media_unittests #

Patch Set 9 : render_widget_host_view_guest fix #

Patch Set 10 : ] #

Patch Set 11 : Use media::CopyXPlane and fix surface_gpu_tests #

Patch Set 12 : Patch for review. #

Total comments: 10

Patch Set 13 : Fixes suggested by wjia #

Total comments: 2

Patch Set 14 : Trim some trailing whitespace. #

Total comments: 63

Patch Set 15 : Address most of Andrew's fixes, except VideoFrame* #

Patch Set 16 : More fixes from Andrew, still no VideoFrame* #

Patch Set 17 : Amend interface to make VideoFrame caller-allocated, use scoped_refptr<T>&'s #

Patch Set 18 : Self-review fixes. #

Patch Set 19 : Fix a verb tense parallelism problem in a comment. #

Total comments: 3

Patch Set 20 : USE_AURA ifdefs for win7_aura, scherkus nits. #

Total comments: 1

Patch Set 21 : Revert RenderWidgetHost changes; instead put the interface on RWHVP directly #

Patch Set 22 : Self-review fixes. unit test not solved yet. #

Patch Set 23 : Sync with r181584 #

Patch Set 24 : Fixed bugs from testing. #

Patch Set 25 : Fix merge conflict on rwhv_mac #

Patch Set 26 : Style fix per wjia #

Unified diffs Side-by-side diffs Delta from patch set Stats (+922 lines, -235 lines) Patch
M content/browser/renderer_host/media/video_capture_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +13 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +117 lines, -17 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/web_contents_video_capture_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 18 chunks +321 lines, -152 lines 0 comments Download
M content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +52 lines, -9 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_guest.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_guest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +25 lines, -5 lines 0 comments Download
M content/browser/renderer_host/test_render_view_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/test_render_view_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +15 lines, -2 lines 0 comments Download
M content/port/browser/render_widget_host_view_port.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +25 lines, -2 lines 0 comments Download
M media/base/video_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +5 lines, -0 lines 0 comments Download
M media/base/video_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -2 lines 0 comments Download
M media/video/capture/mac/video_capture_device_qtkit_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 0 comments Download
M media/video/capture/screen/screen_capture_device_unittest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M media/video/capture/video_capture_device.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +19 lines, -11 lines 0 comments Download
M media/video/capture/video_capture_device_unittest.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M ui/surface/accelerated_surface_transformer_win.h View 1 chunk +2 lines, -1 line 0 comments Download
M ui/surface/accelerated_surface_transformer_win.cc View 3 chunks +16 lines, -11 lines 0 comments Download
M ui/surface/accelerated_surface_transformer_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M ui/surface/accelerated_surface_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +28 lines, -8 lines 0 comments Download
M ui/surface/accelerated_surface_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +170 lines, -12 lines 0 comments Download
M ui/surface/surface.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
ncarter (slow)
+brettw for changes to render_widget_host interface +wjia for media/video/capture +apatrick for ui/surface +scherkus for web_contents_video_capture_device
7 years, 10 months ago (2013-02-03 20:26:45 UTC) #1
apatrick_chromium
ui/surface LGTM https://codereview.chromium.org/12090109/diff/14008/ui/surface/accelerated_surface_win.cc File ui/surface/accelerated_surface_win.cc (right): https://codereview.chromium.org/12090109/diff/14008/ui/surface/accelerated_surface_win.cc#newcode61 ui/surface/accelerated_surface_win.cc:61: void (*copier)(const uint8* source, Any reason not ...
7 years, 10 months ago (2013-02-04 19:16:42 UTC) #2
ncarter (slow)
https://codereview.chromium.org/12090109/diff/14008/ui/surface/accelerated_surface_win.cc File ui/surface/accelerated_surface_win.cc (right): https://codereview.chromium.org/12090109/diff/14008/ui/surface/accelerated_surface_win.cc#newcode61 ui/surface/accelerated_surface_win.cc:61: void (*copier)(const uint8* source, On 2013/02/04 19:16:43, apatrick_chromium wrote: ...
7 years, 10 months ago (2013-02-04 19:38:04 UTC) #3
apatrick_chromium
https://codereview.chromium.org/12090109/diff/14008/ui/surface/accelerated_surface_win.cc File ui/surface/accelerated_surface_win.cc (right): https://codereview.chromium.org/12090109/diff/14008/ui/surface/accelerated_surface_win.cc#newcode61 ui/surface/accelerated_surface_win.cc:61: void (*copier)(const uint8* source, Fair enough. I would have ...
7 years, 10 months ago (2013-02-04 19:58:57 UTC) #4
wjia(left Chromium)
Thanks for refactoring OnIncomingCapturedFrame()! We need support non-compact frame buffers. https://codereview.chromium.org/12090109/diff/14008/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/12090109/diff/14008/content/browser/renderer_host/media/video_capture_controller.cc#newcode391 ...
7 years, 10 months ago (2013-02-04 23:48:40 UTC) #5
ncarter (slow)
https://codereview.chromium.org/12090109/diff/14008/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/12090109/diff/14008/content/browser/renderer_host/media/video_capture_controller.cc#newcode391 content/browser/renderer_host/media/video_capture_controller.cc:391: media::VideoFrame::YV12, // Actually I420, but it's equivalent here. On ...
7 years, 10 months ago (2013-02-05 17:36:07 UTC) #6
scherkus (not reviewing)
https://codereview.chromium.org/12090109/diff/35001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/12090109/diff/35001/content/browser/renderer_host/media/video_capture_controller.cc#newcode275 content/browser/renderer_host/media/video_capture_controller.cc:275: CHECK(dib->created_size() >= static_cast<size_t>(frame_info_.width * nit: CHECK_GE()? https://codereview.chromium.org/12090109/diff/35001/content/browser/renderer_host/media/video_capture_controller.cc#newcode390 content/browser/renderer_host/media/video_capture_controller.cc:390: return; ...
7 years, 10 months ago (2013-02-05 22:40:44 UTC) #7
ncarter (slow)
Fixed everything except the use of raw VideoFrame* pointers, which I discuss in the comments ...
7 years, 10 months ago (2013-02-06 23:54:44 UTC) #8
ncarter (slow)
https://codereview.chromium.org/12090109/diff/14008/ui/surface/accelerated_surface_win.cc File ui/surface/accelerated_surface_win.cc (right): https://codereview.chromium.org/12090109/diff/14008/ui/surface/accelerated_surface_win.cc#newcode61 ui/surface/accelerated_surface_win.cc:61: void (*copier)(const uint8* source, On 2013/02/04 19:58:58, apatrick_chromium wrote: ...
7 years, 10 months ago (2013-02-07 00:00:12 UTC) #9
ncarter (slow)
scherkus, wjia: Please take another look.
7 years, 10 months ago (2013-02-07 13:07:07 UTC) #10
scherkus (not reviewing)
LGTM w/ some nits + replies'n'stuff https://codereview.chromium.org/12090109/diff/35001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/12090109/diff/35001/content/browser/renderer_host/media/video_capture_controller.h#newcode97 content/browser/renderer_host/media/video_capture_controller.h:97: // Helpers. On ...
7 years, 10 months ago (2013-02-07 18:25:03 UTC) #11
ncarter (slow)
brettw: This is ready for your attention ( content/ OWNERS )
7 years, 10 months ago (2013-02-07 18:54:50 UTC) #12
brettw
When I discussed this with John he pointed out that we do not need to ...
7 years, 10 months ago (2013-02-08 21:44:51 UTC) #13
ncarter (slow)
On 2013/02/08 21:44:51, brettw wrote: > When I discussed this with John he pointed out ...
7 years, 10 months ago (2013-02-08 22:23:35 UTC) #14
brettw
If it can be done in a reasonable way without ifdefs, that sounds preferrable.
7 years, 10 months ago (2013-02-08 22:28:39 UTC) #15
ncarter (slow)
PTAL. https://codereview.chromium.org/12090109/diff/39088/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/12090109/diff/39088/content/browser/renderer_host/media/video_capture_controller.cc#newcode448 content/browser/renderer_host/media/video_capture_controller.cc:448: default: On 2013/02/07 18:25:03, scherkus wrote: > you ...
7 years, 10 months ago (2013-02-09 06:17:54 UTC) #16
wjia(left Chromium)
lgtm with nit. https://codereview.chromium.org/12090109/diff/32001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/12090109/diff/32001/content/browser/renderer_host/media/video_capture_controller.h#newcode69 content/browser/renderer_host/media/video_capture_controller.h:69: base::Time timestamp) OVERRIDE; nit: For function ...
7 years, 10 months ago (2013-02-10 06:55:06 UTC) #17
ncarter (slow)
https://codereview.chromium.org/12090109/diff/32001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/12090109/diff/32001/content/browser/renderer_host/media/video_capture_controller.h#newcode69 content/browser/renderer_host/media/video_capture_controller.h:69: base::Time timestamp) OVERRIDE; On 2013/02/10 06:55:06, wjia wrote: > ...
7 years, 10 months ago (2013-02-11 02:12:42 UTC) #18
ncarter (slow)
Waiting on brettw.
7 years, 10 months ago (2013-02-11 19:43:46 UTC) #19
brettw
LGTM. This is only for high-level content integration; I didn't look at the details.
7 years, 10 months ago (2013-02-11 20:50:51 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nick@chromium.org/12090109/34057
7 years, 10 months ago (2013-02-11 20:53:44 UTC) #21
commit-bot: I haz the power
7 years, 10 months ago (2013-02-11 23:06:29 UTC) #22
Message was sent while issue was closed.
Change committed as 181785

Powered by Google App Engine
This is Rietveld 408576698