| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 #include "webrtc/api/objc/avfoundationvideocapturer.h" | 11 #include "avfoundationvideocapturer.h" |
| 12 | 12 |
| 13 #include "webrtc/base/bind.h" | 13 #include "webrtc/base/bind.h" |
| 14 #include "webrtc/base/checks.h" | 14 #include "webrtc/base/checks.h" |
| 15 #include "webrtc/base/thread.h" | 15 #include "webrtc/base/thread.h" |
| 16 | 16 |
| 17 #import <AVFoundation/AVFoundation.h> | 17 #import <AVFoundation/AVFoundation.h> |
| 18 #import <Foundation/Foundation.h> | 18 #import <Foundation/Foundation.h> |
| 19 #import <UIKit/UIKit.h> | 19 #import <UIKit/UIKit.h> |
| 20 | 20 |
| 21 #import "webrtc/base/objc/RTCDispatcher+Private.h" | 21 #import "WebRTC/RTCLogging.h" |
| 22 #import "webrtc/base/objc/RTCLogging.h" | 22 |
| 23 #import "RTCDispatcher+Private.h" |
| 23 | 24 |
| 24 // TODO(tkchin): support other formats. | 25 // TODO(tkchin): support other formats. |
| 25 static NSString *const kDefaultPreset = AVCaptureSessionPreset640x480; | 26 static NSString *const kDefaultPreset = AVCaptureSessionPreset640x480; |
| 26 static cricket::VideoFormat const kDefaultFormat = | 27 static cricket::VideoFormat const kDefaultFormat = |
| 27 cricket::VideoFormat(640, | 28 cricket::VideoFormat(640, |
| 28 480, | 29 480, |
| 29 cricket::VideoFormat::FpsToInterval(30), | 30 cricket::VideoFormat::FpsToInterval(30), |
| 30 cricket::FOURCC_NV12); | 31 cricket::FOURCC_NV12); |
| 31 | 32 |
| 32 // This class used to capture frames using AVFoundation APIs on iOS. It is meant | 33 // This class used to capture frames using AVFoundation APIs on iOS. It is meant |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 537 |
| 537 // This will call a superclass method that will perform the frame conversion | 538 // This will call a superclass method that will perform the frame conversion |
| 538 // to I420. | 539 // to I420. |
| 539 SignalFrameCaptured(this, &frame); | 540 SignalFrameCaptured(this, &frame); |
| 540 | 541 |
| 541 CVPixelBufferUnlockBaseAddress(image_buffer, lock_flags); | 542 CVPixelBufferUnlockBaseAddress(image_buffer, lock_flags); |
| 542 CVBufferRelease(image_buffer); | 543 CVBufferRelease(image_buffer); |
| 543 } | 544 } |
| 544 | 545 |
| 545 } // namespace webrtc | 546 } // namespace webrtc |
| OLD | NEW |