mediafoundation: propagate PrepareForEncode error up.

Reviewed-by: Yubo Xie <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38857>
This commit is contained in:
Pohsiang (John) Hsu 2025-12-03 18:22:01 -08:00 committed by Marge Bot
parent 10138e5b42
commit 47dc4b90e4
3 changed files with 5 additions and 9 deletions

View file

@ -677,6 +677,10 @@ done:
*ppDX12EncodeContext = pDX12EncodeContext; *ppDX12EncodeContext = pDX12EncodeContext;
pDX12EncodeContext = nullptr; pDX12EncodeContext = nullptr;
} }
else
{
MFE_ERROR( "[dx12 hmft 0x%p] PrepareForEncode - hr=0x%x", this, hr );
}
SAFE_DELETE( pDX12EncodeContext ); SAFE_DELETE( pDX12EncodeContext );
SAFE_CLOSEHANDLE( hTexture ); SAFE_CLOSEHANDLE( hTexture );
return hr; return hr;

View file

@ -29,14 +29,6 @@
goto label; \ goto label; \
} \ } \
} }
#define CHECKHR_HRGOTO( hresult, newhresult, label ) \
{ \
hr = hresult; \
if( FAILED( hr ) ) \
{ \
CHECKHR_GOTO( newhresult, label ); \
} \
}
#define CHECKBOOL_GOTO( exp, err, label ) \ #define CHECKBOOL_GOTO( exp, err, label ) \
if( !( exp ) ) \ if( !( exp ) ) \
{ \ { \

View file

@ -2538,7 +2538,7 @@ CDX12EncHMFT::ProcessInput( DWORD dwInputStreamIndex, IMFSample *pSample, DWORD
(void) pSample->GetUINT32( MFSampleExtension_ChromaOnly, &unChromaOnly ); (void) pSample->GetUINT32( MFSampleExtension_ChromaOnly, &unChromaOnly );
// setup the source buffer // setup the source buffer
CHECKHR_HRGOTO( PrepareForEncode( pSample, &pDX12EncodeContext ), MF_E_INVALIDMEDIATYPE, done ); CHECKHR_GOTO( PrepareForEncode( pSample, &pDX12EncodeContext ), done );
if( SUCCEEDED( GetQPMapBufferFromSampleLockHeld( pSample, &qpData, &qpSize, qpMapBuffer ) ) && qpMapBuffer ) if( SUCCEEDED( GetQPMapBufferFromSampleLockHeld( pSample, &qpData, &qpSize, qpMapBuffer ) ) && qpMapBuffer )
{ {
pDX12EncodeContext->SetPipeQPMapBufferInfo( qpData, qpSize ); pDX12EncodeContext->SetPipeQPMapBufferInfo( qpData, qpSize );