diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-07-19 11:30:30 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-07-19 11:31:45 +0200 |
commit | b1f7681555f07e65a96794c1eecc2f393942d154 (patch) | |
tree | f73b541bf1e73cba26a8ceb2e8e9cfe6ec52a71a | |
parent | 638a700463a96b53dc92e9db4522ca861e5c72a1 (diff) |
videobox: Don't overwrite the first component with the alpha value for BGRx
Instead leave the x component unset when filling the borders.
https://bugzilla.gnome.org/show_bug.cgi?id=733380
-rw-r--r-- | gst/videobox/gstvideobox.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gst/videobox/gstvideobox.c b/gst/videobox/gstvideobox.c index 861bcaea3..bfec65af9 100644 --- a/gst/videobox/gstvideobox.c +++ b/gst/videobox/gstvideobox.c @@ -1780,10 +1780,17 @@ fill_rgb32 (GstVideoBoxFill fill_type, guint b_alpha, b_alpha = CLAMP (b_alpha, 0, 255); - empty_pixel = GUINT32_FROM_LE ((b_alpha << (p[0] * 8)) | - (rgb_colors_R[fill_type] << (p[1] * 8)) | - (rgb_colors_G[fill_type] << (p[2] * 8)) | - (rgb_colors_B[fill_type] << (p[3] * 8))); + if (GST_VIDEO_FRAME_N_COMPONENTS (frame) == 4) { + empty_pixel = GUINT32_FROM_LE ((b_alpha << (p[0] * 8)) | + (rgb_colors_R[fill_type] << (p[1] * 8)) | + (rgb_colors_G[fill_type] << (p[2] * 8)) | + (rgb_colors_B[fill_type] << (p[3] * 8))); + } else { + empty_pixel = GUINT32_FROM_LE ( + (rgb_colors_R[fill_type] << (p[1] * 8)) | + (rgb_colors_G[fill_type] << (p[2] * 8)) | + (rgb_colors_B[fill_type] << (p[3] * 8))); + } if (stride == width * 4) { video_box_orc_splat_u32 ((guint32 *) dest, empty_pixel, width * height); |