| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_stream_sink.h" | 5 #include "media/audio/audio_output_stream_sink.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 bool AudioOutputStreamSink::SetVolume(double volume) { | 72 bool AudioOutputStreamSink::SetVolume(double volume) { |
| 73 audio_task_runner_->PostTask( | 73 audio_task_runner_->PostTask( |
| 74 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoSetVolume, this, volume)); | 74 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoSetVolume, this, volume)); |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 | 77 |
| 78 OutputDeviceInfo AudioOutputStreamSink::GetOutputDeviceInfo() { | 78 OutputDeviceInfo AudioOutputStreamSink::GetOutputDeviceInfo() { |
| 79 return OutputDeviceInfo(); | 79 return OutputDeviceInfo(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool AudioOutputStreamSink::IsOptimizedForHardwareParameters() { |
| 83 return true; |
| 84 } |
| 85 |
| 82 bool AudioOutputStreamSink::CurrentThreadIsRenderingThread() { | 86 bool AudioOutputStreamSink::CurrentThreadIsRenderingThread() { |
| 83 NOTIMPLEMENTED(); | 87 NOTIMPLEMENTED(); |
| 84 return false; | 88 return false; |
| 85 } | 89 } |
| 86 | 90 |
| 87 int AudioOutputStreamSink::OnMoreData(base::TimeDelta delay, | 91 int AudioOutputStreamSink::OnMoreData(base::TimeDelta delay, |
| 88 base::TimeTicks delay_timestamp, | 92 base::TimeTicks delay_timestamp, |
| 89 int prior_frames_skipped, | 93 int prior_frames_skipped, |
| 90 AudioBus* dest) { | 94 AudioBus* dest) { |
| 91 // Note: Runs on the audio thread created by the OS. | 95 // Note: Runs on the audio thread created by the OS. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 DCHECK(audio_task_runner_->BelongsToCurrentThread()); | 153 DCHECK(audio_task_runner_->BelongsToCurrentThread()); |
| 150 stream_->SetVolume(volume); | 154 stream_->SetVolume(volume); |
| 151 } | 155 } |
| 152 | 156 |
| 153 void AudioOutputStreamSink::ClearCallback() { | 157 void AudioOutputStreamSink::ClearCallback() { |
| 154 base::AutoLock al(callback_lock_); | 158 base::AutoLock al(callback_lock_); |
| 155 active_render_callback_ = NULL; | 159 active_render_callback_ = NULL; |
| 156 } | 160 } |
| 157 | 161 |
| 158 } // namespace media | 162 } // namespace media |
| OLD | NEW |