Transition Guide
Upgrading from Intel® Media SDK to Intel® oneAPI Video Processing Library
ID
766165
Date
8/11/2021
Public
A newer version of this document is available. Customers should click here to go to the newest version.
Using Internal Memory
The simple use of external memory allocation is shown in legacy-decode:
sts = MFXVideoDECODE_Init(session, &mfxDecParams);Query number required surfaces for decoder MFXVideoDECODE_QueryIOSurf(session, &mfxDecParams, &decRequest); // External (application) allocation of decode surfaces decSurfPool = (mfxFrameSurface1 *)calloc(sizeof(mfxFrameSurface1), decRequest.NumFrameSuggested); sts = AllocateExternalSystemMemorySurfacePool(&decOutBuf, decSurfPool, mfxDecParams.mfx.FrameInfo, decRequest.NumFrameSuggested);
When processing with externally allocated frames, the application must find a free surface in the pool and supply it to oneVPL. It must also use 1.x API synchronization to access the data.
For a decode example using internal allocation, see hello-decode. Note that the application does not need to allocate a surface pool or find free surfaces.
sts = MFXVideoDECODE_DecodeFrameAsync(session, (isDraining) ? NULL : &bitstream, NULL, &decSurfaceOut, &syncp);