mediafoundation: Test compile steps v/s step , and set build flag

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15244
Backport-to: *

Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41221>
This commit is contained in:
Rohit Athavale 2026-04-27 14:58:01 -07:00 committed by Marge Bot
parent 06ebe40ca1
commit c5b184a02a
2 changed files with 33 additions and 0 deletions

View file

@ -958,7 +958,11 @@ CDX12EncHMFT::GetValue( const GUID *Api, VARIANT *Value )
hevcDeltaQPSettings.dataType = CODEC_API_QP_MAP_INT8;
hevcDeltaQPSettings.minValue = static_cast<INT16>( m_uiMinQP );
hevcDeltaQPSettings.maxValue = static_cast<INT16>( m_uiMaxQP );
#if defined(INPUTQPSETTINGS_HAS_STEPS)
hevcDeltaQPSettings.steps = 1;
#else
hevcDeltaQPSettings.step = 1;
#endif
SAFEARRAYBOUND bound = { static_cast<ULONG>( sizeof( hevcDeltaQPSettings ) ),
static_cast<LONG>( 0 ) }; // cElements , lower bound

View file

@ -47,6 +47,35 @@ if get_option('mediafoundation-store-dll')
mf_cpp_args += '-DBUILD_FOR_MSDK' # Can use #if BUILD_FOR_MSDK in .cpp code
endif
# InputQPSettings::step was renamed to ::steps in BR (Bromine) SDK
# Probe which field name the installed SDK exposes.
_inputqp_has_steps = cc.compiles(
'''
#include <windows.h>
#include <mfapi.h>
void test() { InputQPSettings s; (void)s.steps; }
''',
name : 'InputQPSettings::steps present',
)
if _inputqp_has_steps
message('InputQPSettings: using field "steps"')
mf_cpp_args += '-DINPUTQPSETTINGS_HAS_STEPS'
else
_inputqp_has_step = cc.compiles(
'''
#include <windows.h>
#include <mfapi.h>
void test() { InputQPSettings s; (void)s.step; }
''',
name : 'InputQPSettings::step present',
)
if _inputqp_has_step
message('InputQPSettings: using field "step"')
else
error('InputQPSettings has neither "steps" nor "step" — unsupported Windows SDK version')
endif
endif
mediafoundation_files = files(
'codecapi.cpp',
'encode.cpp',