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 // 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 // Gets the playback volume, with range [0.0, 1.0] inclusive. | 123 // Gets the playback volume, with range [0.0, 1.0] inclusive. |
124 virtual void GetVolume(double* volume) OVERRIDE; | 124 virtual void GetVolume(double* volume) OVERRIDE; |
125 | 125 |
126 double sample_rate() const { return sample_rate_; } | 126 double sample_rate() const { return sample_rate_; } |
127 size_t buffer_size() const { return buffer_size_; } | 127 size_t buffer_size() const { return buffer_size_; } |
128 | 128 |
129 // Methods called on IO thread ---------------------------------------------- | 129 // Methods called on IO thread ---------------------------------------------- |
130 // AudioMessageFilter::Delegate methods, called by AudioMessageFilter. | 130 // AudioMessageFilter::Delegate methods, called by AudioMessageFilter. |
131 virtual void OnRequestPacket(AudioBuffersState buffers_state) OVERRIDE; | 131 virtual void OnRequestPacket(AudioBuffersState buffers_state) OVERRIDE; |
132 virtual void OnStateChanged(AudioStreamState state) OVERRIDE; | 132 virtual void OnStateChanged(AudioStreamState state) OVERRIDE; |
133 virtual void OnCreated(base::SharedMemoryHandle handle, | |
134 uint32 length) OVERRIDE; | |
135 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, | 133 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, |
henrika (OOO until Aug 14)
2012/01/29 20:54:00
Same comment as before. Why do we keep "LowLatency
vrk (LEFT CHROMIUM)
2012/01/31 23:53:08
See prev comment!
Changed to "OnStreamCreated" to
| |
136 base::SyncSocket::Handle socket_handle, | 134 base::SyncSocket::Handle socket_handle, |
137 uint32 length) OVERRIDE; | 135 uint32 length) OVERRIDE; |
138 virtual void OnVolume(double volume) OVERRIDE; | 136 virtual void OnVolume(double volume) OVERRIDE; |
139 | 137 |
140 private: | 138 private: |
141 // Encapsulate socket into separate class to avoid double-close. | 139 // Encapsulate socket into separate class to avoid double-close. |
142 // Class is ref-counted to avoid potential race condition if audio device | 140 // Class is ref-counted to avoid potential race condition if audio device |
143 // is deleted simultaneously with audio thread stopping. | 141 // is deleted simultaneously with audio thread stopping. |
144 class AudioSocket : public base::RefCountedThreadSafe<AudioSocket> { | 142 class AudioSocket : public base::RefCountedThreadSafe<AudioSocket> { |
145 public: | 143 public: |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 // These variables must only be set on the IO thread while the audio_thread_ | 242 // These variables must only be set on the IO thread while the audio_thread_ |
245 // is not running. | 243 // is not running. |
246 base::SharedMemoryHandle shared_memory_handle_; | 244 base::SharedMemoryHandle shared_memory_handle_; |
247 scoped_refptr<AudioSocket> audio_socket_; | 245 scoped_refptr<AudioSocket> audio_socket_; |
248 int memory_length_; | 246 int memory_length_; |
249 | 247 |
250 DISALLOW_COPY_AND_ASSIGN(AudioDevice); | 248 DISALLOW_COPY_AND_ASSIGN(AudioDevice); |
251 }; | 249 }; |
252 | 250 |
253 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ | 251 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ |
OLD | NEW |