| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 virtual void provideInput(const WebKit::WebVector<float*>& audio_data, | 51 virtual void provideInput(const WebKit::WebVector<float*>& audio_data, |
| 52 size_t number_of_frames); | 52 size_t number_of_frames); |
| 53 | 53 |
| 54 // AudioRendererSink implementation. | 54 // AudioRendererSink implementation. |
| 55 virtual void Start() OVERRIDE; | 55 virtual void Start() OVERRIDE; |
| 56 virtual void Stop() OVERRIDE; | 56 virtual void Stop() OVERRIDE; |
| 57 virtual void Play() OVERRIDE; | 57 virtual void Play() OVERRIDE; |
| 58 virtual void Pause(bool flush) OVERRIDE; | 58 virtual void Pause(bool flush) OVERRIDE; |
| 59 virtual void SetPlaybackRate(float rate) OVERRIDE; | 59 virtual void SetPlaybackRate(float rate) OVERRIDE; |
| 60 virtual bool SetVolume(double volume) OVERRIDE; | 60 virtual bool SetVolume(double volume) OVERRIDE; |
| 61 virtual void GetVolume(double* volume) OVERRIDE; | |
| 62 virtual void Initialize(const media::AudioParameters& params, | 61 virtual void Initialize(const media::AudioParameters& params, |
| 63 RenderCallback* renderer) OVERRIDE; | 62 RenderCallback* renderer) OVERRIDE; |
| 64 | 63 |
| 65 protected: | 64 protected: |
| 66 virtual ~RenderAudioSourceProvider(); | 65 virtual ~RenderAudioSourceProvider(); |
| 67 | 66 |
| 68 private: | 67 private: |
| 69 // Set to true when Initialize() is called. | 68 // Set to true when Initialize() is called. |
| 70 bool is_initialized_; | 69 bool is_initialized_; |
| 71 int channels_; | 70 int channels_; |
| 72 int sample_rate_; | 71 int sample_rate_; |
| 73 | 72 |
| 74 bool is_running_; | 73 bool is_running_; |
| 75 double volume_; | |
| 76 media::AudioRendererSink::RenderCallback* renderer_; | 74 media::AudioRendererSink::RenderCallback* renderer_; |
| 77 WebKit::WebAudioSourceProviderClient* client_; | 75 WebKit::WebAudioSourceProviderClient* client_; |
| 78 | 76 |
| 79 // Protects access to sink_ | 77 // Protects access to sink_ |
| 80 base::Lock sink_lock_; | 78 base::Lock sink_lock_; |
| 81 | 79 |
| 82 // default_sink_ is the default sink. | 80 // default_sink_ is the default sink. |
| 83 scoped_refptr<media::AudioRendererSink> default_sink_; | 81 scoped_refptr<media::AudioRendererSink> default_sink_; |
| 84 | 82 |
| 85 DISALLOW_COPY_AND_ASSIGN(RenderAudioSourceProvider); | 83 DISALLOW_COPY_AND_ASSIGN(RenderAudioSourceProvider); |
| 86 }; | 84 }; |
| 87 | 85 |
| 88 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ | 86 #endif // CONTENT_RENDERER_MEDIA_RENDER_AUDIOSOURCEPROVIDER_H_ |
| OLD | NEW |