Android TextureView OpenGLRenderer﹕ GL_INVALID_OPERATION

孤街浪徒 提交于 2019-12-11 03:38:25

问题


I have two fragments that has a TextureView to show camera preview or to play video.

after using the app for a while, playing with the screens, i get this error in the logcat

OpenGLRenderer﹕ GL_INVALID_OPERATION

i release everything from my fragments, all members are set to null.

@Override
public void onDestroyView() {
    Logg.DEBUG(TAG, "onDestroyView");
    super.onDestroyView();
    if (mMediaPlayer != null) {
        mMediaPlayer.stop();
        mMediaPlayer.release();
        mMediaPlayer = null;
    }

    nextButton = null;
    pauseButton = null;
    backButton = null;
    playButton = null;
    frontTextView = null;
    backTextView = null;
    surface = null;
    videoView = null;
}

and i see the whole view become weird...

what am i missing?


回答1:


Your screenshot shows situation when system OpenGL context is corrupted / broken. Please check on what thread you release your resouces. GLContext should be destroyed from exactly same thread where it was allocated. In your case it could be setSurface/setDisplay calls made from wrong thread.

If you have stable and easy steps to reproduce you can try to capture GL log using Tracer for OpenGL ES, but its slows your application a lot during capturing



来源:https://stackoverflow.com/questions/24280385/android-textureview-openglrenderer-gl-invalid-operation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!