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

Issue 27420004: Remove threading from RendererGpuVideoAcceleratorFactories (Closed)

Created:
7 years, 2 months ago by sheu
Modified:
6 years, 10 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, wjia+watch_chromium.org, darin-cc_chromium.org, wuchengli, scherkus (not reviewing), brettw
Base URL:
https://chromium.googlesource.com/chromium/src.git@dthread
Visibility:
Public.

Description

This change removes all the threading considerations from GpuVideoAcceleratorFactories (and its implementation, RendererGpuVideoAcceleratorFactories). Most notably, it removes Abort() and associated functions and state. And with the removal of Abort() and friends, we can also remove its Clone() interface. All of the previously abortable operations on the RGVAF (with the exception of ReadPixels()) can be made non-abortable, with no functional difference, due to the way the users of RGVAF function. These three users are WebMediaPlayerImpl/GpuVideoDecoder, RTCVideoDecoder, and RTCVideoEncoder, and they can be made non-abortable because: WebMediaPlayerImpl/GpuVideoDecoder: * Abort() is called from WebMediaPlayerImpl::Destroy(). It has no effect, as: * All the RGVAF entry points are called from the the RGVAF message loop from GpuVideoDecoder (except for ReadPixels()), so the Abort() has no effect on them. RTCVideoDecoder: * Abort() is called from RTCVideoDecoder::WillDestroyCurrentMessageLoop() for the RGVAF message loop. It has no effect, as: * Amost all the RGVAF entry points are called from the RGVAF message loop (except for ReadPixels()), so Abort() has no effect on them. * The other exception is CreateVideoDecodeAccelerator(), which is called from RTC's main thread. But as the Abort() is called from WillDestroyCurrentMessageLoop() for the RGVAF message loop itself, it is guaranteed to occur after any tasks posted to the RGVAF message loop by CreateVideoDecodeAccelerator() has completed, and so the Abort() has no effect. RTCVideoEncoder: * Abort() is called from RTCVideoDecoder::Release(). It has no effect, as: * All the RGVAF entry points are called from the RGVAF message loop. The only functional difference remaining is that making ReadPixels() non-abortable. This is preferable, as as long as a completed video accelerator texture is available, it should be readable. We also specify that all calls to ReadPixels must be made on the RGVAF message loop, like all other entry points, and leave it up to the users of ReadPixels() to handle thread trampolining if necessary. BUG=306333 TEST=local build, run on CrOS snow; build, run unittests on desktop Linux Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247480

Patch Set 1 : 51676bf4 Initial. #

Total comments: 19

Patch Set 2 : 282a294f Rebase, rework, #

Total comments: 17

Patch Set 3 : 7d21c918 Updated. #

Patch Set 4 : 2d3efbfa Rebase. #

Total comments: 4

Patch Set 5 : f77fc38a Unittest fixes. #

Total comments: 5

Patch Set 6 : d731420c Comment update, 'git cl format', rebase #

Total comments: 7

Patch Set 7 : faaba9c2 Removed BindToLoopSync #

Patch Set 8 : 82aa015b Final rebase. #

Patch Set 9 : db94efb8 Clean version at ToT. #

