| 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 AudioDevice. | 5 // Audio rendering unit utilizing AudioDevice. |
| 6 // | 6 // |
| 7 // This class lives inside three threads during it's lifetime, namely: | 7 // This class lives inside three threads during it's lifetime, namely: |
| 8 // 1. Render thread. | 8 // 1. Render thread. |
| 9 // This object is created on the render thread. | 9 // This object is created on the render thread. |
| 10 // 2. Pipeline thread | 10 // 2. Pipeline thread |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // Convert number of bytes to duration of time using information about the | 68 // Convert number of bytes to duration of time using information about the |
| 69 // number of channels, sample rate and sample bits. | 69 // number of channels, sample rate and sample bits. |
| 70 base::TimeDelta ConvertToDuration(int bytes); | 70 base::TimeDelta ConvertToDuration(int bytes); |
| 71 | 71 |
| 72 // Methods called on pipeline thread ---------------------------------------- | 72 // Methods called on pipeline thread ---------------------------------------- |
| 73 void DoPlay(); | 73 void DoPlay(); |
| 74 void DoPause(); | 74 void DoPause(); |
| 75 void DoSeek(); | 75 void DoSeek(); |
| 76 | 76 |
| 77 // AudioDevice::RenderCallback implementation. | 77 // AudioDevice::RenderCallback implementation. |
| 78 virtual void Render(const std::vector<float*>& audio_data, | 78 virtual size_t Render(const std::vector<float*>& audio_data, |
| 79 size_t number_of_frames, | 79 size_t number_of_frames, |
| 80 size_t audio_delay_milliseconds) OVERRIDE; | 80 size_t audio_delay_milliseconds) OVERRIDE; |
| 81 | 81 |
| 82 // Accessors used by tests. | 82 // Accessors used by tests. |
| 83 base::Time earliest_end_time() const { | 83 base::Time earliest_end_time() const { |
| 84 return earliest_end_time_; | 84 return earliest_end_time_; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void set_earliest_end_time(const base::Time& earliest_end_time) { | 87 void set_earliest_end_time(const base::Time& earliest_end_time) { |
| 88 earliest_end_time_ = earliest_end_time; | 88 earliest_end_time_ = earliest_end_time; |
| 89 } | 89 } |
| 90 | 90 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 121 // know when that particular data would start playing, but it is much better | 121 // know when that particular data would start playing, but it is much better |
| 122 // than nothing. | 122 // than nothing. |
| 123 base::Time earliest_end_time_; | 123 base::Time earliest_end_time_; |
| 124 | 124 |
| 125 AudioParameters audio_parameters_; | 125 AudioParameters audio_parameters_; |
| 126 | 126 |
| 127 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 127 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_ | 130 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_ |
| OLD | NEW |