OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "media/audio/android/opensles_input.h" | 5 #include "media/audio/android/opensles_input.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/audio/android/audio_manager_android.h" | 8 #include "media/audio/android/audio_manager_android.h" |
9 | 9 |
10 #define LOG_ON_FAILURE_AND_RETURN(op, ...) \ | 10 #define LOG_ON_FAILURE_AND_RETURN(op, ...) \ |
11 do { \ | 11 do { \ |
12 SLresult err = (op); \ | 12 SLresult err = (op); \ |
13 if (err != SL_RESULT_SUCCESS) { \ | 13 if (err != SL_RESULT_SUCCESS) { \ |
14 DLOG(ERROR) << #op << " failed: " << err; \ | 14 DLOG(ERROR) << #op << " failed: " << err; \ |
15 return __VA_ARGS__; \ | 15 return __VA_ARGS__; \ |
16 } \ | 16 } \ |
17 } while (0) | 17 } while (0) |
18 | 18 |
19 namespace media { | 19 namespace media { |
20 | 20 |
21 OpenSLESInputStream::OpenSLESInputStream(AudioManagerAndroid* audio_manager, | 21 OpenSLESInputStream::OpenSLESInputStream(AudioManagerAndroid* audio_manager, |
22 const AudioParameters& params) | 22 const AudioParameters& params) |
23 : audio_manager_(audio_manager), | 23 : audio_manager_(audio_manager), |
24 callback_(NULL), | 24 callback_(NULL), |
25 recorder_(NULL), | 25 recorder_(NULL), |
26 simple_buffer_queue_(NULL), | 26 simple_buffer_queue_(NULL), |
27 active_queue_(0), | 27 active_buffer_(0), |
28 buffer_size_bytes_(0), | 28 buffer_size_bytes_(0), |
29 started_(false) { | 29 started_(false) { |
30 DVLOG(2) << "OpenSLESInputStream::OpenSLESInputStream()"; | |
30 format_.formatType = SL_DATAFORMAT_PCM; | 31 format_.formatType = SL_DATAFORMAT_PCM; |
31 format_.numChannels = static_cast<SLuint32>(params.channels()); | 32 format_.numChannels = static_cast<SLuint32>(params.channels()); |
32 // Provides sampling rate in milliHertz to OpenSLES. | 33 // Provides sampling rate in milliHertz to OpenSLES. |
33 format_.samplesPerSec = static_cast<SLuint32>(params.sample_rate() * 1000); | 34 format_.samplesPerSec = static_cast<SLuint32>(params.sample_rate() * 1000); |
34 format_.bitsPerSample = params.bits_per_sample(); | 35 format_.bitsPerSample = params.bits_per_sample(); |
35 format_.containerSize = params.bits_per_sample(); | 36 format_.containerSize = params.bits_per_sample(); |
36 format_.endianness = SL_BYTEORDER_LITTLEENDIAN; | 37 format_.endianness = SL_BYTEORDER_LITTLEENDIAN; |
37 if (format_.numChannels == 1) | 38 if (format_.numChannels == 1) |
38 format_.channelMask = SL_SPEAKER_FRONT_CENTER; | 39 format_.channelMask = SL_SPEAKER_FRONT_CENTER; |
39 else if (format_.numChannels == 2) | 40 else if (format_.numChannels == 2) |
40 format_.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT; | 41 format_.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT; |
41 else | 42 else |
42 NOTREACHED() << "Unsupported number of channels: " << format_.numChannels; | 43 NOTREACHED() << "Unsupported number of channels: " << format_.numChannels; |
43 | 44 |
44 buffer_size_bytes_ = params.GetBytesPerBuffer(); | 45 buffer_size_bytes_ = params.GetBytesPerBuffer(); |
45 | 46 |
46 memset(&audio_data_, 0, sizeof(audio_data_)); | 47 memset(&audio_data_, 0, sizeof(audio_data_)); |
47 } | 48 } |
48 | 49 |
49 OpenSLESInputStream::~OpenSLESInputStream() { | 50 OpenSLESInputStream::~OpenSLESInputStream() { |
51 DVLOG(2) << "OpenSLESInputStream::~OpenSLESInputStream()"; | |
52 DCHECK(thread_checker_.CalledOnValidThread()); | |
50 DCHECK(!recorder_object_.Get()); | 53 DCHECK(!recorder_object_.Get()); |
51 DCHECK(!engine_object_.Get()); | 54 DCHECK(!engine_object_.Get()); |
52 DCHECK(!recorder_); | 55 DCHECK(!recorder_); |
53 DCHECK(!simple_buffer_queue_); | 56 DCHECK(!simple_buffer_queue_); |
54 DCHECK(!audio_data_[0]); | 57 DCHECK(!audio_data_[0]); |
55 } | 58 } |
56 | 59 |
57 bool OpenSLESInputStream::Open() { | 60 bool OpenSLESInputStream::Open() { |
61 DVLOG(2) << "OpenSLESInputStream::Open()"; | |
62 DCHECK(thread_checker_.CalledOnValidThread()); | |
58 if (engine_object_.Get()) | 63 if (engine_object_.Get()) |
59 return false; | 64 return false; |
60 | 65 |
61 if (!CreateRecorder()) | 66 if (!CreateRecorder()) |
62 return false; | 67 return false; |
63 | 68 |
64 SetupAudioBuffer(); | 69 SetupAudioBuffer(); |
70 active_buffer_ = 0; | |
65 | 71 |
66 return true; | 72 return true; |
67 } | 73 } |
68 | 74 |
69 void OpenSLESInputStream::Start(AudioInputCallback* callback) { | 75 void OpenSLESInputStream::Start(AudioInputCallback* callback) { |
76 DVLOG(2) << "OpenSLESInputStream::Start()"; | |
77 DCHECK(thread_checker_.CalledOnValidThread()); | |
70 DCHECK(callback); | 78 DCHECK(callback); |
71 DCHECK(recorder_); | 79 DCHECK(recorder_); |
72 DCHECK(simple_buffer_queue_); | 80 DCHECK(simple_buffer_queue_); |
73 if (started_) | 81 if (started_) |
74 return; | 82 return; |
75 | 83 |
76 // Enable the flags before streaming. | 84 base::AutoLock lock(lock_); |
85 DCHECK(!callback_); | |
77 callback_ = callback; | 86 callback_ = callback; |
78 active_queue_ = 0; | |
79 started_ = true; | |
80 | 87 |
81 SLresult err = SL_RESULT_UNKNOWN_ERROR; | 88 SLAndroidSimpleBufferQueueState buffer_queue_state; |
82 // Enqueues |kNumOfQueuesInBuffer| zero buffers to get the ball rolling. | 89 SLresult err = (*simple_buffer_queue_)->GetState(simple_buffer_queue_, |
83 for (int i = 0; i < kNumOfQueuesInBuffer; ++i) { | 90 &buffer_queue_state); |
91 if (SL_RESULT_SUCCESS != err) { | |
92 HandleError(err); | |
93 return; | |
94 } | |
95 | |
96 // Number of free buffers in the queue. | |
97 int num_free_buffers = kMaxNumOfBuffersInQueue - buffer_queue_state.count; | |
98 DCHECK(num_free_buffers == kMaxNumOfBuffersInQueue || num_free_buffers == 0); | |
99 | |
100 // Enqueues |num_free_buffers| zero buffers to get the ball rolling. | |
101 // |num_free_buffers| can be zero if Stop has been called followed by a | |
102 // new call to Start. We do clear the queue in Stop, and the buffer state | |
103 // should then be cleared, but for some reason it is not. Using this | |
104 // approach enables call sequences like: Start, Stop, Start, even if there | |
105 // might be some old data remaining at the second call to Start. | |
106 for (int i = 0; i < num_free_buffers; ++i) { | |
84 err = (*simple_buffer_queue_)->Enqueue( | 107 err = (*simple_buffer_queue_)->Enqueue( |
85 simple_buffer_queue_, | 108 simple_buffer_queue_, |
86 audio_data_[i], | 109 audio_data_[i], |
87 buffer_size_bytes_); | 110 buffer_size_bytes_); |
88 if (SL_RESULT_SUCCESS != err) { | 111 if (SL_RESULT_SUCCESS != err) { |
89 HandleError(err); | 112 HandleError(err); |
90 return; | 113 return; |
91 } | 114 } |
92 } | 115 } |
93 | 116 |
94 // Start the recording by setting the state to |SL_RECORDSTATE_RECORDING|. | 117 // Start the recording by setting the state to |SL_RECORDSTATE_RECORDING|. |
95 err = (*recorder_)->SetRecordState(recorder_, SL_RECORDSTATE_RECORDING); | 118 err = (*recorder_)->SetRecordState(recorder_, SL_RECORDSTATE_RECORDING); |
96 if (SL_RESULT_SUCCESS != err) | 119 if (SL_RESULT_SUCCESS != err) { |
97 HandleError(err); | 120 HandleError(err); |
121 return; | |
122 } | |
123 | |
124 started_ = true; | |
98 } | 125 } |
99 | 126 |
100 void OpenSLESInputStream::Stop() { | 127 void OpenSLESInputStream::Stop() { |
128 DVLOG(2) << "OpenSLESInputStream::Stop()"; | |
129 DCHECK(thread_checker_.CalledOnValidThread()); | |
101 if (!started_) | 130 if (!started_) |
102 return; | 131 return; |
103 | 132 |
133 base::AutoLock lock(lock_); | |
134 | |
104 // Stop recording by setting the record state to |SL_RECORDSTATE_STOPPED|. | 135 // Stop recording by setting the record state to |SL_RECORDSTATE_STOPPED|. |
105 LOG_ON_FAILURE_AND_RETURN( | 136 LOG_ON_FAILURE_AND_RETURN( |
106 (*recorder_)->SetRecordState(recorder_, | 137 (*recorder_)->SetRecordState(recorder_, |
107 SL_RECORDSTATE_STOPPED)); | 138 SL_RECORDSTATE_STOPPED)); |
108 | 139 |
109 // Clear the buffer queue to get rid of old data when resuming recording. | 140 // Clear the buffer queue to get rid of old data when resuming recording. |
110 LOG_ON_FAILURE_AND_RETURN( | 141 LOG_ON_FAILURE_AND_RETURN( |
111 (*simple_buffer_queue_)->Clear(simple_buffer_queue_)); | 142 (*simple_buffer_queue_)->Clear(simple_buffer_queue_)); |
112 | 143 |
113 started_ = false; | 144 started_ = false; |
114 } | 145 } |
115 | 146 |
116 void OpenSLESInputStream::Close() { | 147 void OpenSLESInputStream::Close() { |
148 DVLOG(2) << "OpenSLESInputStream::Close()"; | |
149 DCHECK(thread_checker_.CalledOnValidThread()); | |
150 | |
117 // Stop the stream if it is still recording. | 151 // Stop the stream if it is still recording. |
118 Stop(); | 152 Stop(); |
153 { | |
154 base::AutoLock lock(lock_); | |
119 | 155 |
120 // Explicitly free the player objects and invalidate their associated | 156 if (callback_) { |
121 // interfaces. They have to be done in the correct order. | 157 callback_->OnClose(this); |
122 recorder_object_.Reset(); | 158 callback_ = NULL; |
123 engine_object_.Reset(); | 159 } |
124 simple_buffer_queue_ = NULL; | |
125 recorder_ = NULL; | |
126 | 160 |
127 ReleaseAudioBuffer(); | 161 // Destroy the buffer queue recorder object and invalidate all associated |
162 // interfaces. | |
163 recorder_object_.Reset(); | |
164 simple_buffer_queue_ = NULL; | |
165 recorder_ = NULL; | |
166 | |
167 // Destroy the engine object. We don't store any associated interface for | |
168 // this object. | |
169 engine_object_.Reset(); | |
170 ReleaseAudioBuffer(); | |
171 } | |
128 | 172 |
129 audio_manager_->ReleaseInputStream(this); | 173 audio_manager_->ReleaseInputStream(this); |
130 } | 174 } |
131 | 175 |
132 double OpenSLESInputStream::GetMaxVolume() { | 176 double OpenSLESInputStream::GetMaxVolume() { |
133 NOTIMPLEMENTED(); | 177 NOTIMPLEMENTED(); |
134 return 0.0; | 178 return 0.0; |
135 } | 179 } |
136 | 180 |
137 void OpenSLESInputStream::SetVolume(double volume) { | 181 void OpenSLESInputStream::SetVolume(double volume) { |
138 NOTIMPLEMENTED(); | 182 NOTIMPLEMENTED(); |
139 } | 183 } |
140 | 184 |
141 double OpenSLESInputStream::GetVolume() { | 185 double OpenSLESInputStream::GetVolume() { |
142 NOTIMPLEMENTED(); | 186 NOTIMPLEMENTED(); |
143 return 0.0; | 187 return 0.0; |
144 } | 188 } |
145 | 189 |
146 void OpenSLESInputStream::SetAutomaticGainControl(bool enabled) { | 190 void OpenSLESInputStream::SetAutomaticGainControl(bool enabled) { |
147 NOTIMPLEMENTED(); | 191 NOTIMPLEMENTED(); |
148 } | 192 } |
149 | 193 |
150 bool OpenSLESInputStream::GetAutomaticGainControl() { | 194 bool OpenSLESInputStream::GetAutomaticGainControl() { |
151 NOTIMPLEMENTED(); | 195 NOTIMPLEMENTED(); |
152 return false; | 196 return false; |
153 } | 197 } |
154 | 198 |
155 bool OpenSLESInputStream::CreateRecorder() { | 199 bool OpenSLESInputStream::CreateRecorder() { |
200 DCHECK(thread_checker_.CalledOnValidThread()); | |
201 DCHECK(!engine_object_.Get()); | |
202 DCHECK(!recorder_object_.Get()); | |
203 DCHECK(!recorder_); | |
204 DCHECK(!simple_buffer_queue_); | |
205 | |
156 // Initializes the engine object with specific option. After working with the | 206 // Initializes the engine object with specific option. After working with the |
157 // object, we need to free the object and its resources. | 207 // object, we need to free the object and its resources. |
158 SLEngineOption option[] = { | 208 SLEngineOption option[] = { |
159 { SL_ENGINEOPTION_THREADSAFE, static_cast<SLuint32>(SL_BOOLEAN_TRUE) } | 209 { SL_ENGINEOPTION_THREADSAFE, static_cast<SLuint32>(SL_BOOLEAN_TRUE) } |
160 }; | 210 }; |
161 LOG_ON_FAILURE_AND_RETURN(slCreateEngine(engine_object_.Receive(), | 211 LOG_ON_FAILURE_AND_RETURN(slCreateEngine(engine_object_.Receive(), |
162 1, | 212 1, |
163 option, | 213 option, |
164 0, | 214 0, |
165 NULL, | 215 NULL, |
(...skipping 15 matching lines...) Expand all Loading... | |
181 // Audio source configuration. | 231 // Audio source configuration. |
182 SLDataLocator_IODevice mic_locator = { | 232 SLDataLocator_IODevice mic_locator = { |
183 SL_DATALOCATOR_IODEVICE, SL_IODEVICE_AUDIOINPUT, | 233 SL_DATALOCATOR_IODEVICE, SL_IODEVICE_AUDIOINPUT, |
184 SL_DEFAULTDEVICEID_AUDIOINPUT, NULL | 234 SL_DEFAULTDEVICEID_AUDIOINPUT, NULL |
185 }; | 235 }; |
186 SLDataSource audio_source = { &mic_locator, NULL }; | 236 SLDataSource audio_source = { &mic_locator, NULL }; |
187 | 237 |
188 // Audio sink configuration. | 238 // Audio sink configuration. |
189 SLDataLocator_AndroidSimpleBufferQueue buffer_queue = { | 239 SLDataLocator_AndroidSimpleBufferQueue buffer_queue = { |
190 SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, // Locator type. | 240 SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, // Locator type. |
191 static_cast<SLuint32>(kNumOfQueuesInBuffer) // Number of buffers. | 241 static_cast<SLuint32>(kMaxNumOfBuffersInQueue) // Number of buffers. |
192 }; | 242 }; |
193 SLDataSink audio_sink = { &buffer_queue, &format_ }; | 243 SLDataSink audio_sink = { &buffer_queue, &format_ }; |
194 | 244 |
195 // Create an audio recorder. | 245 // Create an audio recorder. |
196 const SLInterfaceID interface_id[] = { | 246 const SLInterfaceID interface_id[] = { |
197 SL_IID_ANDROIDSIMPLEBUFFERQUEUE, | 247 SL_IID_ANDROIDSIMPLEBUFFERQUEUE, |
198 SL_IID_ANDROIDCONFIGURATION | 248 SL_IID_ANDROIDCONFIGURATION |
199 }; | 249 }; |
200 const SLboolean interface_required[] = { | 250 const SLboolean interface_required[] = { |
201 SL_BOOLEAN_TRUE, | 251 SL_BOOLEAN_TRUE, |
202 SL_BOOLEAN_TRUE | 252 SL_BOOLEAN_TRUE |
203 }; | 253 }; |
254 | |
204 // Create AudioRecorder and specify SL_IID_ANDROIDCONFIGURATION. | 255 // Create AudioRecorder and specify SL_IID_ANDROIDCONFIGURATION. |
205 LOG_ON_FAILURE_AND_RETURN( | 256 LOG_ON_FAILURE_AND_RETURN( |
206 (*engine)->CreateAudioRecorder(engine, | 257 (*engine)->CreateAudioRecorder(engine, |
207 recorder_object_.Receive(), | 258 recorder_object_.Receive(), |
208 &audio_source, | 259 &audio_source, |
209 &audio_sink, | 260 &audio_sink, |
210 arraysize(interface_id), | 261 arraysize(interface_id), |
211 interface_id, | 262 interface_id, |
212 interface_required), | 263 interface_required), |
213 false); | 264 false); |
214 | 265 |
215 SLAndroidConfigurationItf recorder_config; | 266 SLAndroidConfigurationItf recorder_config; |
216 LOG_ON_FAILURE_AND_RETURN( | 267 LOG_ON_FAILURE_AND_RETURN( |
217 recorder_object_->GetInterface(recorder_object_.Get(), | 268 recorder_object_->GetInterface(recorder_object_.Get(), |
218 SL_IID_ANDROIDCONFIGURATION, | 269 SL_IID_ANDROIDCONFIGURATION, |
219 &recorder_config), | 270 &recorder_config), |
220 false); | 271 false); |
221 | 272 |
273 // Uses the main microphone tuned for audio communications. | |
222 SLint32 stream_type = SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION; | 274 SLint32 stream_type = SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION; |
223 LOG_ON_FAILURE_AND_RETURN( | 275 LOG_ON_FAILURE_AND_RETURN( |
224 (*recorder_config)->SetConfiguration(recorder_config, | 276 (*recorder_config)->SetConfiguration(recorder_config, |
225 SL_ANDROID_KEY_RECORDING_PRESET, | 277 SL_ANDROID_KEY_RECORDING_PRESET, |
226 &stream_type, sizeof(SLint32)), | 278 &stream_type, sizeof(SLint32)), |
227 false); | 279 false); |
228 | 280 |
229 // Realize the recorder object in synchronous mode. | 281 // Realize the recorder object in synchronous mode. |
230 LOG_ON_FAILURE_AND_RETURN( | 282 LOG_ON_FAILURE_AND_RETURN( |
231 recorder_object_->Realize(recorder_object_.Get(), | 283 recorder_object_->Realize(recorder_object_.Get(), |
(...skipping 26 matching lines...) Expand all Loading... | |
258 } | 310 } |
259 | 311 |
260 void OpenSLESInputStream::SimpleBufferQueueCallback( | 312 void OpenSLESInputStream::SimpleBufferQueueCallback( |
261 SLAndroidSimpleBufferQueueItf buffer_queue, void* instance) { | 313 SLAndroidSimpleBufferQueueItf buffer_queue, void* instance) { |
262 OpenSLESInputStream* stream = | 314 OpenSLESInputStream* stream = |
263 reinterpret_cast<OpenSLESInputStream*>(instance); | 315 reinterpret_cast<OpenSLESInputStream*>(instance); |
264 stream->ReadBufferQueue(); | 316 stream->ReadBufferQueue(); |
265 } | 317 } |
266 | 318 |
267 void OpenSLESInputStream::ReadBufferQueue() { | 319 void OpenSLESInputStream::ReadBufferQueue() { |
268 if (!started_) | 320 base::AutoLock lock(lock_); |
321 | |
322 // Verify that we are in a recording state. | |
323 SLuint32 state; | |
324 SLresult err = (*recorder_)->GetRecordState(recorder_, &state); | |
wjia(left Chromium)
2013/08/30 16:25:18
This is a regression from last patch. If you don't
tommi (sloooow) - chröme
2013/08/30 16:31:54
good spot - multi-threading is hard ;)
henrika (OOO until Aug 14)
2013/08/31 09:54:45
Thx, so I assume that a NULL check is all we need
| |
325 if (SL_RESULT_SUCCESS != err) { | |
326 HandleError(err); | |
269 return; | 327 return; |
328 } | |
329 if (state != SL_RECORDSTATE_RECORDING) { | |
330 DLOG(WARNING) << "Received callback in non-recording state"; | |
331 return; | |
332 } | |
270 | 333 |
271 // TODO(xians): Get an accurate delay estimation. | 334 // TODO(xians): Get an accurate delay estimation. |
272 callback_->OnData(this, | 335 callback_->OnData(this, |
273 audio_data_[active_queue_], | 336 audio_data_[active_buffer_], |
274 buffer_size_bytes_, | 337 buffer_size_bytes_, |
275 buffer_size_bytes_, | 338 buffer_size_bytes_, |
276 0.0); | 339 0.0); |
277 | 340 |
278 // Done with this buffer. Send it to device for recording. | 341 // Done with this buffer. Send it to device for recording. |
279 SLresult err = (*simple_buffer_queue_)->Enqueue( | 342 err = (*simple_buffer_queue_)->Enqueue( |
280 simple_buffer_queue_, | 343 simple_buffer_queue_, |
281 audio_data_[active_queue_], | 344 audio_data_[active_buffer_], |
282 buffer_size_bytes_); | 345 buffer_size_bytes_); |
283 if (SL_RESULT_SUCCESS != err) | 346 if (SL_RESULT_SUCCESS != err) |
284 HandleError(err); | 347 HandleError(err); |
285 | 348 |
286 active_queue_ = (active_queue_ + 1) % kNumOfQueuesInBuffer; | 349 active_buffer_ = (active_buffer_ + 1) % kMaxNumOfBuffersInQueue; |
287 } | 350 } |
288 | 351 |
289 void OpenSLESInputStream::SetupAudioBuffer() { | 352 void OpenSLESInputStream::SetupAudioBuffer() { |
353 DCHECK(thread_checker_.CalledOnValidThread()); | |
290 DCHECK(!audio_data_[0]); | 354 DCHECK(!audio_data_[0]); |
291 for (int i = 0; i < kNumOfQueuesInBuffer; ++i) { | 355 for (int i = 0; i < kMaxNumOfBuffersInQueue; ++i) { |
292 audio_data_[i] = new uint8[buffer_size_bytes_]; | 356 audio_data_[i] = new uint8[buffer_size_bytes_]; |
293 } | 357 } |
294 } | 358 } |
295 | 359 |
296 void OpenSLESInputStream::ReleaseAudioBuffer() { | 360 void OpenSLESInputStream::ReleaseAudioBuffer() { |
361 DCHECK(thread_checker_.CalledOnValidThread()); | |
297 if (audio_data_[0]) { | 362 if (audio_data_[0]) { |
298 for (int i = 0; i < kNumOfQueuesInBuffer; ++i) { | 363 for (int i = 0; i < kMaxNumOfBuffersInQueue; ++i) { |
299 delete [] audio_data_[i]; | 364 delete [] audio_data_[i]; |
300 audio_data_[i] = NULL; | 365 audio_data_[i] = NULL; |
301 } | 366 } |
302 } | 367 } |
303 } | 368 } |
304 | 369 |
305 void OpenSLESInputStream::HandleError(SLresult error) { | 370 void OpenSLESInputStream::HandleError(SLresult error) { |
306 DLOG(FATAL) << "OpenSLES Input error " << error; | 371 DLOG(ERROR) << "OpenSLES Input error " << error; |
307 if (callback_) | 372 if (callback_) |
308 callback_->OnError(this); | 373 callback_->OnError(this); |
309 } | 374 } |
310 | 375 |
311 } // namespace media | 376 } // namespace media |
OLD | NEW |