From 275d754156d6113568bc7f74e184a3b41393e49a Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Wed, 4 Apr 2018 17:30:21 -0800 Subject: [PATCH] msdk: fix plugin load on implementations with only HW support We can't assume that MSDK always supports SW implementation on all platforms. Thus, msdk_is_available should check for ANY implementation. https://bugzilla.gnome.org/show_bug.cgi?id=794991 --- sys/msdk/gstmsdkcontext.c | 3 ++- sys/msdk/msdk.c | 7 +++---- sys/msdk/msdk.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/msdk/gstmsdkcontext.c b/sys/msdk/gstmsdkcontext.c index 883fdb5cf4..a952370b89 100644 --- a/sys/msdk/gstmsdkcontext.c +++ b/sys/msdk/gstmsdkcontext.c @@ -183,7 +183,8 @@ gst_msdk_context_open (GstMsdkContext * context, gboolean hardware, priv->job_type = job_type; priv->hardware = hardware; - priv->session = msdk_open_session (hardware); + priv->session = + msdk_open_session (hardware ? MFX_IMPL_HARDWARE_ANY : MFX_IMPL_SOFTWARE); if (!priv->session) goto failed; diff --git a/sys/msdk/msdk.c b/sys/msdk/msdk.c index e2c80bf3df..9187648d2d 100644 --- a/sys/msdk/msdk.c +++ b/sys/msdk/msdk.c @@ -147,7 +147,7 @@ msdk_close_session (mfxSession session) } mfxSession -msdk_open_session (gboolean hardware) +msdk_open_session (mfxIMPL impl) { mfxSession session = NULL; mfxVersion version = { {1, 1} @@ -160,8 +160,7 @@ msdk_open_session (gboolean hardware) "HARDWARE3", "HARDWARE4", "RUNTIME" }; - status = MFXInit (hardware ? MFX_IMPL_HARDWARE_ANY : MFX_IMPL_SOFTWARE, - &version, &session); + status = MFXInit (impl, &version, &session); if (status != MFX_ERR_NONE) { GST_ERROR ("Intel Media SDK not available (%s)", msdk_status_to_string (status)); @@ -195,7 +194,7 @@ failed: gboolean msdk_is_available (void) { - mfxSession session = msdk_open_session (FALSE); + mfxSession session = msdk_open_session (MFX_IMPL_AUTO_ANY); if (!session) { return FALSE; } diff --git a/sys/msdk/msdk.h b/sys/msdk/msdk.h index a764f2cfe2..d1c874cbaf 100644 --- a/sys/msdk/msdk.h +++ b/sys/msdk/msdk.h @@ -49,7 +49,7 @@ G_BEGIN_DECLS -mfxSession msdk_open_session (gboolean hardware); +mfxSession msdk_open_session (mfxIMPL impl); void msdk_close_session (mfxSession session); gboolean msdk_is_available (void);