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

Issue 850993002: gpu video: optimize HW video to SW canvas and implement it for WebRTC. (Closed)

Created:
5 years, 11 months ago by dshwang
Modified:
5 years, 10 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, mcasas+watch_chromium.org, yusukes+watch_chromium.org, nona+watch_chromium.org, posciak+watch_chromium.org, jam, penghuang+watch_chromium.org, yukishiino+watch_chromium.org, sievers+watch_chromium.org, jbauman+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, kalyank, mkwst+moarreviews-renderer_chromium.org, piman+watch_chromium.org, cc-bugs_chromium.org, James Su, wjia+watch_chromium.org, danakj+watch_chromium.org, miu+watch_chromium.org, DaleCurtis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

gpu video: optimize HW video to SW canvas and implement it for WebRTC. Currently, very complicated callback mechanism is used to copy HW video to SW canvas in SkCanvasVideoRenderer. When Blink thread needs to readback HW video, the readback callback of VideoFrame is called, and then readback is executed in the media thread using gl context belonging to gpu decoder. It has two bad points: 1. Blink thread is blocked until the media thread gets readback done. 2. It's not implemented yet for WebRTC HW Video to be drawn on SW Canvas. In detail for #2, VideoCaptureImpl creates a texture VideoFrame using the mailbox made in browser process. VideoCaptureImpl doesn't use any gl context so the readback callback is not implemented. Now the callback is removed. This CL implements drawing HW Video on SW SkCanvas in SkCanvasVideoRenderer, so two bad points are resolved. 1. SkCanvasVideoRenderer draws HW Video on SW SkCanvas in Blink thread without interaction with the media thread. 2. WebRTC impl (i.e. VideoCaptureImpl) doesn't need to do anything because SkCanvasVideoRenderer has all logic to draw HW Video on SW SkCanvas. TEST=blink layout test virtual/gpu/fast/canvas/yuv-video-on-accelerated-canvas.html BUG=401058 Committed: https://crrev.com/16e17206be4635966d3ee5a4bf28bcce9cde5d3f Cr-Commit-Position: refs/heads/master@{#315819}

Patch Set 1 #

Total comments: 6

Patch Set 2 : fix android build #

Total comments: 8

Patch Set 3 : address nits #

Total comments: 3

Patch Set 4 : rebase to ToT and add comment in cc/ #

