Reputation: 1
I have Android project using webrtc, using GL native code to draw video frames on a GL SurfaceViewRenderer.
The MediaCodec is decoding and feeding frame by frame. We create a SurfaceTexture which listens to onFrameAvailable , after then we call updateTexImage() on this created surfaceTexture. All this is synchronized locked having it's own thread. Then we notify a drawer class using dedicated thread (For all GLES commands),with this frame buffer. Once this drawer class receives every frame buffer, we call GLES20.glClearColor, then GLES20.glClear(), and drawGES() or drawRGP from webRTC, then we call eglSwapBuffer after then. By running AGI profiler , i noticed that eglSwapBuffer() sometimes takes up to 50 ms but most of the time the FPS is smooth, regardless of crazy dropping of frames and FPS sometimes. And this leads to dropping frames and affects fps leading to freezes.
I will attach a sample of AGI.
Do you have any ideas about what can be happening here.
I didn't try any solution yet.
Upvotes: 0
Views: 32