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

Side by Side Diff: components/audio_modem/audio_recorder_impl.h

Issue 1806313003: Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments from patch 48 Created 4 years, 8 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
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
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_
OLDNEW
« no previous file with comments | « components/audio_modem/audio_player_unittest.cc ('k') | components/audio_modem/audio_recorder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698