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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 virtual void provideInput(const WebKit::WebVector<float*>& audio_data, | 52 virtual void provideInput(const WebKit::WebVector<float*>& audio_data, |
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(size_t buffer_size, | 62 virtual void Initialize( |
63 int channels, | 63 const AudioParameters& params, RenderCallback* renderer) OVERRIDE; |
64 double sample_rate, | |
65 AudioParameters::Format latency_format, | |
66 RenderCallback* renderer) OVERRIDE; | |
67 | 64 |
68 private: | 65 private: |
69 // Set to true when Initialize() is called. | 66 // Set to true when Initialize() is called. |
70 bool is_initialized_; | 67 bool is_initialized_; |
71 int channels_; | 68 int channels_; |
72 double sample_rate_; | 69 int sample_rate_; |
73 | 70 |
74 bool is_running_; | 71 bool is_running_; |
75 double volume_; | 72 double volume_; |
76 media::AudioRendererSink::RenderCallback* renderer_; | 73 media::AudioRendererSink::RenderCallback* renderer_; |
77 WebKit::WebAudioSourceProviderClient* client_; | 74 WebKit::WebAudioSourceProviderClient* client_; |
78 | 75 |
79 // Protects access to sink_ | 76 // Protects access to sink_ |
80 base::Lock sink_lock_; | 77 base::Lock sink_lock_; |
81 | 78 |
82 // default_sink_ is the default sink. | 79 // default_sink_ is the default sink. |
83 scoped_refptr<media::AudioRendererSink> default_sink_; | 80 scoped_refptr<media::AudioRendererSink> default_sink_; |
84 | 81 |
85 DISALLOW_COPY_AND_ASSIGN(RenderAudioSourceProvider); | 82 DISALLOW_COPY_AND_ASSIGN(RenderAudioSourceProvider); |
86 }; | 83 }; |
87 | 84 |
88 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ | 85 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ |
OLD | NEW |