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 8 |
Minor Version number. More... | |
Enumerations | |
enum | NvMediaImageCodec { NVMEDIA_IMAGE_CODEC_H264 = 0, NVMEDIA_IMAGE_CODEC_HEVC = 8, NVMEDIA_IMAGE_CODEC_VP9 = 9 } |
Image codec type. More... | |
Functions | |
NvMediaStatus | NvMediaImageDecoderGetVersion (NvMediaVersion *version) |
Checks the version compatibility for the NvMedia Image decoder library. More... | |
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. More... | |
void | NvMediaImageDecoderUnRegisterPinnedSurfaces (const NvMediaImageDecoder *decoder) |
Unpin all the Pinned decode Surfaces used by decoder. 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... | |
NvMediaStatus | NvMediaImageDecoderGetBackwardUpdates (const NvMediaImageDecoder *decoder, void *backupdates) |
NvMediaImageDecoder get backward updates counters for VP9 adaptive entropy contexts. More... | |
#define NVMEDIA_IMAGEDEC_VERSION_MAJOR 2 |
Major Version number.
Definition at line 44 of file nvmedia_imgdec.h.
#define NVMEDIA_IMAGEDEC_VERSION_MINOR 8 |
Minor Version number.
Definition at line 46 of file nvmedia_imgdec.h.
enum NvMediaImageCodec |
Image codec type.
Enumerator | |
---|---|
NVMEDIA_IMAGE_CODEC_H264 | H.264 codec. |
NVMEDIA_IMAGE_CODEC_HEVC | H265 codec. |
NVMEDIA_IMAGE_CODEC_VP9 | VP9 codec. |
Definition at line 51 of file nvmedia_imgdec.h.
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] | device | A pointer to the device this video decoder will use. |
[in] | codec | Codec type. The following types are supported: |
[in] | width | Decoder width in luminance pixels. |
[in] | height | Decoder height in luminance pixels. |
[in] | maxReferences | The maximum number of reference frames used. This limits internal allocations. |
[in] | maxBitstreamSize | The maximum size for bitstream. This limits internal allocations. |
[in] | inputBuffering | How 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] | flags | Set the flags of the decoder. The following flags are supported: NVMEDIA_IMAGE_DECODER_ATTRIBUTE_PROGRESSIVE_SEQUENCE |
[in] | instanceId | The ID of the engine instance. The following instances are supported: NVMEDIA_DECODER_INSTANCE_0 NVMEDIA_DECODER_INSTANCE_1 NVMEDIA_DECODER_INSTANCE_AUTO |
void NvMediaImageDecoderDestroy | ( | const NvMediaImageDecoder * | decoder | ) |
Destroys a image decoder object.
[in] | decoder | The decoder to be destroyed. |
NvMediaStatus NvMediaImageDecoderGetBackwardUpdates | ( | const NvMediaImageDecoder * | decoder, |
void * | backupdates | ||
) |
NvMediaImageDecoder get backward updates counters for VP9 adaptive entropy contexts.
[in] | decoder | A pointer to the decoder object that performs the decoding operation. |
[in] | backupdates | A pointer to a structure that holds the backward update counters. |
NvMediaStatus NvMediaImageDecoderGetVersion | ( | NvMediaVersion * | version | ) |
Checks the version compatibility for the NvMedia Image decoder library.
[in] | version | A pointer to a NvMediaVersion structure of the client. |
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] | decoder | The decoder object that will perform the decode operation. |
[in] | target | The image surface to render to. |
[in] | pictureInfo | A (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] | numBitstreamBuffers | The number of bitstream buffers containing compressed data for this picture. |
[in] | bitstreams | An array of bitstream buffers. |
[in] | instanceId | The 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 |
void NvMediaImageDecoderUnRegisterPinnedSurfaces | ( | const NvMediaImageDecoder * | decoder | ) |
Unpin all the Pinned decode Surfaces used by decoder.
It is Mandatory for NvMedia Applications to call this API before Freeing Allocated Output Surfaces.
[in] | decoder | The decoder object that will perform the decode operation. |