Fix external texture issues on Android

#rb jack.porter


#ROBOMERGE-SOURCE: CL 8210582 via CL 8210585 via CL 8211298
#ROBOMERGE-BOT: (v401-8057353)

[CL 8211403 by dmitriy dyomin in Main branch]
This commit is contained in:
dmitriy dyomin
2019-08-22 10:03:24 -04:00
parent acb9303bea
commit 14ead86fb3
4 changed files with 23 additions and 1 deletions

View File

@@ -1694,6 +1694,7 @@ public class MediaPlayer14
private int mTextureID = -1;
private float[] mTransformMatrix = new float[16];
private boolean mTextureSizeChanged = true;
private int GL_TEXTURE_EXTERNAL_OES = 0x8D65;
private float mUScale = 1.0f;
private float mVScale = -1.0f;
@@ -1840,6 +1841,10 @@ public class MediaPlayer14
frameUpdateInfo.VOffset = 1.0f - mVOffset;
}
// updateTexImage binds an external texture to active texture unit
// make sure to unbind it to prevent state leak
GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);
return frameUpdateInfo;
}
};

View File

@@ -1333,6 +1333,7 @@ public class VideoDecoder
private int mTextureID = -1;
private float[] mTransformMatrix = new float[16];
private boolean mTextureSizeChanged = true;
private int GL_TEXTURE_EXTERNAL_OES = 0x8D65;
private float mUScale = 1.0f;
private float mVScale = -1.0f;
@@ -1482,6 +1483,11 @@ public class VideoDecoder
Entry<Double,Double> frameTimeDuration = getFrameTimeDuration(getFrameTimestamp());
frameUpdateInfo.Timestamp = frameTimeDuration.getKey();
frameUpdateInfo.Duration = frameTimeDuration.getValue();
// updateTexImage binds an external texture to active texture unit
// make sure to unbind it to prevent state leak
GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);
return frameUpdateInfo;
}
};

View File

@@ -1387,6 +1387,7 @@ class WebViewControl
private int mTextureID = -1;
private float[] mTransformMatrix = new float[16];
private boolean mTextureSizeChanged = true;
private int GL_TEXTURE_EXTERNAL_OES = 0x8D65;
private float mUScale = 1.0f;
private float mVScale = -1.0f;
@@ -1516,7 +1517,11 @@ class WebViewControl
// Get the latest video texture frame.
mSurfaceTexture.updateTexImage();
// updateTexImage binds an external texture to active texture unit
// make sure to unbind it to prevent state leak
GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);
return frameUpdateInfo;
}
};