OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Implementation notes: | 5 // Implementation notes: |
6 // | 6 // |
7 // - It is recommended to first acquire the native sample rate of the default | 7 // - It is recommended to first acquire the native sample rate of the default |
8 // output device and then use the same rate when creating this object. | 8 // output device and then use the same rate when creating this object. |
9 // Use AudioManagerMac::HardwareSampleRate() to retrieve the sample rate. | 9 // Use AudioManagerMac::HardwareSampleRate() to retrieve the sample rate. |
10 // - Calling Close() also leads to self destruction. | 10 // - Calling Close() also leads to self destruction. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Creates the input and output busses. | 119 // Creates the input and output busses. |
120 void CreateIOBusses(); | 120 void CreateIOBusses(); |
121 | 121 |
122 // Gets the fixed playout device hardware latency and stores it. Returns 0 | 122 // Gets the fixed playout device hardware latency and stores it. Returns 0 |
123 // if not available. | 123 // if not available. |
124 double GetHardwareLatency(); | 124 double GetHardwareLatency(); |
125 | 125 |
126 // Gets the current playout latency value. | 126 // Gets the current playout latency value. |
127 double GetPlayoutLatency(const AudioTimeStamp* output_time_stamp); | 127 double GetPlayoutLatency(const AudioTimeStamp* output_time_stamp); |
128 | 128 |
129 void UpdatePlayoutTimestamp(const AudioTimeStamp* timestamp); | 129 // Updates playout timestamp and total lost frames and glitches stats. Returns |
| 130 // the number of lost frames (this render data request). |
| 131 UInt32 UpdatePlayoutTimestampAndStats(const AudioTimeStamp* timestamp); |
130 | 132 |
131 // Called from the dtor and when the stream is reset. | 133 // Called from the dtor and when the stream is reset. |
132 void ReportAndResetStats(); | 134 void ReportAndResetStats(); |
133 | 135 |
134 // Our creator, the audio manager needs to be notified when we close. | 136 // Our creator, the audio manager needs to be notified when we close. |
135 AudioManagerMac* const manager_; | 137 AudioManagerMac* const manager_; |
136 | 138 |
137 const AudioParameters params_; | 139 const AudioParameters params_; |
138 // For convenience - same as in params_. | 140 // For convenience - same as in params_. |
139 const int output_channels_; | 141 const int output_channels_; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // Used to make sure control functions (Start(), Stop() etc) are called on the | 204 // Used to make sure control functions (Start(), Stop() etc) are called on the |
203 // right thread. | 205 // right thread. |
204 base::ThreadChecker thread_checker_; | 206 base::ThreadChecker thread_checker_; |
205 | 207 |
206 DISALLOW_COPY_AND_ASSIGN(AUHALStream); | 208 DISALLOW_COPY_AND_ASSIGN(AUHALStream); |
207 }; | 209 }; |
208 | 210 |
209 } // namespace media | 211 } // namespace media |
210 | 212 |
211 #endif // MEDIA_AUDIO_MAC_AUDIO_AUHAL_MAC_H_ | 213 #endif // MEDIA_AUDIO_MAC_AUDIO_AUHAL_MAC_H_ |
OLD | NEW |