mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +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;
|
const GstVideoFormatInfo *info;
|
||||||
guint8 *pdata;
|
guint8 *pdata;
|
||||||
gsize rowsize, plane_stride;
|
gsize rowsize, plane_stride;
|
||||||
|
gint yoffset;
|
||||||
|
|
||||||
info = outframe->info.finfo;
|
info = outframe->info.finfo;
|
||||||
pdata = GST_VIDEO_FRAME_PLANE_DATA (outframe, plane);
|
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)
|
rowsize = GST_VIDEO_FRAME_COMP_WIDTH (outframe, plane)
|
||||||
* GST_VIDEO_FRAME_COMP_PSTRIDE (outframe, plane);
|
* GST_VIDEO_FRAME_COMP_PSTRIDE (outframe, plane);
|
||||||
height =
|
height =
|
||||||
GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (info, plane, y_end - y_start);
|
GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (info, plane, (y_end - y_start));
|
||||||
pdata += y_start * plane_stride;
|
|
||||||
|
yoffset = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (info, plane, y_start);
|
||||||
|
|
||||||
|
pdata += yoffset * plane_stride;
|
||||||
for (i = 0; i < height; ++i) {
|
for (i = 0; i < height; ++i) {
|
||||||
memset (pdata, 0, rowsize);
|
memset (pdata, 0, rowsize);
|
||||||
pdata += plane_stride;
|
pdata += plane_stride;
|
||||||
|
|
Loading…
Reference in a new issue