Back to Filament

setAcquiredImage

docs/android/dokka/filament-android/com.google.android.filament/-stream/set-acquired-image.md

1.75.01.6 KB
Original Source

//filament-android/com.google.android.filament/Stream/setAcquiredImage

setAcquiredImage

[main]
open fun setAcquiredImage(hwbuffer: Any, handler: Any, callback: Runnable)

Updates an

kotlin
ACQUIRED

stream with an image that is guaranteed to be used in the next frame. This method tells Filament to immediately "acquire" the image and trigger a callback when it is done with it. This should be called by the user outside of beginFrame / endFrame, and should be called only once per frame. If the user pushes images to the same stream multiple times in a single frame, only the final image is honored, but all callbacks are invoked. This method should be called on the same thread that calls beginFrame, which is also where the callback is invoked. This method can only be used for streams that were constructed without calling the Builder.stream method. See Stream for more information about NATIVE and ACQUIRED configurations.

Parameters

main

hwbufferHardwareBuffer (requires API level 26)
handlerExecutor or Handler.
callbacka callback invoked by handler when the hwbuffer can be released.