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 17 matching lines...) Expand all Loading... |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
r.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
r.h" |
29 | 29 |
30 namespace WebKit { | 30 namespace WebKit { |
31 class WebAudioSourceProviderClient; | 31 class WebAudioSourceProviderClient; |
32 } | 32 } |
33 | 33 |
34 class RenderAudioSourceProvider | 34 class RenderAudioSourceProvider |
35 : public WebKit::WebAudioSourceProvider, | 35 : public WebKit::WebAudioSourceProvider, |
36 public media::AudioRendererSink { | 36 public media::AudioRendererSink { |
37 public: | 37 public: |
38 RenderAudioSourceProvider(); | 38 explicit RenderAudioSourceProvider(int render_view_id); |
39 | 39 |
40 // WebKit::WebAudioSourceProvider implementation. | 40 // WebKit::WebAudioSourceProvider implementation. |
41 | 41 |
42 // WebKit calls setClient() if it desires to take control of the rendered | 42 // WebKit calls setClient() if it desires to take control of the rendered |
43 // audio stream. We call client's setFormat() when the audio stream format | 43 // audio stream. We call client's setFormat() when the audio stream format |
44 // is known. | 44 // is known. |
45 virtual void setClient(WebKit::WebAudioSourceProviderClient* client); | 45 virtual void setClient(WebKit::WebAudioSourceProviderClient* client); |
46 | 46 |
47 // If setClient() has been called, then WebKit calls provideInput() | 47 // If setClient() has been called, then WebKit calls provideInput() |
48 // periodically to get the rendered audio stream. | 48 // periodically to get the rendered audio stream. |
(...skipping 21 matching lines...) Expand all Loading... |
70 bool is_running_; | 70 bool is_running_; |
71 media::AudioRendererSink::RenderCallback* renderer_; | 71 media::AudioRendererSink::RenderCallback* renderer_; |
72 WebKit::WebAudioSourceProviderClient* client_; | 72 WebKit::WebAudioSourceProviderClient* client_; |
73 | 73 |
74 // Protects access to sink_ | 74 // Protects access to sink_ |
75 base::Lock sink_lock_; | 75 base::Lock sink_lock_; |
76 | 76 |
77 // default_sink_ is the default sink. | 77 // default_sink_ is the default sink. |
78 scoped_refptr<media::AudioRendererSink> default_sink_; | 78 scoped_refptr<media::AudioRendererSink> default_sink_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(RenderAudioSourceProvider); | 80 DISALLOW_IMPLICIT_CONSTRUCTORS(RenderAudioSourceProvider); |
81 }; | 81 }; |
82 | 82 |
83 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ | 83 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ |
OLD | NEW |