简体   繁体   中英

Select source rectangle from video texturing

I am doing video texturing to a rectangle surface created. I need to create 2 more rectangle of say different size and then copy a part of the texturing video running on the 1st surface (for eg: middle part of the video ) and play it on the new surface created. Is this possible using OpenGL ES ? Through my native video surface renderer, I can do this functionality and can map it to OGLES application. I was just wondering whether it is possible to do directly from OGL app itself, by copying selected rectangle from one of the video texturing surface ?

If your texture is full motion video, you should not copy the texture data because that will be too slow too keep up with video frame rates. You should avoid using glTexImage2D() and instead use the EGL Image Extensions as detailed in my third article here:

http://montgomery1.com/opengl/

But either way, once you have the image in a texture and the texture is bound with glBindTexture(), then any number of rectangles you draw will be textured with that same currently-bound texture, without more copying. These rectangles are actually geometry constructed of triangles and not "surfaces". The framebuffer is the surface. The texture coordinates can be different for each rectangle, which allows you to crop and/or scale the texture mapping uniquely for each.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM