SBSDKBaseCameraViewController

@interface SBSDKBaseCameraViewController : UIViewController

A basic camera view controller. Can be used for custom video frame detection.

  • The controllers camera session.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nonnull) SBSDKCameraSession *cameraSession;

    Swift

    var cameraSession: SBSDKCameraSession { get }
  • If set to YES (default), the camera session will be stopped entirely, when the receiver disappears and restarts when the receiver reappears. There is no CPU usage while the receiver is not on screen.

    NO will NOT stop the camera session, but pause the delivery of video frames and QR codes. There is some very low CPU activity while the receiver is not on screen, but there is also no lag when the receiver returns to the screen.

    Declaration

    Objective-C

    @property (nonatomic) BOOL stopsCameraSessionWhenDisappeared;

    Swift

    var stopsCameraSessionWhenDisappeared: Bool { get set }
  • The desired maximum detection rate of the receiver. The maximum number of video frames per second to be analyzed. Defaults to 20.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger detectionRate;

    Swift

    var detectionRate: UInt { get set }
  • Not available.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Not available.

    Declaration

    Objective-C

    + (nonnull instancetype)new;
  • Designated initializer. Installs the receiver as child view controller onto the parent view controllers view using its entire bounds area.

    Declaration

    Objective-C

    - (nullable instancetype)initWithParentViewController:
                                 (nullable UIViewController *)parentViewController
                                               parentView:
                                                   (nullable UIView *)containerView
                                                  feature:(dooFeature)feature;

    Swift

    init?(parentViewController: UIViewController?, parentView containerView: UIView?, feature: dooFeature)

    Parameters

    parentViewController

    The view controller the newly created instance is embedded into.

  • This function is called whenever a new video frame is being delivered.

    Declaration

    Objective-C

    - (void)willReceiveVideoFrame;

    Swift

    func willReceiveVideoFrame()
  • This function is called when a new video frame is being delivered and the frame limiter does not skip the frame. Do your custom recognition here.

    Declaration

    Objective-C

    - (void)processSampleBuffer:(nonnull CMSampleBufferRef)sampleBuffer
               videoOrientation:(AVCaptureVideoOrientation)orientation;

    Swift

    func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, videoOrientation orientation: AVCaptureVideoOrientation)

    Parameters

    sampleBuffer

    The CMSampleBufferRef containing the video frame data.

    orientation

    The cameras orientation. Can be used to rotate the sample buffer if needed.

  • Updates utility and helper layer frames. Subclasses can override this function to update their own subviews and sublayers.

    Declaration

    Objective-C

    - (void)updateLayerFrames;

    Swift

    func updateLayerFrames()