Jump to content

How to render mediacodec output in vive focus?


xulzee

Recommended Posts

Posted

Hello everyone,

    Now, I am using vive foucus to dispaly video stream in HMD. So I need to use mediacode to decode the  stream, and use opengl to render the frame. But i am a newer in android an opengl, So how do I bind the meidiacodec output to the texture of opengl in ndk. Are there any examples?

    Thanks for any help or advice.

 

Posted

Hi 

Thank you for your help.

Now I think I know a little bit about how to solve the problem. I create a texture in the native code and bind GL_TEXTURE_EXTERNAL_OES, and then I use the texture id to create a SurfaceTexture in the Java code to link the two together.

But now I have another question: it looks like I'm in Java code that's not the same opengl context as native code, so how do you make them have the same opengl context?

Thank you very much!

Posted

WaveSDK create a default context in the native. Developer can do what he wants to do and be sure the texture for WVR_SubmitFrame should create within native context which created by runtime. By using eglMakeCurrent to make sure what current context you want are working on.

Thanks.

Posted

Hi,

Thank you for your help.

I have created a texture in native context, But now I want to create a surfacetexture in the Java layer that points to the texture id, can I do that? Or how do I get into this native context?
Is there any way I can get into this context?

Thank you very much for your help.

 

Posted

Calling eglGetCurrentContext may help you to get the current used context.

If you want to pass variable from native to Java or Java to native. You can also refer to JNI programming from internet.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...