Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / webaudio / RealtimeAnalyser.cpp
index b768a24..8a207e5 100644 (file)
@@ -40,9 +40,7 @@
 #include "wtf/MathExtras.h"
 #include "wtf/Uint8Array.h"
 
-using namespace std;
-
-namespace WebCore {
+namespace blink {
 
 const double RealtimeAnalyser::DefaultSmoothingTimeConstant  = 0.8;
 const double RealtimeAnalyser::DefaultMinDecibels = -100;
@@ -181,8 +179,8 @@ void RealtimeAnalyser::doFFTAnalysis()
 
     // A value of 0 does no averaging with the previous result.  Larger values produce slower, but smoother changes.
     double k = m_smoothingTimeConstant;
-    k = max(0.0, k);
-    k = min(1.0, k);
+    k = std::max(0.0, k);
+    k = std::min(1.0, k);
 
     // Convert the analysis data from complex to magnitude and average with the previous result.
     float* destination = magnitudeBuffer().data();
@@ -206,7 +204,7 @@ void RealtimeAnalyser::getFloatFrequencyData(Float32Array* destinationArray)
     // Convert from linear magnitude to floating-point decibels.
     const double minDecibels = m_minDecibels;
     unsigned sourceLength = magnitudeBuffer().size();
-    size_t len = min(sourceLength, destinationArray->length());
+    size_t len = std::min(sourceLength, destinationArray->length());
     if (len > 0) {
         const float* source = magnitudeBuffer().data();
         float* destination = destinationArray->data();
@@ -230,7 +228,7 @@ void RealtimeAnalyser::getByteFrequencyData(Uint8Array* destinationArray)
 
     // Convert from linear magnitude to unsigned-byte decibels.
     unsigned sourceLength = magnitudeBuffer().size();
-    size_t len = min(sourceLength, destinationArray->length());
+    size_t len = std::min(sourceLength, destinationArray->length());
     if (len > 0) {
         const double rangeScaleFactor = m_maxDecibels == m_minDecibels ? 1 : 1 / (m_maxDecibels - m_minDecibels);
         const double minDecibels = m_minDecibels;
@@ -264,7 +262,7 @@ void RealtimeAnalyser::getFloatTimeDomainData(Float32Array* destinationArray)
         return;
 
     unsigned fftSize = this->fftSize();
-    size_t len = min(fftSize, destinationArray->length());
+    size_t len = std::min(fftSize, destinationArray->length());
     if (len > 0) {
         bool isInputBufferGood = m_inputBuffer.size() == InputBufferSize && m_inputBuffer.size() > fftSize;
         ASSERT(isInputBufferGood);
@@ -293,7 +291,7 @@ void RealtimeAnalyser::getByteTimeDomainData(Uint8Array* destinationArray)
         return;
 
     unsigned fftSize = this->fftSize();
-    size_t len = min(fftSize, destinationArray->length());
+    size_t len = std::min(fftSize, destinationArray->length());
     if (len > 0) {
         bool isInputBufferGood = m_inputBuffer.size() == InputBufferSize && m_inputBuffer.size() > fftSize;
         ASSERT(isInputBufferGood);
@@ -323,6 +321,6 @@ void RealtimeAnalyser::getByteTimeDomainData(Uint8Array* destinationArray)
     }
 }
 
-} // namespace WebCore
+} // namespace blink
 
 #endif // ENABLE(WEB_AUDIO)