Skip to content

Commit

Permalink
smt: Do not force HW adapter type, when requested SW implementation.
Browse files Browse the repository at this point in the history
Fixed wrong usage of HW library with "-sw" option.
  • Loading branch information
Anton Grishin authored and dmitryermilov committed Jun 16, 2020
1 parent a829fbb commit c7ead60
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions samples/sample_multi_transcode/src/sample_multi_transcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,7 @@ mfxStatus Launcher::Init(int argc, msdk_char *argv[])
sts = CheckAndFixAdapterDependency(i, pSinkPipeline);
MSDK_CHECK_STATUS(sts, "CheckAndFixAdapterDependency failed");
// force implementation type based on iGfx/dGfx parameters
if(m_InputParamsArray[i].libType != MFX_IMPL_SOFTWARE)
ForceImplForSession(i);
ForceImplForSession(i);
#endif
sts = pThreadPipeline->pPipeline->Init(&m_InputParamsArray[i],
m_pAllocArray[i].get(),
Expand All @@ -429,8 +428,7 @@ mfxStatus Launcher::Init(int argc, msdk_char *argv[])
sts = CheckAndFixAdapterDependency(i, pParentPipeline);
MSDK_CHECK_STATUS(sts, "CheckAndFixAdapterDependency failed");
// force implementation type based on iGfx/dGfx parameters
if (m_InputParamsArray[i].libType != MFX_IMPL_SOFTWARE)
ForceImplForSession(i);
ForceImplForSession(i);
#endif
sts = pThreadPipeline->pPipeline->Init(&m_InputParamsArray[i],
m_pAllocArray[i].get(),
Expand Down Expand Up @@ -723,6 +721,9 @@ mfxStatus Launcher::QueryAdapters()

void Launcher::ForceImplForSession(mfxU32 idxSession)
{
if (m_InputParamsArray[idxSession].libType == MFX_IMPL_SOFTWARE)
return;

//change only 8 bit of the implementation. Don't touch type of frames
mfxIMPL impl = m_InputParamsArray[idxSession].libType & mfxI32(~0xFF);

Expand Down

0 comments on commit c7ead60

Please sign in to comment.