Package com.banuba.sdk.effect_player
Interface Effect
-
- All Known Implementing Classes:
Effect.CppProxy
public interface Effect
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Effect.CppProxy
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
activate(int fxWidth, int fxHeight, int surfaceWidth, int surfaceHeight)
activate current effect MUST be called from the render thread for OpenGL backends.void
callJsMethod(java.lang.String methodName, java.lang.String params)
Call js method in effect.void
deserialize(java.lang.String resolvedUrl, java.lang.String configOverride)
Deserialize effect from the provided `resoved_url`.void
dump()
void
dumpFs(java.lang.String outDir)
java.lang.String
dumpJson()
void
evalJs(java.lang.String script, JsCallback resultCallback)
Evaluate the `script` in effect.java.lang.String
evalJsSync(java.lang.String script)
Evaluate the `script` in effect.void
reset()
Reset effect state MUST be called from the render threadScene
scene()
If effect is based on Scene engine and it is activated completly - returns Scene object from the effect.EffectStatus
status()
void
update()
Update effect state (evaluate scheduled JS calls) MUST be called from the render threadjava.lang.String
url()
Thread-safe.
-
-
-
Method Detail
-
url
@NonNull java.lang.String url()
Thread-safe. May be called from any thread
-
callJsMethod
void callJsMethod(@NonNull java.lang.String methodName, @NonNull java.lang.String params)
Call js method in effect.- Parameters:
methodName
- JS global function name. Member functions are not supported.params
- Function arguments.
-
evalJs
void evalJs(@NonNull java.lang.String script, @Nullable JsCallback resultCallback)
Evaluate the `script` in effect. This method is thread safe.- Parameters:
sctipt
- JS string to executejs_callback
- Callback for result, will be called in render thread.
-
evalJsSync
@NonNull java.lang.String evalJsSync(@NonNull java.lang.String script)
Evaluate the `script` in effect. MUST be called from the render thread- Parameters:
sctipt
- JS string to execute- Returns:
- JS evaluation result
-
reset
void reset()
Reset effect state MUST be called from the render thread
-
update
void update()
Update effect state (evaluate scheduled JS calls) MUST be called from the render thread
-
scene
@Nullable Scene scene()
If effect is based on Scene engine and it is activated completly - returns Scene object from the effect. Otherwise returns null. MUST be called from the render thread Returned Scene object MUST be used only from the render thread and only while the effect is in the activated state.
-
deserialize
void deserialize(@NonNull java.lang.String resolvedUrl, @NonNull java.lang.String configOverride)
Deserialize effect from the provided `resoved_url`. If `configOverride` is an empty string, will use `config.json` under provided `resolvedUrl`, otherwise content of `configOverride` will be used. Can be called from any thread.
-
activate
void activate(int fxWidth, int fxHeight, int surfaceWidth, int surfaceHeight)
activate current effect MUST be called from the render thread for OpenGL backends.
-
dumpFs
void dumpFs(@NonNull java.lang.String outDir)
-
dump
void dump()
-
dumpJson
@NonNull java.lang.String dumpJson()
-
status
@NonNull EffectStatus status()
-
-