Jump to content
  • Advertisement
Sign in to follow this  
KKTHXBYE

OpenGL ES 3.0 Playing videos on android

This topic is 389 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just found a code which uses libavcodec to decode videos and display them on screen

 Canvas canvas = surfaceHolder.lockCanvas();
 canvas.drawBitmap(mBitmap, mDrawLeft, mDrawTop,
prFramePaint);
 surfaceHolder.unlockCanvasAndPost(canvas);

anyway it looks like a ton of useless garbage, it first decodes then draws a bitmap, i would like to somehow transfer video data to gpu directly so i can just draw a video frame in a simple poly (made of 4 verts), however it may be undoable, anyone has any more information about it?

Share this post


Link to post
Share on other sites
Advertisement

OpenGL?

From what I'm understanding, you want direct access to the pixels of a texture, then modify the pixels of that texture (by consequence removing the middle process of decoding to a pixel array in the client's memory).

You can do that with glMapBuffer/glUnmapBuffer :)

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glMapBuffer.xhtml
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUnmapBuffer.xhtml

When you use `glMapBuffer()`, you will get a pointer to that (pixel) buffer on client-side. After modifying the buffer, you can use `glUnmapBuffer()` to let the graphic card know that the buffer is ready. I think this is the most "permissive" method to do that in OpenGL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!