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

Issue 1633423002: MediaStream audio rendering: Bypass audio processing for non-WebRTC cases. (Closed)

Created:
4 years, 11 months ago by miu
Modified:
4 years, 10 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, mkwst+moarreviews-renderer_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 rendering: Bypass audio processing for non-WebRTC cases. This change renames WebRtcLocalAudioRenderer to TrackAudioRenderer and re-purposes it for rendering all local MediaStream audio tracks, and non-PeerConnection/WebRTC-sourced remote audio tracks (e.g., Cast Streaming). In addition, a number of small functional changes were made to fix audio glitching, especially surrounding Start/Stop/Mute operations: 1. Improved accuracy of GetCurrentRenderTime(), based on audio sample counts rather than using the system clock. 2. Removed the stopping of audio render on mute. This would cause the video player to freeze the video unintentionally. 3. Drop/re-create AudioShifter on any pause-then-play, audio format change, or output device change. The existing Flush() mechanic was causing weird time-shifting effects when the audio data flow was restarted due to retaining the old timing data history. 4. Corrected a timing calculation in the playout_time passed to AudioShifter::Pull(). Since the playout_time is supposed to be "in the future," the correct timestamp should be "now plus audio delay" and not "now minus audio delay." 5. Removed legacy call to GetOptimalBufferSize() for the audio output buffer size. After reviewing the history on this code, I believe it was probably just masked issues that were recently resolved by AudioShifter. Testing demonstrated the extra buffering was not needed. Other changes: Clarified and refreshed documentative code comments. Code clean-ups in media_stream_renderer_factory_impl.cc (e.g., removed output argument in favor of a return value). Testing: 1. Connected a chrome.tabCapture.capture() MediaStream to a local VIDEO element and confirmed reliable playback with good AV sync. 2. Using https://webrtc.github.io/samples/src/content/peerconnection/pc1/ to confirm the WebRTC use case was not broken. 3. Cast Streaming loopback testing (using a simple test extension). BUG=577881, 577874 Committed: https://crrev.com/b1de8b80dfc43efdf16b9eced23acbb335baf75c Cr-Commit-Position: refs/heads/master@{#374766}

Patch Set 1 : #

Total comments: 21

Patch Set 2 : tommi's comments addressed, plus REBASE #

Total comments: 8

Patch Set 3 : Just call SetVolume() after Start(). #

Patch Set 4 : REBASE #

Total comments: 2

Patch Set 5 : Add comment to TrackAudioRenderer header to explain it does not handle remote WebRTC tracks. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+313 lines, -834 lines) Patch
M content/content_renderer.gypi View 1 2 3 4 chunks +5 lines, -5 lines 0 comments Download
M content/renderer/media/media_stream_renderer_factory_impl.cc View 1 3 chunks +40 lines, -58 lines 0 comments Download
A + content/renderer/media/track_audio_renderer.h View 1 2 3 4 7 chunks +65 lines, -59 lines 0 comments Download
A + content/renderer/media/track_audio_renderer.cc View 1 2 7 chunks +179 lines, -143 lines 0 comments Download
D content/renderer/media/webrtc_local_audio_renderer.h View 1 chunk +0 lines, -183 lines 0 comments Download
D content/renderer/media/webrtc_local_audio_renderer.cc View 1 chunk +0 lines, -356 lines 0 comments Download
M media/base/audio_shifter.h View 3 chunks +6 lines, -5 lines 0 comments Download
M media/base/audio_shifter.cc View 2 chunks +18 lines, -25 lines 0 comments Download

Messages

