crop handling in gl plugins (gleffect, glimagesink, glshader, .....)
Submitted by Jian Li
Link to original bug (#748163)
Description
Is there a plan to support video cropping in gl plugins?
Although this can be done when you uploading the pixel data into texture, there is still cases that you can use some extension to bind a buffer to the texture, such as eglimage, dma-bufer or some private extensions. If decoder needs padding or alignment when output video into this buffer, the gl plugins need to handle it correctly.
I tried to support it, but have below question:
- How to get the video buffer width and height?
I can get crop info from GstVideoCropMeta, but how can I get the buffer width and height? We can get real video width/height from GstVideoInfo, but can't get the buffer widht/height after padding/aligned. One way I found is like below for I420 and NV12 video:
videometa = gst_buffer_get_video_meta (buf);
bufw = videometa->stride[0];
bufh = videometa->offset[1] / bufw;
Is there a better way to get this info?
- Supporting crop handling only need to recalculate the texture coordinate, but I found every gl plugin has their own vertices definition, this means I need to modify everywhere to support this.
Is there a plan to make it into a common module?
Version: 1.4.5