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

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: some small changes 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..a2f08920089005e427032ca9f44a66e58cf8d0a1 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -239,6 +239,7 @@ MediaStreamAudioProcessor::MediaStreamAudioProcessor(
const MediaStreamDevice::AudioDeviceParameters& input_params,
WebRtcPlayoutDataSource* playout_data_source)
: render_delay_ms_(0),
+ audio_repetition_detector_(new AudioRepetitionDetector()),
playout_data_source_(playout_data_source),
audio_mirroring_(false),
typing_detected_(false),
@@ -298,6 +299,15 @@ 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.
+ if (audio_repetition_detector_) {
ajm 2015/09/30 00:23:43 Why do you need to check this?
minyue 2015/09/30 19:52:32 Good point. Tommi asked about whether audio_repeti
+ 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