Class OffscreenEffectPlayer

java.lang.Object
com.banuba.sdk.offscreen.OffscreenEffectPlayer

@Deprecated public class OffscreenEffectPlayer extends Object
Deprecated.
The com.banuba.sdk.offscreen package is deprecated. Use PlayerAPI instead.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OffscreenEffectPlayer(android.content.Context context, com.banuba.sdk.effect_player.EffectPlayer player, android.util.Size size, OffscreenSimpleConfig config)
    Deprecated.
     
    OffscreenEffectPlayer(android.content.Context context, OffscreenEffectPlayerConfig config, String key)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    callJsMethod(String method, String parameter)
    Deprecated.
    Allows calling methods defined in the script of the active effect to configure the effect or manage its state.
    void
    enableAudio(boolean enable)
    Deprecated.
    Switch on/off audio in effects.
    void
    evalJs(String script, com.banuba.sdk.effect_player.JsCallback resultCallback)
    Deprecated.
    Allows execute scripts (calling methods) or load JS modules to the environment of active effect
    Deprecated.
    Return the current OEP configuration
    void
    loadEffect(String effectName)
    Deprecated.
    Loads an effect to the effect player asynchronously by default.
    void
    loadEffect(String effectName, boolean async)
    Deprecated.
    Loads an effect to the effect player asynchronously or synchronously.
    void
    Deprecated.
    Suspend current playback attempt.
    void
    Deprecated.
    Switching to active state attempt.
    void
    Deprecated.
    Switch to inactive state.
    void
    processFullImageData(com.banuba.sdk.types.FullImageData fullImageData, ReleaseCallback releaseCallback, long timestamp)
    Deprecated.
    Send FullImageData to process.
    void
    processFullImageData(com.banuba.sdk.types.FullImageData fullImageData, ReleaseCallback releaseCallback, OEPImageFormat outputImageFormat, long timestamp)
    Deprecated.
    Send FullImageData to process.
    void
    processFullImageDataNoSkip(com.banuba.sdk.types.FullImageData fullImageData, ReleaseCallback releaseCallback, long timestamp)
    Deprecated.
    Meaning and parameters are the same as for processFullImageData but in that case the image will wait in the queue until processed, i.e. every image is processed without drops even if another image is being processed at this moment.
    void
    processImage(android.media.Image image, ImageOrientation orientation)
    Deprecated.
    Send Image to process Image will be closed inside OffscreenEffectPlayer
    void
    processImage(android.media.Image image, ImageOrientation orientation, OEPImageFormat outputImageFormat)
    Deprecated.
    Send Image to process Image will be closed inside OffscreenEffectPlayer
    void
    Deprecated.
    Stop processing and release OffscreenEffectPlayer resources
    void
    setImageProcessListener(ImageProcessedListener listener, android.os.Handler handler)
    Deprecated.
    Sets ImageProcessListener The callback will be invoked on handler's thread.
    void
    setSurfaceTexture(android.graphics.SurfaceTexture surfaceTexture)
    Deprecated.
    Sets SurfaceTexture Can be used together with ImageProcessListener.
    void
    Deprecated.
    Unload active effect.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OffscreenEffectPlayer

      public OffscreenEffectPlayer(@NonNull android.content.Context context, @NonNull OffscreenEffectPlayerConfig config, @NonNull String key)
      Deprecated.
    • OffscreenEffectPlayer

      public OffscreenEffectPlayer(@NonNull android.content.Context context, @NonNull com.banuba.sdk.effect_player.EffectPlayer player, @NonNull android.util.Size size, @NonNull OffscreenSimpleConfig config)
      Deprecated.
  • Method Details

    • setImageProcessListener

      public void setImageProcessListener(@Nullable ImageProcessedListener listener, @Nullable android.os.Handler handler)
      Deprecated.
      Sets ImageProcessListener The callback will be invoked on handler's thread. Can be used together with surfaceTexture. In this case, OffscreenEffectPlayer will render to SurfaceTexture and send image to listener

      Passing NULL/NULL will disable prepare and send Buffers to listener

      Parameters:
      listener - The listener to use, or null to remove the listener.
      handler - The handler on which the listener should be invoked, or null to remove the listener
    • setSurfaceTexture

      public void setSurfaceTexture(@Nullable android.graphics.SurfaceTexture surfaceTexture)
      Deprecated.
      Sets SurfaceTexture Can be used together with ImageProcessListener. In this case OffscreenEffectPlayer will render to SurfaceTexture and send image to listener

      Passing NULL will disable render to SurfaceTexture

      Parameters:
      surfaceTexture - The surfaceTexture to use, or null to remove.
    • processImage

      public void processImage(@NonNull android.media.Image image, @NonNull ImageOrientation orientation)
      Deprecated.
      Send Image to process Image will be closed inside OffscreenEffectPlayer
      Parameters:
      image - Android image to process
      orientation - describes current image orientation
    • processImage

      public void processImage(@NonNull android.media.Image image, @NonNull ImageOrientation orientation, @NonNull OEPImageFormat outputImageFormat)
      Deprecated.
      Send Image to process Image will be closed inside OffscreenEffectPlayer
      Parameters:
      image - Android image to process
      orientation - describes current image orientation
      outputImageFormat - describes output Image Format
    • processFullImageData

      public void processFullImageData(@NonNull com.banuba.sdk.types.FullImageData fullImageData, @Nullable ReleaseCallback releaseCallback, long timestamp)
      Deprecated.
      Send FullImageData to process. FullImageData is a container for the Image object or buffers representing image in a specific format.
      Parameters:
      fullImageData - Instance of FullImageData object
      releaseCallback - is called by OEP when image stored in fullImageData can be released. If releaseCallback is passed then Image data isn't copied to improve performance. If a releaseCallback is passed and an Image is used, undefined behavior may occur when the ImageReader is closed and then opened again. In order to avoid this, it is necessary to call playbackStop before closing the camera and playbackPlay after opening it.
      timestamp - lets you associate frame with the timestamp in order to identify it at ImageProcessedListener call
    • processFullImageData

      public void processFullImageData(@NonNull com.banuba.sdk.types.FullImageData fullImageData, @Nullable ReleaseCallback releaseCallback, @NonNull OEPImageFormat outputImageFormat, long timestamp)
      Deprecated.
      Send FullImageData to process. FullImageData is a container for the Image object or buffers representing image in a specific format.
      Parameters:
      fullImageData - Instance of FullImageData object
      releaseCallback - is called by OEP when image stored in fullImageData can be released. If releaseCallback is passed then Image data isn't copied to improve performance. If a releaseCallback is passed and an Image is used, undefined behavior may occur when the ImageReader is closed and then opened again. In order to avoid this, it is necessary to call playbackStop before closing the camera and playbackPlay after opening it.
      outputImageFormat - OEPImageFormat
      timestamp - lets you associate frame with the timestamp in order to identify it at ImageProcessedListener call
    • processFullImageDataNoSkip

      @VisibleForTesting public void processFullImageDataNoSkip(@NonNull com.banuba.sdk.types.FullImageData fullImageData, @Nullable ReleaseCallback releaseCallback, long timestamp)
      Deprecated.
      Meaning and parameters are the same as for processFullImageData but in that case the image will wait in the queue until processed, i.e. every image is processed without drops even if another image is being processed at this moment.
    • loadEffect

      public void loadEffect(@NonNull String effectName)
      Deprecated.
      Loads an effect to the effect player asynchronously by default. Please use another loadEffect method to decide which mode of effect loading appropriates you.
      Parameters:
      effectName - the name of an effect (folder) in the app resource storage
    • loadEffect

      public void loadEffect(@NonNull String effectName, boolean async)
      Deprecated.
      Loads an effect to the effect player asynchronously or synchronously. In the case of synchronous loading, the effect will be loaded and activated as a single step, while for asynchronous loading the activation of effect will be postponed to the rendering phase. The loading of the effect in synchronous mode is practical when you need to be sure that the effect is wholly loaded and activated before the first frame rendering.
      Parameters:
      effectName - the name of an effect (folder) in the app resource storage
      async - if true the effect will be loaded asynchronously, else synchronously
    • unloadEffect

      public void unloadEffect()
      Deprecated.
      Unload active effect. The effect stays in the cache so that another loading of the same effect is faster.
    • callJsMethod

      public void callJsMethod(@NonNull String method, @NonNull String parameter)
      Deprecated.
      Allows calling methods defined in the script of the active effect to configure the effect or manage its state. This method is obsolete, see evalJs.
      Parameters:
      method - - the name of the js method
      parameter - - the parameter to pass to the method
    • evalJs

      public void evalJs(@NonNull String script, @Nullable com.banuba.sdk.effect_player.JsCallback resultCallback)
      Deprecated.
      Allows execute scripts (calling methods) or load JS modules to the environment of active effect
      Parameters:
      script - - js script with escaped quotes
      resultCallback - - the callback called after script's execution completed
    • release

      public void release()
      Deprecated.
      Stop processing and release OffscreenEffectPlayer resources
    • playbackPlay

      public void playbackPlay()
      Deprecated.
      Switching to active state attempt. Possible from paused or stopped state and has no effect if effect playback is already active. Playback resumes from the position saved before `playbackPause` call.
    • playbackPause

      public void playbackPause()
      Deprecated.
      Suspend current playback attempt. The recognizer thread is stopped and all the video textures and audio units playback is stopped as well. Effect player doesn't react on processImage or processFullImageData calls in suspended state except asynchronous-inconsistent mode.
    • playbackStop

      public void playbackStop()
      Deprecated.
      Switch to inactive state. In addition to pause clears recognizer's buffer. The next switch to active state will result in total rerun of active effect which means that it will be started from the very beginning. Call this method when you stop input from camera (e.g. went in background or switch).
    • getConfig

      @NonNull public OffscreenSimpleConfig getConfig()
      Deprecated.
      Return the current OEP configuration
    • enableAudio

      public void enableAudio(boolean enable)
      Deprecated.
      Switch on/off audio in effects.
      Parameters:
      enable -