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 * 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 #include "wtf/PassOwnPtr.h" | 73 #include "wtf/PassOwnPtr.h" |
74 #include "wtf/text/WTFString.h" | 74 #include "wtf/text/WTFString.h" |
75 | 75 |
76 // FIXME: check the proper way to reference an undefined thread ID | 76 // FIXME: check the proper way to reference an undefined thread ID |
77 const WTF::ThreadIdentifier UndefinedThreadIdentifier = 0xffffffff; | 77 const WTF::ThreadIdentifier UndefinedThreadIdentifier = 0xffffffff; |
78 | 78 |
79 namespace blink { | 79 namespace blink { |
80 | 80 |
81 bool AudioContext::isSampleRateRangeGood(float sampleRate) | 81 bool AudioContext::isSampleRateRangeGood(float sampleRate) |
82 { | 82 { |
83 // FIXME: It would be nice if the minimum sample-rate could be less than 44.
1KHz, | 83 return sampleRate >= AudioBuffer::minAllowedSampleRate() && sampleRate <= Au
dioBuffer::maxAllowedSampleRate(); |
84 // but that will require some fixes in HRTFPanner::fftSizeForSampleRate(), a
nd some testing there. | |
85 return sampleRate >= 44100 && sampleRate <= 96000; | |
86 } | 84 } |
87 | 85 |
88 // Don't allow more than this number of simultaneous AudioContexts talking to ha
rdware. | 86 // Don't allow more than this number of simultaneous AudioContexts talking to ha
rdware. |
89 const unsigned MaxHardwareContexts = 6; | 87 const unsigned MaxHardwareContexts = 6; |
90 unsigned AudioContext::s_hardwareContextCount = 0; | 88 unsigned AudioContext::s_hardwareContextCount = 0; |
91 | 89 |
92 AudioContext* AudioContext::create(Document& document, ExceptionState& exception
State) | 90 AudioContext* AudioContext::create(Document& document, ExceptionState& exception
State) |
93 { | 91 { |
94 ASSERT(isMainThread()); | 92 ASSERT(isMainThread()); |
95 if (s_hardwareContextCount >= MaxHardwareContexts) { | 93 if (s_hardwareContextCount >= MaxHardwareContexts) { |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 visitor->trace(m_listener); | 888 visitor->trace(m_listener); |
891 visitor->trace(m_referencedNodes); | 889 visitor->trace(m_referencedNodes); |
892 visitor->trace(m_liveNodes); | 890 visitor->trace(m_liveNodes); |
893 visitor->trace(m_liveAudioSummingJunctions); | 891 visitor->trace(m_liveAudioSummingJunctions); |
894 EventTargetWithInlineData::trace(visitor); | 892 EventTargetWithInlineData::trace(visitor); |
895 } | 893 } |
896 | 894 |
897 } // namespace blink | 895 } // namespace blink |
898 | 896 |
899 #endif // ENABLE(WEB_AUDIO) | 897 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |