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

Issue 14600025: Replace AudioSilenceDetector with an AudioPowerMonitor. (Closed)

Created:
7 years, 7 months ago by miu
Modified:
7 years, 5 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Replace AudioSilenceDetector with an AudioPowerMonitor. This will allow the tab audio UI indicator to animate/paint based on the real-time measured power level of the audio stream being played. This change includes necessary plumbing of the power measurement value all the way from audio internals to the fringes of the tab UI. BUG=178934 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213042

Patch Set 1 : #

Total comments: 20

Patch Set 2 : Better handling of bad AudioBus data. Minor tweaks. #

Total comments: 4

Patch Set 3 : Replace RMS scheme with 1st-order low-pass filter, per crogers@. Simpler, single-threaded unit tes… #

Total comments: 20

Patch Set 4 : Addressed Dale's comments. #

Total comments: 2

Patch Set 5 : audio_power_monitor_unittest.cc compile fixes #

Total comments: 17

Patch Set 6 : Addressed croger's comments. #

Patch Set 7 : Fix subtle shutdown race condition. #

Total comments: 2

Patch Set 8 : Use CancelableCallback instead of extra-task for close reply. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+843 lines, -660 lines) Patch
M base/cancelable_callback.h View 1 2 3 4 5 6 7 1 chunk +70 lines, -0 lines 0 comments Download
M base/float_util.h View 1 2 chunks +11 lines, -1 line 0 comments Download
M base/time/time.cc View 1 2 2 chunks +2 lines, -11 lines 0 comments Download
M chrome/browser/media/audio_stream_indicator.h View 1 2 3 3 chunks +28 lines, -16 lines 0 comments Download
M chrome/browser/media/audio_stream_indicator.cc View 1 2 3 2 chunks +81 lines, -31 lines 0 comments Download
M chrome/browser/media/media_capture_devices_dispatcher.h View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/media/media_capture_devices_dispatcher.cc View 1 2 3 4 5 1 chunk +4 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.h View 1 2 3 4 5 6 2 chunks +3 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.cc View 1 2 3 4 5 6 6 chunks +25 lines, -17 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host_unittest.cc View 1 2 3 4 5 6 7 8 chunks +49 lines, -65 lines 0 comments Download
M content/browser/renderer_host/media/mock_media_observer.h View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M content/public/browser/media_observer.h View 1 2 3 4 5 1 chunk +8 lines, -3 lines 0 comments Download
M media/audio/audio_output_controller.h View 1 2 3 4 5 6 7 4 chunks +7 lines, -5 lines 0 comments Download
M media/audio/audio_output_controller.cc View 1 2 3 4 5 6 7 6 chunks +29 lines, -20 lines 0 comments Download
M media/audio/audio_output_controller_unittest.cc View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
A media/audio/audio_power_monitor.h View 1 2 3 4 5 1 chunk +96 lines, -0 lines 0 comments Download
A media/audio/audio_power_monitor.cc View 1 2 3 4 5 1 chunk +107 lines, -0 lines 0 comments Download
A media/audio/audio_power_monitor_unittest.cc View 1 2 3 4 5 1 chunk +310 lines, -0 lines 0 comments Download
D media/audio/audio_silence_detector.h View 1 2 1 chunk +0 lines, -112 lines 0 comments Download
D media/audio/audio_silence_detector.cc View 1 2 1 chunk +0 lines, -134 lines 0 comments Download
D media/audio/audio_silence_detector_unittest.cc View 1 2 3 4 5 1 chunk +0 lines, -227 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
miu
Chris/Dale, These are the audio internals changes needed to support a real-time power level display ...
7 years, 7 months ago (2013-05-16 05:35:35 UTC) #1
DaleCurtis
Generally I also wonder if instead of DBFS we should just use a [0,1] range ...
7 years, 7 months ago (2013-05-16 18:24:45 UTC) #2
miu
Thanks, Dale. I've addressed your comments. On the topic of using dBFS: Chris suggested in ...
7 years, 7 months ago (2013-05-16 21:44:10 UTC) #3
miu
mark: Could you please review my changes in base/float_util.h and base/time.h? I added a IsNaN() ...
7 years, 7 months ago (2013-05-16 21:45:45 UTC) #4
Mark Mentovai
LGTM in base. Since we’re evidently including C++’s standard <cmath> on all platforms now, do ...
7 years, 7 months ago (2013-05-16 22:38:51 UTC) #5
Chris Rogers
some initial comments https://codereview.chromium.org/14600025/diff/13001/media/audio/audio_power_monitor.cc File media/audio/audio_power_monitor.cc (right): https://codereview.chromium.org/14600025/diff/13001/media/audio/audio_power_monitor.cc#newcode65 media/audio/audio_power_monitor.cc:65: } Instead of computing RMS power ...
7 years, 7 months ago (2013-05-16 22:39:02 UTC) #6
Chris Rogers
sorry that should have been: ave_power_ += (sample*sample - ave_power_) * k;
7 years, 7 months ago (2013-05-16 22:40:15 UTC) #7
miu
On 2013/05/16 22:38:51, Mark Mentovai wrote: > LGTM in base. > > Since we’re evidently ...
7 years, 7 months ago (2013-05-16 23:15:36 UTC) #8
miu
On 2013/05/16 22:40:15, Chris Rogers wrote: > sorry that should have been: > ave_power_ += ...
7 years, 7 months ago (2013-05-16 23:23:37 UTC) #9
Chris Rogers
On 2013/05/16 23:23:37, Yuri wrote: > On 2013/05/16 22:40:15, Chris Rogers wrote: > > sorry ...
7 years, 7 months ago (2013-05-17 00:05:48 UTC) #10
miu
On 2013/05/17 00:05:48, Chris Rogers wrote: > > Any comment on the use of dBFS ...
7 years, 7 months ago (2013-05-17 01:12:28 UTC) #11
miu
Dale/Chris: Finally got the chance to continue work on this. Replaced the RMS power calculations ...
7 years, 5 months ago (2013-07-02 06:10:16 UTC) #12
DaleCurtis
https://codereview.chromium.org/14600025/diff/53001/chrome/browser/media/audio_stream_indicator.h File chrome/browser/media/audio_stream_indicator.h (right): https://codereview.chromium.org/14600025/diff/53001/chrome/browser/media/audio_stream_indicator.h#newcode26 chrome/browser/media/audio_stream_indicator.h:26: float power_dBFS, Style should be all lowercase I think. ...
7 years, 5 months ago (2013-07-02 22:26:34 UTC) #13
DaleCurtis
Also, I defer to crogers for the math in audio power monitor.
7 years, 5 months ago (2013-07-02 22:26:54 UTC) #14
miu
Thanks for the review, Dale. https://codereview.chromium.org/14600025/diff/53001/chrome/browser/media/audio_stream_indicator.h File chrome/browser/media/audio_stream_indicator.h (right): https://codereview.chromium.org/14600025/diff/53001/chrome/browser/media/audio_stream_indicator.h#newcode26 chrome/browser/media/audio_stream_indicator.h:26: float power_dBFS, On 2013/07/02 ...
7 years, 5 months ago (2013-07-09 00:59:55 UTC) #15
miu
avi: Please review change to content/public/browser/media_observer.h Thanks, Yuri
7 years, 5 months ago (2013-07-09 01:14:56 UTC) #16
DaleCurtis
lgtm (again, math deferred to crogers). https://codereview.chromium.org/14600025/diff/63001/chrome/browser/media/audio_stream_indicator.cc File chrome/browser/media/audio_stream_indicator.cc (right): https://codereview.chromium.org/14600025/diff/63001/chrome/browser/media/audio_stream_indicator.cc#newcode93 chrome/browser/media/audio_stream_indicator.cc:93: StreamPowerLevels::iterator stream_it; You ...
7 years, 5 months ago (2013-07-09 01:36:11 UTC) #17
miu
https://codereview.chromium.org/14600025/diff/63001/chrome/browser/media/audio_stream_indicator.cc File chrome/browser/media/audio_stream_indicator.cc (right): https://codereview.chromium.org/14600025/diff/63001/chrome/browser/media/audio_stream_indicator.cc#newcode93 chrome/browser/media/audio_stream_indicator.cc:93: StreamPowerLevels::iterator stream_it; On 2013/07/09 01:36:12, DaleCurtis wrote: > You ...
7 years, 5 months ago (2013-07-09 20:59:53 UTC) #18
Avi (use Gerrit)
LGTM stamp for content.
7 years, 5 months ago (2013-07-16 23:08:18 UTC) #19
Chris Rogers
Yuri, sorry for the long delay. I'm restricting my review to the audio_power_monitor files. Overall ...
7 years, 5 months ago (2013-07-18 00:09:36 UTC) #20
miu
Thanks, Chris. I've made some code changes and responded to your concerns. https://codereview.chromium.org/14600025/diff/85001/media/audio/audio_power_monitor.cc File media/audio/audio_power_monitor.cc ...
7 years, 5 months ago (2013-07-19 01:08:07 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/14600025/102002
7 years, 5 months ago (2013-07-19 01:08:51 UTC) #22
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 5 months ago (2013-07-19 02:38:23 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/14600025/102002
7 years, 5 months ago (2013-07-19 02:40:23 UTC) #24
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=137270
7 years, 5 months ago (2013-07-19 06:46:42 UTC) #25
miu
Dale: PTAL at the diff between Patch Set 6 and 7. The CQ caught a ...
7 years, 5 months ago (2013-07-20 01:43:11 UTC) #26
DaleCurtis
https://codereview.chromium.org/14600025/diff/137001/media/audio/audio_output_controller.cc File media/audio/audio_output_controller.cc (right): https://codereview.chromium.org/14600025/diff/137001/media/audio/audio_output_controller.cc#newcode217 media/audio/audio_output_controller.cc:217: // The AudioOutputController is now closed. Until a playing ...
7 years, 5 months ago (2013-07-22 17:27:20 UTC) #27
miu
https://codereview.chromium.org/14600025/diff/137001/media/audio/audio_output_controller.cc File media/audio/audio_output_controller.cc (right): https://codereview.chromium.org/14600025/diff/137001/media/audio/audio_output_controller.cc#newcode217 media/audio/audio_output_controller.cc:217: // The AudioOutputController is now closed. Until a playing ...
7 years, 5 months ago (2013-07-22 21:10:47 UTC) #28
DaleCurtis
lgtm, but your diff looks messed up, I'm seeing changes to base/cancelable_callback.h which I'm assuming ...
7 years, 5 months ago (2013-07-22 21:36:01 UTC) #29
miu
On 2013/07/22 21:36:01, DaleCurtis wrote: > lgtm, but your diff looks messed up, I'm seeing ...
7 years, 5 months ago (2013-07-22 21:44:11 UTC) #30
miu
Mark: Would you take a look at the addition I made to base/cancelable_callback.h? I needed ...
7 years, 5 months ago (2013-07-22 22:40:59 UTC) #31
Mark Mentovai
LGTM
7 years, 5 months ago (2013-07-23 01:05:36 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/14600025/155001
7 years, 5 months ago (2013-07-23 02:09:53 UTC) #33
commit-bot: I haz the power
7 years, 5 months ago (2013-07-23 05:24:48 UTC) #34
Message was sent while issue was closed.
Change committed as 213042

Powered by Google App Engine
This is Rietveld 408576698