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

Side by Side Diff: webrtc/modules/utility/source/helpers_ios.mm

Issue 1401963002: Adds support for Bluetooth headsets to the iOS audio layer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: nits Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #if defined(WEBRTC_IOS) 11 #if defined(WEBRTC_IOS)
12 12
13 #import <AVFoundation/AVFoundation.h>
13 #import <Foundation/Foundation.h> 14 #import <Foundation/Foundation.h>
14 #import <sys/sysctl.h> 15 #import <sys/sysctl.h>
15 #import <UIKit/UIKit.h> 16 #import <UIKit/UIKit.h>
16 17
17 #include "webrtc/base/checks.h" 18 #include "webrtc/base/checks.h"
18 #include "webrtc/base/logging.h" 19 #include "webrtc/base/logging.h"
19 #include "webrtc/base/scoped_ptr.h" 20 #include "webrtc/base/scoped_ptr.h"
20 #include "webrtc/modules/utility/interface/helpers_ios.h" 21 #include "webrtc/modules/utility/interface/helpers_ios.h"
21 22
22 namespace webrtc { 23 namespace webrtc {
(...skipping 27 matching lines...) Expand all
50 return true; 51 return true;
51 } 52 }
52 53
53 // TODO(henrika): see if it is possible to move to GetThreadName in 54 // TODO(henrika): see if it is possible to move to GetThreadName in
54 // platform_thread.h and base it on pthread methods instead. 55 // platform_thread.h and base it on pthread methods instead.
55 std::string GetCurrentThreadDescription() { 56 std::string GetCurrentThreadDescription() {
56 NSString* name = [NSString stringWithFormat:@"%@", [NSThread currentThread]]; 57 NSString* name = [NSString stringWithFormat:@"%@", [NSThread currentThread]];
57 return StdStringFromNSString(name); 58 return StdStringFromNSString(name);
58 } 59 }
59 60
61 std::string GetAudioSessionCategory() {
62 NSString* category = [[AVAudioSession sharedInstance] category];
63 return StdStringFromNSString(category);
64 }
65
60 std::string GetSystemName() { 66 std::string GetSystemName() {
61 NSString* osName = [[UIDevice currentDevice] systemName]; 67 NSString* osName = [[UIDevice currentDevice] systemName];
62 return StdStringFromNSString(osName); 68 return StdStringFromNSString(osName);
63 } 69 }
64 70
65 std::string GetSystemVersion() { 71 std::string GetSystemVersion() {
66 NSString* osVersion = [[UIDevice currentDevice] systemVersion]; 72 NSString* osVersion = [[UIDevice currentDevice] systemVersion];
67 return StdStringFromNSString(osVersion); 73 return StdStringFromNSString(osVersion);
68 } 74 }
69 75
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 if (!raw_name.compare("x86_64")) 169 if (!raw_name.compare("x86_64"))
164 return std::string("Simulator"); 170 return std::string("Simulator");
165 LOG(LS_WARNING) << "Failed to find device name"; 171 LOG(LS_WARNING) << "Failed to find device name";
166 return raw_name; 172 return raw_name;
167 } 173 }
168 174
169 } // namespace ios 175 } // namespace ios
170 } // namespace webrtc 176 } // namespace webrtc
171 177
172 #endif // defined(WEBRTC_IOS) 178 #endif // defined(WEBRTC_IOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698