1
0

avfilter/vsrc_ddagrab: check for existence of DPI_AWARENESS_CONTEXT

Apparently some (broken?) Windows SDK versions define IDXGIOutput5
but not DPI_AWARENESS_CONTEXT. So we need to explicitly check for its
existence.
This commit is contained in:
Timo Rothenpieler 2022-07-19 13:44:58 +02:00
parent ecd0a7c5bd
commit 926f355aff
2 changed files with 6 additions and 4 deletions

2
configure vendored
View File

@ -2352,6 +2352,7 @@ TOOLCHAIN_FEATURES="
"
TYPES_LIST="
DPI_AWARENESS_CONTEXT
IDXGIOutput5
kCMVideoCodecType_HEVC
kCMVideoCodecType_HEVCWithAlpha
@ -6398,6 +6399,7 @@ check_type "windows.h dxgi1_2.h" "IDXGIOutput1"
check_type "windows.h dxgi1_5.h" "IDXGIOutput5"
check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
check_type "windows.h d3d11.h" "ID3D11VideoContext"
check_type "windows.h" "DPI_AWARENESS_CONTEXT" -D_WIN32_WINNT=0x0A00
check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
check_func_headers mfapi.h MFCreateAlignedMemoryBuffer -lmfplat

View File

@ -18,9 +18,9 @@
#include "config.h"
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0A00
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0602
#define _WIN32_WINNT 0x0A00
#endif
#define WIN32_LEAN_AND_MEAN
@ -151,7 +151,7 @@ static av_cold int init_dxgi_dda(AVFilterContext *avctx)
IDXGIAdapter *dxgi_adapter = NULL;
IDXGIOutput *dxgi_output = NULL;
IDXGIOutput1 *dxgi_output1 = NULL;
#if HAVE_IDXGIOUTPUT5
#if HAVE_IDXGIOUTPUT5 && HAVE_DPI_AWARENESS_CONTEXT
IDXGIOutput5 *dxgi_output5 = NULL;
typedef DPI_AWARENESS_CONTEXT (*set_thread_dpi_t)(DPI_AWARENESS_CONTEXT);
@ -190,7 +190,7 @@ static av_cold int init_dxgi_dda(AVFilterContext *avctx)
return AVERROR_EXTERNAL;
}
#if HAVE_IDXGIOUTPUT5
#if HAVE_IDXGIOUTPUT5 && HAVE_DPI_AWARENESS_CONTEXT
user32_module = dlopen("user32.dll", 0);
if (!user32_module) {
av_log(avctx, AV_LOG_ERROR, "Failed loading user32.dll\n");