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

Issue 1809093003: Moving SwitchOutputDevice out of OutputDevice interface, eliminating OutputDevice (Closed)

Created:
4 years, 9 months ago by o1ka
Modified:
4 years, 8 months ago
CC:
vanellope-cl_google.com, avayvod+watch_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, feature-media-reviews_chromium.org, imcheng+watch_chromium.org, isheriff+watch_chromium.org, jam, jasonroberts+watch_google.com, mcasas+watch_chromium.org, miu, miu+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, posciak+watch_chromium.org, xjz+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Getting rid of OutputDevice interface, moving SwitchOutputDevice() to AudioRendererSink and MediaStreamAudioRenderer interfaces. 1) OutputDevice interface eliminated; 2) OutputDeviceInfo data structure introduced; besides output parameters and device status, it provides device ID information now (at this stage it's useful for unit tests only, but it will also be used for session ID -> device ID mapping in the upcoming CL). 3) AudioRendererSink::GetOutputDevice() is replaced with AudioRendererSink::GetOutputDeviceInfo(), which returns a snapshot of output device information. 3) SwitchOutputDevice() method added to MediaStreamAudioRenderer; 4) SwitchOutputDevice() method added to AudioRendererSink; 5) Mocks and unit tests cleaned up; sink_for_testing_ is removed from AudioRendererMixerManager, mock AudioDeviceFactory is used instead to instantiate sinks for its testing; 6) AudioRendererMixer is dependent on AudioOutputDevice no more; from now on AudioOutputDevice is visible to upper layers as AudioRendererSink only; 7) AudioOutputDevice is the only sink which implements GetOutputDeviceInfo(), all the other sinks redirect the call to their bottom layer. See bug description for mode details and a link to doc with pictures (a bit outdated since Patchset 5 which eliminated OutputDevice interface). BUG=595727, 506507 Committed: https://crrev.com/68b69396916a10dbace194d871c854302bd98347 Cr-Commit-Position: refs/heads/master@{#384550}

Patch Set 1 #

Patch Set 2 : Replace RestartableAudioRendererSink with SwitchableAudioRendererSink in webmediaplayer_impl unit t… #

Total comments: 15

Patch Set 3 : guidou@'s comments addressed, SwitchOutputDeviceCB renamed #

Total comments: 8

Patch Set 4 : fixing AudioOutputDevice lifetime (replacing raw pointer with scoped_refptr) #

Patch Set 5 : Getting rid of OutputDevice interface #

Total comments: 21

Patch Set 6 : Addressing guidou's comments #

Total comments: 38

Patch Set 7 : Addressing miu@ and grunell@ review comments, changing AudioDeviceFactory to produce AudioCapturerS… #

Total comments: 10

Patch Set 8 : Comments addressed #

Patch Set 9 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+621 lines, -705 lines) Patch
M content/browser/renderer_host/media/audio_renderer_host.cc View 1 2 3 4 5 6 6 chunks +9 lines, -13 lines 0 comments Download
M content/public/renderer/media_stream_audio_renderer.h View 1 2 3 4 5 6 7 2 chunks +20 lines, -8 lines 0 comments Download
M content/renderer/media/audio_device_factory.h View 1 2 3 4 5 6 7 6 chunks +33 lines, -29 lines 0 comments Download
M content/renderer/media/audio_device_factory.cc View 1 2 3 4 5 6 7 chunks +46 lines, -35 lines 0 comments Download
M content/renderer/media/audio_renderer_mixer_manager.h View 1 2 3 4 5 2 chunks +1 line, -14 lines 0 comments Download
M content/renderer/media/audio_renderer_mixer_manager.cc View 1 2 3 4 5 chunks +8 lines, -46 lines 0 comments Download
M content/renderer/media/audio_renderer_mixer_manager_unittest.cc View 1 2 3 4 5 6 12 chunks +97 lines, -62 lines 0 comments Download
M content/renderer/media/track_audio_renderer.h View 1 2 3 4 3 chunks +3 lines, -9 lines 0 comments Download
M content/renderer/media/track_audio_renderer.cc View 1 2 3 4 5 12 chunks +29 lines, -43 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -5 lines 0 comments Download
M content/renderer/media/webrtc_audio_capturer.cc View 1 2 3 4 5 6 2 chunks +5 lines, -5 lines 0 comments Download
M content/renderer/media/webrtc_audio_renderer.h View 1 2 3 4 3 chunks +3 lines, -9 lines 0 comments Download
M content/renderer/media/webrtc_audio_renderer.cc View 1 2 3 4 5 6 7 9 chunks +25 lines, -29 lines 0 comments Download
M content/renderer/media/webrtc_audio_renderer_unittest.cc View 1 2 3 4 5 6 8 chunks +58 lines, -84 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -6 lines 0 comments Download
M media/audio/audio_output_device.h View 1 2 3 4 5 4 chunks +3 lines, -13 lines 0 comments Download
M media/audio/audio_output_device.cc View 1 2 3 4 1 chunk +2 lines, -19 lines 0 comments Download
M media/audio/audio_output_ipc.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_output_stream_sink.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_output_stream_sink.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M media/audio/audio_parameters.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M media/audio/audio_parameters.cc View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M media/audio/clockless_audio_sink.h View 1 2 3 4 2 chunks +1 line, -2 lines 0 comments Download
M media/audio/clockless_audio_sink.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M media/audio/null_audio_sink.h View 1 2 3 4 2 chunks +5 lines, -3 lines 0 comments Download
M media/audio/null_audio_sink.cc View 1 2 3 4 1 chunk +8 lines, -2 lines 0 comments Download
M media/base/BUILD.gn View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -3 lines 0 comments Download
M media/base/audio_renderer_mixer.h View 1 2 3 4 1 chunk +1 line, -5 lines 0 comments Download
M media/base/audio_renderer_mixer.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M media/base/audio_renderer_mixer_input.h View 1 2 3 4 5 6 7 8 5 chunks +5 lines, -20 lines 0 comments Download
M media/base/audio_renderer_mixer_input.cc View 1 2 3 4 5 6 7 8 4 chunks +3 lines, -21 lines 0 comments Download
M media/base/audio_renderer_mixer_input_unittest.cc View 1 2 2 chunks +0 lines, -5 lines 0 comments Download
M media/base/audio_renderer_mixer_unittest.cc View 1 2 3 chunks +1 line, -8 lines 0 comments Download
M media/base/audio_renderer_sink.h View 1 2 3 4 5 6 3 chunks +23 lines, -16 lines 0 comments Download
M media/base/fake_audio_renderer_sink.h View 1 2 3 4 3 chunks +3 lines, -4 lines 0 comments Download
M media/base/fake_audio_renderer_sink.cc View 1 2 3 4 2 chunks +10 lines, -5 lines 0 comments Download
M media/base/fake_output_device.h View 1 2 3 4 1 chunk +0 lines, -35 lines 0 comments Download
M media/base/fake_output_device.cc View 1 2 3 4 1 chunk +0 lines, -36 lines 0 comments Download
M media/base/mock_audio_renderer_sink.h View 1 2 3 4 5 6 2 chunks +12 lines, -3 lines 0 comments Download
M media/base/mock_audio_renderer_sink.cc View 1 2 3 4 5 1 chunk +29 lines, -4 lines 0 comments Download
M media/base/output_device.h View 1 2 3 4 1 chunk +0 lines, -67 lines 0 comments Download
A media/base/output_device_info.h View 1 2 3 4 5 6 7 1 chunk +68 lines, -0 lines 0 comments Download
A media/base/output_device_info.cc View 1 2 3 4 5 6 7 1 chunk +40 lines, -0 lines 0 comments Download
M media/blink/webaudiosourceprovider_impl.h View 1 2 3 4 3 chunks +7 lines, -4 lines 0 comments Download
M media/blink/webaudiosourceprovider_impl.cc View 1 2 3 4 2 chunks +14 lines, -3 lines 0 comments Download
M media/blink/webmediaplayer_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -9 lines 0 comments Download
M media/blink/webmediaplayer_impl_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M media/blink/webmediaplayer_params.h View 4 chunks +4 lines, -4 lines 0 comments Download
M media/blink/webmediaplayer_params.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/blink/webmediaplayer_util.h View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M media/blink/webmediaplayer_util.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 53 (20 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1809093003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1809093003/1
4 years, 9 months ago (2016-03-17 15:53:59 UTC) #2
o1ka
PTAL; miu@ - added you in CC since you are "no review" now; you might ...
4 years, 9 months ago (2016-03-17 16:41:09 UTC) #6
Guido Urdaneta
https://codereview.chromium.org/1809093003/diff/20001/content/public/renderer/media_stream_audio_renderer.h File content/public/renderer/media_stream_audio_renderer.h (right): https://codereview.chromium.org/1809093003/diff/20001/content/public/renderer/media_stream_audio_renderer.h#newcode47 content/public/renderer/media_stream_audio_renderer.h:47: // the media::SwitchOutputDeviceResult enum. s/media::SwitchOutputDeviceResult/media::OutputDeviceStatus https://codereview.chromium.org/1809093003/diff/20001/content/renderer/media/audio_device_factory.h File content/renderer/media/audio_device_factory.h (right): ...
4 years, 9 months ago (2016-03-17 17:38:24 UTC) #7
o1ka
guidou@, thank you for the review! Comments addressed, renamed SwitchOutputDeviceCB->OutputDeviceStatusCB, removed GetOutputDeviceCB from AudioRendererMixerInput (this ...
4 years, 9 months ago (2016-03-18 10:45:41 UTC) #8
Guido Urdaneta
lgtm
4 years, 9 months ago (2016-03-18 10:59:06 UTC) #9
o1ka
(I'm working on figuring out what's wrong with Andriod tests)
4 years, 9 months ago (2016-03-18 15:59:50 UTC) #11
Guido Urdaneta
https://codereview.chromium.org/1809093003/diff/40001/content/renderer/media/audio_device_factory.cc File content/renderer/media/audio_device_factory.cc (right): https://codereview.chromium.org/1809093003/diff/40001/content/renderer/media/audio_device_factory.cc#newcode24 content/renderer/media/audio_device_factory.cc:24: media::AudioOutputDevice* NewOutputDevice(int render_frame_id, This should be scoped_refptr https://codereview.chromium.org/1809093003/diff/40001/content/renderer/media/audio_device_factory.cc#newcode29 content/renderer/media/audio_device_factory.cc:29: ...
4 years, 9 months ago (2016-03-21 11:09:20 UTC) #12
o1ka
https://codereview.chromium.org/1809093003/diff/40001/content/renderer/media/audio_device_factory.cc File content/renderer/media/audio_device_factory.cc (right): https://codereview.chromium.org/1809093003/diff/40001/content/renderer/media/audio_device_factory.cc#newcode29 content/renderer/media/audio_device_factory.cc:29: media::AudioOutputDevice* device = new media::AudioOutputDevice( On 2016/03/21 11:09:20, Guido ...
4 years, 9 months ago (2016-03-21 11:50:32 UTC) #13
Guido Urdaneta
https://codereview.chromium.org/1809093003/diff/40001/content/renderer/media/audio_device_factory.h File content/renderer/media/audio_device_factory.h (right): https://codereview.chromium.org/1809093003/diff/40001/content/renderer/media/audio_device_factory.h#newcode98 content/renderer/media/audio_device_factory.h:98: virtual media::AudioRendererSink* CreateAudioRendererMixerSink( On 2016/03/21 11:50:31, o1ka wrote: > ...
4 years, 9 months ago (2016-03-21 12:01:36 UTC) #14
Guido Urdaneta
https://codereview.chromium.org/1809093003/diff/40001/content/renderer/media/audio_device_factory.cc File content/renderer/media/audio_device_factory.cc (right): https://codereview.chromium.org/1809093003/diff/40001/content/renderer/media/audio_device_factory.cc#newcode29 content/renderer/media/audio_device_factory.cc:29: media::AudioOutputDevice* device = new media::AudioOutputDevice( On 2016/03/21 11:50:31, o1ka ...
4 years, 9 months ago (2016-03-21 13:01:45 UTC) #15
o1ka
Android issues is fixed,please HOLD ON with the review though: I do not quite like ...
4 years, 9 months ago (2016-03-21 13:30:51 UTC) #16
o1ka
PTAL. OutputDevice interface eliminated (see updated description). Rationale: (1) After removing SwitchOutputDevice, OutputDevice became a ...
4 years, 9 months ago (2016-03-22 13:21:20 UTC) #18
o1ka
adding miu@: PTAL at TrackAudioRenderer
4 years, 9 months ago (2016-03-22 14:12:54 UTC) #22
Guido Urdaneta
https://codereview.chromium.org/1809093003/diff/80001/content/renderer/media/audio_device_factory.h File content/renderer/media/audio_device_factory.h (right): https://codereview.chromium.org/1809093003/diff/80001/content/renderer/media/audio_device_factory.h#newcode78 content/renderer/media/audio_device_factory.h:78: static media::OutputDeviceStatus GetOutputDeviceStatus( What if we change this to ...
4 years, 9 months ago (2016-03-22 15:30:19 UTC) #23
o1ka
Thank you, guidou@! https://codereview.chromium.org/1809093003/diff/80001/content/renderer/media/audio_device_factory.h File content/renderer/media/audio_device_factory.h (right): https://codereview.chromium.org/1809093003/diff/80001/content/renderer/media/audio_device_factory.h#newcode78 content/renderer/media/audio_device_factory.h:78: static media::OutputDeviceStatus GetOutputDeviceStatus( On 2016/03/22 15:30:18, ...
4 years, 9 months ago (2016-03-22 16:13:56 UTC) #24
Guido Urdaneta
lgtm
4 years, 9 months ago (2016-03-22 16:34:37 UTC) #25
miu
Looks great! Comments: https://codereview.chromium.org/1809093003/diff/100001/content/public/renderer/media_stream_audio_renderer.h File content/public/renderer/media_stream_audio_renderer.h (right): https://codereview.chromium.org/1809093003/diff/100001/content/public/renderer/media_stream_audio_renderer.h#newcode41 content/public/renderer/media_stream_audio_renderer.h:41: // Must never be called on ...
4 years, 9 months ago (2016-03-24 21:32:02 UTC) #26
Henrik Grunell
Really nice job this CL! https://codereview.chromium.org/1809093003/diff/100001/content/renderer/media/audio_device_factory.h File content/renderer/media/audio_device_factory.h (right): https://codereview.chromium.org/1809093003/diff/100001/content/renderer/media/audio_device_factory.h#newcode29 content/renderer/media/audio_device_factory.h:29: class CONTENT_EXPORT AudioDeviceFactory { ...
4 years, 9 months ago (2016-03-25 10:44:40 UTC) #27
o1ka
miu@ and grunell@: Thanks a lot for the comments! - Addressed now. I also changed ...
4 years, 8 months ago (2016-03-29 13:39:54 UTC) #29
miu
lgtm https://codereview.chromium.org/1809093003/diff/100001/content/public/renderer/media_stream_audio_renderer.h File content/public/renderer/media_stream_audio_renderer.h (right): https://codereview.chromium.org/1809093003/diff/100001/content/public/renderer/media_stream_audio_renderer.h#newcode49 content/public/renderer/media_stream_audio_renderer.h:49: // be invoked, so users are advised to ...
4 years, 8 months ago (2016-03-29 19:46:27 UTC) #30
DaleCurtis
skimmed, looks pretty good, just a few questions. https://codereview.chromium.org/1809093003/diff/120001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): https://codereview.chromium.org/1809093003/diff/120001/content/renderer/media/webrtc_audio_renderer.cc#newcode626 content/renderer/media/webrtc_audio_renderer.cc:626: DCHECK(device_info.device_status() ...
4 years, 8 months ago (2016-03-29 19:57:43 UTC) #31
o1ka
Comments addressed/questions answered. avi@chromium.org: need your RS on content/public/renderer/media_stream_audio_renderer.h content/renderer/render_frame_impl.cc - Thanks! https://codereview.chromium.org/1809093003/diff/100001/content/public/renderer/media_stream_audio_renderer.h File content/public/renderer/media_stream_audio_renderer.h ...
4 years, 8 months ago (2016-03-30 14:02:42 UTC) #34
o1ka
Comments addressed/questions answered. avi@chromium.org: need your RS on content/public/renderer/media_stream_audio_renderer.h content/renderer/render_frame_impl.cc - Thanks! https://codereview.chromium.org/1809093003/diff/100001/content/public/renderer/media_stream_audio_renderer.h File content/public/renderer/media_stream_audio_renderer.h ...
4 years, 8 months ago (2016-03-30 14:02:42 UTC) #35
Avi (use Gerrit)
lgtm stampity stamp
4 years, 8 months ago (2016-03-30 16:13:14 UTC) #36
DaleCurtis
defer to miu@, grunell@ and guidou@ who I'm sure have this covered :) -- rs ...
4 years, 8 months ago (2016-03-31 15:55:45 UTC) #37
miu
still lgtm
4 years, 8 months ago (2016-03-31 19:26:26 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1809093003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1809093003/140001
4 years, 8 months ago (2016-04-01 07:44:13 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_gn on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_gn/builds/12330) ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, ...
4 years, 8 months ago (2016-04-01 07:47:03 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1809093003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1809093003/160001
4 years, 8 months ago (2016-04-01 09:40:52 UTC) #46
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 8 months ago (2016-04-01 11:42:23 UTC) #48
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/68b69396916a10dbace194d871c854302bd98347 Cr-Commit-Position: refs/heads/master@{#384550}
4 years, 8 months ago (2016-04-01 11:43:49 UTC) #50
Henrik Grunell
Sorry for the post-commit final review. :) lgtm, but I wonder if you missed one ...
4 years, 8 months ago (2016-04-04 11:15:29 UTC) #51
o1ka
4 years, 8 months ago (2016-04-04 11:18:04 UTC) #52
Message was sent while issue was closed.
On 2016/04/04 11:15:29, Henrik Grunell wrote:
> Sorry for the post-commit final review. :)
> 
> lgtm, but I wonder if you missed one of my comments?
> 
>
https://codereview.chromium.org/1809093003/diff/100001/media/base/output_devi...
> File media/base/output_device_info.h (right):
> 
>
https://codereview.chromium.org/1809093003/diff/100001/media/base/output_devi...
> media/base/output_device_info.h:27: class MEDIA_EXPORT OutputDeviceInfo {
> On 2016/03/29 13:39:54, o1ka wrote:
> > On 2016/03/25 10:44:40, Henrik Grunell wrote:
> > > Add a comment with brief high-level description of the class.
> > 
> > Done.
> 
> I don't see the comment/description.

Oops, it got lost somewhere along the way. Will add in the next CL.

Powered by Google App Engine
This is Rietveld 408576698