msdk: load plugins in h265 and vp8 init

https://bugzilla.gnome.org/show_bug.cgi?id=770990
This commit is contained in:
Scott D Phillips 2016-09-27 14:21:34 -07:00 committed by Josep Torra
parent 2905a7e33e
commit 35f76fc33a
2 changed files with 40 additions and 1 deletions

View file

@ -32,6 +32,7 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <mfxplugin.h>
#include "gstmsdkh265enc.h"
@ -60,6 +61,28 @@ gst_msdkh265enc_set_format (GstMsdkEnc * encoder)
static gboolean
gst_msdkh265enc_configure (GstMsdkEnc * encoder)
{
GstMsdkH265Enc *h265enc = GST_MSDKH265ENC (encoder);
mfxSession session;
mfxStatus status;
const mfxPluginUID *uid;
session = msdk_context_get_session (encoder->context);
if (encoder->hardware)
uid = &MFX_PLUGINID_HEVCE_HW;
else
uid = &MFX_PLUGINID_HEVCE_SW;
status = MFXVideoUSER_Load (session, uid, 1);
if (status < MFX_ERR_NONE) {
GST_ERROR_OBJECT (h265enc, "Media SDK Plugin load failed (%s)",
msdk_status_to_string (status));
return FALSE;
} else if (status > MFX_ERR_NONE) {
GST_WARNING_OBJECT (h265enc, "Media SDK Plugin load warning: %s",
msdk_status_to_string (status));
}
encoder->param.mfx.CodecId = MFX_CODEC_HEVC;
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN;

View file

@ -32,9 +32,10 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <mfxplugin.h>
#include <mfxvp8.h>
#include "gstmsdkvp8enc.h"
#include "mfxvp8.h"
GST_DEBUG_CATEGORY_EXTERN (gst_msdkvp8enc_debug);
#define GST_CAT_DEFAULT gst_msdkvp8enc_debug
@ -108,6 +109,21 @@ static gboolean
gst_msdkvp8enc_configure (GstMsdkEnc * encoder)
{
GstMsdkVP8Enc *thiz = GST_MSDKVP8ENC (encoder);
mfxSession session;
mfxStatus status;
if (encoder->hardware) {
session = msdk_context_get_session (encoder->context);
status = MFXVideoUSER_Load (session, &MFX_PLUGINID_VP8E_HW, 1);
if (status < MFX_ERR_NONE) {
GST_ERROR_OBJECT (thiz, "Media SDK Plugin load failed (%s)",
msdk_status_to_string (status));
return FALSE;
} else if (status > MFX_ERR_NONE) {
GST_WARNING_OBJECT (thiz, "Media SDK Plugin load warning: %s",
msdk_status_to_string (status));
}
}
encoder->param.mfx.CodecId = MFX_CODEC_VP8;
encoder->param.mfx.CodecProfile = thiz->profile;