GLSurfaceView framerate issues on Nexus 5

Viewed 3060

I have an example application (full source) that encodes camera frames with MediaCodec while displaying them on a GLSurfaceView.

Systrace confirms 30 drawing calls are made each second:

Systrace screenshot

However, a screenrecord recording (.mp4, YouTube) shows the apparent framerate to be considerably lower.

In a nutshell, my encoding & display loop does the following:

  • Makes a MediaCodec Surface input EGL Context current
  • Draws a camera frame to the MediaCodec EGL surface
  • Makes the GLSurfaceView EGL Context current
  • Draws the same camera frame to the GLSurfaceView

On a Galaxy Nexus LTE and Nexus 7 (both with AOSP 4.4), the application performs as expected. So far only the Nexus 5 experiences this discrepancy between the number of frames drawn to the screen and the number of frames apparent...

I pray I'm not insane.

1 Answers
Related