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

Side by Side Diff: content/browser/renderer_host/media/audio_input_debug_writer.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: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEBUG_WRITER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEBUG_WRITER_H_
7
8 #include "base/files/file.h"
9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "media/audio/audio_input_writer.h"
14
15 namespace media {
16
17 class AudioBus;
18 class AudioBusRefCounted;
19
20 } // namespace media
21
22 namespace content {
23
24 // Writes audio input data used for debugging purposes. Can be created on any
25 // thread. Must be destroyed on the FILE thread. Write call can be made on any
26 // thread. This object must be unregistered in Write caller before destroyed.
27 // When created, it takes ownership of |file|.
28 class AudioInputDebugWriter : public media::AudioInputWriter {
29 public:
30 explicit AudioInputDebugWriter(base::File file);
31 ~AudioInputDebugWriter() override;
32
33 // Write data from |data| to file.
34 void Write(scoped_ptr<media::AudioBus> data) override;
35
36 private:
37 void DoWrite(scoped_ptr<media::AudioBus> data);
38
39 base::File file_;
40
41 scoped_ptr<char[]> interleaved_data_;
42 int interleaved_data_size_;
43
44 base::WeakPtrFactory<AudioInputDebugWriter> weak_factory_;
45
46 DISALLOW_COPY_AND_ASSIGN(AudioInputDebugWriter);
47 };
48
49 } // namspace content
50
51 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEBUG_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698