LMCameraCaptureProtocol

Objective-C

@protocol LMCameraCaptureProtocol <NSObject>

Swift

protocol LMCameraCaptureProtocol : NSObjectProtocol

Base protocol for camera capture object

  • Called video capture from telephone camera Вызывает захват видеопотока с камеры телефона.

    Note

    Use the previewLayer property to display the video stream on the UI. Use the captureHandler property to capture the frame buffer of the video stream.

    Declaration

    Objective-C

    - (void)startWithDelay:(NSTimeInterval)delay;

    Swift

    func start(withDelay delay: TimeInterval)
  • Stops capturing a video stream.

    Declaration

    Objective-C

    - (void)stopWithCompletion:(VoidBlock _Nonnull)completion;

    Swift

    func stop() async

    Parameters

    completion

    completion block

  • Update frame of capture layer

    Declaration

    Objective-C

    - (void)updateLayerFrameWithRect:(CGRect)rect;

    Swift

    func updateLayerFrame(with rect: CGRect)

    Parameters

    rect

    new frame

  • Configures a video stream capture session.

    Note

    If the device does not have a camera in the selected position or does not support the 1280x720 preset, the method returns false.

    Declaration

    Objective-C

    - (void)configureWithCameraPosition:(AVCaptureDevicePosition)cameraPosition
                             completion:(VoidBlock _Nonnull)completion;

    Swift

    func configure(withCameraPosition cameraPosition: Any!) async

    Parameters

    cameraPosition

    Camera position

  • Gets camera’s preview layer

    Declaration

    Objective-C

    - (void)findPreviewLayerWithBestshotDetector:(id _Nonnull)bestshotDetector
                                      completion:
                                          (CaptureLayerHandler _Nullable)completion;

    Swift

    func findPreviewLayer(withBestshotDetector bestshotDetector: Any) async -> UnsafeMutablePointer<Int32>?

    Parameters

    bestshotDetector

    bestshotDetector, providing camera operations

    completion

    completion block

  • Changes the camera type between main and front.

    Declaration

    Objective-C

    - (void)switchCameraType;

    Swift

    func switchCameraType()
  • Set handler of captured sample buffer

    Declaration

    Objective-C

    - (void)defineSampleBufferhandler:(CaptureSampleBufferHandler)newHandler;

    Swift

    func defineSampleBufferhandler(_ newHandler: CaptureSampleBufferHandler!)
  • Set handler of captured image

    Declaration

    Objective-C

    - (void)defineCGImageHandler:(CaptureCGImageHandler)newHandler;

    Swift

    func defineCGImageHandler(_ newHandler: CaptureCGImageHandler!)