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

Unified Diff: content/renderer/media/media_stream_audio_processor.cc

Issue 1357013006: Add detection for repeated audio in capturing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dropping duration for easier logging Created 5 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
Index: content/renderer/media/media_stream_audio_processor.cc
diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc
index 23547d1b2b6490331f28d0110284f523044e1d57..041032cc12cce3a961ca56079c072ab26e08621e 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -296,6 +296,13 @@ bool MediaStreamAudioProcessor::ProcessAndConsumeData(
if (!capture_fifo_->Consume(&process_bus, capture_delay))
return false;
+ // Detect bit-exact repetition of audio present in the captured audio.
+ // We detect only one channel.
+ audio_repetition_detector_.Detect(process_bus->bus()->channel(0),
+ process_bus->bus()->frames(),
+ 1, // number of channels
+ input_format_.sample_rate());
+
// Use the process bus directly if audio processing is disabled.
MediaStreamAudioBus* output_bus = process_bus;
*new_volume = 0;

Powered by Google App Engine
This is Rietveld 408576698