summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodeo <[email protected]>2015-07-03 17:41:33 +0000
committerRodeo <[email protected]>2015-07-03 17:41:33 +0000
commitce61c1e878d59d7114e2e3781622d5c08c4659bd (patch)
tree0cf8827bddb2da853013833a21f6f0bd6e05c17d
parentcae011934044a1dc0a330d58364fb1d54744d836 (diff)
QSV: don't be quite as picky about marking an encoder as available.
While it worked fine w/HSW, it led to some false negatives on IVB hardware. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7334 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/qsv_common.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/libhb/qsv_common.c b/libhb/qsv_common.c
index acb624417..e383b806e 100644
--- a/libhb/qsv_common.c
+++ b/libhb/qsv_common.c
@@ -274,24 +274,34 @@ static int query_capabilities(mfxSession session, mfxVersion version, hb_qsv_inf
init_video_param(&inputParam);
inputParam.mfx.CodecId = info->codec_id;
- /*
- * MFXVideoENCODE_Query might tell you that an HEVC encoder is
- * available on Haswell hardware, but it'll fail to initialize.
- * Check encoder availability with MFXVideoENCODE_Init instead.
- */
- if ((status = MFXVideoENCODE_Init(session, &inputParam)) >= MFX_ERR_NONE)
+ memset(&videoParam, 0, sizeof(mfxVideoParam));
+ videoParam.mfx.CodecId = inputParam.mfx.CodecId;
+
+ if (MFXVideoENCODE_Query(session, &inputParam, &videoParam) >= MFX_ERR_NONE &&
+ videoParam.mfx.CodecId == info->codec_id)
{
/*
- * When initializing encode-only on a hardware implementation,
- * MFX_WRN_PARTIAL_ACCELERATION could mean the graphics driver's
- * fallback software implementation is used; we don't want that.
+ * MFXVideoENCODE_Query might tell you that an HEVC encoder is
+ * available on Haswell hardware, but it'll fail to initialize.
+ * So check encoder availability with MFXVideoENCODE_Init too.
*/
- if (status != MFX_WRN_PARTIAL_ACCELERATION)
+ if ((status = MFXVideoENCODE_Init(session, &videoParam)) >= MFX_ERR_NONE)
{
info->available = 1;
}
+ else if (info->codec_id == MFX_CODEC_AVC)
+ {
+ /*
+ * This should not fail for AVC encoders, so we want to know
+ * about it - however, it may fail for other encoders (ignore)
+ */
+ fprintf(stderr,
+ "hb_qsv_info_init: MFXVideoENCODE_Init failed"
+ " (0x%"PRIX32", 0x%"PRIX32", %d)\n",
+ info->codec_id, info->implementation, status);
+ }
+ MFXVideoENCODE_Close(session);
}
- MFXVideoENCODE_Close(session);
}
}
if (!info->available)