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

Side by Side Diff: media/audio/mac/audio_manager_mac.cc

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/mac/aggregate_device_manager.cc ('k') | net/base/keygen_handler_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/mac/audio_manager_mac.h" 5 #include "media/audio/mac/audio_manager_mac.h"
6 6
7 #include <CoreAudio/AudioHardware.h> 7 #include <CoreAudio/AudioHardware.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 kAudioHardwarePropertyDefaultOutputDevice; 196 kAudioHardwarePropertyDefaultOutputDevice;
197 197
198 result = AudioObjectGetPropertyData(kAudioObjectSystemObject, 198 result = AudioObjectGetPropertyData(kAudioObjectSystemObject,
199 &property_address, 199 &property_address,
200 0, 200 0,
201 0, 201 0,
202 &device_size, 202 &device_size,
203 &audio_device_id); 203 &audio_device_id);
204 } else { 204 } else {
205 // Non-default device. 205 // Non-default device.
206 base::mac::ScopedCFTypeRef<CFStringRef> 206 base::ScopedCFTypeRef<CFStringRef> uid(
207 uid(base::SysUTF8ToCFStringRef(device_id)); 207 base::SysUTF8ToCFStringRef(device_id));
208 AudioValueTranslation value; 208 AudioValueTranslation value;
209 value.mInputData = &uid; 209 value.mInputData = &uid;
210 value.mInputDataSize = sizeof(CFStringRef); 210 value.mInputDataSize = sizeof(CFStringRef);
211 value.mOutputData = &audio_device_id; 211 value.mOutputData = &audio_device_id;
212 value.mOutputDataSize = device_size; 212 value.mOutputDataSize = device_size;
213 UInt32 translation_size = sizeof(AudioValueTranslation); 213 UInt32 translation_size = sizeof(AudioValueTranslation);
214 214
215 property_address.mSelector = kAudioHardwarePropertyDeviceForUID; 215 property_address.mSelector = kAudioHardwarePropertyDeviceForUID;
216 result = AudioObjectGetPropertyData(kAudioObjectSystemObject, 216 result = AudioObjectGetPropertyData(kAudioObjectSystemObject,
217 &property_address, 217 &property_address,
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 current_sample_rate_ = new_sample_rate; 601 current_sample_rate_ = new_sample_rate;
602 current_output_device_ = new_output_device; 602 current_output_device_ = new_output_device;
603 NotifyAllOutputDeviceChangeListeners(); 603 NotifyAllOutputDeviceChangeListeners();
604 } 604 }
605 605
606 AudioManager* CreateAudioManager() { 606 AudioManager* CreateAudioManager() {
607 return new AudioManagerMac(); 607 return new AudioManagerMac();
608 } 608 }
609 609
610 } // namespace media 610 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/mac/aggregate_device_manager.cc ('k') | net/base/keygen_handler_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698