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

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: on andrew's comment Created 5 years, 3 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 56d9570720d5eb9f97005203956ca652b0b010be..7aab61a034e3b6a5202534be27df173ad2ec103c 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -298,6 +298,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