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

Issue 1721273002: MediaStream audio object graph untangling and clean-ups. (Closed)

Created:
4 years, 10 months ago by miu
Modified:
4 years, 9 months ago
CC:
avayvod+watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, extensions-reviews_chromium.org, feature-media-reviews_chromium.org, hubbe, imcheng+watch_chromium.org, isheriff+watch_chromium.org, jam, jasonroberts+watch_google.com, jochen+watch_chromium.org, mcasas+watch_chromium.org, miu+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mkwst+moarreviews-shell_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-test-runner_chromium.org, Peter Beverloo, posciak+watch_chromium.org, tommi (sloooow) - chröme, 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

MediaStream audio object graph untangling and clean-ups. This change consists of a number of "clean-up" changes that are being done to make the soon-upcoming refactoring of these classes go much more smoothly. These are: 1. Public content MediaStreamApi functions cleaned up. Removed "duplicated" functions that don't really do the same thing. Removed hard-coded audio parameters from AddAudioTrackToMediaStream(). 2. Eliminated ref-counting of WebRtcAudioCapturer and WebAudioCaptureSource. Removed unnecessary references to these from WebRtcLocalAudioTrack. Not only did this improve encapsulation of some code, but it also allowed for the removal of several dozen lines of "dead weight" testing set-upcode throughout the directory. 3. Renamed MediaStreamAudioTrack::GetTrack() method to From(), to be consistent with how this pattern is used in other parts of libcontent, and added a MediaStreamAudioSource::From(). 4. Moved audio level calculations out of WebRtcLocalAudioTrack and into WebRtcAudioCapturer. This way, when multiple tracks are present, the calculation is only being done once on the same audio. 5. Eliminated call to WebRtcCapturer::Stop() from WebRtcAudioDeviceImpl::Terminate(), which are each supposed to run on different threads. From testing, DCHECKs should have been firing, but weren't, so the Terminate() method seems to be dead code. 6. Miscellaneous other "compaction" and comment updates. BUG=577881, 577874 TBR=peter@chromium.org Committed: https://crrev.com/26bfd80549511a7e05f23c9941c41ced104ddf28 Cr-Commit-Position: refs/heads/master@{#380065}

Patch Set 1 : #

Total comments: 23

Patch Set 2 : Addressed mcasas's 1st round comments, plus REBASE. #

Total comments: 57

Patch Set 3 : addressed o1ka's comments #

Total comments: 7

Patch Set 4 : Addressed o1ka's 2nd round of comments. #

Total comments: 11

Patch Set 5 : REBASE again to fix compile #

Patch Set 6 : addressed o1ka's 3rd round of comments #

Patch Set 7 : Fix unit tests broken by recent MSAudioTrack::Stop() reworking. #

Total comments: 21

Patch Set 8 : Changes addressing tommi's suggestions. #

Total comments: 4

Patch Set 9 : Resolved minor nits around in-line argument comments, use of const&. #

Patch Set 10 : REBASE #

