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: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/389>
This commit is contained in:
Marc Leeman 2020-09-01 09:31:33 +02:00 committed by Víctor Manuel Jáquez Leal
parent 0818af088b
commit 629154642f

View file

@ -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);