| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 /// ***** Creates a message box with Cocoa framework | 53 /// ***** Creates a message box with Cocoa framework |
| 54 /// ***** Returns 0 on success, -1 otherwise. | 54 /// ***** Returns 0 on success, -1 otherwise. |
| 55 - (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:(const char*)deviceUnique
IdUTF8 | 55 - (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:(const char*)deviceUnique
IdUTF8 |
| 56 AndTitle:(const char*)dialogTitleUTF8 | 56 AndTitle:(const char*)dialogTitleUTF8 |
| 57 AndParentWindow:(void*) parentWindow | 57 AndParentWindow:(void*) parentWindow |
| 58 AtX:(uint32_t)positionX | 58 AtX:(uint32_t)positionX |
| 59 AndY:(uint32_t) positionY | 59 AndY:(uint32_t) positionY |
| 60 { | 60 { |
| 61 NSString* strTitle = [NSString stringWithFormat:@"%s", dialogTitleUTF8]; | 61 NSString* strTitle = [NSString stringWithFormat:@"%s", dialogTitleUTF8]; |
| 62 NSString* strButton = @"Alright"; | 62 NSString* strButton = @"Alright"; |
| 63 NSAlert* alert = [NSAlert alertWithMessageText:strTitle | 63 NSAlert* alert = [[NSAlert alloc] init]; |
| 64 defaultButton:strButton | 64 alert.messageText = strTitle; |
| 65 alternateButton:nil otherButton:nil | 65 [alert addButtonWithTitle:strButton]; |
| 66 informativeTextWithFormat:@"Device %s is capturing", devic
eUniqueIdUTF8]; | 66 alert.informativeText = |
| 67 [NSString stringWithFormat:@"Device %s is capturing", |
| 68 deviceUniqueIdUTF8]; |
| 67 [alert setAlertStyle:NSInformationalAlertStyle]; | 69 [alert setAlertStyle:NSInformationalAlertStyle]; |
| 68 [alert runModal]; | 70 [alert runModal]; |
| 69 return [NSNumber numberWithInt:0]; | 71 return [NSNumber numberWithInt:0]; |
| 70 } | 72 } |
| 71 | 73 |
| 72 - (NSNumber*)getCaptureDeviceCount{ | 74 - (NSNumber*)getCaptureDeviceCount{ |
| 73 [self getCaptureDevices]; | 75 [self getCaptureDevices]; |
| 74 return [NSNumber numberWithInt:_captureDeviceCountInfo]; | 76 return [NSNumber numberWithInt:_captureDeviceCountInfo]; |
| 75 } | 77 } |
| 76 | 78 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 98 if(!tempCaptureDevice) | 100 if(!tempCaptureDevice) |
| 99 { | 101 { |
| 100 return [NSNumber numberWithInt:-1]; | 102 return [NSNumber numberWithInt:-1]; |
| 101 } | 103 } |
| 102 | 104 |
| 103 memset(deviceName, 0, deviceNameLength); | 105 memset(deviceName, 0, deviceNameLength); |
| 104 memset(deviceUniqueID, 0, deviceUniqueIDLength); | 106 memset(deviceUniqueID, 0, deviceUniqueIDLength); |
| 105 | 107 |
| 106 bool successful = NO; | 108 bool successful = NO; |
| 107 | 109 |
| 110 // TODO(5478): Update deprecated APIs. |
| 111 #pragma clang diagnostic push |
| 112 #pragma clang diagnostic ignored "-Wdeprecated" |
| 108 NSString* tempString = [tempCaptureDevice localizedDisplayName]; | 113 NSString* tempString = [tempCaptureDevice localizedDisplayName]; |
| 109 successful = [tempString getCString:(char*)deviceName | 114 successful = [tempString getCString:(char*)deviceName |
| 110 maxLength:deviceNameLength encoding:NSUTF8StringEncoding]; | 115 maxLength:deviceNameLength encoding:NSUTF8StringEncoding]; |
| 111 if(NO == successful) | 116 if(NO == successful) |
| 112 { | 117 { |
| 113 memset(deviceName, 0, deviceNameLength); | 118 memset(deviceName, 0, deviceNameLength); |
| 114 return [NSNumber numberWithInt:-1]; | 119 return [NSNumber numberWithInt:-1]; |
| 115 } | 120 } |
| 116 | 121 |
| 117 tempString = [tempCaptureDevice uniqueID]; | 122 tempString = [tempCaptureDevice uniqueID]; |
| 118 successful = [tempString getCString:(char*)deviceUniqueID | 123 successful = [tempString getCString:(char*)deviceUniqueID |
| 119 maxLength:deviceUniqueIDLength encoding:NSUTF8StringEncoding]; | 124 maxLength:deviceUniqueIDLength encoding:NSUTF8StringEncoding]; |
| 120 if(NO == successful) | 125 if(NO == successful) |
| 121 { | 126 { |
| 122 memset(deviceUniqueID, 0, deviceNameLength); | 127 memset(deviceUniqueID, 0, deviceNameLength); |
| 123 return [NSNumber numberWithInt:-1]; | 128 return [NSNumber numberWithInt:-1]; |
| 124 } | 129 } |
| 130 #pragma clang diagnostic pop |
| 125 | 131 |
| 126 return [NSNumber numberWithInt:0]; | 132 return [NSNumber numberWithInt:0]; |
| 127 | 133 |
| 128 } | 134 } |
| 129 | 135 |
| 130 // ****************** "private" category functions below here *****************
* | 136 // ****************** "private" category functions below here *****************
* |
| 131 #pragma mark **** "private" method implementations | 137 #pragma mark **** "private" method implementations |
| 132 | 138 |
| 133 - (NSNumber*)initializeVariables | 139 - (NSNumber*)initializeVariables |
| 134 { | 140 { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 { | 178 { |
| 173 if(NO == _OSSupportedInfo) | 179 if(NO == _OSSupportedInfo) |
| 174 { | 180 { |
| 175 return [NSNumber numberWithInt:0]; | 181 return [NSNumber numberWithInt:0]; |
| 176 } | 182 } |
| 177 | 183 |
| 178 if(_captureDevicesInfo) | 184 if(_captureDevicesInfo) |
| 179 { | 185 { |
| 180 [_captureDevicesInfo release]; | 186 [_captureDevicesInfo release]; |
| 181 } | 187 } |
| 188 // TODO(5478): Update deprecated APIs. |
| 189 #pragma clang diagnostic push |
| 190 #pragma clang diagnostic ignored "-Wdeprecated" |
| 182 _captureDevicesInfo = [[NSArray alloc] | 191 _captureDevicesInfo = [[NSArray alloc] |
| 183 initWithArray:[QTCaptureDevice | 192 initWithArray:[QTCaptureDevice |
| 184 inputDevicesWithMediaType:QTMediaType
Video]]; | 193 inputDevicesWithMediaType:QTMediaType
Video]]; |
| 194 #pragma clang diagnostic pop |
| 185 | 195 |
| 186 _captureDeviceCountInfo = _captureDevicesInfo.count; | 196 _captureDeviceCountInfo = _captureDevicesInfo.count; |
| 187 | 197 |
| 188 return [NSNumber numberWithInt:0]; | 198 return [NSNumber numberWithInt:0]; |
| 189 } | 199 } |
| 190 | 200 |
| 191 @end | 201 @end |
| OLD | NEW |