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

Issue 13445009: cc: Move video upload to VideoResourceUpdater. (Closed)

Created:
7 years, 8 months ago by danakj
Modified:
7 years, 8 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, cc-bugs_chromium.org, jam, darin-cc_chromium.org, piman, backer, sheu, slavi
Visibility:
Public.

Description

cc: Move video upload to VideoResourceUpdater. The VideoLayerImpl currently does upload of video frames from media::VideoFrame to hardware/software resources, and displays these resources through quads. This code is unfriendly to ubercomp as it requires holding onto the hardware resources when using hardware decode, and because it reuses the same textures every frame even though they need to be sent to the parent compositor. This CL introduces the VideoResourceUpdater class, and moves all logic around media::VideoFrame to that class. The VideoResourceUpdater class takes as input a VideoFrame, and produces a set of TextureMailboxes for the video layer to consume. In the software case, the VideoResourceUpdater sets itself up as the release callback so it can delete the backing texture when the browser compositor is done with it (it could recycle it in the future). In the hardware case, the VideoResourceUpdater takes a callback as input, so it can have the WebMediaPlayer notified when the texture is given back from the browser, and the hardware decoder can use it again for writing. This CL also prepares us better for software uber-compositing video. The video layer deals now only with abstract "resources", except for the mailboxes for ubercompositor. The TextureMailbox construct needs to be abstracted in order to hold a hardware or software backing for ubercompositor. Then the video layer's special-case code for software can be entirely removed and it will be fully software-uber-compositor-ready. Currently, the VideoLayerImpl just makes use of the VideoResourceUpdater class, making this a refactor without any functional change. This will make video playback in ubercompositor work correctly for software-decoded video. In order to address hardware-decoded video, a followup CL will have the WebMediaPlayer hook up a callback through the VideoResourceUpdater to ensure it doesn't reuse a texture for decode until it is returned from the parent compositor. R=enne,jamesr BUG=179729 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193323

Patch Set 1 : #

Patch Set 2 : IOSurfaceQuad has a resource from VideoLayer, so also give it a resource from IOSurfaceLayer #

Patch Set 3 : Fix software compositing #

Total comments: 6

Patch Set 4 : piman comments #

Patch Set 5 : consume textures that were produced #

