glimagesink: Avoid assert in query.
authorHe Junyan <junyan.he@intel.com>
Fri, 6 Nov 2020 06:05:39 +0000 (14:05 +0800)
committerHe Junyan <junyan.he@intel.com>
Thu, 3 Dec 2020 16:40:12 +0000 (00:40 +0800)
commit6ffddd27e5216a142bfd882c5375f0816303b136
treeb6a583a799cca6647a49b966b13ebf125b1f4684
parentf7ea6d9b64282bb11a220f3ffe8c9e94baf83221
glimagesink: Avoid assert in query.

The sink_query just uses context, other_context and display to query info.
But all these objects can be changed or distroyed in state_change() func
and other places.
This patch is not very perfect. The condition race still exists in other
places in this element. All the functions directly access these objects
without protection. Most of them are executed when the data is pushing and
draw context/window have already been established, so they should not have
problems. But the sink_query and propose_allocation functions are the query
-like functions and executed in query context, which can be called in any
state of the element. So it can cause some crash issues because of destroyed
context object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/922>
ext/gl/gstglimagesink.c