Jump to content
Happy Holidays! Limited Staff Responses: 1/20 - 1/31 ×

How to render mediacodec output in vive focus?


xulzee
 Share

Recommended Posts

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.

 

Link to comment
Share on other sites

Hi ,

 

We don't have existing samples or further experiences to share now.

However maybe you can check "East Movie Texture" from Unity Asset Store for reference.

https://assetstore.unity.com/packages/tools/video/easy-movie-texture-video-texture-10032

We have partners to select this as base for development for video playing.

Hope other developers can provide more advises.

Thanks.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...