summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorRodeo <[email protected]>2015-06-27 22:15:45 +0000
committerRodeo <[email protected]>2015-06-27 22:15:45 +0000
commitb7eef0ad6ef14845a2a1fb89980ba971b4b6db98 (patch)
tree1f4d34c10d20616e89d4a63422eaca9f739151c7 /libhb
parentc56ae5803602026f2be8b2c2fb205362b2a7672a (diff)
QSV: be more picky about marking an encoder as available.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7329 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/qsv_common.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/libhb/qsv_common.c b/libhb/qsv_common.c
index 8d2edce1f..acb624417 100644
--- a/libhb/qsv_common.c
+++ b/libhb/qsv_common.c
@@ -274,14 +274,24 @@ static int query_capabilities(mfxSession session, mfxVersion version, hb_qsv_inf
init_video_param(&inputParam);
inputParam.mfx.CodecId = info->codec_id;
- 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)
+ /*
+ * 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)
{
- info->available = 1;
+ /*
+ * 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.
+ */
+ if (status != MFX_WRN_PARTIAL_ACCELERATION)
+ {
+ info->available = 1;
+ }
}
+ MFXVideoENCODE_Close(session);
}
}
if (!info->available)