| 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 // Audio rendering unit utilizing audio output stream provided by browser | 5 // Audio rendering unit utilizing audio output stream provided by browser |
| 6 // process through IPC. | 6 // process through IPC. |
| 7 // | 7 // |
| 8 // Relationship of classes. | 8 // Relationship of classes. |
| 9 // | 9 // |
| 10 // AudioRendererHost AudioRendererImpl | 10 // AudioRendererHost AudioRendererImpl |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 virtual void SetVolume(float volume) OVERRIDE; | 86 virtual void SetVolume(float volume) OVERRIDE; |
| 87 | 87 |
| 88 protected: | 88 protected: |
| 89 // Methods called on audio renderer thread ---------------------------------- | 89 // Methods called on audio renderer thread ---------------------------------- |
| 90 // These methods are called from AudioRendererBase. | 90 // These methods are called from AudioRendererBase. |
| 91 virtual bool OnInitialize(int bits_per_channel, | 91 virtual bool OnInitialize(int bits_per_channel, |
| 92 ChannelLayout channel_layout, | 92 ChannelLayout channel_layout, |
| 93 int sample_rate) OVERRIDE; | 93 int sample_rate) OVERRIDE; |
| 94 virtual void OnStop() OVERRIDE; | 94 virtual void OnStop() OVERRIDE; |
| 95 | 95 |
| 96 // Called when the decoder completes a Read(). | |
| 97 virtual void ConsumeAudioSamples( | |
| 98 scoped_refptr<media::Buffer> buffer_in) OVERRIDE; | |
| 99 | |
| 100 private: | 96 private: |
| 101 // We are using either low- or high-latency code path. | 97 // We are using either low- or high-latency code path. |
| 102 enum LatencyType { | 98 enum LatencyType { |
| 103 kUninitializedLatency = 0, | 99 kUninitializedLatency = 0, |
| 104 kLowLatency, | 100 kLowLatency, |
| 105 kHighLatency | 101 kHighLatency |
| 106 }; | 102 }; |
| 107 static LatencyType latency_type_; | 103 static LatencyType latency_type_; |
| 108 | 104 |
| 109 // For access to constructor and IO thread methods. | 105 // For access to constructor and IO thread methods. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // remember when it should stop playing, and do not assume that buffer is | 219 // remember when it should stop playing, and do not assume that buffer is |
| 224 // empty till that time. Workaround is not bulletproof, as we don't exactly | 220 // empty till that time. Workaround is not bulletproof, as we don't exactly |
| 225 // know when that particular data would start playing, but it is much better | 221 // know when that particular data would start playing, but it is much better |
| 226 // than nothing. | 222 // than nothing. |
| 227 base::Time earliest_end_time_; | 223 base::Time earliest_end_time_; |
| 228 | 224 |
| 229 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 225 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
| 230 }; | 226 }; |
| 231 | 227 |
| 232 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_ | 228 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_ |
| OLD | NEW |