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

Unified Diff: media/audio/audio_manager.h

Issue 2582703003: Audio output debug recording. (Closed)
Patch Set: Code review. Created 3 years, 10 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 | « media/audio/audio_debug_recording_manager_unittest.cc ('k') | media/audio/audio_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_manager.h
diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h
index 613df4d2ee6c70ccfad1241c23b6a0d0bf7a752d..cd91b399d6d4595ce60faf0131baa65f9cfd8bca 100644
--- a/media/audio/audio_manager.h
+++ b/media/audio/audio_manager.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/callback_forward.h"
+#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner_helpers.h"
@@ -19,6 +20,7 @@
#include "media/base/audio_parameters.h"
namespace base {
+class FilePath;
class SingleThreadTaskRunner;
}
@@ -58,9 +60,13 @@ class MEDIA_EXPORT AudioManager {
// The manager will use |worker_task_runner| for heavyweight tasks.
// The |worker_task_runner| may be the same as |task_runner|. This same
// task runner is returned by GetWorkerTaskRunner.
+ //
+ // |file_task_runner| is used for audio debug recordings and is the task
+ // runner to do file output operations on.
static ScopedAudioManagerPtr Create(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
AudioLogFactory* audio_log_factory);
// A convenience wrapper of AudioManager::Create for testing.
@@ -239,6 +245,15 @@ class MEDIA_EXPORT AudioManager {
virtual std::unique_ptr<AudioLog> CreateAudioLog(
AudioLogFactory::AudioComponent component) = 0;
+ // Enable output debug recording. InitializeOutputDebugRecording() must be
+ // called before this function.
+ // TODO(grunell): Control input debug recording via these functions too.
+ virtual void EnableOutputDebugRecording(
+ const base::FilePath& base_file_name) = 0;
+
+ // Disable output debug recording.
+ virtual void DisableOutputDebugRecording() = 0;
+
// Gets the name of the audio manager (e.g., Windows, Mac, PulseAudio).
virtual const char* GetName() = 0;
@@ -246,10 +261,17 @@ class MEDIA_EXPORT AudioManager {
virtual void SetMaxStreamCountForTesting(int max_input, int max_output);
protected:
+ FRIEND_TEST_ALL_PREFIXES(AudioManagerTest, AudioDebugRecording);
+
AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner);
virtual ~AudioManager();
+ // Initializes output debug recording. Can be called on any thread; will post
+ // to the audio thread if not called on it.
+ virtual void InitializeOutputDebugRecording(
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) = 0;
+
private:
friend class base::DeleteHelper<AudioManager>;
friend class AudioManagerDeleter;
« no previous file with comments | « media/audio/audio_debug_recording_manager_unittest.cc ('k') | media/audio/audio_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698