Class BaseCaptureReader
- Direct Known Subclasses:
AudioCaptureReader
,VideoCaptureReader
All asynchronous reader objects derive from this class. Asynchronous readers are available for
image reading (VideoCaptureReader
) and audio reading (AudioCaptureReader
).
Asynchronous readers provide managed performance scaling by default.
The general signaling mechanism provides asynchronous callbacks when processing has been completed
on a packet of data (image frame or audio buffer) via the
ResultListener.onReaderResult(ReaderResult, ResultType)
and
ResultListener.onError(com.digimarc.dms.readers.BaseReader.ReaderError, com.digimarc.dms.readers.BaseReader.ResultType)
methods. These callbacks are delivered by a
separate thread within the capture reader class. The callbacks will always be delivered to your
application on the UI thread. Delays in returning from these callbacks will not obstruct the reader
itself, but it may cause a backup in the delivery of further notification callbacks.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.digimarc.dms.readers.BaseReader
BaseReader.AudioSymbology, BaseReader.ImageDetectionType, BaseReader.ImageSymbology, BaseReader.ReaderError, BaseReader.ReaderType, BaseReader.ResultType, BaseReader.Symbology, BaseReader.UndefinedSymbology
-
Field Summary
Fields inherited from class com.digimarc.dms.readers.BaseReader
All_Audio_Readers, All_Barcode_1D_Readers, All_Barcode_Readers, All_Image_Readers, mActionLock, mAllowScheduling, mOptions, mSymbologyMask
-
Constructor Summary
ModifierConstructorDescriptionprotected
BaseCaptureReader
(int symbologyMask, ResultListener listener, ReaderOptions options) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
notifyOfError
(BaseReader.ReaderError errorCode, BaseReader.ResultType type) protected void
notifyOfReadResults
(ReaderResult result, BaseReader.ResultType type) void
release()
This method should be called when the reader is no longer needed.Methods inherited from class com.digimarc.dms.readers.BaseReader
buildSymbologyMask, clearCache, createDetectors, getReaderOptions, getSymbologies, initialize, releaseDetectors, setAllowPerformanceScheduling, setReaderOptions, setSymbologies, validateSymbologies
-
Field Details
-
mResultListener
-
-
Constructor Details
-
BaseCaptureReader
protected BaseCaptureReader(int symbologyMask, @NonNull ResultListener listener, @Nullable ReaderOptions options) throws ReaderException Constructor.- Parameters:
symbologyMask
- A bitmask value containing the symbologies that the reader should use.options
- An optional dictionary of flags and settings for the reader. The available entries are documented separately.- Throws:
ReaderException
- An exception will be thrown if an invalid symbology or options entry is specified for this reader.
-
-
Method Details
-
notifyOfReadResults
protected void notifyOfReadResults(@NonNull ReaderResult result, @NonNull BaseReader.ResultType type) -
notifyOfError
protected void notifyOfError(@NonNull BaseReader.ReaderError errorCode, @NonNull BaseReader.ResultType type) -
release
public void release()Description copied from class:BaseReader
This method should be called when the reader is no longer needed. Failure to call this method may result in objects remaining in memory beyond their useful lifespan.- Overrides:
release
in classBaseReader
-