| 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 // RenderAudioSourceProvider provides a bridge between classes: | 5 // RenderAudioSourceProvider provides a bridge between classes: |
| 6 // WebKit::WebAudioSourceProvider <---> media::AudioRendererSink | 6 // WebKit::WebAudioSourceProvider <---> media::AudioRendererSink |
| 7 // | 7 // |
| 8 // RenderAudioSourceProvider is a "sink" of audio, and uses a default | 8 // RenderAudioSourceProvider is a "sink" of audio, and uses a default |
| 9 // AudioOutputDevice if a client has not explicitly been set. | 9 // AudioOutputDevice if a client has not explicitly been set. |
| 10 // | 10 // |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
r.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
r.h" |
| 31 | 31 |
| 32 namespace WebKit { | 32 namespace WebKit { |
| 33 class WebAudioSourceProviderClient; | 33 class WebAudioSourceProviderClient; |
| 34 } | 34 } |
| 35 | 35 |
| 36 class RenderAudioSourceProvider | 36 class RenderAudioSourceProvider |
| 37 : public WebKit::WebAudioSourceProvider, | 37 : public WebKit::WebAudioSourceProvider, |
| 38 public media::AudioRendererSink { | 38 public media::AudioRendererSink { |
| 39 public: | 39 public: |
| 40 RenderAudioSourceProvider(); | 40 RenderAudioSourceProvider(int render_view_id); |
| 41 | 41 |
| 42 // WebKit::WebAudioSourceProvider implementation. | 42 // WebKit::WebAudioSourceProvider implementation. |
| 43 | 43 |
| 44 // WebKit calls setClient() if it desires to take control of the rendered | 44 // WebKit calls setClient() if it desires to take control of the rendered |
| 45 // audio stream. We call client's setFormat() when the audio stream format | 45 // audio stream. We call client's setFormat() when the audio stream format |
| 46 // is known. | 46 // is known. |
| 47 virtual void setClient(WebKit::WebAudioSourceProviderClient* client); | 47 virtual void setClient(WebKit::WebAudioSourceProviderClient* client); |
| 48 | 48 |
| 49 // If setClient() has been called, then WebKit calls provideInput() | 49 // If setClient() has been called, then WebKit calls provideInput() |
| 50 // periodically to get the rendered audio stream. | 50 // periodically to get the rendered audio stream. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 77 // Protects access to sink_ | 77 // Protects access to sink_ |
| 78 base::Lock sink_lock_; | 78 base::Lock sink_lock_; |
| 79 | 79 |
| 80 // default_sink_ is the default sink. | 80 // default_sink_ is the default sink. |
| 81 scoped_refptr<media::AudioRendererSink> default_sink_; | 81 scoped_refptr<media::AudioRendererSink> default_sink_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(RenderAudioSourceProvider); | 83 DISALLOW_COPY_AND_ASSIGN(RenderAudioSourceProvider); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ | 86 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ |
| OLD | NEW |