| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "webkit/media/webaudiosourceprovider_impl.h" | 5 #include "webkit/media/webaudiosourceprovider_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
rClient.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
rClient.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 is_running_ = false; | 91 is_running_ = false; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void WebAudioSourceProviderImpl::Play() { | 94 void WebAudioSourceProviderImpl::Play() { |
| 95 base::AutoLock auto_lock(sink_lock_); | 95 base::AutoLock auto_lock(sink_lock_); |
| 96 if (!client_) | 96 if (!client_) |
| 97 sink_->Play(); | 97 sink_->Play(); |
| 98 is_running_ = true; | 98 is_running_ = true; |
| 99 } | 99 } |
| 100 | 100 |
| 101 void WebAudioSourceProviderImpl::Pause(bool flush) { | 101 void WebAudioSourceProviderImpl::Pause() { |
| 102 base::AutoLock auto_lock(sink_lock_); | 102 base::AutoLock auto_lock(sink_lock_); |
| 103 if (!client_) | 103 if (!client_) |
| 104 sink_->Pause(flush); | 104 sink_->Pause(); |
| 105 is_running_ = false; | 105 is_running_ = false; |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool WebAudioSourceProviderImpl::SetVolume(double volume) { | 108 bool WebAudioSourceProviderImpl::SetVolume(double volume) { |
| 109 base::AutoLock auto_lock(sink_lock_); | 109 base::AutoLock auto_lock(sink_lock_); |
| 110 if (!client_) | 110 if (!client_) |
| 111 sink_->SetVolume(volume); | 111 sink_->SetVolume(volume); |
| 112 return true; | 112 return true; |
| 113 } | 113 } |
| 114 | 114 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 127 | 127 |
| 128 if (client_) { | 128 if (client_) { |
| 129 // Inform WebKit about the audio stream format. | 129 // Inform WebKit about the audio stream format. |
| 130 client_->setFormat(channels_, sample_rate_); | 130 client_->setFormat(channels_, sample_rate_); |
| 131 } | 131 } |
| 132 | 132 |
| 133 is_initialized_ = true; | 133 is_initialized_ = true; |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace webkit_media | 136 } // namespace webkit_media |
| OLD | NEW |