Playing video in a GLSurfaceView instead of SurfaceView

前端 未结 4 510
醉梦人生
醉梦人生 2021-01-19 21:12

I\'ve been struggling with this for 2 days now... Following this answer: https://stackoverflow.com/a/2006454/444324 - it is mentioned that it\'s possible to play a video in

相关标签:
4条回答
  • 2021-01-19 21:42

    Check out the code available here for playing a video using OpenGl ES 2.0 with GLSurfaceView

    https://github.com/satish13131/Android_Programs/tree/master/graphics/opengl/video/surfaceview

    It involves OpenGL rendering for video

    0 讨论(0)
  • 2021-01-19 21:42

    Why did you implement a class (com.commonsware.android.camera.GLSurfaceView) with the same name as the GLSurfaceView ?

    If you declared the view as an android.opengl.GLSurfaceView in layout XML you cannot cast it to com.commonsware.android.camera.GLSurfaceView

    0 讨论(0)
  • 2021-01-19 21:51

    OK, solved this... I had several errors but the final error I present in my question is solved by adding this code to the onCreate:

    mPreview.setRenderer(new Renderer() {
    
                @Override
                public void onSurfaceCreated(GL10 gl, EGLConfig config) {
                    // TODO Auto-generated method stub
    
                }
    
                @Override
                public void onSurfaceChanged(GL10 gl, int width, int height) {
                    // TODO Auto-generated method stub
    
                }
    
                @Override
                public void onDrawFrame(GL10 gl) {
                    // TODO Auto-generated method stub
    
                }
            });
    
    0 讨论(0)
  • 2021-01-19 21:52

    well in one place you are refereing to android.opengl.GLSurfaceView and the other to com.commonsware.android.camera.GLSurfaceView they are different GLSurfaceView classes from different packages

    0 讨论(0)
提交回复
热议问题