OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_DEBUG_FILE_WRITER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_DEBUG_FILE_WRITER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_DEBUG_FILE_WRITER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_DEBUG_FILE_WRITER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace content { | 26 namespace content { |
27 | 27 |
28 // Writes audio input data used for debugging purposes. All operations are | 28 // Writes audio input data used for debugging purposes. All operations are |
29 // non-blocking. | 29 // non-blocking. |
30 class CONTENT_EXPORT AudioDebugFileWriter | 30 class CONTENT_EXPORT AudioDebugFileWriter |
31 : public NON_EXPORTED_BASE(media::AudioFileWriter) { | 31 : public NON_EXPORTED_BASE(media::AudioFileWriter) { |
32 public: | 32 public: |
33 explicit AudioDebugFileWriter(const media::AudioParameters& params); | 33 explicit AudioDebugFileWriter(const media::AudioParameters& params); |
34 ~AudioDebugFileWriter() override; | 34 ~AudioDebugFileWriter() override; |
35 | 35 |
| 36 static std::unique_ptr<media::AudioFileWriter> Create( |
| 37 const media::AudioParameters& params); |
| 38 |
36 void Start(const base::FilePath& file) override; | 39 void Start(const base::FilePath& file) override; |
37 void Stop() override; | 40 void Stop() override; |
38 void Write(std::unique_ptr<media::AudioBus> data) override; | 41 void Write(std::unique_ptr<media::AudioBus> data) override; |
39 bool WillWrite() override; | 42 bool WillWrite() override; |
40 | 43 |
41 private: | 44 private: |
42 class AudioFileWriter; | 45 class AudioFileWriter; |
43 using AudioFileWriterUniquePtr = | 46 using AudioFileWriterUniquePtr = |
44 std::unique_ptr<AudioFileWriter, BrowserThread::DeleteOnFileThread>; | 47 std::unique_ptr<AudioFileWriter, BrowserThread::DeleteOnFileThread>; |
45 AudioFileWriterUniquePtr file_writer_; | 48 AudioFileWriterUniquePtr file_writer_; |
46 const media::AudioParameters params_; | 49 const media::AudioParameters params_; |
47 base::SequenceChecker client_sequence_checker_; | 50 base::SequenceChecker client_sequence_checker_; |
48 }; | 51 }; |
49 | 52 |
50 } // namspace content | 53 } // namspace content |
51 | 54 |
52 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_DEBUG_FILE_WRITER_H_ | 55 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_DEBUG_FILE_WRITER_H_ |
OLD | NEW |