| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/clockless_audio_sink.h" | 5 #include "media/audio/clockless_audio_sink.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | |
| 8 #include "base/location.h" | |
| 9 #include "base/single_thread_task_runner.h" | |
| 10 #include "base/threading/simple_thread.h" | 7 #include "base/threading/simple_thread.h" |
| 11 | 8 |
| 12 namespace media { | 9 namespace media { |
| 13 | 10 |
| 14 // Internal to ClocklessAudioSink. Class is used to call Render() on a seperate | 11 // Internal to ClocklessAudioSink. Class is used to call Render() on a seperate |
| 15 // thread, running as fast as it can read the data. | 12 // thread, running as fast as it can read the data. |
| 16 class ClocklessAudioSinkThread : public base::DelegateSimpleThread::Delegate { | 13 class ClocklessAudioSinkThread : public base::DelegateSimpleThread::Delegate { |
| 17 public: | 14 public: |
| 18 explicit ClocklessAudioSinkThread(const AudioParameters& params, | 15 explicit ClocklessAudioSinkThread(const AudioParameters& params, |
| 19 AudioRendererSink::RenderCallback* callback) | 16 AudioRendererSink::RenderCallback* callback) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 98 |
| 102 playing_ = false; | 99 playing_ = false; |
| 103 playback_time_ = thread_->Stop(); | 100 playback_time_ = thread_->Stop(); |
| 104 } | 101 } |
| 105 | 102 |
| 106 bool ClocklessAudioSink::SetVolume(double volume) { | 103 bool ClocklessAudioSink::SetVolume(double volume) { |
| 107 // Audio is always muted. | 104 // Audio is always muted. |
| 108 return volume == 0.0; | 105 return volume == 0.0; |
| 109 } | 106 } |
| 110 | 107 |
| 111 void ClocklessAudioSink::SwitchOutputDevice( | |
| 112 const std::string& device_id, | |
| 113 const GURL& security_origin, | |
| 114 const SwitchOutputDeviceCB& callback) { | |
| 115 callback.Run(SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_SUPPORTED); | |
| 116 } | |
| 117 | |
| 118 } // namespace media | 108 } // namespace media |
| OLD | NEW |