Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: media/audio/mac/audio_auhal_mac.h

Issue 1487983002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698