d3d11videosink: Fix deadlock when parent window is busy
authorSeungha Yang <seungha@centricular.com>
Wed, 14 Dec 2022 16:15:10 +0000 (01:15 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 15 Dec 2022 17:37:48 +0000 (17:37 +0000)
commita27c5c81df48b830f4027949a461ce97e395913c
treef9cdc76a56af39af4180c40d88f08bcc2a5e63ba
parentf7b342f1dd73eb4d513f344c6e99e6686425bcc4
d3d11videosink: Fix deadlock when parent window is busy

Deadlock sequence:
* From a streaming thread, d3d11videosink sends synchronous message
  to the parent window, so that internal (child) window can be
  constructed on the parent window's thread
* App thread (parent window thread) is waiting for pipeline's
  state change (to GST_STATE_NULL) but streaming thread is
  blocked and waiting for app thread

To avoid the deadlock, GstD3D11WindowWin32 should send message
to the parent window asynchronously.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3570>
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11videosink.cpp
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11window.cpp
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11window.h
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11window_dummy.cpp
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11window_win32.cpp