| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo() { | 158 OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo() { |
| 159 CHECK(!task_runner()->BelongsToCurrentThread()); | 159 CHECK(!task_runner()->BelongsToCurrentThread()); |
| 160 did_receive_auth_.Wait(); | 160 did_receive_auth_.Wait(); |
| 161 return OutputDeviceInfo(AudioDeviceDescription::UseSessionIdToSelectDevice( | 161 return OutputDeviceInfo(AudioDeviceDescription::UseSessionIdToSelectDevice( |
| 162 session_id_, device_id_) | 162 session_id_, device_id_) |
| 163 ? matched_device_id_ | 163 ? matched_device_id_ |
| 164 : device_id_, | 164 : device_id_, |
| 165 device_status_, output_params_); | 165 device_status_, output_params_); |
| 166 } | 166 } |
| 167 | 167 |
| 168 bool AudioOutputDevice::IsOptimizedForHardwareParameters() { |
| 169 return true; |
| 170 } |
| 171 |
| 168 bool AudioOutputDevice::CurrentThreadIsRenderingThread() { | 172 bool AudioOutputDevice::CurrentThreadIsRenderingThread() { |
| 169 // Since this function is supposed to be called on the rendering thread, | 173 // Since this function is supposed to be called on the rendering thread, |
| 170 // it's safe to access |audio_callback_| here. It will always be valid when | 174 // it's safe to access |audio_callback_| here. It will always be valid when |
| 171 // the rendering thread is running. | 175 // the rendering thread is running. |
| 172 return audio_callback_->CurrentThreadIsAudioDeviceThread(); | 176 return audio_callback_->CurrentThreadIsAudioDeviceThread(); |
| 173 } | 177 } |
| 174 | 178 |
| 175 void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() { | 179 void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() { |
| 176 DCHECK(task_runner()->BelongsToCurrentThread()); | 180 DCHECK(task_runner()->BelongsToCurrentThread()); |
| 177 DCHECK_EQ(state_, IDLE); | 181 DCHECK_EQ(state_, IDLE); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 render_callback_->Render(delay, delay_timestamp, frames_skipped, | 501 render_callback_->Render(delay, delay_timestamp, frames_skipped, |
| 498 output_bus_.get()); | 502 output_bus_.get()); |
| 499 } | 503 } |
| 500 | 504 |
| 501 bool AudioOutputDevice::AudioThreadCallback:: | 505 bool AudioOutputDevice::AudioThreadCallback:: |
| 502 CurrentThreadIsAudioDeviceThread() { | 506 CurrentThreadIsAudioDeviceThread() { |
| 503 return thread_checker_.CalledOnValidThread(); | 507 return thread_checker_.CalledOnValidThread(); |
| 504 } | 508 } |
| 505 | 509 |
| 506 } // namespace media | 510 } // namespace media |
| OLD | NEW |