Chromium Code Reviews| 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/null_audio_sink.h" | 5 #include "media/audio/null_audio_sink.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "media/audio/fake_audio_worker.h" | 10 #include "media/audio/fake_audio_worker.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 | 72 |
| 73 bool NullAudioSink::SetVolume(double volume) { | 73 bool NullAudioSink::SetVolume(double volume) { |
| 74 // Audio is always muted. | 74 // Audio is always muted. |
| 75 return volume == 0.0; | 75 return volume == 0.0; |
| 76 } | 76 } |
| 77 | 77 |
| 78 OutputDeviceInfo NullAudioSink::GetOutputDeviceInfo() { | 78 OutputDeviceInfo NullAudioSink::GetOutputDeviceInfo() { |
| 79 return OutputDeviceInfo(OUTPUT_DEVICE_STATUS_OK); | 79 return OutputDeviceInfo(OUTPUT_DEVICE_STATUS_OK); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool NullAudioSink::OptimizedForHardwareParameters() { | |
| 83 return true; | |
|
DaleCurtis
2017/05/01 22:55:08
Ditto, false.
flim-chromium
2017/05/15 15:15:57
Done.
| |
| 84 } | |
| 85 | |
| 82 bool NullAudioSink::CurrentThreadIsRenderingThread() { | 86 bool NullAudioSink::CurrentThreadIsRenderingThread() { |
| 83 return task_runner_->BelongsToCurrentThread(); | 87 return task_runner_->BelongsToCurrentThread(); |
| 84 } | 88 } |
| 85 | 89 |
| 86 void NullAudioSink::SwitchOutputDevice(const std::string& device_id, | 90 void NullAudioSink::SwitchOutputDevice(const std::string& device_id, |
| 87 const url::Origin& security_origin, | 91 const url::Origin& security_origin, |
| 88 const OutputDeviceStatusCB& callback) { | 92 const OutputDeviceStatusCB& callback) { |
| 89 callback.Run(OUTPUT_DEVICE_STATUS_ERROR_INTERNAL); | 93 callback.Run(OUTPUT_DEVICE_STATUS_ERROR_INTERNAL); |
| 90 } | 94 } |
| 91 | 95 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 103 void NullAudioSink::StartAudioHashForTesting() { | 107 void NullAudioSink::StartAudioHashForTesting() { |
| 104 DCHECK(!initialized_); | 108 DCHECK(!initialized_); |
| 105 audio_hash_.reset(new AudioHash()); | 109 audio_hash_.reset(new AudioHash()); |
| 106 } | 110 } |
| 107 | 111 |
| 108 std::string NullAudioSink::GetAudioHashForTesting() { | 112 std::string NullAudioSink::GetAudioHashForTesting() { |
| 109 return audio_hash_ ? audio_hash_->ToString() : std::string(); | 113 return audio_hash_ ? audio_hash_->ToString() : std::string(); |
| 110 } | 114 } |
| 111 | 115 |
| 112 } // namespace media | 116 } // namespace media |
| OLD | NEW |