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

Unified Diff: media/audio/mac/audio_output_mac.cc

Issue 10836022: Get ChannelLayout on OSX with non-deprecated methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dangling pragma. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_output_mac.cc
diff --git a/media/audio/mac/audio_output_mac.cc b/media/audio/mac/audio_output_mac.cc
index b0784ebe6a776042051fec1bedd95e22b7aec7d2..7f96735a495d6771b1e027740129cb7dcc95806a 100644
--- a/media/audio/mac/audio_output_mac.cc
+++ b/media/audio/mac/audio_output_mac.cc
@@ -115,14 +115,10 @@ bool PCMQueueOutAudioOutputStream::Open() {
}
// Get the size of the channel layout.
UInt32 core_layout_size;
- // TODO(annacc): AudioDeviceGetPropertyInfo() is deprecated, but its
- // replacement, AudioObjectGetPropertyDataSize(), doesn't work yet with
- // kAudioDevicePropertyPreferredChannelLayout.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- err = AudioDeviceGetPropertyInfo(device_id, 0, false,
- kAudioDevicePropertyPreferredChannelLayout,
- &core_layout_size, NULL);
+ property_address.mSelector = kAudioDevicePropertyPreferredChannelLayout;
+ property_address.mScope = kAudioDevicePropertyScopeOutput;
+ err = AudioObjectGetPropertyDataSize(device_id, &property_address, 0, NULL,
+ &core_layout_size);
if (err != noErr) {
HandleError(err);
return false;
@@ -133,17 +129,13 @@ bool PCMQueueOutAudioOutputStream::Open() {
core_channel_layout.reset(
reinterpret_cast<AudioChannelLayout*>(malloc(core_layout_size)));
memset(core_channel_layout.get(), 0, core_layout_size);
- // TODO(annacc): AudioDeviceGetProperty() is deprecated, but its
- // replacement, AudioObjectGetPropertyData(), doesn't work yet with
- // kAudioDevicePropertyPreferredChannelLayout.
- err = AudioDeviceGetProperty(device_id, 0, false,
- kAudioDevicePropertyPreferredChannelLayout,
- &core_layout_size, core_channel_layout.get());
+ err = AudioObjectGetPropertyData(device_id, &property_address, 0, NULL,
+ &core_layout_size,
+ core_channel_layout.get());
if (err != noErr) {
HandleError(err);
return false;
}
-#pragma clang diagnostic pop
num_core_channels_ =
static_cast<int>(core_channel_layout->mNumberChannelDescriptions);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698