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 617512 - [alpha] should work in passthrough in all formats if alpha == 1.0
[alpha] should work in passthrough in all formats if alpha == 1.0
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 0.10.24
Assigned To: Sebastian Dröge (slomo)
GStreamer Maintainers
Depends on:
Blocks: 613416
 
 
Reported: 2010-05-03 10:29 UTC by Edward Hervey
Modified: 2010-06-01 09:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
alpha: Add property to allow passthrough mode (13.93 KB, patch)
2010-05-26 11:14 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Edward Hervey 2010-05-03 10:29:54 UTC
alpha always converts the incoming gstreamer to an alpha variant, regardless of whether it will need to apply alpha or not.

It should be able to passthrough the input buffer without any modifications if the following conditions are met:
* method == 'set'
* alpha == 1.0

This would allow having the following pipeline push out I420 all the way:

videotestsrc ! video/x-raw-yuv,format=I420 ! alpha alpha=1.0 ! video/x-raw-yuv,format={ AYUV, I420 } ! fakesink

The caps should be re-negotiated the moment alpha modification is needed (i.e. if you have a running pipeline as above, and you change alpha to 0.99999).
Comment 1 Benjamin Otte (Company) 2010-05-03 11:31:01 UTC
Wouldn't that mean the caps are dependant on when the alpha value was last set - i.e. if you started with alpha=0.9 and while the pipeline ran set it to 1.0 you'd get AYUV, but if you started with alpha=1.0 and didn't set it you'd end up with I420?

Or would that mean that for a controlled channel with a tween from 1.0 to 0.0 you'd get I420 in the beginning and AYUV when the tween starts changing the alpha value? Would that mean pipelines that miss a colorspace element could error out half-way through?

So in short I think it's a bad idea to make the negotiated caps depend on a controllable (i.e. settable while the pipeline runs) property.
Comment 2 Edward Hervey 2010-05-03 11:41:20 UTC
(In reply to comment #1)
> Wouldn't that mean the caps are dependant on when the alpha value was last set
> - i.e. if you started with alpha=0.9 and while the pipeline ran set it to 1.0
> you'd get AYUV

  It will start with AYUV, but the moment you set it to 1.0 it should attempt to renegotiate caps (which might or might not end up in pushing out AYUV, depending on what downstream can accept).

, but if you started with alpha=1.0 and didn't set it you'd end
> up with I420?

  yes

> 
> Or would that mean that for a controlled channel with a tween from 1.0 to 0.0
> you'd get I420 in the beginning and AYUV when the tween starts changing the
> alpha value?

  yes

 Would that mean pipelines that miss a colorspace element could
> error out half-way through?

  yes, no big problem there imho.

> 
> So in short I think it's a bad idea to make the negotiated caps depend on a
> controllable (i.e. settable while the pipeline runs) property.

 You do realize you don't need a GstController to change that property ? Changing caps at runtime isn't a problem with other elements (videoscale does that fine), why should it be a problem now ?
Comment 3 Sebastian Dröge (slomo) 2010-05-04 07:53:21 UTC
(In reply to comment #2)

> > So in short I think it's a bad idea to make the negotiated caps depend on a
> > controllable (i.e. settable while the pipeline runs) property.
> 
>  You do realize you don't need a GstController to change that property ?
> Changing caps at runtime isn't a problem with other elements (videoscale does
> that fine), why should it be a problem now ?

...only that videoscale changes the caps only if a downstream or upstream element provides new caps. But videobox does what you said and nobody ever complained :)

I think it's a good idea to support this in the alpha element too, but maybe make it an extra property. The element's documentation says that the element will add an alpha channel, which it definitely wouldn't with your proposed change.
Comment 4 Sebastian Dröge (slomo) 2010-05-26 11:14:57 UTC
Created attachment 162008 [details] [review]
alpha: Add property to allow passthrough mode

This passthrough mode is used if the alpha method is "set"
and the alpha value is 1.0.

Fixes bug #617512.
Comment 5 Sebastian Dröge (slomo) 2010-06-01 09:24:09 UTC
commit ab3b4bc82f09204c6a8f694a70ec4ac197267d21
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Wed May 26 13:13:44 2010 +0200

    alpha: Add property to allow passthrough mode
    
    This passthrough mode is used if the alpha method is "set"
    and the alpha value is 1.0.
    
    Fixes bug #617512.