Package com.banuba.sdk.offscreen
Class OffscreenEffectPlayer
java.lang.Object
com.banuba.sdk.offscreen.OffscreenEffectPlayer
Deprecated.
The com.banuba.sdk.offscreen package is deprecated. Use PlayerAPI instead.
-
Constructor Summary
ConstructorDescriptionOffscreenEffectPlayer
(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 TypeMethodDescriptionvoid
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
Deprecated.Allows execute scripts (calling methods) or load JS modules to the environment of active effectDeprecated.Return the current OEP configurationvoid
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 OffscreenEffectPlayervoid
processImage
(android.media.Image image, ImageOrientation orientation, OEPImageFormat outputImageFormat) Deprecated.Send Image to process Image will be closed inside OffscreenEffectPlayervoid
release()
Deprecated.Stop processing and release OffscreenEffectPlayer resourcesvoid
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.
-
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 listenerPassing 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 listenerPassing NULL will disable render to SurfaceTexture
- Parameters:
surfaceTexture
- The surfaceTexture to use, or null to remove.
-
processImage
Deprecated.Send Image to process Image will be closed inside OffscreenEffectPlayer- Parameters:
image
- Android image to processorientation
- 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 processorientation
- describes current image orientationoutputImageFormat
- 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 objectreleaseCallback
- 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 objectreleaseCallback
- 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
- OEPImageFormattimestamp
- 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
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
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 storageasync
- 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
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 methodparameter
- - 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 quotesresultCallback
- - 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
Deprecated.Return the current OEP configuration -
enableAudio
public void enableAudio(boolean enable) Deprecated.Switch on/off audio in effects.- Parameters:
enable
-
-