Patch Set 10 : cf596ded Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+172 lines, -308 lines) Patch
M content/renderer/media/renderer_gpu_video_accelerator_factories.h View 1 2 3 4 5 6 7 8 5 chunks +5 lines, -44 lines 0 comments Download
M content/renderer/media/renderer_gpu_video_accelerator_factories.cc View 1 2 3 4 5 6 7 8 7 chunks +21 lines, -135 lines 0 comments Download
M content/renderer/media/rtc_video_decoder.h View 1 2 3 4 5 6 7 8 7 chunks +6 lines, -10 lines 0 comments Download
M content/renderer/media/rtc_video_decoder.cc View 1 2 3 4 5 6 7 8 9 chunks +49 lines, -41 lines 0 comments Download
M content/renderer/media/rtc_video_decoder_factory.h View 2 chunks +7 lines, -4 lines 0 comments Download
M content/renderer/media/rtc_video_decoder_factory.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -7 lines 0 comments Download
M content/renderer/media/rtc_video_decoder_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -12 lines 0 comments Download
M content/renderer/media/rtc_video_encoder.h View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -4 lines 0 comments Download
M content/renderer/media/rtc_video_encoder.cc View 1 2 3 4 5 6 7 8 6 chunks +5 lines, -10 lines 0 comments Download
M content/renderer/media/rtc_video_encoder_factory.h View 3 chunks +8 lines, -4 lines 0 comments Download
M content/renderer/media/rtc_video_encoder_factory.cc View 1 3 chunks +3 lines, -6 lines 0 comments Download
M content/renderer/media/webmediaplayer_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -4 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -1 line 0 comments Download
M media/cast/test/fake_gpu_video_accelerator_factories.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -5 lines 0 comments Download
M media/cast/test/fake_gpu_video_accelerator_factories.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -4 lines 0 comments Download
M media/filters/gpu_video_accelerator_factories.h View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -9 lines 0 comments Download
M media/filters/gpu_video_decoder.cc View 1 2 3 4 5 6 7 8 5 chunks +31 lines, -5 lines 0 comments Download
M media/filters/mock_gpu_video_accelerator_factories.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -3 lines 0 comments Download

Messages

Total messages: 66 (0 generated)
sheu
fischman@: the big one. PTAL. (Doesn't have to be right now; it ain't blocking M31...) ...
7 years, 2 months ago (2013-10-16 00:57:44 UTC) #1
wuchengli
- rtc_video_decoder_unittest.cc calls Abort() and needs updated. - There's a typo in the change description. ...
7 years, 2 months ago (2013-10-16 07:43:17 UTC) #2
Ami GONE FROM CHROMIUM
https://chromiumcodereview.appspot.com/27420004/diff/3001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc File content/renderer/media/renderer_gpu_video_accelerator_factories.cc (right): https://chromiumcodereview.appspot.com/27420004/diff/3001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc#newcode43 content/renderer/media/renderer_gpu_video_accelerator_factories.cc:43: // keeps us alive until this task completes. That ...
7 years, 2 months ago (2013-10-17 22:22:17 UTC) #3
sheu
https://chromiumcodereview.appspot.com/27420004/diff/3001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc File content/renderer/media/renderer_gpu_video_accelerator_factories.cc (right): https://chromiumcodereview.appspot.com/27420004/diff/3001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc#newcode43 content/renderer/media/renderer_gpu_video_accelerator_factories.cc:43: // keeps us alive until this task completes. On ...
7 years, 2 months ago (2013-10-21 05:17:35 UTC) #4
wuchengli
- rtc_video_decoder_unittest.cc calls Abort() and needs updated. - There's a typo in the change description. ...
7 years, 2 months ago (2013-10-21 05:59:00 UTC) #5
Ami GONE FROM CHROMIUM
https://chromiumcodereview.appspot.com/27420004/diff/14001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc File content/renderer/media/renderer_gpu_video_accelerator_factories.cc (right): https://chromiumcodereview.appspot.com/27420004/diff/14001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc#newcode35 content/renderer/media/renderer_gpu_video_accelerator_factories.cc:35: if (message_loop_->BelongsToCurrentThread()) { This is never the case, right? ...
7 years, 2 months ago (2013-10-22 17:21:19 UTC) #6
sheu
Updated. PTAL https://chromiumcodereview.appspot.com/27420004/diff/14001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc File content/renderer/media/renderer_gpu_video_accelerator_factories.cc (right): https://chromiumcodereview.appspot.com/27420004/diff/14001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc#newcode35 content/renderer/media/renderer_gpu_video_accelerator_factories.cc:35: if (message_loop_->BelongsToCurrentThread()) { On 2013/10/22 17:21:19, Ami ...
7 years, 2 months ago (2013-10-24 01:16:38 UTC) #7
sheu
Updated. PTAL https://chromiumcodereview.appspot.com/27420004/diff/14001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc File content/renderer/media/renderer_gpu_video_accelerator_factories.cc (right): https://chromiumcodereview.appspot.com/27420004/diff/14001/content/renderer/media/renderer_gpu_video_accelerator_factories.cc#newcode35 content/renderer/media/renderer_gpu_video_accelerator_factories.cc:35: if (message_loop_->BelongsToCurrentThread()) { On 2013/10/22 17:21:19, Ami ...
7 years, 2 months ago (2013-10-24 01:16:38 UTC) #8
sheu
Updated. PTAL
7 years, 2 months ago (2013-10-24 01:16:40 UTC) #9
Ami GONE FROM CHROMIUM
https://chromiumcodereview.appspot.com/27420004/diff/14001/media/filters/gpu_video_decoder.cc File media/filters/gpu_video_decoder.cc (right): https://chromiumcodereview.appspot.com/27420004/diff/14001/media/filters/gpu_video_decoder.cc#newcode445 media/filters/gpu_video_decoder.cc:445: factories_->GetMessageLoop(), base::Bind( On 2013/10/22 17:21:19, Ami Fischman wrote: > ...
7 years, 2 months ago (2013-10-24 01:42:25 UTC) #10
wuchengli
https://chromiumcodereview.appspot.com/27420004/diff/314001/media/filters/gpu_video_accelerator_factories.h File media/filters/gpu_video_accelerator_factories.h (right): https://chromiumcodereview.appspot.com/27420004/diff/314001/media/filters/gpu_video_accelerator_factories.h#newcode63 media/filters/gpu_video_accelerator_factories.h:63: // |ReadPixels()|. Remove ReadPixels exception. https://chromiumcodereview.appspot.com/27420004/diff/314001/media/filters/gpu_video_accelerator_factories.h#newcode65 media/filters/gpu_video_accelerator_factories.h:65: You probably ...
7 years, 2 months ago (2013-10-24 03:17:20 UTC) #11
sheu
Updated. PTAL https://chromiumcodereview.appspot.com/27420004/diff/14001/media/filters/gpu_video_decoder.cc File media/filters/gpu_video_decoder.cc (right): https://chromiumcodereview.appspot.com/27420004/diff/14001/media/filters/gpu_video_decoder.cc#newcode445 media/filters/gpu_video_decoder.cc:445: factories_->GetMessageLoop(), base::Bind( Right. I'd like to avoid ...
7 years, 2 months ago (2013-10-25 00:59:30 UTC) #12
wuchengli
LGTM. I didn't review bind_to_loop* files.
7 years, 2 months ago (2013-10-25 01:52:24 UTC) #13
Ami GONE FROM CHROMIUM
Only the bindtoloopsync comment (request for doco) is required; the rest are optional or things ...
7 years, 1 month ago (2013-10-26 19:30:25 UTC) #14
sheu
https://chromiumcodereview.appspot.com/27420004/diff/364001/content/renderer/media/rtc_video_encoder_factory.h File content/renderer/media/rtc_video_encoder_factory.h (right): https://chromiumcodereview.appspot.com/27420004/diff/364001/content/renderer/media/rtc_video_encoder_factory.h#newcode16 content/renderer/media/rtc_video_encoder_factory.h:16: On 2013/10/26 19:30:26, Ami Fischman wrote: > Here and ...
7 years, 1 month ago (2013-10-28 18:58:05 UTC) #15
sheu
jamesr@: PTAL at content/renderer/render_thread_imp.cc; OWNERS check
7 years, 1 month ago (2013-10-28 18:59:51 UTC) #16
Ami GONE FROM CHROMIUM
LGTM
7 years, 1 month ago (2013-10-28 19:20:33 UTC) #17
jamesr
content/renderer/render_thread_impl.cc lgtm. I'm not sure about whether the bind primitives belong in media/base - adding ...
7 years, 1 month ago (2013-10-28 19:22:10 UTC) #18
sheu
They're not in base/ since apparently there was some discussion about them not belonging in ...
7 years, 1 month ago (2013-10-28 19:24:13 UTC) #19
Ami GONE FROM CHROMIUM
On Mon, Oct 28, 2013 at 12:24 PM, <sheu@chromium.org> wrote: > They're not in base/ ...
7 years, 1 month ago (2013-10-28 19:35:37 UTC) #20
jam
https://codereview.chromium.org/27420004/diff/494001/content/renderer/media/rtc_video_decoder.cc File content/renderer/media/rtc_video_decoder.cc (right): https://codereview.chromium.org/27420004/diff/494001/content/renderer/media/rtc_video_decoder.cc#newcode134 content/renderer/media/rtc_video_decoder.cc:134: waiter.Wait(); is this running on the main thread? https://codereview.chromium.org/27420004/diff/494001/media/base/bind_to_loop.h ...
7 years, 1 month ago (2013-10-28 20:11:07 UTC) #21
sheu
https://codereview.chromium.org/27420004/diff/494001/content/renderer/media/rtc_video_decoder.cc File content/renderer/media/rtc_video_decoder.cc (right): https://codereview.chromium.org/27420004/diff/494001/content/renderer/media/rtc_video_decoder.cc#newcode134 content/renderer/media/rtc_video_decoder.cc:134: waiter.Wait(); On 2013/10/28 20:11:08, jam wrote: > is this ...
7 years, 1 month ago (2013-10-28 20:32:58 UTC) #22
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/27420004/diff/494001/content/renderer/media/rtc_video_decoder.cc File content/renderer/media/rtc_video_decoder.cc (right): https://codereview.chromium.org/27420004/diff/494001/content/renderer/media/rtc_video_decoder.cc#newcode134 content/renderer/media/rtc_video_decoder.cc:134: waiter.Wait(); On 2013/10/28 20:32:58, sheu wrote: > On 2013/10/28 ...
7 years, 1 month ago (2013-10-28 20:38:21 UTC) #23
jam
https://codereview.chromium.org/27420004/diff/494001/content/renderer/media/rtc_video_decoder.cc File content/renderer/media/rtc_video_decoder.cc (right): https://codereview.chromium.org/27420004/diff/494001/content/renderer/media/rtc_video_decoder.cc#newcode134 content/renderer/media/rtc_video_decoder.cc:134: waiter.Wait(); On 2013/10/28 20:38:22, Ami Fischman wrote: > On ...
7 years, 1 month ago (2013-10-28 20:43:25 UTC) #24
Ami GONE FROM CHROMIUM
On Mon, Oct 28, 2013 at 1:43 PM, <jam@chromium.org> wrote: > So this is why ...
7 years, 1 month ago (2013-10-28 20:55:53 UTC) #25
jam
On 2013/10/28 20:55:53, Ami Fischman wrote: > On Mon, Oct 28, 2013 at 1:43 PM, ...
7 years, 1 month ago (2013-10-28 22:17:19 UTC) #26
sheu
On 2013/10/28 22:17:19, jam wrote: > On 2013/10/28 20:55:53, Ami Fischman wrote: > > On ...
7 years, 1 month ago (2013-10-31 20:07:32 UTC) #27
jam
On 2013/10/31 20:07:32, sheu wrote: > On 2013/10/28 22:17:19, jam wrote: > > On 2013/10/28 ...
7 years, 1 month ago (2013-10-31 22:26:39 UTC) #28
Ami GONE FROM CHROMIUM
jam: the utilities are already in media/base (not base/) and in the media:: namespace (not ...
7 years, 1 month ago (2013-10-31 22:28:08 UTC) #29
sheu
On 2013/10/31 22:26:39, jam wrote: > On 2013/10/31 20:07:32, sheu wrote: > > > > ...
7 years, 1 month ago (2013-10-31 22:32:46 UTC) #30
sheu
jam@: would it be sufficient to add threading restrictions in another CL?
7 years, 1 month ago (2013-11-01 23:55:33 UTC) #31
jam
On 2013/11/01 23:55:33, sheu wrote: > jam@: would it be sufficient to add threading restrictions ...
7 years, 1 month ago (2013-11-04 20:09:22 UTC) #32
sheu
On 2013/11/04 20:09:22, jam wrote: > On 2013/11/01 23:55:33, sheu wrote: > > jam@: would ...
7 years, 1 month ago (2013-11-04 20:56:15 UTC) #33
sheu
fischman@ corrected me: readpixels happens from (and needs to block) the render thread, not the ...
7 years, 1 month ago (2013-11-04 23:06:30 UTC) #34
sheu
fischman@ corrected me: readpixels happens from (and needs to block) the render thread, not the ...
7 years, 1 month ago (2013-11-04 23:06:31 UTC) #35
jam
On 2013/11/04 23:06:31, sheu wrote: > fischman@ corrected me: > > readpixels happens from (and ...
7 years, 1 month ago (2013-11-05 16:35:34 UTC) #36
Ami GONE FROM CHROMIUM
@jam: the canvas drawImage JS API is synchronous; when it returns the pixels need to ...
7 years, 1 month ago (2013-11-05 16:56:56 UTC) #37
jam
On 2013/11/05 16:56:56, Ami Fischman wrote: > @jam: the canvas drawImage JS API is synchronous; ...
7 years, 1 month ago (2013-11-05 18:16:32 UTC) #38
sheu
Updated, PTAL. One (functional no-op) difference made also: make ReadPixels() take a visible_rect argument instead ...
7 years, 1 month ago (2013-11-05 23:49:12 UTC) #39
Ami GONE FROM CHROMIUM
PS#7 LGTM. FTR jam/sheu/fischman chatted off-reviewlog about BindToLoopSync and why the render thread must block. ...
7 years, 1 month ago (2013-11-06 01:14:05 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/27420004/974003
7 years, 1 month ago (2013-11-06 01:34:48 UTC) #41
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=98340
7 years, 1 month ago (2013-11-06 04:44:10 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/27420004/974003
7 years, 1 month ago (2013-11-06 05:06:22 UTC) #43
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_aura&number=94598
7 years, 1 month ago (2013-11-06 07:14:40 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/27420004/974003
7 years, 1 month ago (2013-11-06 07:19:03 UTC) #45
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_aura&number=94684
7 years, 1 month ago (2013-11-06 09:23:33 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/27420004/974003
7 years, 1 month ago (2013-11-06 22:02:27 UTC) #47
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=172628
7 years, 1 month ago (2013-11-07 00:27:47 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/27420004/1454001
7 years, 1 month ago (2013-11-11 19:32:27 UTC) #49
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 1 month ago (2013-11-11 20:49:49 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/27420004/1454001
7 years, 1 month ago (2013-11-11 21:29:34 UTC) #51
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=173982
7 years, 1 month ago (2013-11-12 01:46:47 UTC) #52
sheu
Sorry for the thrash. I've looked at the failures multiple ways and it still looks ...
7 years, 1 month ago (2013-11-18 22:35:24 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/27420004/1884001
7 years, 1 month ago (2013-11-18 22:36:37 UTC) #54
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) browser_tests, content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=176048
7 years, 1 month ago (2013-11-19 01:16:45 UTC) #55
sheu
For reference: this CL is blocked on a content_browsertests bug that seems to be difficult ...
7 years ago (2013-12-02 22:18:25 UTC) #56
Ami GONE FROM CHROMIUM
@sheu: phoglund@ disabled a bunch of those tests recently; does that change the story for ...
7 years ago (2013-12-02 22:21:45 UTC) #57
sheu
It makes me antsy to be committing threading changes like this, while some relevant tests ...
7 years ago (2013-12-02 22:23:24 UTC) #58
Ami GONE FROM CHROMIUM
On 2013/12/02 22:23:24, sheu wrote: > It makes me antsy to be committing threading changes ...
7 years ago (2013-12-03 22:59:08 UTC) #59
sheu
And update on this CL: So, the thing is that I can't get the failing ...
6 years, 11 months ago (2014-01-07 02:48:23 UTC) #60
Ami GONE FROM CHROMIUM
@sheu: I believe the webrtc test flakiness has been fixed. Can this land now?
6 years, 11 months ago (2014-01-24 23:13:42 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/27420004/3664001
6 years, 11 months ago (2014-01-28 02:55:05 UTC) #62
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) telemetry_perf_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=252642
6 years, 10 months ago (2014-01-28 05:13:44 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/27420004/3664001
6 years, 10 months ago (2014-01-28 18:16:40 UTC) #64
commit-bot: I haz the power
Change committed as 247480
6 years, 10 months ago (2014-01-28 19:09:52 UTC) #65
Adam Rice
6 years, 10 months ago (2014-01-29 06:56:43 UTC) #66
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/145103004/ by ricea@chromium.org.

The reason for reverting is: Sorry, it looks like you broke the Win 7 Tests
(dbg)(2) bot.
http://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%28....

Powered by Google App Engine
This is Rietveld 408576698