Patch Set 5 : fix android build fail #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -219 lines) Patch
M cc/resources/video_resource_updater.cc View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M cc/trees/layer_tree_host_unittest_context.cc View 1 2 3 1 chunk +2 lines, -4 lines 0 comments Download
M content/browser/media/capture/desktop_capture_device_aura.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_unittest.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_browsertest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/android/webmediaplayer_android.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/media/renderer_gpu_video_accelerator_factories.h View 1 chunk +0 lines, -3 lines 0 comments Download
M content/renderer/media/renderer_gpu_video_accelerator_factories.cc View 1 2 3 2 chunks +0 lines, -50 lines 0 comments Download
M content/renderer/media/rtc_video_decoder.cc View 1 2 3 2 chunks +0 lines, -28 lines 0 comments Download
M content/renderer/media/video_capture_impl.cc View 1 2 3 2 chunks +1 line, -4 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms.cc View 1 2 3 4 chunks +19 lines, -5 lines 0 comments Download
M media/base/video_frame.h View 1 2 3 4 chunks +0 lines, -15 lines 0 comments Download
M media/base/video_frame.cc View 1 2 3 3 chunks +0 lines, -14 lines 0 comments Download
M media/base/video_frame_unittest.cc View 1 2 3 2 chunks +0 lines, -2 lines 0 comments Download
M media/filters/gpu_video_accelerator_factories.h View 2 chunks +0 lines, -8 lines 0 comments Download
M media/filters/gpu_video_decoder.cc View 1 2 3 3 chunks +0 lines, -29 lines 0 comments Download
M media/filters/mock_gpu_video_accelerator_factories.h View 2 chunks +0 lines, -5 lines 0 comments Download
M media/filters/skcanvas_video_renderer.h View 1 2 3 2 chunks +7 lines, -3 lines 0 comments Download
M media/filters/skcanvas_video_renderer.cc View 1 2 3 5 chunks +48 lines, -41 lines 0 comments Download
M media/filters/skcanvas_video_renderer_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 32 (9 generated)
dshwang
Could you review this a bit huge refactory? This CL removes lots of code. https://codereview.chromium.org/850993002/diff/1/content/renderer/media/rtc_video_decoder.cc ...
5 years, 11 months ago (2015-01-14 20:32:14 UTC) #2
dshwang
https://codereview.chromium.org/850993002/diff/1/content/renderer/media/webmediaplayer_ms.cc File content/renderer/media/webmediaplayer_ms.cc (right): https://codereview.chromium.org/850993002/diff/1/content/renderer/media/webmediaplayer_ms.cc#newcode75 content/renderer/media/webmediaplayer_ms.cc:75: bitmap.eraseColor(SK_ColorTRANSPARENT); This CL removes VideoFrame::ReadPixelsFromNativeTexture. In addition, reusing SkCanvasVideoRenderer::Copy ...
5 years, 11 months ago (2015-01-14 20:41:20 UTC) #4
DaleCurtis
I haven't reviewed yet, but your description only lists the bad points and not what ...
5 years, 11 months ago (2015-01-14 21:14:28 UTC) #5
dshwang
On 2015/01/14 21:14:28, DaleCurtis wrote: > I haven't reviewed yet, but your description only lists ...
5 years, 11 months ago (2015-01-14 21:46:38 UTC) #6
Justin Novosad
I am not an OWNER in these areas, but the interactions with SkCanvas look fine ...
5 years, 11 months ago (2015-01-14 22:06:00 UTC) #7
DaleCurtis
This all looks great to me, deleted code and a simplified process == \o/ I'm ...
5 years, 11 months ago (2015-01-14 22:44:01 UTC) #8
dshwang
@junov, @DaleCurtis, thx for reviewing! @scherkus, could you review media/ ? @danakj, could you review ...
5 years, 11 months ago (2015-01-15 13:44:16 UTC) #9
scherkus (not reviewing)
lgtm
5 years, 11 months ago (2015-01-15 19:19:29 UTC) #10
dshwang
On 2015/01/15 19:19:29, scherkus wrote: > lgtm thx for reviewing! @danakj, could you review cc/ ...
5 years, 11 months ago (2015-01-16 16:15:41 UTC) #11
dshwang
On 2015/01/16 16:15:41, dshwang wrote: > On 2015/01/15 19:19:29, scherkus wrote: > > lgtm > ...
5 years, 11 months ago (2015-01-19 14:44:28 UTC) #13
DaleCurtis
(moving myself to cc since scherkus gave approval!)
5 years, 11 months ago (2015-01-20 18:49:29 UTC) #15
dshwang
On 2015/01/20 18:49:29, DaleCurtis wrote: > (moving myself to cc since scherkus gave approval!) thx ...
5 years, 11 months ago (2015-01-21 13:40:32 UTC) #16
dshwang
@danakj, could you review cc/ and content/browser/renderer_host/ ?
5 years, 10 months ago (2015-02-10 08:38:45 UTC) #18
dshwang
On 2015/02/10 08:38:45, dshwang wrote: > @danakj, could you review cc/ and content/browser/renderer_host/ ? blink ...
5 years, 10 months ago (2015-02-10 08:47:45 UTC) #19
danakj
On 2015/02/10 08:38:45, dshwang wrote: > @danakj, could you review cc/ and content/browser/renderer_host/ ? LGTM
5 years, 10 months ago (2015-02-10 17:48:06 UTC) #20
danakj
https://codereview.chromium.org/850993002/diff/40001/cc/resources/video_resource_updater.cc File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/850993002/diff/40001/cc/resources/video_resource_updater.cc#newcode297 cc/resources/video_resource_updater.cc:297: video_renderer_->Copy(video_frame, &canvas, media::Context3D()); On 2015/01/21 13:40:32, dshwang wrote: > ...
5 years, 10 months ago (2015-02-10 17:48:13 UTC) #21
dshwang
@sievers, could you review content/browser/renderer_host/render_widget_host_view_browsertest.cc ? On 2015/02/10 17:48:13, danakj wrote: > https://codereview.chromium.org/850993002/diff/40001/cc/resources/video_resource_updater.cc > File ...
5 years, 10 months ago (2015-02-10 19:09:13 UTC) #22
no sievers
On 2015/02/10 19:09:13, dshwang wrote: > @sievers, could you review > content/browser/renderer_host/render_widget_host_view_browsertest.cc ? lgtm
5 years, 10 months ago (2015-02-11 01:02:53 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/850993002/60001
5 years, 10 months ago (2015-02-11 13:58:39 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/58064)
5 years, 10 months ago (2015-02-11 14:06:53 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/850993002/80001
5 years, 10 months ago (2015-02-11 18:52:37 UTC) #30
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 10 months ago (2015-02-11 20:08:15 UTC) #31
commit-bot: I haz the power
5 years, 10 months ago (2015-02-11 20:09:03 UTC) #32
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/16e17206be4635966d3ee5a4bf28bcce9cde5d3f
Cr-Commit-Position: refs/heads/master@{#315819}

Powered by Google App Engine
This is Rietveld 408576698