2019-08-17 03:49:25 +02:00
|
|
|
// Copyright 2019 The MediaPipe Authors.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
#import <AVFoundation/AVFoundation.h>
|
|
|
|
|
|
|
|
#import "mediapipe/objc/MPPInputSource.h"
|
|
|
|
|
|
|
|
/// A source that obtains video frames from the camera.
|
|
|
|
@interface MPPCameraInputSource : MPPInputSource
|
|
|
|
|
|
|
|
/// Whether we are allowed to use the camera.
|
|
|
|
@property(nonatomic, getter=isAuthorized, readonly) BOOL authorized;
|
|
|
|
|
|
|
|
/// Session preset to use for capturing.
|
2022-09-09 03:06:56 +02:00
|
|
|
@property(nonatomic, nullable) NSString *sessionPreset;
|
2019-08-17 03:49:25 +02:00
|
|
|
|
|
|
|
/// Which camera on an iOS device to use, assuming iOS device with more than one camera.
|
|
|
|
@property(nonatomic) AVCaptureDevicePosition cameraPosition;
|
|
|
|
|
|
|
|
// Whether to use depth data or not
|
|
|
|
@property(nonatomic) BOOL useDepth;
|
|
|
|
|
|
|
|
/// Whether to rotate video buffers with device rotation.
|
|
|
|
@property(nonatomic) BOOL autoRotateBuffers;
|
|
|
|
|
2020-06-06 01:49:27 +02:00
|
|
|
/// Whether to mirror the video or not.
|
|
|
|
@property(nonatomic) BOOL videoMirrored;
|
|
|
|
|
2020-02-10 22:27:13 +01:00
|
|
|
/// The camera intrinsic matrix.
|
|
|
|
@property(nonatomic, readonly) matrix_float3x3 cameraIntrinsicMatrix;
|
|
|
|
|
2019-08-17 03:49:25 +02:00
|
|
|
/// The capture session.
|
|
|
|
@property(nonatomic, readonly) AVCaptureSession *session;
|
|
|
|
|
|
|
|
/// The capture video preview layer.
|
|
|
|
@property(nonatomic, readonly) AVCaptureVideoPreviewLayer *videoPreviewLayer;
|
|
|
|
|
|
|
|
/// The orientation of camera frame buffers.
|
|
|
|
@property(nonatomic) AVCaptureVideoOrientation orientation;
|
|
|
|
|
|
|
|
/// Prompts the user to grant camera access and provides the result as a BOOL to a completion
|
|
|
|
/// handler. Should be called after [MPPCameraInputSource init] and before
|
|
|
|
/// [MPPCameraInputSource start]. If the user has previously granted or denied permission, this
|
|
|
|
/// method simply returns the saved response to the permission request.
|
|
|
|
- (void)requestCameraAccessWithCompletionHandler:(void (^_Nullable)(BOOL granted))handler;
|
|
|
|
|
|
|
|
@end
|