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

Side by Side Diff: media/base/audio_latency.cc

Issue 2750543003: Support AudioContextOptions latencyHint as double. (Closed)
Patch Set: Fixes based on reviewer comments. Created 3 years, 9 months 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 2016 The Chromium Authors. All rights reserved. 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 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 #include "media/base/audio_latency.h" 5 #include "media/base/audio_latency.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // the jitter. 119 // the jitter.
120 const int kSmallBufferSize = 1024; 120 const int kSmallBufferSize = 1024;
121 const int kDefaultCallbackBufferSize = 2048; 121 const int kDefaultCallbackBufferSize = 2048;
122 if (hardware_buffer_size <= kSmallBufferSize) 122 if (hardware_buffer_size <= kSmallBufferSize)
123 return kDefaultCallbackBufferSize; 123 return kDefaultCallbackBufferSize;
124 #endif 124 #endif
125 125
126 return hardware_buffer_size; 126 return hardware_buffer_size;
127 } 127 }
128 128
129 int AudioLatency::GetExactBufferSize(int preferred_buffer_size,
o1ka 2017/03/16 10:51:24 Take a look at AudioLatency::GetHighLatencyBufferS
Andrew MacPherson 2017/03/16 17:02:09 Interesting, should we do this for Exact then (use
o1ka 2017/03/17 11:17:22 dalecurtis@ - WDYT?
130 int min_buffer_size,
131 int max_buffer_size) {
132 return std::max(std::min(preferred_buffer_size, max_buffer_size),
133 min_buffer_size);
134 }
135
129 } // namespace media 136 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698