summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2015-05-13 17:38:35 +1000
committerMatthew Waters <matthew@centricular.com>2015-05-13 17:44:30 +1000
commitc51916905293587f090f172c3971209e4af971dd (patch)
treeb1f87e67de886b67b722a28b9c2d882db06452d4 /gst
parent725c1147bcb82250d70f012da7ff5b17f24c1107 (diff)
downloadgstreamer-plugins-bad-c51916905293587f090f172c3971209e4af971dd.tar.gz
compositor: fix rectangle obscure test to clamp against the output frame size
Rather than one of the input pad video info's. The test checking this was not constraining the output frame size to ensure that the out of frame stream was not being displayed.
Diffstat (limited to 'gst')
-rw-r--r--gst/compositor/compositor.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gst/compositor/compositor.c b/gst/compositor/compositor.c
index 756df1ac5..a97072948 100644
--- a/gst/compositor/compositor.c
+++ b/gst/compositor/compositor.c
@@ -417,15 +417,13 @@ gst_compositor_pad_prepare_frame (GstVideoAggregatorPad * pad,
* the case where (say, with negative xpos/ypos) the non-obscured portion of
* the frame could be outside the bounds of the video itself and hence not
* visible at all */
- frame_rect.x = CLAMP (cpad->xpos, 0,
- GST_VIDEO_INFO_WIDTH (&pad->buffer_vinfo));
- frame_rect.y = CLAMP (cpad->ypos, 0,
- GST_VIDEO_INFO_HEIGHT (&pad->buffer_vinfo));
+ frame_rect.x = CLAMP (cpad->xpos, 0, GST_VIDEO_INFO_WIDTH (&vagg->info));
+ frame_rect.y = CLAMP (cpad->ypos, 0, GST_VIDEO_INFO_HEIGHT (&vagg->info));
/* Clamp the width/height to the frame boundaries as well */
- frame_rect.w = MIN (GST_VIDEO_INFO_WIDTH (&cpad->conversion_info),
- GST_VIDEO_INFO_WIDTH (&pad->buffer_vinfo) - cpad->xpos);
- frame_rect.h = MIN (GST_VIDEO_INFO_HEIGHT (&cpad->conversion_info),
- GST_VIDEO_INFO_HEIGHT (&pad->buffer_vinfo) - cpad->ypos);
+ frame_rect.w =
+ MAX (GST_VIDEO_INFO_WIDTH (&cpad->conversion_info) - frame_rect.x, 0);
+ frame_rect.h =
+ MAX (GST_VIDEO_INFO_HEIGHT (&cpad->conversion_info) - frame_rect.y, 0);
GST_OBJECT_LOCK (vagg);
/* Check if this frame is obscured by a higher-zorder frame