Skip to content

glvideomixer: Add 'sizing-policy' pad property

The sizing policy allows selecting between the current behavior, which deforms the texture to fill the width and height of the pad; and a new 'keep-aspect-ratio' sizing policy, which fits the texture within the rectangle respecting its original aspect ratio.

The reason for this is that this allows avoiding extra elements in the pipeline, and reduces the number of buffer passing through the pipeline.

Most of this code is a direct port of the sizing policy handling of the compositor element, except it is adapted to operate on GL texture coordinates through the projection matrix.


For some more context, I've been working on an app that uses GL compositing quite a lot to generate a scene suitable for streaming. Without this feature, the scene looks like this:

image

With this feature, it looks like this:

image

(This is my first contribution to GStreamer so apologies if I'm not following any particular protocols.)

Merge request reports