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 "content/renderer/media/audio_device.h" | 5 #include "content/renderer/media/audio_device.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 Send(new AudioHostMsg_SetVolume(stream_id_, volume)); | 197 Send(new AudioHostMsg_SetVolume(stream_id_, volume)); |
198 } | 198 } |
199 | 199 |
200 void AudioDevice::OnRequestPacket(AudioBuffersState buffers_state) { | 200 void AudioDevice::OnRequestPacket(AudioBuffersState buffers_state) { |
201 // This method does not apply to the low-latency system. | 201 // This method does not apply to the low-latency system. |
202 } | 202 } |
203 | 203 |
204 void AudioDevice::OnStateChanged(AudioStreamState state) { | 204 void AudioDevice::OnStateChanged(AudioStreamState state) { |
205 if (state == kAudioStreamError) { | 205 if (state == kAudioStreamError) { |
206 DLOG(WARNING) << "AudioDevice::OnStateChanged(kError)"; | 206 DLOG(WARNING) << "AudioDevice::OnStateChanged(kError)"; |
| 207 callback_->OnError(); |
207 } | 208 } |
208 } | 209 } |
209 | 210 |
210 void AudioDevice::OnCreated( | 211 void AudioDevice::OnCreated( |
211 base::SharedMemoryHandle handle, uint32 length) { | 212 base::SharedMemoryHandle handle, uint32 length) { |
212 // Not needed in this simple implementation. | 213 // Not needed in this simple implementation. |
213 } | 214 } |
214 | 215 |
215 void AudioDevice::OnLowLatencyCreated( | 216 void AudioDevice::OnLowLatencyCreated( |
216 base::SharedMemoryHandle handle, | 217 base::SharedMemoryHandle handle, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 320 |
320 if (audio_thread_.get()) { | 321 if (audio_thread_.get()) { |
321 // Close the socket to terminate the main thread function in the | 322 // Close the socket to terminate the main thread function in the |
322 // audio thread. | 323 // audio thread. |
323 audio_socket_->Close(); | 324 audio_socket_->Close(); |
324 audio_socket_ = NULL; | 325 audio_socket_ = NULL; |
325 audio_thread_->Join(); | 326 audio_thread_->Join(); |
326 audio_thread_.reset(NULL); | 327 audio_thread_.reset(NULL); |
327 } | 328 } |
328 } | 329 } |
OLD | NEW |