OpenGL/Android: changing video dimensions fails

Maxim Golov maxim.golov at gmail.com
Mon Jun 19 18:15:27 UTC 2023


Hi all,

TLDR: I am attempting to implement letterboxing with Gstreamer and OpenGL,
on Android. I observe intermittent failures.

Here's my simplified pipeline:

    udpsrc ! rtpjitterbuffer ! queue ! rtph265depay ! decodebin3
    ! glupload ! glcolorconvert ! glcolorbalance
    ! glvideomixer background=black ! capsfilter
    ! gltransformation
    ! glimagesinkelement sync=false

The idea is to perform letterboxing by adding the `x` or `y` offset to the
glvideomixer and adjusting the `width` and `height` at the capsfilter. This
allows me to maintain the same video aspect ratio as the output window,
preventing the
letterboxing bands from appearing when the video is zoomed in.

Here's an example: If the input video measures 320x240 and the window is
320x300, the `y` offset is 30, and the `width` and `height` are 320x300.

The problem happens when the output window is resized and the letterboxing
needs
to be adjusted. I can resize the window several times before the change
to the stream geometry fails with this message:


../libs/gst/base/gstbasetransform.c:1372:gst_base_transform_setcaps:<glcolorconvertelement0>
       transform could not transform video/x-raw(memory:GLMemory), format=
       (string)RGBA, width=(int)..., height=(int)..., ..... in anything we
       support

I've attempted to pause the pipeline before changing the parameters and
resume it
afterwards, but the problem remains.

Does anyone have any ideas about what might be causing this random failure?

(If you're wondering why I'm managing zooming and letterboxing in
gstreamer instead of in SurfaceView: In this specific system, SurfaceView,
when
zoomed in, interferes with other UI elements).

Will appreciate your help,

Maxim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230619/90ff3459/attachment.htm>


More information about the gstreamer-devel mailing list