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 577017 - Videomixer blend bgra and ayuv
Videomixer blend bgra and ayuv
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal enhancement
: 0.10.16
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-27 20:26 UTC by Alex Ugarte
Modified: 2009-05-28 11:59 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Modifications to support bgra buffer (39.15 KB, patch)
2009-03-27 20:29 UTC, Alex Ugarte
none Details | Review
New version with support for i420 (55.42 KB, patch)
2009-03-27 23:43 UTC, Alex Ugarte
none Details | Review

Description Alex Ugarte 2009-03-27 20:26:06 UTC
I have modified videomixer plugin, so that it can also accept BGRA frames (they all must be AYUV or BGRA).
I think it can easily be extended to support other raw formats.
Comment 1 Alex Ugarte 2009-03-27 20:29:31 UTC
Created attachment 131522 [details] [review]
Modifications to support bgra buffer

This is a summary of what I have done:
*I have removed the following functions:
  gst_videomixer_fill_checker
  gst_videomixer_fill_color
  gst_videomixer_blend_ayuv_ayuv
and replace them by three functors:
  (*blend) 
  (*fill_checker)
  (*fill_color)
These functionalities are implemented in two files, one for AYUV (blend_ayuv.c)
and one for BGRA (blend_bgra.c)

*The plugin's pads now negotitate their format so that tey all have the same
format (size may be different), more or less in the sameway as audio "adder"
does. Depending on the format AYUV or BGRA functions are set to the functors.

I think it would be easy to add the functionality requested in this "bug", by
simply providing a blend_i420.c file.

PS: I think my code does not follow the style guides (at least git complains about that) :\ sorry. I will try to fix it
Comment 2 Alex Ugarte 2009-03-27 23:43:17 UTC
Created attachment 131531 [details] [review]
New version with support for i420

I have modified the code so that it cn also blend i420 buffers
Comment 3 Sebastian Dröge (slomo) 2009-05-07 13:21:53 UTC
Could you split this patch into three? One for the refactoring to function pointers, one for adding bgra support on top of this and one for adding i420 support?

Also, the cairo dependency must be conditional, i.e. you need some Makefile.am and #ifdef magic :)

Other than that this is a great patch :) To conform to the coding style guidelines just run gst-indent (from gstreamer/tools) on the C files.
Comment 4 Tim-Philipp Müller 2009-05-07 13:50:58 UTC
videomixer should not have any cairo dependency at all imho, even if it's optional.
Comment 5 Alex Ugarte 2009-05-08 09:19:47 UTC
Cairo is only used to do the blending of the buffers, so I will try to replace this with a specific internal function as it is done in AYUV and i420(I don't think that it should be colex). I will also do the tree patches (at least try to, I am newy to git and patches in general :).
Comment 6 Sebastian Dröge (slomo) 2009-05-28 10:49:36 UTC
Ok, I'll work on this now :)
Comment 7 Sebastian Dröge (slomo) 2009-05-28 11:59:35 UTC
commit a5c30ae5028d054c5a3c4014d0eda1ea92d05b1f
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Thu May 28 13:56:15 2009 +0200

    videomixer: Fix background blitting when a color mode is selected with BGRA

commit 83fc39ccff50b2d6071650e4300f1239ef23f0c0
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Thu May 28 13:54:14 2009 +0200

    videomixer: Some cleanup and fix the calculation of the frame size in bytes

commit 699b696db8dfa17db3f3fe34b19ea1722420e024
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Thu May 28 13:35:52 2009 +0200

    videomixer: Fix I420 blending to actually do something
    
    For this we a) implement the checkers filling and b)
    actually blend the src/dest by using the src alpha value
    from the pad.

commit ad1f79fd817c0a8d7f40258c8e0ff94d20c1ef89
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Thu May 28 13:14:13 2009 +0200

    videomixer: Fix ARGB blending to actually work

commit f66906e89109f83bc29b23e201f9259375933fd2
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Thu May 28 13:04:51 2009 +0200

    videomixer: Blend BGRA ourselves instead of using Cairo

commit 82abbeaf4f69f22191a28c72a99c0093835edb11
Author: Alex Ugarte <alexugarte@gmail.com>
Date:   Thu May 28 12:55:16 2009 +0200

    videomixer: Add support for blending BGRA and AYUV
    
    Fixes bug #577017.