]> git.sesse.net Git - ffmpeg/commit
hwcontext_vaapi: remove duplicate formats from sw_format list
authorHaihao Xiang <haihao.xiang@intel.com>
Fri, 24 Jul 2020 02:39:09 +0000 (10:39 +0800)
committerMark Thompson <sw@jkqxz.net>
Mon, 27 Jul 2020 15:06:30 +0000 (16:06 +0100)
commitfa3da243e6ba1567aadfa198bafd32c320e01205
tree29a3764b86091893fc465f2e2b5f261821eb1ccc
parentd951eea6fd7d62acff70640db002997db01315fb
hwcontext_vaapi: remove duplicate formats from sw_format list

hwcontext_vaapi maps different VA fourcc to the same pix_fmt for U/V
plane swap cases, however duplicate formats are not expected in sw_format
list when merging formats.

For example:
ffmpeg -loglevel debug -init_hw_device vaapi -filter_hw_device vaapi0 \
-f lavfi -i smptebars -vf \
"hwupload=derive_device=vaapi,scale_vaapi,hwdownload,format=yuv420p" \
-vframes 1 -f null -

Without this fix, an auto scaler is required for the above command
   Duplicate formats in ff_merge_formats detected
   [auto_scaler_0 @ 0x560df58f4550] Setting 'flags' to value 'bicubic'
   [auto_scaler_0 @ 0x560df58f4550] w:iw h:ih flags:'bicubic' interl:0
   [Parsed_hwupload_0 @ 0x560df58f0ec0] auto-inserting filter
   'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and
   the filter 'Parsed_hwupload_0'

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
libavutil/hwcontext_vaapi.c