OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 26 matching lines...) Expand all Loading... |
37 NSCondition* _captureChangingCondition; | 37 NSCondition* _captureChangingCondition; |
38 } | 38 } |
39 | 39 |
40 @synthesize frameRotation = _framRotation; | 40 @synthesize frameRotation = _framRotation; |
41 | 41 |
42 - (id)initWithOwner:(VideoCaptureIos*)owner captureId:(int)captureId { | 42 - (id)initWithOwner:(VideoCaptureIos*)owner captureId:(int)captureId { |
43 if (self == [super init]) { | 43 if (self == [super init]) { |
44 _owner = owner; | 44 _owner = owner; |
45 _captureId = captureId; | 45 _captureId = captureId; |
46 _captureSession = [[AVCaptureSession alloc] init]; | 46 _captureSession = [[AVCaptureSession alloc] init]; |
47 #if defined(__IPHONE_7_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 | 47 #if defined(__IPHONE_7_0) && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) \ |
| 48 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 |
48 NSString* version = [[UIDevice currentDevice] systemVersion]; | 49 NSString* version = [[UIDevice currentDevice] systemVersion]; |
49 if ([version integerValue] >= 7) { | 50 if ([version integerValue] >= 7) { |
50 _captureSession.usesApplicationAudioSession = NO; | 51 _captureSession.usesApplicationAudioSession = NO; |
51 } | 52 } |
52 #endif | 53 #endif |
53 _captureChanging = NO; | 54 _captureChanging = NO; |
54 _captureChangingCondition = [[NSCondition alloc] init]; | 55 _captureChangingCondition = [[NSCondition alloc] init]; |
55 | 56 |
56 if (!_captureSession || !_captureChangingCondition) { | 57 if (!_captureSession || !_captureChangingCondition) { |
57 return nil; | 58 return nil; |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 415 } |
415 | 416 |
416 - (void)waitForCaptureChangeToFinish { | 417 - (void)waitForCaptureChangeToFinish { |
417 [_captureChangingCondition lock]; | 418 [_captureChangingCondition lock]; |
418 while (_captureChanging) { | 419 while (_captureChanging) { |
419 [_captureChangingCondition wait]; | 420 [_captureChangingCondition wait]; |
420 } | 421 } |
421 [_captureChangingCondition unlock]; | 422 [_captureChangingCondition unlock]; |
422 } | 423 } |
423 @end | 424 @end |
OLD | NEW |