Package com.banuba.sdk.effect_player
Class EffectManager.CppProxy
- java.lang.Object
-
- com.banuba.sdk.effect_player.EffectManager.CppProxy
-
- All Implemented Interfaces:
EffectManager
- Enclosing interface:
- EffectManager
public static final class EffectManager.CppProxy extends java.lang.Object implements EffectManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.banuba.sdk.effect_player.EffectManager
EffectManager.CppProxy
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
_djinni_private_destroy()
void
addEffectActivatedListener(EffectActivatedListener effectActivatedListener)
Add callback to receive notifications on effect change.void
addEffectEventListener(EffectEventListener effectEventListener)
Add callback to receive events from effect.void
addErrorListener(ErrorListener errorListener)
Add callback to receive errors messages from Effect Player.void
addHintListener(HintListener hintListener)
Add callback to receive user-visible messages from effects.Effect
createEffect(java.lang.String workDir)
Create empty effect.Effect
current()
Get active effect Thread-safe.void
disableSurfacePresentation()
disable surface presentation.Size
effectSize()
Get current effect size Thread-safe.float
effectVolume()
Get effect audio volume.protected void
finalize()
static EffectInfo
getEffectInfo(java.lang.String url)
Get effect info.Effect
load(java.lang.String url)
Load and activate effect sync.Effect
loadAsync(java.lang.String url)
Load effect async, activate in the draw() call when it will be ready.ReloadResult
reloadConfig(java.lang.String config)
Reload current effect config from the string provided.void
removeEffectActivatedListener(EffectActivatedListener effectActivatedListener)
Remove callback to receive notifications on effect change.void
removeEffectEventListener(EffectEventListener effectEventListener)
Remove callback to receive events from effect.void
removeErrorListener(ErrorListener errorListener)
Remove callback to receive errors messages from Effect Player.void
removeHintListener(HintListener hintListener)
Remove callback to receive user-visible messages from effects.void
setCurrentEffect(Effect effect)
Set current effect.void
setEffectSize(int fxWidth, int fxHeight)
Changes effect player render size, should be called on render thread.void
setEffectVolume(float volume)
Set effect audio volume.void
setRenderSurface(SurfaceData data)
set different render surfaces.Size
surfaceSize()
Get current surface size Thread-safe.void
unload(Effect effect)
Unload effect from cache.void
update(boolean sync)
Update effect loading state
-
-
-
Method Detail
-
_djinni_private_destroy
public void _djinni_private_destroy()
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
addErrorListener
public void addErrorListener(ErrorListener errorListener)
Description copied from interface:EffectManager
Add callback to receive errors messages from Effect Player. Thread-safe. May be called from any thread- Specified by:
addErrorListener
in interfaceEffectManager
-
removeErrorListener
public void removeErrorListener(ErrorListener errorListener)
Description copied from interface:EffectManager
Remove callback to receive errors messages from Effect Player. Thread-safe. May be called from any thread- Specified by:
removeErrorListener
in interfaceEffectManager
-
addHintListener
public void addHintListener(HintListener hintListener)
Description copied from interface:EffectManager
Add callback to receive user-visible messages from effects. You should display them on UI. Thread-safe. May be called from any thread- Specified by:
addHintListener
in interfaceEffectManager
-
removeHintListener
public void removeHintListener(HintListener hintListener)
Description copied from interface:EffectManager
Remove callback to receive user-visible messages from effects. Thread-safe. May be called from any thread- Specified by:
removeHintListener
in interfaceEffectManager
-
addEffectEventListener
public void addEffectEventListener(EffectEventListener effectEventListener)
Description copied from interface:EffectManager
Add callback to receive events from effect. Thread-safe. May be called from any thread- Specified by:
addEffectEventListener
in interfaceEffectManager
-
removeEffectEventListener
public void removeEffectEventListener(EffectEventListener effectEventListener)
Description copied from interface:EffectManager
Remove callback to receive events from effect. Thread-safe. May be called from any thread- Specified by:
removeEffectEventListener
in interfaceEffectManager
-
addEffectActivatedListener
public void addEffectActivatedListener(EffectActivatedListener effectActivatedListener)
Description copied from interface:EffectManager
Add callback to receive notifications on effect change. Thread-safe. May be called from any thread- Specified by:
addEffectActivatedListener
in interfaceEffectManager
-
removeEffectActivatedListener
public void removeEffectActivatedListener(EffectActivatedListener effectActivatedListener)
Description copied from interface:EffectManager
Remove callback to receive notifications on effect change. Thread-safe. May be called from any thread- Specified by:
removeEffectActivatedListener
in interfaceEffectManager
-
createEffect
public Effect createEffect(java.lang.String workDir)
Description copied from interface:EffectManager
Create empty effect. If working directory path is empty string then effect assumed as an in-memory effect.- Specified by:
createEffect
in interfaceEffectManager
-
setCurrentEffect
public void setCurrentEffect(Effect effect)
Description copied from interface:EffectManager
Set current effect. Thread-safe. May be called from any thread- Specified by:
setCurrentEffect
in interfaceEffectManager
-
load
public Effect load(java.lang.String url)
Description copied from interface:EffectManager
Load and activate effect sync. MUST be called from the render thread.- Specified by:
load
in interfaceEffectManager
-
loadAsync
public Effect loadAsync(java.lang.String url)
Description copied from interface:EffectManager
Load effect async, activate in the draw() call when it will be ready. Thread-safe. May be called from any thread.- Specified by:
loadAsync
in interfaceEffectManager
-
reloadConfig
public ReloadResult reloadConfig(java.lang.String config)
Description copied from interface:EffectManager
Reload current effect config from the string provided. If this reload is possible without effect recreation, this method will return `hot_reload == true`, otherwise `current` effect will be replaced and the method will return `hot_reload == false`. Thread-safe. May be called from any thread.- Specified by:
reloadConfig
in interfaceEffectManager
-
unload
public void unload(Effect effect)
Description copied from interface:EffectManager
Unload effect from cache. if no currently loading effect - works the same way as load(""); launches empty effect loading. MUST be called from the render thread- Specified by:
unload
in interfaceEffectManager
-
current
public Effect current()
Description copied from interface:EffectManager
Get active effect Thread-safe. May be called from any thread- Specified by:
current
in interfaceEffectManager
-
update
public void update(boolean sync)
Description copied from interface:EffectManager
Update effect loading state- Specified by:
update
in interfaceEffectManager
- Parameters:
sync
- syncronize effect manager, block until effect loaded MUST be called from the render thread
-
effectSize
public Size effectSize()
Description copied from interface:EffectManager
Get current effect size Thread-safe. May be called from any thread- Specified by:
effectSize
in interfaceEffectManager
-
surfaceSize
public Size surfaceSize()
Description copied from interface:EffectManager
Get current surface size Thread-safe. May be called from any thread- Specified by:
surfaceSize
in interfaceEffectManager
-
effectVolume
public float effectVolume()
Description copied from interface:EffectManager
Get effect audio volume. Thread-safe. May be called from any thread- Specified by:
effectVolume
in interfaceEffectManager
- Returns:
- A volume in range `[0, 1]`, where `1` means maximum volume.
-
setEffectVolume
public void setEffectVolume(float volume)
Description copied from interface:EffectManager
Set effect audio volume. Thread-safe. May be called from any thread- Specified by:
setEffectVolume
in interfaceEffectManager
- Parameters:
volume
- A value in range `[0, 1]`, where `1` means maximum volume.
-
setEffectSize
public void setEffectSize(int fxWidth, int fxHeight)
Description copied from interface:EffectManager
Changes effect player render size, should be called on render thread. MUST be called from the render thread- Specified by:
setEffectSize
in interfaceEffectManager
-
setRenderSurface
public void setRenderSurface(SurfaceData data)
Description copied from interface:EffectManager
set different render surfaces. Can be treated as void*- Specified by:
setRenderSurface
in interfaceEffectManager
-
disableSurfacePresentation
public void disableSurfacePresentation()
Description copied from interface:EffectManager
disable surface presentation. Needed for offscreen rendering- Specified by:
disableSurfacePresentation
in interfaceEffectManager
-
getEffectInfo
@NonNull public static EffectInfo getEffectInfo(@NonNull java.lang.String url)
Description copied from interface:EffectManager
Get effect info. May be called before loading effect "render type" and "recognizer features" fields won't be filled Thread-safe. May be called from any thread
-
-