public virtual void setSize(Endpoint stream, int width, int height)
{
// Generate 3 texture ids for Y/U/V and place them into |textures|,
// allocating enough storage for |width|x|height| pixels.
int[] textures = yuvTextures[stream == Endpoint.LOCAL ? 0 : 1];
GLES20.GlGenTextures(3, textures, 0);
for (int i = 0; i < 3; ++i)
{
int w = i == 0 ? width : width / 2;
int h = i == 0 ? height : height / 2;
GLES20.GlActiveTexture(GLES20.GlTexture0 + i);
GLES20.GlBindTexture(GLES20.GlTexture2d, textures[i]);
GLES20.GlTexImage2D(GLES20.GlTexture2d, 0, GLES20.GlLuminance, w, h, 0, GLES20.GlLuminance, GLES20.GlUnsignedByte, null);
GLES20.GlTexParameterf(GLES20.GlTexture2d, GLES20.GlTextureMinFilter, GLES20.GlLinear);
GLES20.GlTexParameterf(GLES20.GlTexture2d, GLES20.GlTextureMagFilter, GLES20.GlLinear);
GLES20.GlTexParameterf(GLES20.GlTexture2d, GLES20.GlTextureWrapS, GLES20.GlClampToEdge);
GLES20.GlTexParameterf(GLES20.GlTexture2d, GLES20.GlTextureWrapT, GLES20.GlClampToEdge);
}
checkNoGLES2Error();
}