How can I pass a java HardwareBuffer to Texture on android platform? #7712
JungleKong
started this conversation in
General
Replies: 1 comment 1 reply
-
I converted this issue to a discussion. I will try to answer asap. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to use a share texture provided by another process, represented by HardwareBuffer.
When I try to pass it to Filament Texture, but
setExternalImage
takes the EGLImage as parameter.So I tried to add an API to OpenGLDriver, it looks like that:
Then a Texture JNI interface will be OK as usual, an I call it
I am certain that the hardwareBuffer can lock right value in native(OpenGLDriver::setExternalHardwareBuffer), it just dose not work.
So, where did I go wrong, and how can I fix it?
By the way, if I gen Texture in Java directly and then bind texId with HardwareBuffer, it works very well.
It looks like as bellow:
At fisrt, I create Engine use Java EGL context,
engine = Engine.create(sharedContext)
and then gen Texture ID and prepare AHardwareBuffer, pass them to native cpp
In Java, pass the texId to Filament Texture
Or how can I share Texture between two Filament processes?
Beta Was this translation helpful? Give feedback.
All reactions