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 "content/renderer/media/webaudiosourceprovider_impl.h" | 5 #include "content/renderer/media/webaudiosourceprovider_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "media/base/bind_to_loop.h" | 12 #include "media/base/bind_to_current_loop.h" |
13 #include "third_party/WebKit/public/platform/WebAudioSourceProviderClient.h" | 13 #include "third_party/WebKit/public/platform/WebAudioSourceProviderClient.h" |
14 | 14 |
15 using blink::WebVector; | 15 using blink::WebVector; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Simple helper class for Try() locks. Lock is Try()'d on construction and | 21 // Simple helper class for Try() locks. Lock is Try()'d on construction and |
22 // must be checked via the locked() attribute. If acquisition was successful | 22 // must be checked via the locked() attribute. If acquisition was successful |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 void WebAudioSourceProviderImpl::OnSetFormat() { | 180 void WebAudioSourceProviderImpl::OnSetFormat() { |
181 base::AutoLock auto_lock(sink_lock_); | 181 base::AutoLock auto_lock(sink_lock_); |
182 if (!client_) | 182 if (!client_) |
183 return; | 183 return; |
184 | 184 |
185 // Inform Blink about the audio stream format. | 185 // Inform Blink about the audio stream format. |
186 client_->setFormat(channels_, sample_rate_); | 186 client_->setFormat(channels_, sample_rate_); |
187 } | 187 } |
188 | 188 |
189 } // namespace content | 189 } // namespace content |
OLD | NEW |