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 COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_IMPL_H_ | 5 #ifndef COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_IMPL_H_ |
6 #define COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_IMPL_H_ | 6 #define COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_IMPL_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
13 #include "components/audio_modem/audio_recorder.h" | 15 #include "components/audio_modem/audio_recorder.h" |
14 #include "media/audio/audio_io.h" | 16 #include "media/audio/audio_io.h" |
15 #include "media/audio/audio_parameters.h" | 17 #include "media/audio/audio_parameters.h" |
16 | 18 |
17 namespace base { | 19 namespace base { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void StopOnAudioThread(); | 68 void StopOnAudioThread(); |
67 void StopAndCloseOnAudioThread(); | 69 void StopAndCloseOnAudioThread(); |
68 void FinalizeOnAudioThread(); | 70 void FinalizeOnAudioThread(); |
69 | 71 |
70 // AudioInputStream::AudioInputCallback overrides: | 72 // AudioInputStream::AudioInputCallback overrides: |
71 // Called by the audio recorder when a full packet of audio data is | 73 // Called by the audio recorder when a full packet of audio data is |
72 // available. This is called from a special audio thread and the | 74 // available. This is called from a special audio thread and the |
73 // implementation should return as soon as possible. | 75 // implementation should return as soon as possible. |
74 void OnData(media::AudioInputStream* stream, | 76 void OnData(media::AudioInputStream* stream, |
75 const media::AudioBus* source, | 77 const media::AudioBus* source, |
76 uint32 hardware_delay_bytes, | 78 uint32_t hardware_delay_bytes, |
77 double volume) override; | 79 double volume) override; |
78 void OnError(media::AudioInputStream* stream) override; | 80 void OnError(media::AudioInputStream* stream) override; |
79 | 81 |
80 // Flushes the audio loop, making sure that any queued operations are | 82 // Flushes the audio loop, making sure that any queued operations are |
81 // performed. | 83 // performed. |
82 void FlushAudioLoopForTesting(); | 84 void FlushAudioLoopForTesting(); |
83 | 85 |
84 bool is_recording_; | 86 bool is_recording_; |
85 | 87 |
86 media::AudioInputStream* stream_; | 88 media::AudioInputStream* stream_; |
87 | 89 |
88 RecordedSamplesCallback decode_callback_; | 90 RecordedSamplesCallback decode_callback_; |
89 | 91 |
90 // Outside of the ctor/Initialize method, only access the next variables on | 92 // Outside of the ctor/Initialize method, only access the next variables on |
91 // the recording thread. | 93 // the recording thread. |
92 scoped_ptr<media::AudioBus> buffer_; | 94 scoped_ptr<media::AudioBus> buffer_; |
93 int total_buffer_frames_; | 95 int total_buffer_frames_; |
94 int buffer_frame_index_; | 96 int buffer_frame_index_; |
95 | 97 |
96 scoped_ptr<media::AudioInputStream> input_stream_for_testing_; | 98 scoped_ptr<media::AudioInputStream> input_stream_for_testing_; |
97 scoped_ptr<media::AudioParameters> params_for_testing_; | 99 scoped_ptr<media::AudioParameters> params_for_testing_; |
98 | 100 |
99 DISALLOW_COPY_AND_ASSIGN(AudioRecorderImpl); | 101 DISALLOW_COPY_AND_ASSIGN(AudioRecorderImpl); |
100 }; | 102 }; |
101 | 103 |
102 } // namespace audio_modem | 104 } // namespace audio_modem |
103 | 105 |
104 #endif // COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_IMPL_H_ | 106 #endif // COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_IMPL_H_ |
OLD | NEW |