MSDK: Improve the GstContext setting logic.
authorHe Junyan <junyan.he@intel.com>
Tue, 17 Aug 2021 13:51:58 +0000 (21:51 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 11 Feb 2022 07:13:45 +0000 (07:13 +0000)
commit85664b5af620680cd38d22aebb935f9290635323
tree53f2af0dbe2f812e7960a28a039427e1c8b6d59d
parenta905e7474bac7f01f6895a171535a3d9ce431bf4
MSDK: Improve the GstContext setting logic.

We now can use the gst va lib's display to create our MSDK context,
and use its helper functions to simplify our code. The improved logic
is like this:
1. Every MSDK element should use gst_msdk_context_find() to find a MSDK
context from neighbour. If valid, reuse it.
2. Use gst_msdk_ensure_new_context(). It will first query neighbours
about the GstVaDisplay, if found(e.g. some VA element is connected),
use gst_msdk_context_from_external_display() to create a MSDK context.
3. Then, creating the MSDK context from scratch. It creates both the
display and MSDK context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
subprojects/gst-plugins-bad/sys/msdk/gstmsdkcontextutil.c
subprojects/gst-plugins-bad/sys/msdk/gstmsdkcontextutil.h
subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c
subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c
subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c