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

Issue 2038053002: Change audio render thread checking to use new AudioRendererSink::BelongsToRendererThread() (Closed)

Created:
4 years, 6 months ago by Henrik Grunell
Modified:
4 years, 5 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change audio render thread checking to use new AudioRendererSink::BelongsToRendererThread(). This is required for making AudioOutputDevice restartable. We'll then spin up a new thread each Start(), and we need to deal with thread checks differently in the WebRTC audio rendering path. This change introduces AudioRendererSink::BelongsToRendererThread(). Also MediaStreamAudioProcessor::OnRenderThreadChanged() to notify that the render thread has changed. BUG=607916 Committed: https://crrev.com/2c754510b660c9c13e754e8e01599977e5c41aad Cr-Commit-Position: refs/heads/master@{#400429}

Patch Set 1 #

Total comments: 7

Patch Set 2 : Using the new BelongsTo...() function for thread checking. #

Total comments: 8

Patch Set 3 : Code review fixes (dalecurtis@). #

Total comments: 34

Patch Set 4 : Code review (tommi@). #

Total comments: 6

Patch Set 5 : Code review. #

Patch Set 6 : Code review. #

Patch Set 7 : Build fix. Rebase. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -23 lines) Patch
M content/renderer/media/media_stream_audio_processor.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/media/media_stream_audio_processor.cc View 1 3 chunks +17 lines, -0 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_impl.h View 1 2 chunks +6 lines, -1 line 0 comments Download
M content/renderer/media/webrtc_audio_device_impl.cc View 1 2 3 2 chunks +8 lines, -1 line 2 comments Download
M content/renderer/media/webrtc_audio_renderer.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M content/renderer/media/webrtc_audio_renderer.cc View 1 2 3 6 chunks +7 lines, -5 lines 0 comments Download
M media/audio/audio_device_thread.h View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download
M media/audio/audio_device_thread.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M media/audio/audio_output_device.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M media/audio/audio_output_device.cc View 1 2 3 4 5 6 3 chunks +16 lines, -0 lines 0 comments Download
M media/audio/audio_output_stream_sink.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M media/audio/audio_output_stream_sink.cc View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M media/audio/clockless_audio_sink.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M media/audio/clockless_audio_sink.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M media/audio/null_audio_sink.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M media/audio/null_audio_sink.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M media/base/audio_renderer_mixer_input.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M media/base/audio_renderer_mixer_input.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M media/base/audio_renderer_sink.h View 1 2 3 4 1 chunk +5 lines, -0 lines 2 comments Download
M media/base/fake_audio_renderer_sink.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M media/base/fake_audio_renderer_sink.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M media/base/mock_audio_renderer_sink.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M media/blink/webaudiosourceprovider_impl.h View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M media/blink/webaudiosourceprovider_impl.cc View 1 2 3 3 chunks +18 lines, -13 lines 0 comments Download

Messages

