| 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/audio_output_device.h" | 5 #include "media/audio/audio_output_device.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 return false; | 138 return false; |
| 139 | 139 |
| 140 if (!task_runner()->PostTask(FROM_HERE, | 140 if (!task_runner()->PostTask(FROM_HERE, |
| 141 base::Bind(&AudioOutputDevice::SetVolumeOnIOThread, this, volume))) { | 141 base::Bind(&AudioOutputDevice::SetVolumeOnIOThread, this, volume))) { |
| 142 return false; | 142 return false; |
| 143 } | 143 } |
| 144 | 144 |
| 145 return true; | 145 return true; |
| 146 } | 146 } |
| 147 | 147 |
| 148 OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo() { | 148 OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo( |
| 149 const AudioParameters& preferred_params) { |
| 149 CHECK(!task_runner()->BelongsToCurrentThread()); | 150 CHECK(!task_runner()->BelongsToCurrentThread()); |
| 150 did_receive_auth_.Wait(); | 151 did_receive_auth_.Wait(); |
| 151 return OutputDeviceInfo(AudioDeviceDescription::UseSessionIdToSelectDevice( | 152 return OutputDeviceInfo(AudioDeviceDescription::UseSessionIdToSelectDevice( |
| 152 session_id_, device_id_) | 153 session_id_, device_id_) |
| 153 ? matched_device_id_ | 154 ? matched_device_id_ |
| 154 : device_id_, | 155 : device_id_, |
| 155 device_status_, output_params_); | 156 device_status_, output_params_); |
| 156 } | 157 } |
| 157 | 158 |
| 158 bool AudioOutputDevice::CurrentThreadIsRenderingThread() { | 159 bool AudioOutputDevice::CurrentThreadIsRenderingThread() { |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 render_callback_->Render(delay, delay_timestamp, frames_skipped, | 488 render_callback_->Render(delay, delay_timestamp, frames_skipped, |
| 488 output_bus_.get()); | 489 output_bus_.get()); |
| 489 } | 490 } |
| 490 | 491 |
| 491 bool AudioOutputDevice::AudioThreadCallback:: | 492 bool AudioOutputDevice::AudioThreadCallback:: |
| 492 CurrentThreadIsAudioDeviceThread() { | 493 CurrentThreadIsAudioDeviceThread() { |
| 493 return thread_checker_.CalledOnValidThread(); | 494 return thread_checker_.CalledOnValidThread(); |
| 494 } | 495 } |
| 495 | 496 |
| 496 } // namespace media | 497 } // namespace media |
| OLD | NEW |