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

Unified Diff: media/audio/audio_file_writer.h

Issue 2582703003: Audio output debug recording. (Closed)
Patch Set: Code review (pfeldman@/dalecurtis@) and a fix. Rebase. 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
Index: media/audio/audio_file_writer.h
diff --git a/media/audio/audio_file_writer.h b/media/audio/audio_file_writer.h
index dabfa23dd95566b78e32f34e6312a5608a9a2b9d..99a6feaff3827539fe071744b832c7ca338021d9 100644
--- a/media/audio/audio_file_writer.h
+++ b/media/audio/audio_file_writer.h
@@ -7,18 +7,23 @@
#include <memory>
-namespace base {
-class FilePath;
-}
+#include "base/callback_forward.h"
+#include "base/files/file_path.h"
namespace media {
class AudioBus;
+class AudioParameters;
// A writer interface used for writing audio data to file for debugging
// purposes.
class AudioFileWriter {
public:
+ // Used for creating an AudioFileWriter.
+ using CreateCallback =
+ base::RepeatingCallback<std::unique_ptr<AudioFileWriter>(
+ const AudioParameters&)>;
+
virtual ~AudioFileWriter() {}
// Must be called before calling Write() for the first time after creation or
@@ -38,8 +43,13 @@ class AudioFileWriter {
// may be ambigulous if Start() or Stop() is executed at the moment. Can be
// called from any sequence.
virtual bool WillWrite() = 0;
+
+ // Gets the extension for the file type the as a string, for example "wav".
+ // Can be called before calling Start() to add the appropriate extension to
+ // the filename.
+ virtual const base::FilePath::CharType* GetFileNameExtension() = 0;
};
-} // namespace media
+} // namspace media
#endif // MEDIA_AUDIO_AUDIO_FILE_WRITER_H_

Powered by Google App Engine
This is Rietveld 408576698