summaryrefslogtreecommitdiff
path: root/gst/videocrop
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2019-11-12 17:28:22 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2019-11-12 17:28:22 -0500
commite66a4b64b30063166077dc916410db04ec27f062 (patch)
treeef495ddba0f491124e924d78fbe1049085a1269d /gst/videocrop
parent98a5726eba4f724b3795e0ed2e68a88350d7b697 (diff)
downloadgstreamer-plugins-good-e66a4b64b30063166077dc916410db04ec27f062.tar.gz
videocrop: Also update the coordinate when in-place
This update is needed when the output caps is not changed (e.g. we are moving a viewport around). Fixes #669
Diffstat (limited to 'gst/videocrop')
-rw-r--r--gst/videocrop/gstvideocrop.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gst/videocrop/gstvideocrop.c b/gst/videocrop/gstvideocrop.c
index c2e93a22d..104522a9b 100644
--- a/gst/videocrop/gstvideocrop.c
+++ b/gst/videocrop/gstvideocrop.c
@@ -508,11 +508,19 @@ static GstFlowReturn
gst_video_crop_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
{
GstVideoCrop *vcrop = GST_VIDEO_CROP (trans);
+ GstVideoFilter *vfilter = GST_VIDEO_FILTER (trans);
GstVideoMeta *video_meta;
GstVideoCropMeta *crop_meta;
GST_LOG_OBJECT (trans, "Transforming in-place");
+ if (G_UNLIKELY (vcrop->need_update)) {
+ if (!gst_video_crop_set_info (vfilter, NULL, &vcrop->in_info, NULL,
+ &vcrop->out_info)) {
+ return GST_FLOW_ERROR;
+ }
+ }
+
/* The video meta is required since we are going to make the caps
* width/height smaller, which would not result in a usable GstVideoInfo for
* mapping the buffer. */