Android. How play video on Surface(OpenGL)

前端 未结 4 1012
野趣味
野趣味 2020-12-05 10:59

Need to help

  1. How play video on Surface(OpenGL) in Android? I tried playing video in mySurfaceView extends SurfaceView with help m

4条回答
  •  悲&欢浪女
    2020-12-05 11:28

    I guess you can't. At least that's what i found out. My plan was to have some sort of OpenGL scene (text ticker) while playing a video. Since android uses HW decoding for displaying a video, it will not be done with OpenGL. I also tried to play the video in OpenGL using ffmpeg but i found out, that no device i tried with, was performant enough to do SW decoding via ffmpeg.

    So I had to use a VideoView to display my video and put a GLSurfaceView on top of it, to view my ticker text. But you have to make the GLSurfaceView translucent like in ApiDemos done with 'TranslucentGLSurfaceViewActivity'.

    Another thing i realized: If you put a GLSurfaceView on top of a VideoView your fps breaks down dramatically from 60fps (opengl) to about 30-40fps. This applied to all 2.x versions of android i tested. Last week i had the chance to test it on Android 4 and this time i got no break down in fps. Maybe they really improved graphics pipeline for ICS.

    Greetings, -chris-

提交回复
热议问题