From 629154642f99fad7eb5bb8750979f4a64c10166d Mon Sep 17 00:00:00 2001 From: Marc Leeman Date: Tue, 1 Sep 2020 09:31:33 +0200 Subject: [PATCH] vaapisink: when updating the caps, reset rotation When an element upstream changes settings (e.g. crop), new caps are sent to vaapisink. When vaapisink was rotating the image, it needs to re-evaluate if the sink needs to rotate the image. Part-of: --- gst/vaapi/gstvaapisink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index 2d7824e..e722b71 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -1401,6 +1401,9 @@ gst_vaapisink_set_caps (GstBaseSink * base_sink, GstCaps * caps) update_colorimetry (sink, &GST_VIDEO_INFO_COLORIMETRY (vip)); gst_caps_replace (&sink->caps, caps); + /* Reset the rotation to the default when new caps are coming in. This + * forces re-evaluating if the rotation needs to be done */ + sink->rotation = DEFAULT_ROTATION; gst_vaapisink_ensure_colorbalance (sink); gst_vaapisink_ensure_rotation (sink, FALSE); -- 2.7.4