mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 06:26:23 +00:00
geometrictransform: Fix setting black background for AYUV buffers
When the frame buffer is AYUV writing all zeros does not set it to black, in YUV colorspace 0x10 is the black level for luminance and 0x80 is the black level for chrominance. Fix setting the background to black when the out_frame format is AYUV; in all the other supported formats zeroing the data with memset is still the right thing to do. https://bugzilla.gnome.org/show_bug.cgi?id=710392
This commit is contained in:
parent
7ec5f8527a
commit
ae2231624c
1 changed files with 10 additions and 1 deletions
|
@ -240,7 +240,16 @@ gst_geometric_transform_transform_frame (GstVideoFilter * vfilter,
|
|||
|
||||
in_data = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0);
|
||||
out_data = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0);
|
||||
memset (out_data, 0, out_frame->map[0].size);
|
||||
|
||||
if (GST_VIDEO_FRAME_FORMAT (out_frame) == GST_VIDEO_FORMAT_AYUV) {
|
||||
/* in AYUV black is not just all zeros:
|
||||
* 0x10 is black for Y,
|
||||
* 0x80 is black for Cr and Cb */
|
||||
for (int i = 0; i < out_frame->map[0].size; i += 4)
|
||||
GST_WRITE_UINT32_BE (out_data + i, 0xff108080);
|
||||
} else {
|
||||
memset (out_data, 0, out_frame->map[0].size);
|
||||
}
|
||||
|
||||
GST_OBJECT_LOCK (gt);
|
||||
if (gt->precalc_map) {
|
||||
|
|
Loading…
Reference in a new issue