| 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 namespace WebKit { | 30 namespace WebKit { |
| 31 class WebAudioSourceProviderClient; | 31 class WebAudioSourceProviderClient; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace content { | 34 namespace content { |
| 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 explicit RenderAudioSourceProvider(int source_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 21 matching lines...) Expand all Loading... |
| 72 bool is_running_; | 72 bool is_running_; |
| 73 media::AudioRendererSink::RenderCallback* renderer_; | 73 media::AudioRendererSink::RenderCallback* renderer_; |
| 74 WebKit::WebAudioSourceProviderClient* client_; | 74 WebKit::WebAudioSourceProviderClient* client_; |
| 75 | 75 |
| 76 // Protects access to sink_ | 76 // Protects access to sink_ |
| 77 base::Lock sink_lock_; | 77 base::Lock sink_lock_; |
| 78 | 78 |
| 79 // default_sink_ is the default sink. | 79 // default_sink_ is the default sink. |
| 80 scoped_refptr<media::AudioRendererSink> default_sink_; | 80 scoped_refptr<media::AudioRendererSink> default_sink_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(RenderAudioSourceProvider); | 82 DISALLOW_IMPLICIT_CONSTRUCTORS(RenderAudioSourceProvider); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace content | 85 } // namespace content |
| 86 | 86 |
| 87 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ | 87 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ |
| OLD | NEW |