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

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: Code review 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 "base/move.h"
14 #include "media/audio/audio_input_writer.h"
15
16 namespace media {
17
18 class AudioBus;
19 class AudioBusRefCounted;
20
21 } // namespace media
22
23 namespace content {
24
25 // Writes audio input data used for debugging purposes. Can be created on any
26 // thread. Must be destroyed on the FILE thread. Write call can be made on any
27 // thread. This object must be unregistered in Write caller before destroyed.
28 // When created, it takes ownership of |file|.
29 class AudioInputDebugWriter : public media::AudioInputWriter {
30
tommi (sloooow) - chröme 2015/08/19 11:32:21 nit: remove
Henrik Grunell 2015/08/19 19:57:16 Done.
31 public:
32 explicit AudioInputDebugWriter(base::File file);
33
34 ~AudioInputDebugWriter() override;
35
36 // Write data from |data| to file.
37 void Write(scoped_ptr<media::AudioBus> data) override;
38
39 private:
40 void DoWrite(scoped_ptr<media::AudioBus> data);
41
42 base::File file_;
43
44 scoped_ptr<char[]> interleaved_data_;
tommi (sloooow) - chröme 2015/08/19 11:32:21 maybe a comment about the format of the buffer? (i
Henrik Grunell 2015/08/19 19:57:16 Done.
45 int interleaved_data_size_;
46
47 base::WeakPtrFactory<AudioInputDebugWriter> weak_factory_;
48 };
49
50 } // namspace content
51
52 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEBUG_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698