Click this data on the texture with "glTexSubImage2D" and render the texture. Please note that this texture should have a power of 2, so for your business you can do this (2048, 1024), but you can only update the part (1280, 720):
CGSize videoSize; CGSize textureSize; GLuint dimension = 1; while (videoSize.width > dimension) { dimension <<= 1; } textureSize = CGSizeMake(dimension, .0f); dimension = 1; while (videoSize.height > dimension) { dimension <<= 1; } textureSize = CGSizeMake(textureSize.width, dimension); GLuint texture; glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, textureSize.width, textureSize.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); GLfloat textureCoordinates[] = { .0f, .0f, .0f, videoSize.height/textureSize.height, videoSize.width/textureSize.width, .0f, videoSize.width/textureSize.width, videoSize.height/textureSize.height };
To update the texture:
void *data; glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, videoSize.width, videoSize.height, GL_RGBA, GL_UNSIGNED_BYTE, data);
Then just draw your textured box.