Total messages: 53 (19 generated)
Henrik Grunell
Please have a look at these changes, either of the functions will be added. https://codereview.chromium.org/2038053002/diff/1/media/base/audio_renderer_sink.h ...
4 years, 6 months ago (2016-06-03 13:53:42 UTC) #3
DaleCurtis
https://codereview.chromium.org/2038053002/diff/1/media/base/audio_renderer_sink.h File media/base/audio_renderer_sink.h (right): https://codereview.chromium.org/2038053002/diff/1/media/base/audio_renderer_sink.h#newcode32 media/base/audio_renderer_sink.h:32: virtual void OnInitialized() = 0; On 2016/06/03 at 13:53:42, ...
4 years, 6 months ago (2016-06-03 20:54:13 UTC) #4
Henrik Grunell
https://codereview.chromium.org/2038053002/diff/1/media/base/audio_renderer_sink.h File media/base/audio_renderer_sink.h (right): https://codereview.chromium.org/2038053002/diff/1/media/base/audio_renderer_sink.h#newcode32 media/base/audio_renderer_sink.h:32: virtual void OnInitialized() = 0; On 2016/06/03 20:54:13, DaleCurtis ...
4 years, 6 months ago (2016-06-08 09:19:07 UTC) #5
DaleCurtis
https://codereview.chromium.org/2038053002/diff/1/media/base/audio_renderer_sink.h File media/base/audio_renderer_sink.h (right): https://codereview.chromium.org/2038053002/diff/1/media/base/audio_renderer_sink.h#newcode78 media/base/audio_renderer_sink.h:78: virtual bool BelongsToRenderingThread() = 0; On 2016/06/08 at 09:19:06, ...
4 years, 6 months ago (2016-06-08 18:10:13 UTC) #6
Henrik Grunell
So, the twist is MSAP. It doesn't know about ASR and this function. I.e. it ...
4 years, 6 months ago (2016-06-08 19:46:40 UTC) #7
DaleCurtis
Is there any bridge between these classes that can be used to force detach of ...
4 years, 6 months ago (2016-06-08 20:39:13 UTC) #8
Henrik Grunell
On 2016/06/08 20:39:13, DaleCurtis wrote: > Is there any bridge between these classes that can ...
4 years, 6 months ago (2016-06-09 12:01:36 UTC) #9
Henrik Grunell
New patch set with only the BelongsToRenderingThread() function, and change to use it instead of ...
4 years, 6 months ago (2016-06-10 12:43:41 UTC) #10
DaleCurtis
Overall this looks good, but the call sites in production code should probably not be ...
4 years, 6 months ago (2016-06-10 18:24:49 UTC) #11
Henrik Grunell
Addressed Dale's comments. Adding jam@ for base/threading/thread_restrictions.h. Is it acceptable to add AudioDeviceThread as friend ...
4 years, 6 months ago (2016-06-13 12:46:15 UTC) #14
Henrik Grunell
Addressed Dale's comments. Adding jam@ for base/threading/thread_restrictions.h. Is it acceptable to add AudioDeviceThread as friend ...
4 years, 6 months ago (2016-06-13 12:46:15 UTC) #15
tommi (sloooow) - chröme
https://codereview.chromium.org/2038053002/diff/40001/content/renderer/media/media_stream_audio_processor.cc File content/renderer/media/media_stream_audio_processor.cc (right): https://codereview.chromium.org/2038053002/diff/40001/content/renderer/media/media_stream_audio_processor.cc#newcode141 content/renderer/media/media_stream_audio_processor.cc:141: DCHECK(thread_checker_.CalledOnValidThread()); nit: The DCHECK() part here isn't needed. Just ...
4 years, 6 months ago (2016-06-13 14:15:21 UTC) #16
jam
lgtm https://codereview.chromium.org/2038053002/diff/40001/base/threading/thread_restrictions.h File base/threading/thread_restrictions.h (right): https://codereview.chromium.org/2038053002/diff/40001/base/threading/thread_restrictions.h#newcode220 base/threading/thread_restrictions.h:220: friend class media::AudioDeviceThread; nit: order
4 years, 6 months ago (2016-06-13 18:22:22 UTC) #17
Henrik Grunell
Replying to some comments. I'll fix the rest of the comments tomorrow as suggested. https://codereview.chromium.org/2038053002/diff/40001/base/threading/thread_restrictions.h ...
4 years, 6 months ago (2016-06-13 20:38:35 UTC) #18
Henrik Grunell
https://codereview.chromium.org/2038053002/diff/40001/base/threading/thread_restrictions.h File base/threading/thread_restrictions.h (right): https://codereview.chromium.org/2038053002/diff/40001/base/threading/thread_restrictions.h#newcode220 base/threading/thread_restrictions.h:220: friend class media::AudioDeviceThread; On 2016/06/13 20:38:35, Henrik Grunell wrote: ...
4 years, 6 months ago (2016-06-14 11:30:01 UTC) #20
Henrik Grunell
4 years, 6 months ago (2016-06-14 11:37:15 UTC) #21
DaleCurtis
https://codereview.chromium.org/2038053002/diff/60001/media/audio/audio_output_device.cc File media/audio/audio_output_device.cc (right): https://codereview.chromium.org/2038053002/diff/60001/media/audio/audio_output_device.cc#newcode158 media/audio/audio_output_device.cc:158: // Since this function is supposed to be called ...
4 years, 6 months ago (2016-06-14 17:07:51 UTC) #22
Henrik Grunell
https://codereview.chromium.org/2038053002/diff/60001/media/audio/audio_output_device.cc File media/audio/audio_output_device.cc (right): https://codereview.chromium.org/2038053002/diff/60001/media/audio/audio_output_device.cc#newcode158 media/audio/audio_output_device.cc:158: // Since this function is supposed to be called ...
4 years, 6 months ago (2016-06-14 19:33:41 UTC) #23
DaleCurtis
https://codereview.chromium.org/2038053002/diff/60001/media/audio/audio_output_device.cc File media/audio/audio_output_device.cc (right): https://codereview.chromium.org/2038053002/diff/60001/media/audio/audio_output_device.cc#newcode158 media/audio/audio_output_device.cc:158: // Since this function is supposed to be called ...
4 years, 6 months ago (2016-06-14 20:07:16 UTC) #24
Henrik Grunell
Any more comments now or are we good to go? Also removed jam@ as reviewer ...
4 years, 6 months ago (2016-06-15 07:17:54 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2038053002/120001
4 years, 6 months ago (2016-06-15 07:19:14 UTC) #28
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/246719)
4 years, 6 months ago (2016-06-15 07:33:58 UTC) #30
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2038053002/140001
4 years, 6 months ago (2016-06-15 11:29:54 UTC) #32
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-15 13:38:09 UTC) #34
DaleCurtis
lgtm
4 years, 6 months ago (2016-06-15 16:45:12 UTC) #36
tommi (sloooow) - chröme
lgtm. One question below but I don't feel strongly about it. https://codereview.chromium.org/2038053002/diff/140001/content/renderer/media/webrtc_audio_device_impl.cc File content/renderer/media/webrtc_audio_device_impl.cc (right): ...
4 years, 6 months ago (2016-06-15 19:29:11 UTC) #37
Henrik Grunell
https://codereview.chromium.org/2038053002/diff/140001/content/renderer/media/webrtc_audio_device_impl.cc File content/renderer/media/webrtc_audio_device_impl.cc (right): https://codereview.chromium.org/2038053002/diff/140001/content/renderer/media/webrtc_audio_device_impl.cc#newcode72 content/renderer/media/webrtc_audio_device_impl.cc:72: sink->OnRenderThreadChanged(); On 2016/06/15 19:29:11, tommi-chrömium wrote: > should this ...
4 years, 6 months ago (2016-06-16 12:19:16 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2038053002/140001
4 years, 6 months ago (2016-06-16 12:20:15 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/240170)
4 years, 6 months ago (2016-06-16 17:10:35 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2038053002/140001
4 years, 6 months ago (2016-06-16 20:07:46 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/240407)
4 years, 6 months ago (2016-06-17 00:05:04 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2038053002/140001
4 years, 6 months ago (2016-06-17 11:23:13 UTC) #49
commit-bot: I haz the power
Committed patchset #7 (id:140001)
4 years, 6 months ago (2016-06-17 15:10:46 UTC) #51
commit-bot: I haz the power
4 years, 6 months ago (2016-06-17 15:12:26 UTC) #53
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/2c754510b660c9c13e754e8e01599977e5c41aad
Cr-Commit-Position: refs/heads/master@{#400429}

Powered by Google App Engine
This is Rietveld 408576698