Unified diffs Side-by-side diffs Delta from patch set Stats (+760 lines, -812 lines) Patch
M chrome/renderer/extensions/cast_streaming_native_handler.cc View 1 2 3 4 5 6 7 8 2 chunks +20 lines, -5 lines 0 comments Download
M content/public/renderer/media_stream_api.h View 1 2 3 4 5 6 7 1 chunk +14 lines, -22 lines 0 comments Download
M content/public/renderer/media_stream_api.cc View 1 2 3 4 5 6 7 2 chunks +65 lines, -84 lines 0 comments Download
M content/public/renderer/media_stream_audio_sink.cc View 1 2 3 4 5 6 7 1 chunk +6 lines, -3 lines 0 comments Download
M content/renderer/media/audio_track_recorder.cc View 2 chunks +2 lines, -1 line 0 comments Download
M content/renderer/media/audio_track_recorder_unittest.cc View 2 chunks +1 line, -7 lines 0 comments Download
M content/renderer/media/media_recorder_handler.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/renderer/media/media_stream_audio_level_calculator.h View 1 2 3 4 5 6 7 2 chunks +35 lines, -14 lines 0 comments Download
M content/renderer/media/media_stream_audio_level_calculator.cc View 4 chunks +24 lines, -11 lines 0 comments Download
M content/renderer/media/media_stream_audio_source.h View 1 2 3 4 5 6 7 3 chunks +48 lines, -9 lines 0 comments Download
M content/renderer/media/media_stream_audio_source.cc View 1 2 3 4 5 6 7 3 chunks +34 lines, -3 lines 0 comments Download
M content/renderer/media/media_stream_audio_track.h View 1 2 3 4 chunks +28 lines, -2 lines 0 comments Download
M content/renderer/media/media_stream_audio_track.cc View 1 2 3 4 5 3 chunks +26 lines, -1 line 0 comments Download
M content/renderer/media/media_stream_center.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M content/renderer/media/media_stream_renderer_factory_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/media/mock_media_stream_registry.cc View 2 chunks +2 lines, -13 lines 0 comments Download
M content/renderer/media/rtc_peer_connection_handler.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/rtc_peer_connection_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +2 lines, -12 lines 0 comments Download
M content/renderer/media/speech_recognition_audio_sink.cc View 1 2 3 4 1 chunk +1 line, -4 lines 0 comments Download
M content/renderer/media/speech_recognition_audio_sink_unittest.cc View 3 chunks +5 lines, -13 lines 0 comments Download
M content/renderer/media/track_audio_renderer.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/media/user_media_client_impl.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/user_media_client_impl_unittest.cc View 1 2 3 4 3 chunks +5 lines, -4 lines 0 comments Download
M content/renderer/media/webaudio_capturer_source.h View 1 4 chunks +8 lines, -18 lines 0 comments Download
M content/renderer/media/webaudio_capturer_source.cc View 1 3 chunks +13 lines, -12 lines 0 comments Download
M content/renderer/media/webrtc/media_stream_remote_audio_track.h View 1 2 3 3 chunks +6 lines, -1 line 0 comments Download
M content/renderer/media/webrtc/media_stream_remote_audio_track.cc View 1 2 3 4 2 chunks +7 lines, -2 lines 0 comments Download
M content/renderer/media/webrtc/mock_peer_connection_dependency_factory.h View 1 2 3 4 5 6 7 8 9 3 chunks +2 lines, -5 lines 0 comments Download
M content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -11 lines 0 comments Download
M content/renderer/media/webrtc/peer_connection_dependency_factory.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -9 lines 0 comments Download
M content/renderer/media/webrtc/peer_connection_dependency_factory.cc View 1 2 3 4 5 6 7 8 9 7 chunks +30 lines, -41 lines 0 comments Download
M content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h View 1 2 3 4 5 6 7 8 4 chunks +19 lines, -21 lines 0 comments Download
M content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc View 1 2 3 4 5 6 7 8 6 chunks +43 lines, -36 lines 0 comments Download
M content/renderer/media/webrtc/webrtc_local_audio_track_adapter_unittest.cc View 5 chunks +10 lines, -10 lines 0 comments Download
M content/renderer/media/webrtc/webrtc_media_stream_adapter.cc View 1 2 3 4 2 chunks +4 lines, -5 lines 0 comments Download
M content/renderer/media/webrtc/webrtc_media_stream_adapter_unittest.cc View 2 chunks +1 line, -10 lines 0 comments Download
M content/renderer/media/webrtc_audio_capturer.h View 1 2 3 8 chunks +13 lines, -19 lines 0 comments Download
M content/renderer/media/webrtc_audio_capturer.cc View 1 2 3 14 chunks +52 lines, -112 lines 0 comments Download
M content/renderer/media/webrtc_audio_capturer_unittest.cc View 1 3 chunks +25 lines, -26 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_impl.h View 1 2 4 chunks +9 lines, -9 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_impl.cc View 1 2 3 4 5 6 7 8 chunks +36 lines, -51 lines 0 comments Download
M content/renderer/media/webrtc_audio_renderer.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/webrtc_local_audio_source_provider_unittest.cc View 2 chunks +4 lines, -11 lines 0 comments Download
M content/renderer/media/webrtc_local_audio_track.h View 1 2 3 4 5 6 7 8 4 chunks +17 lines, -47 lines 0 comments Download
M content/renderer/media/webrtc_local_audio_track.cc View 1 2 3 4 5 6 7 8 3 chunks +22 lines, -94 lines 0 comments Download
M content/renderer/media/webrtc_local_audio_track_unittest.cc View 1 2 3 4 5 6 16 chunks +92 lines, -41 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -1 line 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.cc View 1 2 3 4 5 6 7 8 9 2 chunks +9 lines, -2 lines 0 comments Download

Messages

