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> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // AudioInputStream::AudioInputCallback overrides: | 72 // AudioInputStream::AudioInputCallback overrides: |
73 // 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 |
74 // available. This is called from a special audio thread and the | 74 // available. This is called from a special audio thread and the |
75 // implementation should return as soon as possible. | 75 // implementation should return as soon as possible. |
76 void OnData(media::AudioInputStream* stream, | 76 void OnData(media::AudioInputStream* stream, |
77 const media::AudioBus* source, | 77 const media::AudioBus* source, |
78 uint32_t hardware_delay_bytes, | 78 uint32_t hardware_delay_bytes, |
79 double volume) override; | 79 double volume) override; |
80 void OnError(media::AudioInputStream* stream) override; | 80 void OnError(media::AudioInputStream* stream) override; |
81 | 81 |
82 // Flushes the audio loop, making sure that any queued operations are | |
83 // performed. | |
84 void FlushAudioLoopForTesting(); | |
85 | |
86 bool is_recording_; | 82 bool is_recording_; |
87 | 83 |
88 media::AudioInputStream* stream_; | 84 media::AudioInputStream* stream_; |
89 | 85 |
90 RecordedSamplesCallback decode_callback_; | 86 RecordedSamplesCallback decode_callback_; |
91 | 87 |
92 // Outside of the ctor/Initialize method, only access the next variables on | 88 // Outside of the ctor/Initialize method, only access the next variables on |
93 // the recording thread. | 89 // the recording thread. |
94 scoped_ptr<media::AudioBus> buffer_; | 90 scoped_ptr<media::AudioBus> buffer_; |
95 int total_buffer_frames_; | 91 int total_buffer_frames_; |
96 int buffer_frame_index_; | 92 int buffer_frame_index_; |
97 | 93 |
98 scoped_ptr<media::AudioInputStream> input_stream_for_testing_; | 94 scoped_ptr<media::AudioInputStream> input_stream_for_testing_; |
99 scoped_ptr<media::AudioParameters> params_for_testing_; | 95 scoped_ptr<media::AudioParameters> params_for_testing_; |
100 | 96 |
101 DISALLOW_COPY_AND_ASSIGN(AudioRecorderImpl); | 97 DISALLOW_COPY_AND_ASSIGN(AudioRecorderImpl); |
102 }; | 98 }; |
103 | 99 |
104 } // namespace audio_modem | 100 } // namespace audio_modem |
105 | 101 |
106 #endif // COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_IMPL_H_ | 102 #endif // COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_IMPL_H_ |
OLD | NEW |