NVIDIA DRIVE 5.0 Linux SDK API Reference

5.0.5.0 Release

 All Data Structures 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...
 

Modules

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

Macros

#define NVMEDIA_IMAGEDEC_VERSION_MAJOR   2
 Major Version number. More...
 
#define NVMEDIA_IMAGEDEC_VERSION_MINOR   0
 Minor Version number. More...
 

Enumerations

enum  NvMediaImageCodec {
  NVMEDIA_IMAGE_CODEC_H264 = 0,
  NVMEDIA_IMAGE_CODEC_HEVC = 8
}
 Image codec type. More...
 

Functions

NvMediaStatus NvMediaImageDecoderGetVersion (NvMediaVersion *version)
 Checks the version compatibility for the NvMedia Image decoder library. More...
 
NvMediaImageDecoderNvMediaImageDecoderCreate (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 (NvMediaImageDecoder *decoder)
 Destroys a image decoder object. More...
 
NvMediaStatus NvMediaImageDecoderRender (NvMediaImageDecoder *decoder, NvMediaImage *target, 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

#define NVMEDIA_IMAGEDEC_VERSION_MAJOR   2

Major Version number.

Definition at line 43 of file nvmedia_imgdec.h.

#define NVMEDIA_IMAGEDEC_VERSION_MINOR   0

Minor Version number.

Definition at line 45 of file nvmedia_imgdec.h.

Enumeration Type Documentation

Image codec type.

Enumerator
NVMEDIA_IMAGE_CODEC_H264 

H.264 codec.

NVMEDIA_IMAGE_CODEC_HEVC 

H265 codec.

Definition at line 50 of file nvmedia_imgdec.h.

Function Documentation

NvMediaImageDecoder* NvMediaImageDecoderCreate ( 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:

Parameters
[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:
NVMEDIA_IMAGE_DECODER_ATTRIBUTE_PROGRESSIVE_SEQUENCE
[in]instanceIdThe ID of the engine instance. The following instances are supported:
NVMEDIA_DECODER_INSTANCE_0
NVMEDIA_DECODER_INSTANCE_1
NVMEDIA_DECODER_INSTANCE_AUTO
Returns
NvMediaVideoDecoder The new video decoder's handle or NULL if unsuccessful.
void NvMediaImageDecoderDestroy ( NvMediaImageDecoder decoder)

Destroys a image decoder object.

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

Checks the version compatibility for the NvMedia Image decoder library.

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

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

Parameters
[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:
NVMEDIA_DECODER_INSTANCE_0
NVMEDIA_DECODER_INSTANCE_1
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER