xulzee Posted September 29, 2018 Share Posted September 29, 2018 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 More sharing options...
Tony PH Lin Posted October 4, 2018 Share Posted October 4, 2018 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 More sharing options...
xulzee Posted October 8, 2018 Author Share Posted October 8, 2018 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 More sharing options...
Tony PH Lin Posted October 8, 2018 Share Posted October 8, 2018 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 More sharing options...
xulzee Posted October 9, 2018 Author Share Posted October 9, 2018 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 More sharing options...
Tony PH Lin Posted October 9, 2018 Share Posted October 9, 2018 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now