Hi guys, We're developing a native app for GearVR using the Native Application Framework. In the app we interface a 3rd party library (gstreamer) from which we, ideally, would like to fetch textures, which are uploaded to GPU by gstreamer and then use them in the VR app. Naturally, to be able to utilize these textures we need to share VR thread context with gstreamer thread. I obtain the display and context using eglGetCurrentContext and eglGetCurrentDisplay in the VrCubeWorld::EnteredVrMode or at first frame in VrCubeWorld::Frame (we're adopting the VrCubeWorld example) and then I pass it to gstreamer.
The problem is that the context sharing is not successful: using textures IDs received from gstreamer results in GL_INVALID_OPERATION. As we keep last twenty buffers received IDs assume values from 1-20. These values overlap with the IDs of our test textures which we created in the VR thread, which, to me, indicates that we failed at sharing. The same mechanism worked correctly with our previous NON-VR version of the app, where we used native OpenGL thread with surfaceview. After reading the VrApi doc (https://developer.oculus.com/documentation/mobilesdk/latest/concepts/mobile-vrapi/#mobile-vrapi), the section about the app context, I start to have a feeling that there is more than one context and perhaps the we do not get hold of the right one. Can anyone help us to understand where the problem lays? Is there an api call that can help us get the right context and display? Is it even possible with the VrFramework or should we rather use the "bare-metal" VrApi with surfaceview?