[FFmpeg-devel] [PATCH v2 5/5] avutil/hwcontext_qsv: map D3D11VA frames to QSV frames

Soft Works softworkz at hotmail.com
Sat Apr 30 18:09:41 EEST 2022



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Tong
> Wu
> Sent: Friday, April 29, 2022 12:45 PM
> To: ffmpeg-devel at ffmpeg.org
> Cc: Tong Wu <tong1.wu at intel.com>
> Subject: [FFmpeg-devel] [PATCH v2 5/5] avutil/hwcontext_qsv: map
> D3D11VA frames to QSV frames
> 
> Fixes:
> $ ffmpeg.exe -init_hw_device d3d11va=d3d11 -f lavfi -i
> yuvtestsrc -vf
> "format=nv12,hwupload=extra_hw_frames=16,hwmap=derive_device=qsv,forma
> t=qsv
> ,hwdownload,format=nv12" -f null -
> 
> Signed-off-by: Tong Wu <tong1.wu at intel.com>
> ---
>  libavutil/hwcontext_qsv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
> index 6bc920ef59..1bdffee4a4 100644
> --- a/libavutil/hwcontext_qsv.c
> +++ b/libavutil/hwcontext_qsv.c
> @@ -1363,7 +1363,8 @@ static int qsv_map_to(AVHWFramesContext
> *dst_ctx,
>          {
>              mfxHDLPair *pair = (mfxHDLPair*)hwctx-
> >surfaces[i].Data.MemId;
>              if (pair->first == src->data[0]
> -                && pair->second == src->data[1]) {
> +                && (pair->second == src->data[1]
> +                    || (pair->second == (mfxMemId)MFX_INFINITE &&
> src->data[1] == (uint8_t *)0))) {
>                  index = i;
>                  break;
>              }
> --

LGTM.

softworkz


More information about the ffmpeg-devel mailing list