6969
7070#include " mfx_unified_decode_logging.h"
7171
72- #if defined(MFX_ENABLE_DECODE_NEXT)
73- #include " video_decode.h"
74- #include " decode_codecs_registry.h"
75- #endif
7672
7773
78- #if defined(MFX_ENABLE_DECODE_NEXT)
79- using mfx::decode_next::IsDecodeNextEnabled;
80- using mfx::decode_next::RegisterAllDecodeImpls;
81- using mfx::decode_next::ReportDecodeNextStatus;
82- #endif
8374
8475template <>
8576VideoDECODE* _mfxSession::Create<VideoDECODE>(mfxVideoParam& par)
@@ -88,14 +79,6 @@ VideoDECODE* _mfxSession::Create<VideoDECODE>(mfxVideoParam& par)
8879 VideoCORE* core = m_pCORE.get ();
8980 mfxStatus mfxRes = MFX_ERR_MEMORY_ALLOC ;
9081
91- #if defined(MFX_ENABLE_DECODE_NEXT)
92- if (IsDecodeNextEnabled (core->GetHWType (), par.mfx .CodecId ))
93- {
94- RegisterAllDecodeImpls ();
95- pDECODE = new mfx::decode_next::VideoDECODENext (core, par.mfx .CodecId , &mfxRes);
96- }
97- else
98- #endif
9982 {
10083 // create a codec instance
10184 switch (par.mfx .CodecId )
@@ -197,14 +180,6 @@ mfxStatus MFXVideoDECODE_Query(mfxSession session, mfxVideoParam *in, mfxVideoPa
197180
198181 try
199182 {
200- #if defined(MFX_ENABLE_DECODE_NEXT)
201- if (IsDecodeNextEnabled (session->m_pCORE ->GetHWType (), out->mfx .CodecId ))
202- {
203- RegisterAllDecodeImpls ();
204- mfxRes = mfx::decode_next::DecodeAdapter::Query (session->m_pCORE .get (), out->mfx .CodecId , in, out);
205- }
206- else
207- #endif
208183 {
209184 switch (out->mfx .CodecId )
210185 {
@@ -297,14 +272,6 @@ mfxStatus MFXVideoDECODE_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfx
297272
298273 try
299274 {
300- #if defined(MFX_ENABLE_DECODE_NEXT)
301- if (IsDecodeNextEnabled (session->m_pCORE ->GetHWType (), par->mfx .CodecId ))
302- {
303- RegisterAllDecodeImpls ();
304- mfxRes = mfx::decode_next::DecodeAdapter::QueryIOSurf (session->m_pCORE .get (), par->mfx .CodecId , par, request);
305- }
306- else
307- #endif
308275 {
309276 switch (par->mfx .CodecId )
310277 {
@@ -400,14 +367,6 @@ mfxStatus MFXVideoDECODE_DecodeHeader(mfxSession session, mfxBitstream *bs, mfxV
400367
401368 try
402369 {
403- #if defined(MFX_ENABLE_DECODE_NEXT)
404- if (IsDecodeNextEnabled (session->m_pCORE ->GetHWType (), par->mfx .CodecId ))
405- {
406- RegisterAllDecodeImpls ();
407- mfxRes = mfx::decode_next::DecodeAdapter::DecodeHeader (session->m_pCORE .get (), par->mfx .CodecId , bs, par);
408- }
409- else
410- #endif
411370 {
412371 switch (par->mfx .CodecId )
413372 {
@@ -500,16 +459,14 @@ mfxStatus MFXVideoDECODE_Init(mfxSession session, mfxVideoParam *par)
500459
501460 try
502461 {
503- // Create new decode instance
462+ // check existence of component
504463 if (!session->m_pDECODE )
505464 {
465+ // create a new instance
506466 session->m_pDECODE .reset (session->Create <VideoDECODE>(*par));
507467 MFX_CHECK (session->m_pDECODE .get (), MFX_ERR_INVALID_VIDEO_PARAM );
508468 }
509469
510- #if defined(MFX_ENABLE_DECODE_NEXT)
511- ReportDecodeNextStatus (session->m_pCORE ->GetHWType (), par->mfx .CodecId );
512- #endif
513470
514471 // Init decode instance
515472 mfxRes = session->m_pDECODE ->Init (par);
0 commit comments