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

Issue 10537121: Adds AudioDevice factory for all audio clients in Chrome (Closed)

Created:
8 years, 6 months ago by henrika (OOO until Aug 14)
Modified:
8 years, 5 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jochen+watch-content_chromium.org, darin-cc_chromium.org, tommi (sloooow) - chröme
Visibility:
Public.

Description

This CL adds a new factory method called AudioDeviceFactory. It allows the user to create a media::AudioRenderSink implementation (AudioDevice) using a factory. We can now mock (or try alternative implementations of) AudioDevice for all clients at one centralized place. BUG=none TEST=content_unittests, misc. WebRTC demos, WebAudio demos and <audio> tag demos. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=144888

Patch Set 1 #

Patch Set 2 : Adds support for unit tests #

Patch Set 3 : Renaming #

Patch Set 4 : EOL conversions #

Patch Set 5 : nits #

Patch Set 6 : Improved comments and rebased #

Patch Set 7 : Fixed build errors on Linux and Mac #

Patch Set 8 : Moved factory to content/renderer/media #

Total comments: 4

Patch Set 9 : Changes based on review by jochen@ #

Patch Set 10 : Removed DVLOGs #

Total comments: 8

Patch Set 11 : Removed usage of template to simplify #

Patch Set 12 : Refactored based on input from all reviewers #

Patch Set 13 : Minor cleanup #

Total comments: 10

Patch Set 14 : Changes based on review by Chris #

Total comments: 17

Patch Set 15 : Moved AudioDeviceFactory to content namespace #

Total comments: 18

Patch Set 16 : Changes based on review by John #

Patch Set 17 : Minor fix before landing #

