OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return m_private->requiresAudioConsumer(); | 171 return m_private->requiresAudioConsumer(); |
172 } | 172 } |
173 | 173 |
174 class ConsumerWrapper final : public AudioDestinationConsumer { | 174 class ConsumerWrapper final : public AudioDestinationConsumer { |
175 public: | 175 public: |
176 static ConsumerWrapper* create(WebAudioDestinationConsumer* consumer) | 176 static ConsumerWrapper* create(WebAudioDestinationConsumer* consumer) |
177 { | 177 { |
178 return new ConsumerWrapper(consumer); | 178 return new ConsumerWrapper(consumer); |
179 } | 179 } |
180 | 180 |
181 virtual void setFormat(size_t numberOfChannels, float sampleRate) override; | 181 void setFormat(size_t numberOfChannels, float sampleRate) override; |
182 virtual void consumeAudio(AudioBus*, size_t numberOfFrames) override; | 182 void consumeAudio(AudioBus*, size_t numberOfFrames) override; |
183 | 183 |
184 WebAudioDestinationConsumer* consumer() { return m_consumer; } | 184 WebAudioDestinationConsumer* consumer() { return m_consumer; } |
185 | 185 |
186 private: | 186 private: |
187 explicit ConsumerWrapper(WebAudioDestinationConsumer* consumer) : m_consumer
(consumer) { } | 187 explicit ConsumerWrapper(WebAudioDestinationConsumer* consumer) : m_consumer
(consumer) { } |
188 | 188 |
189 // m_consumer is not owned by this class. | 189 // m_consumer is not owned by this class. |
190 WebAudioDestinationConsumer* m_consumer; | 190 WebAudioDestinationConsumer* m_consumer; |
191 }; | 191 }; |
192 | 192 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>(it->get()); | 227 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>(it->get()); |
228 if (wrapper->consumer() == consumer) { | 228 if (wrapper->consumer() == consumer) { |
229 m_private->removeAudioConsumer(wrapper); | 229 m_private->removeAudioConsumer(wrapper); |
230 return true; | 230 return true; |
231 } | 231 } |
232 } | 232 } |
233 return false; | 233 return false; |
234 } | 234 } |
235 | 235 |
236 } // namespace blink | 236 } // namespace blink |
OLD | NEW |