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 // AudioDevice if a client has not explicitly been set. | 9 // AudioDevice if a client has not explicitly been set. |
10 // | 10 // |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 size_t number_of_frames); | 53 size_t number_of_frames); |
54 | 54 |
55 // AudioRendererSink implementation. | 55 // AudioRendererSink implementation. |
56 virtual void Start() OVERRIDE; | 56 virtual void Start() OVERRIDE; |
57 virtual void Stop() OVERRIDE; | 57 virtual void Stop() OVERRIDE; |
58 virtual void Play() OVERRIDE; | 58 virtual void Play() OVERRIDE; |
59 virtual void Pause(bool flush) OVERRIDE; | 59 virtual void Pause(bool flush) OVERRIDE; |
60 virtual bool SetVolume(double volume) OVERRIDE; | 60 virtual bool SetVolume(double volume) OVERRIDE; |
61 virtual void GetVolume(double* volume) OVERRIDE; | 61 virtual void GetVolume(double* volume) OVERRIDE; |
62 virtual void Initialize( | 62 virtual void Initialize( |
63 const AudioParameters& params, RenderCallback* renderer) OVERRIDE; | 63 const media::AudioParameters& params, RenderCallback* renderer) OVERRIDE; |
64 | 64 |
65 private: | 65 private: |
66 // Set to true when Initialize() is called. | 66 // Set to true when Initialize() is called. |
67 bool is_initialized_; | 67 bool is_initialized_; |
68 int channels_; | 68 int channels_; |
69 int sample_rate_; | 69 int sample_rate_; |
70 | 70 |
71 bool is_running_; | 71 bool is_running_; |
72 double volume_; | 72 double volume_; |
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_COPY_AND_ASSIGN(RenderAudioSourceProvider); |
83 }; | 83 }; |
84 | 84 |
85 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ | 85 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ |
OLD | NEW |