- Home /
Quickly Updating Texture2d in Unity from Android Java
Since each platform has its own decoder for h264 video streams, I need to have a general Unity program (hence the name Unity) that is able to get frames quickly from the platform on which it is running. I have this easily working from windows, but for Android, I have some issues:
I have a bridge implemented between Unity and Java
Using byte [] to update a Texture2D works but is so slow that it is not use-able
I have used almost everything out there to attempt to speed this up
The main idea that I have now is that there is a way to pass a pointer of the byte [] in the Texture2D in Unity to the Java side of the code so that there is a direct application of the new video frame. Since it was a pointer, there is no transfer back of data, it is just done.
At this point, it does not work due to a number of issues. Mainly, my entire 7 years working in video games and never messing with Java.
Right now I really want to find an answer to this seemingly simple situation. I truly want to get this one aspect implemented so that I can proceed to easier parts of this side project. Once I have this working, I plan to make a website or at least a post somewhere of all the steps I have taken to help others.