Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_BASE_AUDIO_LATENCY_H_ | |
| 6 #define MEDIA_BASE_AUDIO_LATENCY_H_ | |
| 7 | |
| 8 #include "media/base/media_export.h" | |
| 9 | |
| 10 namespace media { | |
| 11 | |
| 12 class MEDIA_EXPORT AudioLatency { | |
| 13 public: | |
| 14 // Categoties of expected latencies for input/output audio. Do not change | |
|
Henrik Grunell
2016/06/29 12:20:54
"Categories" (spelling).
o1ka
2016/06/29 13:57:31
Done.
| |
| 15 // existing values, they are used for UMA histogram reporting. | |
| 16 enum LatencyType { | |
| 17 // Specific latency in milliseconds. | |
| 18 LATENCY_EXACT_MS = 0, | |
| 19 // Lowest possible latency which does not cause glitches. | |
| 20 LATENCY_INTERACTIVE = 1, | |
| 21 // Latency optimized for real time communication. | |
| 22 LATENCY_RTC = 2, | |
| 23 // Latency optimized for continuous playback and power saving. | |
| 24 LATENCY_PLAYBACK = 3, | |
| 25 // For validation only. | |
| 26 LATENCY_LAST = LATENCY_PLAYBACK, | |
| 27 LATENCY_COUNT = LATENCY_LAST + 1 | |
| 28 }; | |
| 29 | |
| 30 // |preferred_buffer_size| should be set to 0 if a client has no preference. | |
| 31 static int GetHighLatencyBufferSize(int sample_rate, | |
| 32 int preferred_buffer_size); | |
| 33 | |
| 34 // |hardware_buffer_size| should be set to 0 if unknown/invalid/not preferred. | |
| 35 static int GetRtcBufferSize(int sample_rate, int hardware_buffer_size); | |
| 36 | |
| 37 static int GetInteractiveBufferSize(int hardware_buffer_size); | |
| 38 }; | |
| 39 | |
| 40 } // namespace media | |
| 41 | |
| 42 #endif // MEDIA_BASE_AUDIO_LATENCY_H_ | |
| OLD | NEW |