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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp

Issue 2334773003: Support sample rates up to 384 kHz. (Closed)
Patch Set: Rebase and fix up histograms.xml Created 4 years, 2 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 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // at 48kHz). The number of buckets is fairly arbitrary. 104 // at 48kHz). The number of buckets is fairly arbitrary.
105 DEFINE_STATIC_LOCAL(CustomCountHistogram, offlineContextLengthHistogram, 105 DEFINE_STATIC_LOCAL(CustomCountHistogram, offlineContextLengthHistogram,
106 ("WebAudio.OfflineAudioContext.Length", 1, 1000000, 50)); 106 ("WebAudio.OfflineAudioContext.Length", 1, 1000000, 50));
107 // The limits are the min and max AudioBuffer sample rates currently 107 // The limits are the min and max AudioBuffer sample rates currently
108 // supported. We use explicit values here instead of 108 // supported. We use explicit values here instead of
109 // AudioUtilities::minAudioBufferSampleRate() and 109 // AudioUtilities::minAudioBufferSampleRate() and
110 // AudioUtilities::maxAudioBufferSampleRate(). The number of buckets is 110 // AudioUtilities::maxAudioBufferSampleRate(). The number of buckets is
111 // fairly arbitrary. 111 // fairly arbitrary.
112 DEFINE_STATIC_LOCAL( 112 DEFINE_STATIC_LOCAL(
113 CustomCountHistogram, offlineContextSampleRateHistogram, 113 CustomCountHistogram, offlineContextSampleRateHistogram,
114 ("WebAudio.OfflineAudioContext.SampleRate", 3000, 192000, 50)); 114 ("WebAudio.OfflineAudioContext.SampleRate384kHz", 3000, 384000, 50));
115 115
116 offlineContextChannelCountHistogram.sample(numberOfChannels); 116 offlineContextChannelCountHistogram.sample(numberOfChannels);
117 offlineContextLengthHistogram.count(numberOfFrames); 117 offlineContextLengthHistogram.count(numberOfFrames);
118 offlineContextSampleRateHistogram.count(sampleRate); 118 offlineContextSampleRateHistogram.count(sampleRate);
119 119
120 audioContext->suspendIfNeeded(); 120 audioContext->suspendIfNeeded();
121 return audioContext; 121 return audioContext;
122 } 122 }
123 123
124 OfflineAudioContext::OfflineAudioContext(Document* document, 124 OfflineAudioContext::OfflineAudioContext(Document* document,
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 436
437 // Note that the GraphLock is required before this check. Since this needs 437 // Note that the GraphLock is required before this check. Since this needs
438 // to run on the audio thread, OfflineGraphAutoLocker must be used. 438 // to run on the audio thread, OfflineGraphAutoLocker must be used.
439 if (m_scheduledSuspends.contains(currentSampleFrame())) 439 if (m_scheduledSuspends.contains(currentSampleFrame()))
440 return true; 440 return true;
441 441
442 return false; 442 return false;
443 } 443 }
444 444
445 } // namespace blink 445 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698