Using the Software Video Decoders
NvMedia provides two functions to support software video decoders.
- The decoder obtains a mapped YUV video surface by calling the
NvMediaVideoSurfaceLockfunction. -
During the call, NvMedia waits while the surface is being used by the internal engines. Consequently, this is a blocking call. Once the function returns, the surface is used by the software decoder. The returned parameters are the mapped memory YUV pointers and the associated pitches.
It also returns the width and height in terms of luma pixels.
- When the decoder finishes filling up the surfaces, it calls the
NvMediaVideoSurfaceUnlockfunction.This tells NvMedia that the surface can be used for the internal engines.
On certain NVIDIA DRIVE™ platforms, the mapping returns a NULL pointer indicating that the surface is not CPU accessible.