mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 04:45:36 +00:00
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
This commit is contained in:
parent
c6fa635b21
commit
5976518f0b
3 changed files with 6 additions and 6 deletions
|
@ -183,7 +183,8 @@ gst_msdk_context_open (GstMsdkContext * context, gboolean hardware,
|
||||||
|
|
||||||
priv->job_type = job_type;
|
priv->job_type = job_type;
|
||||||
priv->hardware = hardware;
|
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)
|
if (!priv->session)
|
||||||
goto failed;
|
goto failed;
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ msdk_close_session (mfxSession session)
|
||||||
}
|
}
|
||||||
|
|
||||||
mfxSession
|
mfxSession
|
||||||
msdk_open_session (gboolean hardware)
|
msdk_open_session (mfxIMPL impl)
|
||||||
{
|
{
|
||||||
mfxSession session = NULL;
|
mfxSession session = NULL;
|
||||||
mfxVersion version = { {1, 1}
|
mfxVersion version = { {1, 1}
|
||||||
|
@ -160,8 +160,7 @@ msdk_open_session (gboolean hardware)
|
||||||
"HARDWARE3", "HARDWARE4", "RUNTIME"
|
"HARDWARE3", "HARDWARE4", "RUNTIME"
|
||||||
};
|
};
|
||||||
|
|
||||||
status = MFXInit (hardware ? MFX_IMPL_HARDWARE_ANY : MFX_IMPL_SOFTWARE,
|
status = MFXInit (impl, &version, &session);
|
||||||
&version, &session);
|
|
||||||
if (status != MFX_ERR_NONE) {
|
if (status != MFX_ERR_NONE) {
|
||||||
GST_ERROR ("Intel Media SDK not available (%s)",
|
GST_ERROR ("Intel Media SDK not available (%s)",
|
||||||
msdk_status_to_string (status));
|
msdk_status_to_string (status));
|
||||||
|
@ -195,7 +194,7 @@ failed:
|
||||||
gboolean
|
gboolean
|
||||||
msdk_is_available (void)
|
msdk_is_available (void)
|
||||||
{
|
{
|
||||||
mfxSession session = msdk_open_session (FALSE);
|
mfxSession session = msdk_open_session (MFX_IMPL_AUTO_ANY);
|
||||||
if (!session) {
|
if (!session) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
mfxSession msdk_open_session (gboolean hardware);
|
mfxSession msdk_open_session (mfxIMPL impl);
|
||||||
void msdk_close_session (mfxSession session);
|
void msdk_close_session (mfxSession session);
|
||||||
|
|
||||||
gboolean msdk_is_available (void);
|
gboolean msdk_is_available (void);
|
||||||
|
|
Loading…
Reference in a new issue