qsv/hevcdec: Load hw plugin by default on non-windows os

Software plugin is not available on Linux, Only works on Windows.
Similar changes have been applied to qsv hevc encoder by
b05128f3c9.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
This commit is contained in:
Li, Zhong 2017-11-10 03:03:42 -05:00 committed by Maxym Dmytrychenko
parent 3152058bf1
commit 136e7cf64c
1 changed files with 7 additions and 1 deletions

View File

@ -171,6 +171,12 @@ static void qsv_decode_flush(AVCodecContext *avctx)
ff_qsv_decode_flush(avctx, &s->qsv);
}
#if defined(_WIN32)
#define LOAD_PLUGIN_DEFAULT LOAD_PLUGIN_HEVC_SW
#else
#define LOAD_PLUGIN_DEFAULT LOAD_PLUGIN_HEVC_HW
#endif
#define OFFSET(x) offsetof(QSVH2645Context, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
@ -187,7 +193,7 @@ AVHWAccel ff_hevc_qsv_hwaccel = {
static const AVOption hevc_options[] = {
{ "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD },
{ "load_plugin", "A user plugin to load in an internal session", OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_HEVC_SW }, LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_HW, VD, "load_plugin" },
{ "load_plugin", "A user plugin to load in an internal session", OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_DEFAULT }, LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_HW, VD, "load_plugin" },
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_NONE }, 0, 0, VD, "load_plugin" },
{ "hevc_sw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_SW }, 0, 0, VD, "load_plugin" },
{ "hevc_hw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_HW }, 0, 0, VD, "load_plugin" },