2

我有两个片段,它们有一个 TextureView 来显示相机预览或播放视频。

使用该应用程序一段时间后,玩屏幕后,我在 logcat 中收到此错误

OpenGLRenderer﹕ GL_INVALID_OPERATION

我从我的片段中释放所有内容,所有成员都设置为空。

@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;
}

我看到整个视图变得很奇怪......

我错过了什么?

在此处输入图像描述

4

1 回答 1

2

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

于 2014-06-26T14:51:50.033 回答