Unified diffs Side-by-side diffs Delta from patch set Stats (+777 lines, -544 lines) Patch
M cc/cc.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M cc/layers/io_surface_layer_impl.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M cc/layers/io_surface_layer_impl.cc View 1 4 chunks +26 lines, -8 lines 0 comments Download
M cc/layers/video_frame_provider_client_impl.cc View 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/video_layer_impl.h View 2 chunks +11 lines, -31 lines 0 comments Download
M cc/layers/video_layer_impl.cc View 1 2 10 chunks +137 lines, -308 lines 0 comments Download
M cc/output/delegating_renderer_unittest.cc View 1 2 3 1 chunk +5 lines, -5 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 3 chunks +9 lines, -9 lines 0 comments Download
M cc/quads/draw_quad_unittest.cc View 1 6 chunks +56 lines, -70 lines 0 comments Download
M cc/quads/io_surface_draw_quad.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
M cc/quads/io_surface_draw_quad.cc View 1 3 chunks +6 lines, -7 lines 0 comments Download
M cc/quads/stream_video_draw_quad.h View 2 chunks +3 lines, -3 lines 0 comments Download
M cc/quads/stream_video_draw_quad.cc View 3 chunks +6 lines, -7 lines 0 comments Download
M cc/quads/yuv_video_draw_quad.h View 2 chunks +9 lines, -9 lines 0 comments Download
M cc/quads/yuv_video_draw_quad.cc View 3 chunks +19 lines, -16 lines 0 comments Download
A cc/resources/video_resource_updater.h View 1 2 3 4 1 chunk +87 lines, -0 lines 0 comments Download
A cc/resources/video_resource_updater.cc View 1 2 3 4 1 chunk +326 lines, -0 lines 0 comments Download
M cc/test/render_pass_test_common.cc View 1 6 chunks +20 lines, -18 lines 0 comments Download
M cc/test/test_web_graphics_context_3d.h View 1 chunk +6 lines, -0 lines 0 comments Download
M cc/test/test_web_graphics_context_3d.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_delegated.cc View 1 2 3 3 chunks +8 lines, -3 lines 0 comments Download
M content/common/cc_messages.h View 1 5 chunks +5 lines, -12 lines 0 comments Download
M content/common/cc_messages_unittest.cc View 1 10 chunks +16 lines, -35 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
danakj
7 years, 8 months ago (2013-04-06 02:29:51 UTC) #1
danakj
+piman for ResourceProvider: I've made it support WeakPtr so that I can tell when it ...
7 years, 8 months ago (2013-04-06 02:31:28 UTC) #2
danakj
+skaslev FYI
7 years, 8 months ago (2013-04-06 02:44:35 UTC) #3
danakj
There's something slightly off with software-compositing in this CL, demonstrated by the layout test failures. ...
7 years, 8 months ago (2013-04-06 02:49:27 UTC) #4
danakj
Sorted out software compositing in the latest patch.
7 years, 8 months ago (2013-04-07 18:58:32 UTC) #5
piman
Some comments. https://codereview.chromium.org/13445009/diff/23001/cc/resources/resource_provider.h File cc/resources/resource_provider.h (right): https://codereview.chromium.org/13445009/diff/23001/cc/resources/resource_provider.h#newcode47 cc/resources/resource_provider.h:47: : public base::SupportsWeakPtr<ResourceProvider> { Will the VideoResourceUpdater ...
7 years, 8 months ago (2013-04-08 21:03:47 UTC) #6
danakj
https://codereview.chromium.org/13445009/diff/23001/cc/resources/resource_provider.h File cc/resources/resource_provider.h (right): https://codereview.chromium.org/13445009/diff/23001/cc/resources/resource_provider.h#newcode47 cc/resources/resource_provider.h:47: : public base::SupportsWeakPtr<ResourceProvider> { Removed this as per offline ...
7 years, 8 months ago (2013-04-08 21:44:56 UTC) #7
enne (OOO)
lgtm, now that I've had time to digest it. I have the same concerns as ...
7 years, 8 months ago (2013-04-09 20:54:34 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/13445009/27001
7 years, 8 months ago (2013-04-09 20:56:13 UTC) #9
commit-bot: I haz the power
Presubmit check for 13445009-27001 failed and returned exit status 1. INFO:root:Found 23 file(s). Running presubmit ...
7 years, 8 months ago (2013-04-09 20:56:26 UTC) #10
danakj
Ah, piman can you take a look at the content stuff, and I'll add a ...
7 years, 8 months ago (2013-04-09 20:57:52 UTC) #11
danakj
+cdn for cc_messages.h For video we're moving from passing resource id + size + format, ...
7 years, 8 months ago (2013-04-09 20:59:08 UTC) #12
Cris Neckar
lgtm on IPC changes
7 years, 8 months ago (2013-04-09 21:25:30 UTC) #13
piman
Yes, sorry, LGTM.
7 years, 8 months ago (2013-04-09 23:19:17 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/13445009/27001
7 years, 8 months ago (2013-04-09 23:20:14 UTC) #15
danakj
On Tue, Apr 9, 2013 at 4:19 PM, <piman@chromium.org> wrote: > Yes, sorry, LGTM. > ...
7 years, 8 months ago (2013-04-09 23:25:25 UTC) #16
danakj
@piman/@enne: please take a look at the last version. updated with lessons learned from recycling. ...
7 years, 8 months ago (2013-04-09 23:48:54 UTC) #17
piman
lgtm
7 years, 8 months ago (2013-04-10 00:58:44 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/13445009/62001
7 years, 8 months ago (2013-04-10 01:01:20 UTC) #19
commit-bot: I haz the power
7 years, 8 months ago (2013-04-10 04:44:50 UTC) #20
Message was sent while issue was closed.
Change committed as 193323

Powered by Google App Engine
This is Rietveld 408576698