Interface DISResultListener


public interface DISResultListener
This interface provides access to more detailed SDK notifications by exposing the ReaderResult and ResolvedContent objects from the base SDK.

In the interest of simplifying implementation the DMSDetectorView component combines image and audio readers and a resolver in the same package. Notifications from all three of these objects are passed to the application through this listener interface. Notifications will be passed to the app for all image and audio detections, and if the app wants to, these detections can be turned into a web link via the Digimarc resolver.

The onImageResult(ReaderResult) will be called after each detection attempt (i.e. image frame), and onAudioResult(ReaderResult) will be called when an audio read occurs. Your application can handle the data contained within the ReaderResult as it desires. At the end of the callback processing you can return a list of Payload objects to the SDK. Each payload within the list will be then be resolved via the Digimarc resolver. If no resolving is desired then return null.

Unless your application is implementing its own payload caching the easiest way to implement payload resolving if for your Detection callback method to return the list of payloads provided by ReaderResult.getNewPayloads(). Using this method to get only the new payloads means that your application will not re-resolve a payload unless another read of the same type (Digimarc Barcode, Digimarc Barcode for Audio or Traditional Barcode) has occurred since the last time a given payload was read.

See the DetectorViewDemo sample application for a demonstration of both techniques. In its DISResultListener implementation the sample app makes use of the new payloads list for audio reads, but implements its own caching and handling for image reads.

  • Method Details

    • onImageResult

      @Nullable List<Payload> onImageResult(@NonNull ReaderResult result)
      Called after each image frame. The result will contain zero or more read records.
      Parameters:
      result - A ReaderResult object.
      Returns:
      A List containing all of the Payloads that you wish to resolve, or null for no resolving.
    • onAudioResult

      @Nullable List<Payload> onAudioResult(@NonNull ReaderResult result)
      Called after each audio detection. The result will contain one or more read records.
      Parameters:
      result - A ReaderResult object.
      Returns:
      A List containing all of the Payloads that you wish to resolve, or null for no resolving.
    • onResolved

      void onResolved(@NonNull ResolvedContent result)
      This will be called when a resolve operation is completed and the content data is available for your app to use.
      Parameters:
      result - Content data for the resolved payload.