videoflip: fix possible crash when setting the video-direction while running
authorMatthew Waters <matthew@centricular.com>
Wed, 9 Dec 2020 09:20:18 +0000 (20:20 +1100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 4 Jan 2021 12:10:12 +0000 (12:10 +0000)
commitdb15ec92864a2987bb278d48f15338dccf7f9cc4
treefb7538c21d5058dfbbf3789db3b96e42ef226e70
parent35018d67ef1c0e3641b457e5a4b74c2d6c26c998
videoflip: fix possible crash when setting the video-direction while running

A classic case of not enough locking.

One interesting thing with this is the interaction between the
rotation value and caps negotiation.  i.e. the width/height of the caps
can be swapped depending on the video-direction property.  We can't lock
the entirety of the caps negotiation for obvious reasons so we need to
do something else.  This takes the approach of trying to use a single
rotation value throughout the entirety of the negotiation and then
subsequent output frame in a kind of latching sequence.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/792
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/836>
docs/gst_plugins_cache.json
gst/videofilter/gstvideoflip.c
gst/videofilter/gstvideoflip.h
tests/check/elements/videoflip.c