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

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

Issue 1357013006: Add detection for repeated audio in capturing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: decoupling uma reporting from detection 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.h
diff --git a/content/renderer/media/media_stream_audio_processor.h b/content/renderer/media/media_stream_audio_processor.h
index 4b74ca0a24090d73f7649b93a36dce24d2f9c62b..356d5989f4dfe221b694c86ef24b04f342d7850c 100644
--- a/content/renderer/media/media_stream_audio_processor.h
+++ b/content/renderer/media/media_stream_audio_processor.h
@@ -14,6 +14,7 @@
#include "content/common/content_export.h"
#include "content/public/common/media_stream_request.h"
#include "content/renderer/media/aec_dump_message_filter.h"
+#include "content/renderer/media/audio_repetition_detector.h"
#include "content/renderer/media/webrtc_audio_device_impl.h"
#include "media/base/audio_converter.h"
#include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
@@ -112,7 +113,16 @@ class CONTENT_EXPORT MediaStreamAudioProcessor :
~MediaStreamAudioProcessor() override;
private:
+ class AudioRepetitionReporter : public AudioRepetitionDetector {
Henrik Grunell 2015/10/20 08:50:16 Comment on the class.
Henrik Grunell 2015/10/20 08:50:16 Let this class own a detector instead of inheritin
minyue 2015/10/23 12:05:23 Per offline discussion with Tommi, we use base::Ca
+ public:
+ AudioRepetitionReporter(int min_length_ms, size_t max_frames,
+ const int* look_back_times, size_t num_look_back);
+ private:
+ void ReportRepetition(int look_back_ms) override;
+ };
+
friend class MediaStreamAudioProcessorTest;
+
FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioProcessorTest,
GetAecDumpMessageFilter);
@@ -153,6 +163,9 @@ class CONTENT_EXPORT MediaStreamAudioProcessor :
// both the capture audio thread and the render audio thread.
base::subtle::Atomic32 render_delay_ms_;
+ // Module to detect and report (to UMA) bit exact audio repetition.
+ scoped_ptr<AudioRepetitionReporter> audio_repetition_reporter_;
+
// Module to handle processing and format conversion.
scoped_ptr<webrtc::AudioProcessing> audio_processing_;

Powered by Google App Engine
This is Rietveld 408576698