mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
compositor: fix drawing of transparent background
When drawing the background multithreaded, y_start needs to be scaled to obtain the correct byte offset from which to start memsetting (yoffset). Fixes #871 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1042>
This commit is contained in:
parent
11b5ebd058
commit
dd71f359be
1 changed files with 6 additions and 2 deletions
|
@ -1124,6 +1124,7 @@ _draw_background (GstCompositor * comp, GstVideoFrame * outframe,
|
|||
const GstVideoFormatInfo *info;
|
||||
guint8 *pdata;
|
||||
gsize rowsize, plane_stride;
|
||||
gint yoffset;
|
||||
|
||||
info = outframe->info.finfo;
|
||||
pdata = GST_VIDEO_FRAME_PLANE_DATA (outframe, plane);
|
||||
|
@ -1131,8 +1132,11 @@ _draw_background (GstCompositor * comp, GstVideoFrame * outframe,
|
|||
rowsize = GST_VIDEO_FRAME_COMP_WIDTH (outframe, plane)
|
||||
* GST_VIDEO_FRAME_COMP_PSTRIDE (outframe, plane);
|
||||
height =
|
||||
GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (info, plane, y_end - y_start);
|
||||
pdata += y_start * plane_stride;
|
||||
GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (info, plane, (y_end - y_start));
|
||||
|
||||
yoffset = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (info, plane, y_start);
|
||||
|
||||
pdata += yoffset * plane_stride;
|
||||
for (i = 0; i < height; ++i) {
|
||||
memset (pdata, 0, rowsize);
|
||||
pdata += plane_stride;
|
||||
|
|
Loading…
Reference in a new issue