From b6ac79a0c5bca04a0550b7db3ead3b59bd51b5bf Mon Sep 17 00:00:00 2001 From: Jay Yang Date: Mon, 21 Oct 2024 08:14:08 +0000 Subject: [PATCH] [vfi] add platform caps check for Query API --- .../vpp/include/mfx_vpp_ai_frame_interpolation.h | 2 ++ .../vpp/src/mfx_vpp_ai_frame_interpolation.cpp | 14 ++++++++++++++ _studio/mfx_lib/vpp/src/mfx_vpp_sw_internal.cpp | 6 +++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/_studio/mfx_lib/vpp/include/mfx_vpp_ai_frame_interpolation.h b/_studio/mfx_lib/vpp/include/mfx_vpp_ai_frame_interpolation.h index c10f528f27..28b63e9a48 100644 --- a/_studio/mfx_lib/vpp/include/mfx_vpp_ai_frame_interpolation.h +++ b/_studio/mfx_lib/vpp/include/mfx_vpp_ai_frame_interpolation.h @@ -48,6 +48,8 @@ class MFXVideoFrameInterpolation MFXVideoFrameInterpolation(); virtual ~MFXVideoFrameInterpolation(); + static mfxStatus Query(VideoCORE* core); + mfxStatus Init( VideoCORE* core, const mfxFrameInfo& inInfo, diff --git a/_studio/mfx_lib/vpp/src/mfx_vpp_ai_frame_interpolation.cpp b/_studio/mfx_lib/vpp/src/mfx_vpp_ai_frame_interpolation.cpp index 593d1eeaed..335a191881 100644 --- a/_studio/mfx_lib/vpp/src/mfx_vpp_ai_frame_interpolation.cpp +++ b/_studio/mfx_lib/vpp/src/mfx_vpp_ai_frame_interpolation.cpp @@ -736,4 +736,18 @@ mfxStatus MFXVideoFrameInterpolation::AddTaskQueue(mfxU32 taskIndex) m_outStamp = 0; } return MFX_ERR_NONE; +} + +mfxStatus MFXVideoFrameInterpolation::Query(VideoCORE* core) +{ + MFX_CHECK_NULL_PTR1(core); + auto platform = core->GetHWType(); + if (platform == MFX_HW_DG2 || platform >= MFX_HW_MTL) + { + return MFX_ERR_NONE; + } + else + { + MFX_RETURN(MFX_ERR_UNSUPPORTED); + } } \ No newline at end of file diff --git a/_studio/mfx_lib/vpp/src/mfx_vpp_sw_internal.cpp b/_studio/mfx_lib/vpp/src/mfx_vpp_sw_internal.cpp index 28dffdf3f8..4ac82c205e 100644 --- a/_studio/mfx_lib/vpp/src/mfx_vpp_sw_internal.cpp +++ b/_studio/mfx_lib/vpp/src/mfx_vpp_sw_internal.cpp @@ -384,7 +384,7 @@ bool IsCompositionMode(mfxVideoParam* pParam) return false; } -mfxStatus ExtendedQuery(VideoCORE *, mfxU32 filterName, mfxExtBuffer* pHint) +mfxStatus ExtendedQuery(VideoCORE *core, mfxU32 filterName, mfxExtBuffer* pHint) { if( MFX_EXTBUFF_VPP_DENOISE == filterName || MFX_EXTBUFF_VPP_DENOISE2 == filterName @@ -437,6 +437,10 @@ mfxStatus ExtendedQuery(VideoCORE *, mfxU32 filterName, mfxExtBuffer* pHint) { MFX_RETURN(CheckScalingParam(pHint)); } + else if (MFX_EXTBUFF_VPP_AI_FRAME_INTERPOLATION == filterName) + { + MFX_RETURN(MFXVideoFrameInterpolation::Query(core)); + } else // ignore { return MFX_ERR_NONE;