Sequence Frame Source
Defined in framework ScanditCaptureCore
- SequenceFrameSource
open class SequenceFrameSource : NSObject, FrameSource
Added in version 6.12.0
Emits frames added via add(_:).
This class can be used if the camera is not handled by Scandit Data Capture SDK (i.e., when using another framework handling the camera, like ARKit). Register an instance of this class as the data source via DataCaptureContext.frameSource and then add frames coming from the camera via add(_:).
Note
Register the frame source and switch it on once, outside of your frame loop, and then call add(_:) for each frame. Do not create a frame source per frame, and do not set one on the DataCaptureContext from inside the frame loop. In particular, do not feed a continuous camera stream through ImageFrameSource — it is meant for single images and turns off after each one.
Note
The only pixel format type supported is kCVPixelFormatType_420YpCbCr8BiPlanarFullRange.
- init()
init()
Added in version 6.12.0
- init(captureDevicePosition:lensPosition:)
init(captureDevicePosition: AVCaptureDevice.Position, lensPosition: CGFloat)
Added in version 6.12.0
Constructs a new SequenceFrameSource. It requires the position of the capture device (https://developer.apple.com/documentation/avfoundation/avcapturedevice/position-swift.enum) and the lens position (https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624643-lensposition).
- `switch`(toDesiredState:)
open func `switch`(toDesiredState state: FrameSourceState) async ->
BoolAdded in version 6.14.0
Implemented from FrameSource. See FrameSource.`switch`(toDesiredState:completionHandler:).
- `switch`(toDesiredState:)
open func `switch`(toDesiredState state: FrameSourceState) ->
VoidAdded in version 6.12.0
Convenience method for FrameSource.`switch`(toDesiredState:completionHandler:): it is same as calling FrameSource.`switch`(toDesiredState:completionHandler:) with the second argument set to nil.
- add(_:)
open func add(_ sampleBuffer: CMSampleBuffer) ->
VoidAdded in version 6.12.0
Adds a sample buffer. If this frame source is on and connected to a DataCaptureContext this is the next frame that will be processed. Note that the only pixel format type supported is kCVPixelFormatType_420YpCbCr8BiPlanarFullRange.