Sequence Frame Source
Defined in package com.scandit.datacapture.core.source
- SequenceFrameSourceProcessListener
interface SequenceFrameSourceProcessListener
Added in version 6.14.0
- processingFinished(buffer)
void
processingFinished(byte
[] buffer)Added in version 6.14.0
- SequenceFrameSource
class SequenceFrameSource : FrameSource
Added in version 6.14.0
Emits frames added via addFrame().
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 addFrame().
Note
The only pixel format type supported is NV21.
- create(cameraPosition)
static @NonNull SequenceFrameSource create(CameraPosition cameraPosition)
Added in version 6.14.0
Constructs a new SequenceFrameSource. It requires the position of the capture device in the form of a CameraPosition, which is a direct translation from the native Android camera position (Camera API 1 - https://developer.android.com/reference/android/hardware/Camera.CameraInfo#facing, Camera API 2 - https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_FACING). Defaults to a 90º orientation for the mounted camera (Camera API 1 - https://developer.android.com/reference/android/hardware/Camera.CameraInfo#orientation, Camera API 2 - https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SENSOR_ORIENTATION).
- create(cameraPosition, captureDeviceOrientation, sequenceFrameSourceProcess)
static @NonNull SequenceFrameSource create(CameraPosition cameraPosition,
int
captureDeviceOrientation, @NonNull SequenceFrameSourceProcessListener sequenceFrameSourceProcess)Added in version 6.14.0
Constructs a new SequenceFrameSource. It requires the position of the capture device in the form of a CameraPosition, which is a direct translation from the native Android camera position (Camera API 1 - https://developer.android.com/reference/android/hardware/Camera.CameraInfo#facing, Camera API 2 - https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_FACING), the mounted camera orientation (Camera API 1 - https://developer.android.com/reference/android/hardware/Camera.CameraInfo#orientation, Camera API 2 - https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SENSOR_ORIENTATION) and a SequenceFrameSourceProcessListener which will be called when the frame buffer has been processed and is ready to be freed.
- desiredState
FrameSourceState getDesiredState()
Added in version 6.14.0
Implemented from FrameSource. See FrameSource.desiredState.
- currentState
FrameSourceState getCurrentState()
Added in version 6.14.0
Implemented from FrameSource. See FrameSource.currentState.
- addListener(listener)
void
addListener(@Nullable FrameSourceListener listener)Added in version 6.14.0
Implemented from FrameSource. See FrameSource.addListener().
- removeListener(listener)
void
removeListener(@Nullable FrameSourceListener listener)Added in version 6.14.0
Implemented from FrameSource. See FrameSource.removeListener().
- switchToDesiredState(desiredState, whenDone)
void
switchToDesiredState(FrameSourceState desiredState, @Nullable Callback<@NonNull Boolean> whenDone)Added in version 6.14.0
Implemented from FrameSource. See FrameSource.switchToDesiredState().
- addFrame(width, height, buffer)
void
addFrame(int
width,int
height,byte
[] buffer)Added in version 6.14.0
Add an image byte buffer with a given width and height. 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 NV21, otherwise an AssertionError is thrown.
- addFrame(frame)
void
addFrame(@NonNullImage
frame)Added in version 6.14.0
Add an
Image
to the frame source. This type is usually provided by the Camera API 2. If this frame source is ON and connected to a DataCaptureContext this is the next frame that will be processed.