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

Unified Diff: media/audio/audio_output_resampler.h

Issue 2582703003: Audio output debug recording. (Closed)
Patch Set: Changed to record in AudioOutputResampler. Created 3 years, 11 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_manager_base.cc ('k') | media/audio/audio_output_resampler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_resampler.h
diff --git a/media/audio/audio_output_resampler.h b/media/audio/audio_output_resampler.h
index da512e09ebc345934a326a8c367678f639678067..fb3d1c90119af8af88b213e5cb99ca4a42abd150 100644
--- a/media/audio/audio_output_resampler.h
+++ b/media/audio/audio_output_resampler.h
@@ -7,6 +7,7 @@
#include <map>
+#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
@@ -47,6 +48,10 @@ class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher {
void StreamVolumeSet(AudioOutputProxy* stream_proxy, double volume) override;
void CloseStream(AudioOutputProxy* stream_proxy) override;
+ // Controls debug recording.
DaleCurtis 2017/01/24 01:12:02 It seems like this should just be something like S
+ void EnableDebugRecording(const base::FilePath& file_name);
+ void DisableDebugRecording();
+
private:
using CallbackMap =
std::map<AudioOutputProxy*, std::unique_ptr<OnMoreDataConverter>>;
@@ -64,6 +69,12 @@ class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher {
// Stops the stream corresponding to the |item| in |callbacks_|.
void StopStreamInternal(const CallbackMap::value_type& item);
+ // Helper function that conditionally starts debug recording.
+ void MaybeStartDebugRecording();
+
+ // The AudioManager that creates us.
+ AudioManager* audio_manager_;
+
// Dispatcher to proxy all AudioOutputDispatcher calls too.
std::unique_ptr<AudioOutputDispatcherImpl> dispatcher_;
@@ -90,6 +101,10 @@ class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher {
// to a fake stream indefinitely for transient errors.
base::Timer reinitialize_timer_;
+ // Used for audio debug recordings. The file name is stored when enabling to
+ // be able to enable on new OnMoreDataConverters.
+ base::FilePath debug_recording_file_name_;
+
base::WeakPtrFactory<AudioOutputResampler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(AudioOutputResampler);
};
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/audio_output_resampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698