Title: [162944] trunk/Source/WebCore
Revision
162944
Author
jer.no...@apple.com
Date
2014-01-28 10:22:07 -0800 (Tue, 28 Jan 2014)

Log Message

[Mac] Use explicit, rather than canonical, AudioFormatFlags and types.
https://bugs.webkit.org/show_bug.cgi?id=127781

Reviewed by Eric Carlson.

Since every mac platform uses Float32 audio samples, use these types explicitly
rather than the implicit, canonical AudioSampleType type. Once we're using Float32
explicity, we can also use the explicit kAudioFormatFlagsNativeFloatPacked flag
rather than the canonical version.

* platform/audio/mac/AudioDestinationMac.cpp:
(WebCore::AudioDestinationMac::configure):
* platform/audio/mac/AudioFileReaderMac.cpp:
(WebCore::AudioFileReader::createBus):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (162943 => 162944)


--- trunk/Source/WebCore/ChangeLog	2014-01-28 18:18:47 UTC (rev 162943)
+++ trunk/Source/WebCore/ChangeLog	2014-01-28 18:22:07 UTC (rev 162944)
@@ -1,3 +1,20 @@
+2014-01-28  Jer Noble  <jer.no...@apple.com>
+
+        [Mac] Use explicit, rather than canonical, AudioFormatFlags and types.
+        https://bugs.webkit.org/show_bug.cgi?id=127781
+
+        Reviewed by Eric Carlson.
+
+        Since every mac platform uses Float32 audio samples, use these types explicitly
+        rather than the implicit, canonical AudioSampleType type. Once we're using Float32
+        explicity, we can also use the explicit kAudioFormatFlagsNativeFloatPacked flag
+        rather than the canonical version.
+
+        * platform/audio/mac/AudioDestinationMac.cpp:
+        (WebCore::AudioDestinationMac::configure):
+        * platform/audio/mac/AudioFileReaderMac.cpp:
+        (WebCore::AudioFileReader::createBus):
+
 2014-01-27  Alexey Proskuryakov  <a...@apple.com>
 
         Expose SQL database creation and modification times

Modified: trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp (162943 => 162944)


--- trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp	2014-01-28 18:18:47 UTC (rev 162943)
+++ trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp	2014-01-28 18:22:07 UTC (rev 162944)
@@ -124,19 +124,16 @@
     OSStatus result = AudioUnitSetProperty(m_outputUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Global, 0, &input, sizeof(input));
     ASSERT(!result);
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     // Set stream format
     AudioStreamBasicDescription streamFormat;
     streamFormat.mSampleRate = m_sampleRate;
     streamFormat.mFormatID = kAudioFormatLinearPCM;
-    streamFormat.mFormatFlags = kAudioFormatFlagsCanonical | kAudioFormatFlagIsNonInterleaved;
-    streamFormat.mBitsPerChannel = 8 * sizeof(AudioSampleType);
+    streamFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kAudioFormatFlagIsNonInterleaved;
+    streamFormat.mBitsPerChannel = 8 * sizeof(Float32);
     streamFormat.mChannelsPerFrame = 2;
     streamFormat.mFramesPerPacket = 1;
-    streamFormat.mBytesPerPacket = sizeof(AudioSampleType);
-    streamFormat.mBytesPerFrame = sizeof(AudioSampleType);
-#pragma clang diagnostic pop
+    streamFormat.mBytesPerPacket = sizeof(Float32);
+    streamFormat.mBytesPerFrame = sizeof(Float32);
 
     result = AudioUnitSetProperty(m_outputUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, (void*)&streamFormat, sizeof(AudioStreamBasicDescription));
     ASSERT(!result);

Modified: trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp (162943 => 162944)


--- trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp	2014-01-28 18:18:47 UTC (rev 162943)
+++ trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp	2014-01-28 18:22:07 UTC (rev 162944)
@@ -157,17 +157,14 @@
     // Client format will be linear PCM (canonical), and potentially change sample-rate.
     m_clientDataFormat = m_fileDataFormat;
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     m_clientDataFormat.mFormatID = kAudioFormatLinearPCM;
-    m_clientDataFormat.mFormatFlags = kAudioFormatFlagsCanonical;
-    m_clientDataFormat.mBitsPerChannel = 8 * sizeof(AudioSampleType);
+    m_clientDataFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
+    m_clientDataFormat.mBitsPerChannel = 8 * sizeof(Float32);
     m_clientDataFormat.mChannelsPerFrame = numberOfChannels;
     m_clientDataFormat.mFramesPerPacket = 1;
-    m_clientDataFormat.mBytesPerPacket = sizeof(AudioSampleType);
-    m_clientDataFormat.mBytesPerFrame = sizeof(AudioSampleType);
+    m_clientDataFormat.mBytesPerPacket = sizeof(Float32);
+    m_clientDataFormat.mBytesPerFrame = sizeof(Float32);
     m_clientDataFormat.mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
-#pragma clang diagnostic pop
 
     if (sampleRate)
         m_clientDataFormat.mSampleRate = sampleRate;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to