| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "platform/audio/AudioDestination.h" | 29 #include "platform/audio/AudioDestination.h" |
| 30 | 30 |
| 31 #include <memory> | 31 #include <memory> |
| 32 #include "platform/Histogram.h" | 32 #include "platform/Histogram.h" |
| 33 #include "platform/audio/AudioUtilities.h" | 33 #include "platform/audio/AudioUtilities.h" |
| 34 #include "platform/audio/PushPullFIFO.h" | 34 #include "platform/audio/PushPullFIFO.h" |
| 35 #include "platform/weborigin/SecurityOrigin.h" | 35 #include "platform/weborigin/SecurityOrigin.h" |
| 36 #include "platform/wtf/PtrUtil.h" |
| 36 #include "public/platform/Platform.h" | 37 #include "public/platform/Platform.h" |
| 37 #include "public/platform/WebAudioLatencyHint.h" | 38 #include "public/platform/WebAudioLatencyHint.h" |
| 38 #include "public/platform/WebSecurityOrigin.h" | 39 #include "public/platform/WebSecurityOrigin.h" |
| 39 #include "wtf/PtrUtil.h" | |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 // FIFO Size. | 43 // FIFO Size. |
| 44 // | 44 // |
| 45 // TODO(hongchan): This was estimated based on the largest callback buffer size | 45 // TODO(hongchan): This was estimated based on the largest callback buffer size |
| 46 // that we would ever need. The current UMA stats indicates that this is, in | 46 // that we would ever need. The current UMA stats indicates that this is, in |
| 47 // fact, probably too small. There are Android devices out there with a size of | 47 // fact, probably too small. There are Android devices out there with a size of |
| 48 // 8000 or so. We might need to make this larger. See: crbug.com/670747 | 48 // 8000 or so. We might need to make this larger. See: crbug.com/670747 |
| 49 const size_t kFIFOSize = 8192; | 49 const size_t kFIFOSize = 8192; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 callbackBufferSizeHistogram.sample(m_callbackBufferSize); | 198 callbackBufferSizeHistogram.sample(m_callbackBufferSize); |
| 199 | 199 |
| 200 // Check if the requested buffer size is too large. | 200 // Check if the requested buffer size is too large. |
| 201 bool isBufferSizeValid = | 201 bool isBufferSizeValid = |
| 202 m_callbackBufferSize + AudioUtilities::kRenderQuantumFrames <= kFIFOSize; | 202 m_callbackBufferSize + AudioUtilities::kRenderQuantumFrames <= kFIFOSize; |
| 203 DCHECK(isBufferSizeValid); | 203 DCHECK(isBufferSizeValid); |
| 204 return isBufferSizeValid; | 204 return isBufferSizeValid; |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace blink | 207 } // namespace blink |
| OLD | NEW |