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

Unified Diff: content/renderer/media/media_stream_audio_level_calculator.h

Issue 661693003: Avoid reporting 0 as input level when AudioProcessing zero out the audio data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed the variable name and comment. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/media/media_stream_audio_level_calculator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_audio_level_calculator.h
diff --git a/content/renderer/media/media_stream_audio_level_calculator.h b/content/renderer/media/media_stream_audio_level_calculator.h
index 41c9c34f7be1b2f803941ca2429417ddc8eb4fdc..3b4b2f6babfb6ad9811d8b224d3e44f74385c056 100644
--- a/content/renderer/media/media_stream_audio_level_calculator.h
+++ b/content/renderer/media/media_stream_audio_level_calculator.h
@@ -21,8 +21,14 @@ class MediaStreamAudioLevelCalculator {
// Calculates the signal level of the audio data.
// Returns the absolute value of the amplitude of the signal.
+ // |force_report_nonzero_energy| is a flag forcing the calculator to
+ // report nonzero energy. Since |audio_data| is post processed data, and the
tommi (sloooow) - chröme 2014/10/20 15:40:17 // report nonzero energy even if the energy of the
no longer working on chromium 2014/10/20 15:45:46 Done.
+ // audio processing might zero all the audio data, when the caller detects
+ // the pre processed data contain energy, it could pass
+ // |force_report_nonzero_energy| as true to force calculator to report 1 as
+ // energy when |audio_data| is all zero.
int Calculate(const int16* audio_data, int number_of_channels,
- int number_of_frames);
+ int number_of_frames, bool force_report_nonzero_energy);
private:
// Used to DCHECK that the constructor and Calculate() are always called on
« no previous file with comments | « no previous file | content/renderer/media/media_stream_audio_level_calculator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698