NVIDIA DRIVE OS Linux SDK API Reference Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Image Decoder

Detailed Description

Defines and manages objects that decode video.

The NvMediaImageDecoder object decodes compressed video data, writing the results to a NvMediaImage.

A specific NvMedia implementation may support decoding multiple types of compressed video data. However, NvMediaImageDecoder objects are able to decode a specific type of compressed video data. This type must be specified during creation.

Data Structures

struct  NvMediaImageDecoder
 A handle representing a IMAGE decoder object. More...


 Decoder Creation Flag
 Defines decoder flag bit masks for constructing the decoder.


 Major Version number. More...
 Minor Version number. More...


enum  NvMediaImageCodec {
 Image codec type. More...


NvMediaStatus NvMediaImageDecoderGetVersion (NvMediaVersion *version)
 Checks the version compatibility for the NvMedia Image decoder library. More...
NvMediaImageDecoderNvMediaImageDecoderCreate (const NvMediaDevice *device, NvMediaImageCodec codec, uint16_t width, uint16_t height, uint16_t maxReferences, uint64_t maxBitstreamSize, uint8_t inputBuffering, uint32_t flags, NvMediaDecoderInstanceId instanceId)
 Creates a image decoder object. More...
void NvMediaImageDecoderDestroy (const NvMediaImageDecoder *decoder)
 Destroys a image decoder object. More...
NvMediaStatus NvMediaImageDecoderRender (const NvMediaImageDecoder *decoder, NvMediaImage *target, const NvMediaPictureInfo *pictureInfo, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, NvMediaDecoderInstanceId instanceId)
 Decodes a compressed field/frame and render the result into a NvMediaImage. More...

Macro Definition Documentation


Major Version number.

Definition at line 44 of file nvmedia_imgdec.h.


Minor Version number.

Definition at line 46 of file nvmedia_imgdec.h.

Enumeration Type Documentation

Image codec type.


H.264 codec.


H265 codec.

Definition at line 51 of file nvmedia_imgdec.h.

Function Documentation

NvMediaImageDecoder* NvMediaImageDecoderCreate ( const NvMediaDevice device,
NvMediaImageCodec  codec,
uint16_t  width,
uint16_t  height,
uint16_t  maxReferences,
uint64_t  maxBitstreamSize,
uint8_t  inputBuffering,
uint32_t  flags,
NvMediaDecoderInstanceId  instanceId 

Creates a image decoder object.

Creates a NvMediaImageDecoder object for the specified codec. Each decoder object may be accessed by a separate thread. The object must be destroyed with NvMediaImageDecoderDestroy(). All surfaces used with the NvMediaImageDecoder must be obtained by /ref NvMediaSurfaceFormatGetType with:

[in]deviceA pointer to the device this video decoder will use.
[in]codecCodec type. The following types are supported:
[in]widthDecoder width in luminance pixels.
[in]heightDecoder height in luminance pixels.
[in]maxReferencesThe maximum number of reference frames used. This limits internal allocations.
[in]maxBitstreamSizeThe maximum size for bitstream. This limits internal allocations.
[in]inputBufferingHow many frames can be in flight at any given time. If this value is 1, NvMediaImageDecoderRender() blocks until the previous frame has finished decoding. If this is 2, NvMediaImageDecoderRender blocks if two frames are pending but does not block if one is pending. This value is clamped internally to between 1 and 8.
[in]flagsSet the flags of the decoder. The following flags are supported:
[in]instanceIdThe ID of the engine instance. The following instances are supported:
NvMediaVideoDecoder The new video decoder's handle or NULL if unsuccessful.
void NvMediaImageDecoderDestroy ( const NvMediaImageDecoder decoder)

Destroys a image decoder object.

[in]decoderThe decoder to be destroyed.
NvMediaStatus NvMediaImageDecoderGetVersion ( NvMediaVersion version)

Checks the version compatibility for the NvMedia Image decoder library.

[in]versionA pointer to a NvMediaVersion structure of the client.
NvMediaStatus The status of the operation. Possible values are:
NVMEDIA_STATUS_BAD_PARAMETER if the pointer is invalid.
NvMediaStatus NvMediaImageDecoderRender ( const NvMediaImageDecoder decoder,
NvMediaImage target,
const NvMediaPictureInfo pictureInfo,
uint32_t  numBitstreamBuffers,
const NvMediaBitstreamBuffer bitstreams,
NvMediaDecoderInstanceId  instanceId 

Decodes a compressed field/frame and render the result into a NvMediaImage.

[in]decoderThe decoder object that will perform the decode operation.
[in]targetThe image surface to render to.
[in]pictureInfoA (pointer to a) structure containing information about the picture to be decoded. Note that the appropriate type of NvMediaPictureInfo* structure must be provided to match to profile that the decoder was created for.
[in]numBitstreamBuffersThe number of bitstream buffers containing compressed data for this picture.
[in]bitstreamsAn array of bitstream buffers.
[in]instanceIdThe ID of the engine instance. The following instances are supported if NVMEDIA_DECODER_INSTANCE_AUTO was used in NvMediaImageDecoderCreate API, else this parameter is ignored:
NvMediaStatus The completion status of the operation. Possible values are: