OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Low-latency audio rendering unit utilizing audio output stream provided | 5 // Low-latency audio rendering unit utilizing audio output stream provided |
6 // by browser process through IPC. | 6 // by browser process through IPC. |
7 // | 7 // |
8 // Relationship of classes. | 8 // Relationship of classes. |
9 // | 9 // |
10 // AudioOutputController AudioDevice | 10 // AudioOutputController AudioDevice |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // Sets the playback volume, with range [0.0, 1.0] inclusive. | 94 // Sets the playback volume, with range [0.0, 1.0] inclusive. |
95 // Returns |true| on success. | 95 // Returns |true| on success. |
96 bool SetVolume(double volume); | 96 bool SetVolume(double volume); |
97 | 97 |
98 // Gets the playback volume, with range [0.0, 1.0] inclusive. | 98 // Gets the playback volume, with range [0.0, 1.0] inclusive. |
99 void GetVolume(double* volume); | 99 void GetVolume(double* volume); |
100 | 100 |
101 double sample_rate() const { return sample_rate_; } | 101 double sample_rate() const { return sample_rate_; } |
102 size_t buffer_size() const { return buffer_size_; } | 102 size_t buffer_size() const { return buffer_size_; } |
103 | 103 |
104 static double GetAudioHardwareSampleRate(); | |
105 static size_t GetAudioHardwareBufferSize(); | |
106 | |
107 // Methods called on IO thread ---------------------------------------------- | 104 // Methods called on IO thread ---------------------------------------------- |
108 // AudioMessageFilter::Delegate methods, called by AudioMessageFilter. | 105 // AudioMessageFilter::Delegate methods, called by AudioMessageFilter. |
109 virtual void OnRequestPacket(AudioBuffersState buffers_state); | 106 virtual void OnRequestPacket(AudioBuffersState buffers_state); |
110 virtual void OnStateChanged(AudioStreamState state); | 107 virtual void OnStateChanged(AudioStreamState state); |
111 virtual void OnCreated(base::SharedMemoryHandle handle, uint32 length); | 108 virtual void OnCreated(base::SharedMemoryHandle handle, uint32 length); |
112 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, | 109 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, |
113 base::SyncSocket::Handle socket_handle, | 110 base::SyncSocket::Handle socket_handle, |
114 uint32 length); | 111 uint32 length); |
115 virtual void OnVolume(double volume); | 112 virtual void OnVolume(double volume); |
116 | 113 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 166 |
170 // Data transfer between browser and render process uses a combination | 167 // Data transfer between browser and render process uses a combination |
171 // of sync sockets and shared memory to provide lowest possible latency. | 168 // of sync sockets and shared memory to provide lowest possible latency. |
172 scoped_ptr<base::SharedMemory> shared_memory_; | 169 scoped_ptr<base::SharedMemory> shared_memory_; |
173 scoped_ptr<base::SyncSocket> socket_; | 170 scoped_ptr<base::SyncSocket> socket_; |
174 | 171 |
175 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioDevice); | 172 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioDevice); |
176 }; | 173 }; |
177 | 174 |
178 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ | 175 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ |
OLD | NEW |