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 700413 - ximagesink: add alpha mask support
ximagesink: add alpha mask support
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.x
Other Linux
: Normal enhancement
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-15 20:54 UTC by Benjamin Gaignard
Modified: 2013-05-16 10:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add alpha mask support (2.37 KB, patch)
2013-05-15 20:54 UTC, Benjamin Gaignard
none Details | Review
add alpha mask support for depth=32,bpp=32 (2.37 KB, patch)
2013-05-16 09:02 UTC, Benjamin Gaignard
none Details | Review

Description Benjamin Gaignard 2013-05-15 20:54:38 UTC
Created attachment 244357 [details] [review]
add alpha mask support

When X screen return a depth = 32 with bpp = 24, the alpha mask be
correctly set to have a known GST video format.
X visual structure doesn't provide the aplha mask information but we can
find it from the others masks.
alpha_mask must also take care of little/big endian bit swap.
Comment 1 Tim-Philipp Müller 2013-05-15 21:59:19 UTC
Is it really the case that depth=32,bpp=24 means there's an alpha channel? How do we differentiate an alpha channel being present from an unused padding byte for alignment purposes?
Comment 2 Benjamin Gaignard 2013-05-16 09:01:27 UTC
I have made a mistake in bug description, this patch is for depth=32 and bpp=32 (updated patch with correct values in header). In this case you need to have alpha mask to be sure to call gst_video_format_from_rgba32_masks in gst_video_format_from_masks function.

I think depth=32,bpp=24 is not possible, and depth=24,bpp=32 (padding byte case) is already correctly handle.
Comment 3 Benjamin Gaignard 2013-05-16 09:02:03 UTC
Created attachment 244382 [details] [review]
add alpha mask support for depth=32,bpp=32
Comment 4 Tim-Philipp Müller 2013-05-16 10:40:50 UTC
commit 5da2bd3216cd067e720386b791509bf2f5222a1a
Author: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Date:   Thu May 16 10:52:29 2013 +0200

    video: fix gst_video_format_from_masks() for little endian masks with alpha
    
    Need to byte-order swap the alpha mask as well in this case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700413

commit 80e700a566cdfe03751a7e48ae7fe3b18d1c6fb6
Author: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Date:   Thu May 16 10:52:29 2013 +0200

    ximagesink: add support for 32-bit RGB with alpha mask
    
    When X screen return a depth = 32 with bpp = 32, the alpha mask
    must be correctly set to have a known GStreamer video format.
    X visual structure doesn't provide the alpha mask information,
    but we can find it from the others masks.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700413