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

Unified Diff: media/audio/audio_input_controller.h

Issue 1272223003: Implement writing mic audio input data to file for debugging purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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
« no previous file with comments | « content/renderer/media/aec_dump_message_filter.cc ('k') | media/audio/audio_input_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller.h
diff --git a/media/audio/audio_input_controller.h b/media/audio/audio_input_controller.h
index 6f14394d0b397e4ed3a43df6ec3c5302d92d7964..26b715115bf2094d8f2bd31c98042e0dab24b31c 100644
--- a/media/audio/audio_input_controller.h
+++ b/media/audio/audio_input_controller.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/atomicops.h"
#include "base/callback.h"
+#include "base/files/file.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
@@ -79,6 +80,7 @@ namespace media {
#define AUDIO_POWER_MONITORING
#endif
+class AudioInputWriter;
class UserInputMonitor;
class MEDIA_EXPORT AudioInputController
@@ -229,6 +231,13 @@ class MEDIA_EXPORT AudioInputController
bool SharedMemoryAndSyncSocketMode() const { return sync_writer_ != NULL; }
+ // Enable debug recording of audio input.
+ void EnableDebugRecording(AudioInputWriter* input_writer);
+
+ // Disbale debug recording of audio input. Must be called before owner of
+ // |input_writer| deletes it.
+ void DisableDebugRecording(const base::Closure& callback);
+
protected:
friend class base::RefCountedThreadSafe<AudioInputController>;
@@ -303,6 +312,14 @@ class MEDIA_EXPORT AudioInputController
void LogSilenceState(SilenceState value);
#endif
+ // Enable and disable debug recording of audio input. Called on the audio
+ // thread.
+ void DoEnableDebugRecording(AudioInputWriter* input_writer);
+ void DoDisableDebugRecording();
+
+ // Called on the audio thread.
+ void WriteInputDataForDebugging(scoped_ptr<AudioBus> data);
+
// Gives access to the task runner of the creating thread.
scoped_refptr<base::SingleThreadTaskRunner> creator_task_runner_;
@@ -366,6 +383,9 @@ class MEDIA_EXPORT AudioInputController
// Time when a low-latency stream is created.
base::TimeTicks low_latency_create_time_;
+ // Used for audio debug recordings. Accessed on audio thread.
+ AudioInputWriter* input_writer_;
+
DISALLOW_COPY_AND_ASSIGN(AudioInputController);
};
« no previous file with comments | « content/renderer/media/aec_dump_message_filter.cc ('k') | media/audio/audio_input_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698