Total messages: 41 (12 generated)
miu
mcasas/olka: PTAL. Please see the change description for this to make sense. ;-)
4 years, 10 months ago (2016-02-23 05:38:06 UTC) #3
mcasas
a few comments to get going. https://codereview.chromium.org/1721273002/diff/20001/content/public/renderer/media_stream_api.cc File content/public/renderer/media_stream_api.cc (right): https://codereview.chromium.org/1721273002/diff/20001/content/public/renderer/media_stream_api.cc#newcode47 content/public/renderer/media_stream_api.cc:47: const blink::WebString track_id ...
4 years, 10 months ago (2016-02-26 01:28:19 UTC) #4
miu
Thanks, mcasas. PTAL. o1ka, comments, or all lgty? https://codereview.chromium.org/1721273002/diff/20001/content/public/renderer/media_stream_api.cc File content/public/renderer/media_stream_api.cc (right): https://codereview.chromium.org/1721273002/diff/20001/content/public/renderer/media_stream_api.cc#newcode47 content/public/renderer/media_stream_api.cc:47: const ...
4 years, 10 months ago (2016-02-27 03:46:37 UTC) #5
o1ka
I've got some questions. (Sorry for the delay, it took me a while to get ...
4 years, 9 months ago (2016-02-29 14:28:05 UTC) #6
miu
Thanks for taking a look. Responded to your comments and re-worked the Stop() mechanism a ...
4 years, 9 months ago (2016-03-01 09:43:55 UTC) #7
o1ka
Thank you for clarifications! Some more questions. https://codereview.chromium.org/1721273002/diff/40001/content/renderer/media/media_stream_audio_track.cc File content/renderer/media/media_stream_audio_track.cc (right): https://codereview.chromium.org/1721273002/diff/40001/content/renderer/media/media_stream_audio_track.cc#newcode22 content/renderer/media/media_stream_audio_track.cc:22: Stop(); On ...
4 years, 9 months ago (2016-03-01 14:18:59 UTC) #8
miu
o1ka: Thanks. Addressed your 2nd round comments. PTAL. https://codereview.chromium.org/1721273002/diff/40001/content/renderer/media/media_stream_audio_track.cc File content/renderer/media/media_stream_audio_track.cc (right): https://codereview.chromium.org/1721273002/diff/40001/content/renderer/media/media_stream_audio_track.cc#newcode22 content/renderer/media/media_stream_audio_track.cc:22: Stop(); ...
4 years, 9 months ago (2016-03-02 01:12:51 UTC) #9
o1ka
Thank you, looks good, a couple of minor points. tommi@, could you take a look? ...
4 years, 9 months ago (2016-03-02 16:31:14 UTC) #11
miu
https://codereview.chromium.org/1721273002/diff/80001/content/renderer/media/media_stream_audio_source.h File content/renderer/media/media_stream_audio_source.h (right): https://codereview.chromium.org/1721273002/diff/80001/content/renderer/media/media_stream_audio_source.h#newcode57 content/renderer/media/media_stream_audio_source.h:57: audio_capturer_ = std::move(capturer); On 2016/03/02 16:31:14, o1ka wrote: > ...
4 years, 9 months ago (2016-03-02 23:38:10 UTC) #12
tommi (sloooow) - chröme
looks great! looking forward to getting this in (and thanks for the thorough reviews olga) ...
4 years, 9 months ago (2016-03-03 11:07:31 UTC) #13
miu
Thanks, tommi. PTAL. https://codereview.chromium.org/1721273002/diff/140001/content/public/renderer/media_stream_audio_sink.cc File content/public/renderer/media_stream_audio_sink.cc (right): https://codereview.chromium.org/1721273002/diff/140001/content/public/renderer/media_stream_audio_sink.cc#newcode18 content/public/renderer/media_stream_audio_sink.cc:18: if (MediaStreamAudioTrack* native_track = MediaStreamAudioTrack::From(track)) On ...
4 years, 9 months ago (2016-03-05 02:55:31 UTC) #14
miu
finnur: PTAL at chrome/renderer/extensions/cast_streaming_native_handler.cc (related to content/public/renderer/media_stream_api.h changes). jochen: PTAL at content/public/renderer/* changes. peter: Need ...
4 years, 9 months ago (2016-03-05 02:58:45 UTC) #16
Finnur
Rubberstamp LGTM with one nit. https://codereview.chromium.org/1721273002/diff/160001/chrome/renderer/extensions/cast_streaming_native_handler.cc File chrome/renderer/extensions/cast_streaming_native_handler.cc (right): https://codereview.chromium.org/1721273002/diff/160001/chrome/renderer/extensions/cast_streaming_native_handler.cc#newcode873 chrome/renderer/extensions/cast_streaming_native_handler.cc:873: params.frames_per_buffer(), true /* is_remote ...
4 years, 9 months ago (2016-03-07 12:14:24 UTC) #17
o1ka
Great stuff! lgtm after clarifying my last question. https://codereview.chromium.org/1721273002/diff/80001/content/renderer/media/media_stream_audio_source.h File content/renderer/media/media_stream_audio_source.h (right): https://codereview.chromium.org/1721273002/diff/80001/content/renderer/media/media_stream_audio_source.h#newcode57 content/renderer/media/media_stream_audio_source.h:57: audio_capturer_ ...
4 years, 9 months ago (2016-03-07 16:00:28 UTC) #18
miu
https://codereview.chromium.org/1721273002/diff/160001/chrome/renderer/extensions/cast_streaming_native_handler.cc File chrome/renderer/extensions/cast_streaming_native_handler.cc (right): https://codereview.chromium.org/1721273002/diff/160001/chrome/renderer/extensions/cast_streaming_native_handler.cc#newcode873 chrome/renderer/extensions/cast_streaming_native_handler.cc:873: params.frames_per_buffer(), true /* is_remote */, On 2016/03/07 12:14:24, Finnur ...
4 years, 9 months ago (2016-03-07 20:08:52 UTC) #19
jochen (gone - plz use gerrit)
lgtm
4 years, 9 months ago (2016-03-08 15:47:18 UTC) #20
tommi (sloooow) - chröme
lgtm (assuming bot redness fixed)
4 years, 9 months ago (2016-03-08 16:46:01 UTC) #21
Henrik Grunell
Awesome that you do this! Lgtm, though I haven't looked in detail in all files, ...
4 years, 9 months ago (2016-03-09 02:31:24 UTC) #24
miu
Thanks all. Bot issues in latest patchset were transient, unrelated to this change. (Note: TBR'ing ...
4 years, 9 months ago (2016-03-09 02:32:19 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1721273002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1721273002/200001
4 years, 9 months ago (2016-03-09 03:06:43 UTC) #29
commit-bot: I haz the power
Committed patchset #10 (id:200001)
4 years, 9 months ago (2016-03-09 04:32:53 UTC) #31
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/26bfd80549511a7e05f23c9941c41ced104ddf28 Cr-Commit-Position: refs/heads/master@{#380065}
4 years, 9 months ago (2016-03-09 04:41:36 UTC) #33
sof
Were any layout tests run for this CL?
4 years, 9 months ago (2016-03-09 08:45:24 UTC) #35
sof
A revert of this CL (patchset #10 id:200001) has been created in https://codereview.chromium.org/1780653002/ by sigbjornf@opera.com. ...
4 years, 9 months ago (2016-03-09 08:49:16 UTC) #36
Henrik Grunell
On 2016/03/09 08:45:24, sof wrote: > Were any layout tests run for this CL? Are ...
4 years, 9 months ago (2016-03-09 13:17:00 UTC) #37
sof
On 2016/03/09 13:17:00, Henrik Grunell wrote: > On 2016/03/09 08:45:24, sof wrote: > > Were ...
4 years, 9 months ago (2016-03-09 13:54:08 UTC) #38
o1ka
On 2016/03/09 13:17:00, Henrik Grunell wrote: > On 2016/03/09 08:45:24, sof wrote: > > Were ...
4 years, 9 months ago (2016-03-09 13:59:19 UTC) #39
sof
On 2016/03/09 13:59:19, o1ka wrote: > On 2016/03/09 13:17:00, Henrik Grunell wrote: > > On ...
4 years, 9 months ago (2016-03-09 14:04:10 UTC) #40
miu
4 years, 9 months ago (2016-03-09 19:33:47 UTC) #41
Message was sent while issue was closed.
Ok, looks like all the tests that broke were crashes that occurred due to a
CHECK() I added in WebRtcLocalAudioTrackAdapter::Create().  It seems there can
be a RenderThreadImpl but no PCFactory signaling thread.  I'll whip-up a retry
change.

Powered by Google App Engine
This is Rietveld 408576698