After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769962 - videocompositor: Remove output format alpha check
videocompositor: Remove output format alpha check
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-16 03:14 UTC by kevin
Modified: 2018-05-07 15:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kevin 2016-08-16 03:14:30 UTC
Why need below code to check output format alpha? Our hardware support transform such as RGBA to YUYV. But video compositor will report error.

      if (at_least_one_alpha && !(finfo->flags & GST_VIDEO_FORMAT_FLAG_ALPHA)) {
        GST_ELEMENT_ERROR (vagg, CORE, NEGOTIATION,
            ("At least one of the input pads contains alpha, but configured caps don't support alpha."),
            ("Either convert your inputs to not contain alpha or add a videoconvert after the aggregator"));
        ret = FALSE;
        goto done;
      }
Comment 1 Sebastian Dröge (slomo) 2016-08-16 06:50:33 UTC
What is exactly the problem you observe?


This code is there because otherwise compositor will already operate on a non-alpha format when doing the blending. It always does the blending on the output format.
Blending on non-alpha formats means however that you completely ignore the alpha channel of the input, and that's a (quite severe) loss of information.
Comment 2 kevin 2016-08-16 07:14:09 UTC
We write one plugin based on videoaggregator for our hardware. The hardware has the capability to do video blending. The input has alpha channel and the output hasn't alpha channel. And we need the plugin output video format without alpha. But above code will report error. And plugin can't overwrite the function which report error.

Can changed to just print warning for loss of information?
Comment 3 Sebastian Dröge (slomo) 2016-08-16 07:27:26 UTC
(In reply to kevin from comment #2)
> We write one plugin based on videoaggregator for our hardware. The hardware
> has the capability to do video blending. The input has alpha channel and the
> output hasn't alpha channel. And we need the plugin output video format
> without alpha. But above code will report error. And plugin can't overwrite
> the function which report error.

Then some API has to be added to videoaggregator to allow subclasses to override this behaviour. glvideomixer would be able to make use of that too.

> Can changed to just print warning for loss of information?

No, as that will cause silent loss of information when using compositor.
Comment 4 kevin 2016-08-16 07:50:49 UTC
So, how about to move output alpha check into gst_video_aggregator_src_setcaps(). And change gst_video_aggregator_src_setcaps() to one virtual function?
Comment 5 Olivier Crête 2017-05-20 17:19:17 UTC
I wonder if the base class shouldn't have a special case if there is an input that is "fullscreen", at the bottom, and doesn't have alpha.. Or a solid background color? Then the input can have alpha, but not the output.
Comment 6 Sebastian Dröge (slomo) 2018-05-07 15:51:43 UTC
Let's close this for now until someone wants to work on this and can provide a coherent design how it should work. This can be added in a backwards compatible way to videoaggregator when needed.