Shahar
Shahar

Reputation: 3692

Android TextureView OpenGLRenderer﹕ GL_INVALID_OPERATION

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?

enter image description here

Upvotes: 2

Views: 3368

Answers (1)

vadimvolk
vadimvolk

Reputation: 711

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

Upvotes: 2

Related Questions