diff options
author | nyanmisaka <nst799610810@gmail.com> | 2021-11-16 16:16:22 +0800 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-12-04 14:06:30 +0100 |
commit | 64467cbca2d9d638348eaeaef13511999744cf7a (patch) | |
tree | e9b64450c54edf834dbbeae20dfb2f90a5576367 | |
parent | c6f4e10111debf5b547a399661a5fe997d761033 (diff) | |
download | ffmpeg-64467cbca2d9d638348eaeaef13511999744cf7a.tar.gz |
libavutil/hwcontext_qsv: fix a bug for mapping vaapi frame to qsv
The data stored in data[3] in VAAPI AVFrame is VASurfaceID while
the data stored in pair->first is the pointer of VASurfaceID, so
we need to do cast to make following commandline works:
ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \
-hwaccel_output_format vaapi -i input.264 \
-vf "hwmap=derive_device=qsv,format=qsv" -c:v h264_qsv output.264
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavutil/hwcontext_qsv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 268be9f8a1..a5d154a24d 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -1218,7 +1218,7 @@ static int qsv_map_to(AVHWFramesContext *dst_ctx, case AV_PIX_FMT_VAAPI: { mfxHDLPair *pair = (mfxHDLPair*)hwctx->surfaces[i].Data.MemId; - if (pair->first == src->data[3]) { + if (*(VASurfaceID*)pair->first == (VASurfaceID)src->data[3]) { index = i; break; } |