Total messages: 37 (17 generated)
miu
hubbe: PTAL, and I've made a few FYI comments below: https://codereview.chromium.org/1633423002/diff/60001/content/content_renderer.gypi File content/content_renderer.gypi (right): https://codereview.chromium.org/1633423002/diff/60001/content/content_renderer.gypi#newcode70 ...
4 years, 11 months ago (2016-01-27 05:14:14 UTC) #6
miu
Adding tommi@ and grunell@. PTAL (this is change 1 of 2).
4 years, 10 months ago (2016-01-28 21:15:01 UTC) #9
hubbe
Looked, but didn't grok. I didn't see anything wrong, but I also was not able ...
4 years, 10 months ago (2016-01-28 21:53:21 UTC) #10
Henrik Grunell
Adding olka@ as reviewer.
4 years, 10 months ago (2016-01-29 09:47:42 UTC) #12
miu
On 2016/01/28 21:53:21, hubbe wrote: > Looked, but didn't grok. > I didn't see anything ...
4 years, 10 months ago (2016-01-29 19:40:11 UTC) #13
hubbe
On 2016/01/29 19:40:11, miu wrote: > On 2016/01/28 21:53:21, hubbe wrote: > > Looked, but ...
4 years, 10 months ago (2016-01-29 20:14:50 UTC) #14
tommi (sloooow) - chröme
great stuff! I've got a couple of minor questions but thanks for doing this. https://codereview.chromium.org/1633423002/diff/60001/content/content_renderer.gypi ...
4 years, 10 months ago (2016-02-01 20:32:24 UTC) #15
miu
Thanks, Tommi. Addressed all of your comments. PTAL. https://codereview.chromium.org/1633423002/diff/60001/content/renderer/media/media_stream_renderer_factory_impl.cc File content/renderer/media/media_stream_renderer_factory_impl.cc (right): https://codereview.chromium.org/1633423002/diff/60001/content/renderer/media/media_stream_renderer_factory_impl.cc#newcode123 content/renderer/media/media_stream_renderer_factory_impl.cc:123: if ...
4 years, 10 months ago (2016-02-03 03:48:46 UTC) #16
miu
dalecurtis: Need OWNERS rubber-stamp for trivial changes in media/base/audio_shifter.* (hubbe@ already took a look).
4 years, 10 months ago (2016-02-03 03:51:24 UTC) #18
DaleCurtis
media/base lgtm if hubbe@ is happy.
4 years, 10 months ago (2016-02-06 00:45:33 UTC) #19
tommi (sloooow) - chröme
lgtm
4 years, 10 months ago (2016-02-06 08:51:04 UTC) #20
hubbe
https://codereview.chromium.org/1633423002/diff/80001/content/renderer/media/track_audio_renderer.cc File content/renderer/media/track_audio_renderer.cc (right): https://codereview.chromium.org/1633423002/diff/80001/content/renderer/media/track_audio_renderer.cc#newcode57 content/renderer/media/track_audio_renderer.cc:57: base::TimeTicks::Now() + There is a change her from now ...
4 years, 10 months ago (2016-02-06 21:42:19 UTC) #21
o1ka
I'm not quite an expert here, just have a couple of questions. https://codereview.chromium.org/1633423002/diff/80001/content/renderer/media/track_audio_renderer.cc File content/renderer/media/track_audio_renderer.cc ...
4 years, 10 months ago (2016-02-08 16:58:59 UTC) #22
miu
https://codereview.chromium.org/1633423002/diff/80001/content/renderer/media/track_audio_renderer.cc File content/renderer/media/track_audio_renderer.cc (right): https://codereview.chromium.org/1633423002/diff/80001/content/renderer/media/track_audio_renderer.cc#newcode57 content/renderer/media/track_audio_renderer.cc:57: base::TimeTicks::Now() + On 2016/02/06 21:42:19, hubbe wrote: > There ...
4 years, 10 months ago (2016-02-10 04:25:48 UTC) #27
o1ka
lgtm https://codereview.chromium.org/1633423002/diff/80001/content/renderer/media/track_audio_renderer.cc File content/renderer/media/track_audio_renderer.cc (right): https://codereview.chromium.org/1633423002/diff/80001/content/renderer/media/track_audio_renderer.cc#newcode274 content/renderer/media/track_audio_renderer.cc:274: sink_->SetVolume(volume_); On 2016/02/10 04:25:48, miu wrote: > On ...
4 years, 10 months ago (2016-02-10 10:24:12 UTC) #28
o1ka
lgtm https://codereview.chromium.org/1633423002/diff/80001/content/renderer/media/track_audio_renderer.cc File content/renderer/media/track_audio_renderer.cc (right): https://codereview.chromium.org/1633423002/diff/80001/content/renderer/media/track_audio_renderer.cc#newcode274 content/renderer/media/track_audio_renderer.cc:274: sink_->SetVolume(volume_); On 2016/02/10 04:25:48, miu wrote: > On ...
4 years, 10 months ago (2016-02-10 10:24:13 UTC) #29
miu
Thanks for taking a look! :) https://codereview.chromium.org/1633423002/diff/120001/content/renderer/media/track_audio_renderer.h File content/renderer/media/track_audio_renderer.h (right): https://codereview.chromium.org/1633423002/diff/120001/content/renderer/media/track_audio_renderer.h#newcode36 content/renderer/media/track_audio_renderer.h:36: // generated from ...
4 years, 10 months ago (2016-02-10 21:43:12 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1633423002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1633423002/140001
4 years, 10 months ago (2016-02-10 21:46:48 UTC) #33
commit-bot: I haz the power
Committed patchset #5 (id:140001)
4 years, 10 months ago (2016-02-10 23:11:08 UTC) #35
commit-bot: I haz the power
4 years, 10 months ago (2016-02-16 22:32:09 UTC) #37
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/b1de8b80dfc43efdf16b9eced23acbb335baf75c
Cr-Commit-Position: refs/heads/master@{#374766}

Powered by Google App Engine
This is Rietveld 408576698