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 29 matching lines...) Expand all Loading... |
40 NSCondition* _captureChangingCondition; | 40 NSCondition* _captureChangingCondition; |
41 } | 41 } |
42 | 42 |
43 @synthesize frameRotation = _framRotation; | 43 @synthesize frameRotation = _framRotation; |
44 | 44 |
45 - (id)initWithOwner:(VideoCaptureIos*)owner captureId:(int)captureId { | 45 - (id)initWithOwner:(VideoCaptureIos*)owner captureId:(int)captureId { |
46 if (self == [super init]) { | 46 if (self == [super init]) { |
47 _owner = owner; | 47 _owner = owner; |
48 _captureId = captureId; | 48 _captureId = captureId; |
49 _captureSession = [[AVCaptureSession alloc] init]; | 49 _captureSession = [[AVCaptureSession alloc] init]; |
50 #if defined(__IPHONE_7_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 | 50 #if defined(__IPHONE_7_0) && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) \ |
| 51 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 |
51 NSString* version = [[UIDevice currentDevice] systemVersion]; | 52 NSString* version = [[UIDevice currentDevice] systemVersion]; |
52 if ([version integerValue] >= 7) { | 53 if ([version integerValue] >= 7) { |
53 _captureSession.usesApplicationAudioSession = NO; | 54 _captureSession.usesApplicationAudioSession = NO; |
54 } | 55 } |
55 #endif | 56 #endif |
56 _captureChanging = NO; | 57 _captureChanging = NO; |
57 _captureChangingCondition = [[NSCondition alloc] init]; | 58 _captureChangingCondition = [[NSCondition alloc] init]; |
58 | 59 |
59 if (!_captureSession || !_captureChangingCondition) { | 60 if (!_captureSession || !_captureChangingCondition) { |
60 return nil; | 61 return nil; |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 } | 380 } |
380 | 381 |
381 - (void)waitForCaptureChangeToFinish { | 382 - (void)waitForCaptureChangeToFinish { |
382 [_captureChangingCondition lock]; | 383 [_captureChangingCondition lock]; |
383 while (_captureChanging) { | 384 while (_captureChanging) { |
384 [_captureChangingCondition wait]; | 385 [_captureChangingCondition wait]; |
385 } | 386 } |
386 [_captureChangingCondition unlock]; | 387 [_captureChangingCondition unlock]; |
387 } | 388 } |
388 @end | 389 @end |
OLD | NEW |