diff options
author | Zhong Li <zhong.li@intel.com> | 2019-09-20 04:45:27 +0800 |
---|---|---|
committer | Zhong Li <zhong.li@intel.com> | 2019-09-26 13:44:11 +0800 |
commit | 525de9567903e32b6ee2dc594bd55c26581029dd (patch) | |
tree | 475669cb1b6e1c05eb0e832a763669ea05d77811 /libavcodec/qsv.c | |
parent | 74007dd86a87289a075926704fae5bd8ef313bb5 (diff) | |
download | ffmpeg-525de9567903e32b6ee2dc594bd55c26581029dd.tar.gz |
lavc/qsv: add memory type message
Signed-off-by: Zhong Li <zhong.li@intel.com>
Diffstat (limited to 'libavcodec/qsv.c')
-rw-r--r-- | libavcodec/qsv.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index c4aef70b1e..994c9ebcb0 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -138,6 +138,35 @@ int ff_qsv_level_to_mfx(enum AVCodecID codec_id, int level) } static const struct { + int mfx_iopattern; + const char *desc; +} qsv_iopatterns[] = { + {MFX_IOPATTERN_IN_VIDEO_MEMORY, "input is video memory surface" }, + {MFX_IOPATTERN_IN_SYSTEM_MEMORY, "input is system memory surface" }, + {MFX_IOPATTERN_IN_OPAQUE_MEMORY, "input is opaque memory surface" }, + {MFX_IOPATTERN_OUT_VIDEO_MEMORY, "output is video memory surface" }, + {MFX_IOPATTERN_OUT_SYSTEM_MEMORY, "output is system memory surface" }, + {MFX_IOPATTERN_OUT_OPAQUE_MEMORY, "output is opaque memory surface" }, +}; + +int ff_qsv_print_iopattern(void *log_ctx, int mfx_iopattern, + const char *extra_string) +{ + const char *desc = NULL; + + for (int i = 0; i < FF_ARRAY_ELEMS(qsv_iopatterns); i++) { + if (qsv_iopatterns[i].mfx_iopattern == mfx_iopattern) { + desc = qsv_iopatterns[i].desc; + } + } + if (!desc) + desc = "unknown iopattern"; + + av_log(log_ctx, AV_LOG_VERBOSE, "%s: %s\n", extra_string, desc); + return 0; +} + +static const struct { mfxStatus mfxerr; int averr; const char *desc; |