Nav Nav
Nav Nav

Reputation: 167

Android Camera Frame Rendering

I am trying to render my camera frames in Android and make use of canvas,bitmap,onDraw() to display the frames on my Surfaceview. However my code performance which does the rendering on the Native side is taking up to 70% of my cpu. The rendering speed is good but CPU consumption is bad.The problem is that I have another overlaying surfaceview(surfaceview2) to display something else while I am rendering and capturing camera. I was wondering how may I reduce the cpu consumption and make use of gpu more or etc. The possible solutions so far are : a) using opengl to draw my frames on surfaceview but limited resources and sample codes b) using native side to draw my frames but limited resources as well

Does anyone know how can I perform YV12 to rbg using above techniques?

Upvotes: 0

Views: 1363

Answers (1)

solidpixel
solidpixel

Reputation: 12069

A lot of the modern GPUs can decode YUV natively; the issue is how to get the YUV surface into OpenGL ES as this is not normally something which Open GL ES does ...

Most operating systems (Android included) let you import external surfaces into OpenGL ES via the EGL_image_external extension, and these external surfaces can be marked up a being YUV.

The only problem is that I'm not entirely sure how this works on the Android side (sorry) - so someone else will have to answer that. I only know the graphics driver side - just know that it is possible on most modern mobile GPUs.

Upvotes: 0

Related Questions