Patch Set 18 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -64 lines) Patch
M content/content_renderer.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/media/audio_device.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -3 lines 0 comments Download
M content/renderer/media/audio_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +3 lines, -14 lines 0 comments Download
A content/renderer/media/audio_device_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +47 lines, -0 lines 0 comments Download
A content/renderer/media/audio_device_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +32 lines, -0 lines 0 comments Download
M content/renderer/media/audio_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -0 lines 0 comments Download
M content/renderer/media/audio_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +12 lines, -0 lines 0 comments Download
M content/renderer/media/render_audiosourceprovider.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/render_audiosourceprovider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +7 lines, -6 lines 0 comments Download
M content/renderer/media/renderer_webaudiodevice_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -5 lines 0 comments Download
M content/renderer/media/renderer_webaudiodevice_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -1 line 0 comments Download
M content/renderer/media/webrtc_audio_device_impl.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +13 lines, -11 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +19 lines, -19 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -1 line 0 comments Download
M content/test/webrtc_audio_device_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 65 (0 generated)
henrika (OOO until Aug 14)
Hi guys, I would appreciate your feedback on this one. The goal is to make ...
8 years, 6 months ago (2012-06-14 12:50:11 UTC) #1
henrika (OOO until Aug 14)
One more comment. I also removed: AudioDevice(const media::AudioParameters& params, RenderCallback* callback) om this CL, since ...
8 years, 6 months ago (2012-06-14 13:27:27 UTC) #2
jochen (gone - plz use gerrit)
http://codereview.chromium.org/10537121/diff/8005/content/renderer/renderer_webkitplatformsupport_impl.cc File content/renderer/renderer_webkitplatformsupport_impl.cc (right): http://codereview.chromium.org/10537121/diff/8005/content/renderer/renderer_webkitplatformsupport_impl.cc#newcode646 content/renderer/renderer_webkitplatformsupport_impl.cc:646: return NULL; nit. indent http://codereview.chromium.org/10537121/diff/8005/content/renderer/renderer_webkitplatformsupport_impl.cc#newcode647 content/renderer/renderer_webkitplatformsupport_impl.cc:647: RenderViewImpl* render_view = ...
8 years, 6 months ago (2012-06-14 13:32:35 UTC) #3
henrika (OOO until Aug 14)
http://codereview.chromium.org/10537121/diff/8005/content/renderer/renderer_webkitplatformsupport_impl.cc File content/renderer/renderer_webkitplatformsupport_impl.cc (right): http://codereview.chromium.org/10537121/diff/8005/content/renderer/renderer_webkitplatformsupport_impl.cc#newcode646 content/renderer/renderer_webkitplatformsupport_impl.cc:646: return NULL; On 2012/06/14 13:32:35, jochen wrote: > nit. ...
8 years, 6 months ago (2012-06-14 13:56:32 UTC) #4
henrika (OOO until Aug 14)
Antoine, seems like I need you as well on the few parts in content/renderer/ (can ...
8 years, 6 months ago (2012-06-14 14:02:21 UTC) #5
piman
http://codereview.chromium.org/10537121/diff/4011/content/renderer/renderer_webkitplatformsupport_impl.cc File content/renderer/renderer_webkitplatformsupport_impl.cc (right): http://codereview.chromium.org/10537121/diff/4011/content/renderer/renderer_webkitplatformsupport_impl.cc#newcode644 content/renderer/renderer_webkitplatformsupport_impl.cc:644: WebFrame* web_frame = WebFrame::frameForCurrentContext(); This sounds like this method ...
8 years, 6 months ago (2012-06-14 17:00:50 UTC) #6
henrika (OOO until Aug 14)
Thanks for your comments Antoine. http://codereview.chromium.org/10537121/diff/4011/content/renderer/renderer_webkitplatformsupport_impl.cc File content/renderer/renderer_webkitplatformsupport_impl.cc (right): http://codereview.chromium.org/10537121/diff/4011/content/renderer/renderer_webkitplatformsupport_impl.cc#newcode644 content/renderer/renderer_webkitplatformsupport_impl.cc:644: WebFrame* web_frame = WebFrame::frameForCurrentContext(); ...
8 years, 6 months ago (2012-06-14 17:18:29 UTC) #7
piman
http://codereview.chromium.org/10537121/diff/4011/content/renderer/renderer_webkitplatformsupport_impl.cc File content/renderer/renderer_webkitplatformsupport_impl.cc (right): http://codereview.chromium.org/10537121/diff/4011/content/renderer/renderer_webkitplatformsupport_impl.cc#newcode644 content/renderer/renderer_webkitplatformsupport_impl.cc:644: WebFrame* web_frame = WebFrame::frameForCurrentContext(); On 2012/06/14 17:18:29, henrika wrote: ...
8 years, 6 months ago (2012-06-14 17:29:31 UTC) #8
Chris Rogers
Hi Henrik, leaking internal implementation details of AudioDevice (the AudioMessageFilter) in the public API is ...
8 years, 6 months ago (2012-06-14 17:41:44 UTC) #9
henrika (OOO until Aug 14)
Chris, sorry but I am not sure if I understand your arguments here. What I ...
8 years, 6 months ago (2012-06-14 18:59:25 UTC) #10
Chris Rogers
On 2012/06/14 18:59:25, henrika wrote: > Chris, > > sorry but I am not sure ...
8 years, 6 months ago (2012-06-14 19:25:05 UTC) #11
henrika (OOO until Aug 14)
Is it correct that you like the result of this CL *very* much but you ...
8 years, 6 months ago (2012-06-14 20:12:18 UTC) #12
scherkus (not reviewing)
On 2012/06/14 20:12:18, henrika wrote: > Is it correct that you like the result of ...
8 years, 6 months ago (2012-06-15 01:12:54 UTC) #13
Chris Rogers
I was looking at the main-thread issue with AudioDevice and think it could be fixed ...
8 years, 6 months ago (2012-06-15 03:34:28 UTC) #14
henrika (OOO until Aug 14)
I thought that the Singleton design pattern should be avoided in Chrome, or perhaps you ...
8 years, 6 months ago (2012-06-15 13:45:35 UTC) #15
henrika (OOO until Aug 14)
On Fri, Jun 15, 2012 at 3:12 AM, <scherkus@chromium.org> wrote: > On 2012/06/14 20:12:18, henrika ...
8 years, 6 months ago (2012-06-15 14:09:13 UTC) #16
henrika (OOO until Aug 14)
> > I understand that you're doing some experiments with alternative > implementations, but I'm ...
8 years, 6 months ago (2012-06-15 14:43:37 UTC) #17
Chris Rogers
On 2012/06/15 13:45:35, henrika wrote: > I thought that the Singleton design pattern should be ...
8 years, 6 months ago (2012-06-15 17:24:37 UTC) #18
Chris Rogers
On 2012/06/15 14:43:37, henrika wrote: > > > > I understand that you're doing some ...
8 years, 6 months ago (2012-06-15 17:42:00 UTC) #19
tommi (sloooow) - chröme
What about making the message filter an implementation detail of one of the factories? * ...
8 years, 6 months ago (2012-06-16 05:54:44 UTC) #20
tommi (sloooow) - chröme
I just looked at what I believe to be the contention point and I think ...
8 years, 6 months ago (2012-06-16 09:09:06 UTC) #21
henrika (OOO until Aug 14)
Chris, regarding singletons in Chrome, the following comment is added to singleton.h: // Instead of ...
8 years, 6 months ago (2012-06-18 09:15:31 UTC) #22
Chris Rogers
On 2012/06/16 09:09:06, tommi wrote: > I just looked at what I believe to be ...
8 years, 6 months ago (2012-06-18 17:32:40 UTC) #23
Chris Rogers
On 2012/06/18 09:15:31, henrika wrote: > Chris, > > regarding singletons in Chrome, the following ...
8 years, 6 months ago (2012-06-18 17:36:48 UTC) #24
tommi (sloooow) - chröme
> My recommendation is to maintain a pointer to the AudioMessageFilter as a static > ...
8 years, 6 months ago (2012-06-18 21:00:40 UTC) #25
tommi (sloooow) - chröme
On 2012/06/18 17:32:40, Chris Rogers wrote: > On 2012/06/16 09:09:06, tommi wrote: > > I ...
8 years, 6 months ago (2012-06-18 21:12:18 UTC) #26
henrika (OOO until Aug 14)
> Well, it's not really a question of agreeing or disagreeing. That is how > ...
8 years, 6 months ago (2012-06-18 22:09:17 UTC) #27
Chris Rogers
On 2012/06/18 21:12:18, tommi wrote: > Well, it's not really a question of agreeing or ...
8 years, 6 months ago (2012-06-18 22:43:16 UTC) #28
Chris Rogers
On 2012/06/18 21:00:40, tommi wrote: > > My recommendation is to maintain a pointer to ...
8 years, 6 months ago (2012-06-18 22:51:39 UTC) #29
henrika (OOO until Aug 14)
Chris (and Tommi who is on vacation...), thanks for all your input on this CL. ...
8 years, 6 months ago (2012-06-19 13:06:32 UTC) #30
tommi (sloooow) - chröme
On Tue, Jun 19, 2012 at 12:43 AM, <crogers@google.com> wrote: > On 2012/06/18 21:12:18, tommi ...
8 years, 6 months ago (2012-06-19 14:17:37 UTC) #31
tommi (sloooow) - chröme
[+john] On Tue, Jun 19, 2012 at 12:51 AM, <crogers@google.com> wrote: > On 2012/06/18 21:00:40, ...
8 years, 6 months ago (2012-06-19 14:27:55 UTC) #32
Chris Rogers
On 2012/06/19 14:27:55, tommi wrote: > Singletons are simple, no question about it. But to ...
8 years, 6 months ago (2012-06-19 19:56:13 UTC) #33
Chris Rogers
Hi Henrik, I've uploaded an example of how we could address the threading issues with ...
8 years, 6 months ago (2012-06-20 01:42:30 UTC) #34
tommi (sloooow) - chröme
On Wed, Jun 20, 2012 at 3:42 AM, <crogers@google.com> wrote: > Hi Henrik, I've uploaded ...
8 years, 6 months ago (2012-06-20 07:48:50 UTC) #35
tommi (sloooow) - chröme
On Tue, Jun 19, 2012 at 9:56 PM, <crogers@google.com> wrote: > On 2012/06/19 14:27:55, tommi ...
8 years, 6 months ago (2012-06-20 12:11:35 UTC) #36
jam
(late to the party, just saw this thread. for future reference, I'm CCd on a ...
8 years, 6 months ago (2012-06-20 16:07:10 UTC) #37
Chris Rogers
Hi John, thanks for taking the time to read through the whole thread. I think ...
8 years, 6 months ago (2012-06-20 17:29:38 UTC) #38
henrika (OOO until Aug 14)
John, thanks for suggesting an alternative solution. It sounds like a great idea but I ...
8 years, 6 months ago (2012-06-20 17:30:47 UTC) #39
tommi (sloooow) - chröme
Thanks John for chiming in and I think that's a great idea. On Wed, Jun ...
8 years, 6 months ago (2012-06-20 18:20:32 UTC) #40
tommi (sloooow) - chröme
Hey Henrik - here's an example that uses a callback (see ReadCompleteCallback): https://chromiumcodereview.appspot.com/10540047/ On Wed, ...
8 years, 6 months ago (2012-06-20 18:28:49 UTC) #41
henrika (OOO until Aug 14)
I will try to wrap something up that makes everyone happy. Stay tuned.
8 years, 6 months ago (2012-06-21 09:03:21 UTC) #42
scherkus (not reviewing)
Apologies for mysteriously disappearing from this thread! I see this as another case of "making ...
8 years, 6 months ago (2012-06-22 05:41:31 UTC) #43
henrika (OOO until Aug 14)
Hi all, I have now modified this CL and tried to take all input into ...
8 years, 6 months ago (2012-06-25 15:56:01 UTC) #44
Chris Rogers
Hi Henrik, this looks great - much simpler! http://codereview.chromium.org/10537121/diff/40001/content/renderer/media/audio_device.cc File content/renderer/media/audio_device.cc (right): http://codereview.chromium.org/10537121/diff/40001/content/renderer/media/audio_device.cc#newcode49 content/renderer/media/audio_device.cc:49: DVLOG(1) ...
8 years, 6 months ago (2012-06-25 20:05:17 UTC) #45
jam
On 2012/06/25 15:56:01, henrika wrote: > Hi all, > > I have now modified this ...
8 years, 6 months ago (2012-06-25 20:14:04 UTC) #46
henrika (OOO until Aug 14)
Moved tommi to CC list since he is on vacation. jam: Need your OK for ...
8 years, 6 months ago (2012-06-26 11:17:27 UTC) #47
henrika (OOO until Aug 14)
http://codereview.chromium.org/10537121/diff/47001/content/renderer/media/audio_message_filter.cc File content/renderer/media/audio_message_filter.cc (right): http://codereview.chromium.org/10537121/diff/47001/content/renderer/media/audio_message_filter.cc#newcode25 content/renderer/media/audio_message_filter.cc:25: // DCHECK(RenderThreadImpl::current()) << Will remove this part to simplify ...
8 years, 6 months ago (2012-06-26 15:55:48 UTC) #48
Chris Rogers
Thanks Henrik - LGTM
8 years, 6 months ago (2012-06-26 19:04:48 UTC) #49
Chris Rogers
http://codereview.chromium.org/10537121/diff/47001/content/renderer/media/audio_device.h File content/renderer/media/audio_device.h (right): http://codereview.chromium.org/10537121/diff/47001/content/renderer/media/audio_device.h#newcode79 content/renderer/media/audio_device.h:79: class AudioMessageFilter; It seems like you can probably just ...
8 years, 6 months ago (2012-06-26 19:05:14 UTC) #50
henrika (OOO until Aug 14)
http://codereview.chromium.org/10537121/diff/47001/content/renderer/media/audio_device.h File content/renderer/media/audio_device.h (right): http://codereview.chromium.org/10537121/diff/47001/content/renderer/media/audio_device.h#newcode79 content/renderer/media/audio_device.h:79: class AudioMessageFilter; To me the existing change still makes ...
8 years, 6 months ago (2012-06-26 20:28:51 UTC) #51
Chris Rogers
Sorry, mis-read that part. Yes, I agree we should remove the old constructor I was ...
8 years, 6 months ago (2012-06-26 21:11:53 UTC) #52
scherkus (not reviewing)
very nice! http://codereview.chromium.org/10537121/diff/47001/content/renderer/media/audio_device.cc File content/renderer/media/audio_device.cc (right): http://codereview.chromium.org/10537121/diff/47001/content/renderer/media/audio_device.cc#newcode14 content/renderer/media/audio_device.cc:14: #include "content/renderer/media/audio_message_filter.h" nit: we include this in ...
8 years, 5 months ago (2012-06-26 23:34:30 UTC) #53
henrika (OOO until Aug 14)
Moved factory class to content as Andrew suggested. Resulted in some minor changes. http://codereview.chromium.org/10537121/diff/47001/content/renderer/media/audio_device.cc File ...
8 years, 5 months ago (2012-06-27 08:23:15 UTC) #54
jam
http://codereview.chromium.org/10537121/diff/56001/content/renderer/media/audio_device_factory.h File content/renderer/media/audio_device_factory.h (right): http://codereview.chromium.org/10537121/diff/56001/content/renderer/media/audio_device_factory.h#newcode22 content/renderer/media/audio_device_factory.h:22: class AudioDeviceFactory { nit: it's a bit odd that ...
8 years, 5 months ago (2012-06-27 15:56:28 UTC) #55
Chris Rogers
On 2012/06/27 15:56:28, John Abd-El-Malek wrote: > http://codereview.chromium.org/10537121/diff/56001/content/renderer/media/audio_device_factory.h > File content/renderer/media/audio_device_factory.h (right): > > http://codereview.chromium.org/10537121/diff/56001/content/renderer/media/audio_device_factory.h#newcode22 ...
8 years, 5 months ago (2012-06-27 17:46:17 UTC) #56
henrika (OOO until Aug 14)
John: Replied but did not make the changes. Will fix tomorrow. Please check my comments ...
8 years, 5 months ago (2012-06-27 17:54:47 UTC) #57
jam
http://codereview.chromium.org/10537121/diff/56001/content/renderer/media/audio_message_filter.h File content/renderer/media/audio_message_filter.h (right): http://codereview.chromium.org/10537121/diff/56001/content/renderer/media/audio_message_filter.h#newcode43 content/renderer/media/audio_message_filter.h:43: static AudioMessageFilter* current(); On 2012/06/27 17:54:47, henrika wrote: > ...
8 years, 5 months ago (2012-06-27 18:03:58 UTC) #58
jam
On 2012/06/27 17:46:17, Chris Rogers wrote: > On 2012/06/27 15:56:28, John Abd-El-Malek wrote: > > ...
8 years, 5 months ago (2012-06-27 18:06:18 UTC) #59
Chris Rogers
On 2012/06/27 18:06:18, John Abd-El-Malek wrote: > On 2012/06/27 17:46:17, Chris Rogers wrote: > > ...
8 years, 5 months ago (2012-06-27 19:20:33 UTC) #60
henrika (OOO until Aug 14)
Uploaded new patch taking all feedback from John into account. Still have not changed the ...
8 years, 5 months ago (2012-06-28 11:36:01 UTC) #61
jam
lgtm because I don't want to hold up this patch longer. > > I was ...
8 years, 5 months ago (2012-06-28 15:00:01 UTC) #62
henrika (OOO until Aug 14)
Chris, if you are fine with the proposal from John, I can make that last ...
8 years, 5 months ago (2012-06-28 15:07:12 UTC) #63
Chris Rogers
Henrik: I'm happy with the patch (except for changing the factory name) John: we can ...
8 years, 5 months ago (2012-06-28 18:31:46 UTC) #64
scherkus (not reviewing)
8 years, 5 months ago (2012-06-28 18:52:35 UTC) #65
LGTM % any last minute naming changes you want to do :)

Powered by Google App Engine
This is Rietveld 408576698