The NvMediaIJPD object takes a JPEG bitstream and decompress it to image data.
6
Data Structures | |
struct | NVMEDIAJPEGDecAttributes |
Holds image JPEG decoder attributes. More... | |
struct | NvMediaJPEGAppMarkerInfo |
Holds image JPEG decoder marker Info. More... | |
struct | NVMEDIAJPEGDecInfo |
Holds image JPEG decoder stream information. More... | |
Macros | |
#define | NVMEDIA_IJPD_VERSION_MAJOR 1 |
Major version number. More... | |
#define | NVMEDIA_IJPD_VERSION_MINOR 0 |
Minor version number. More... | |
#define | NVMEDIA_IJPD_VERSION_PATCH 0 |
Patch version number. More... | |
#define | NVMEDIA_IJPD_MAX_PRENVSCISYNCFENCES (16U) |
Specifies the maximum number of times NvMediaIJPDInsertPreNvSciSyncFence() can be called before each call to NvMediaIJPDFeedFrame(). More... | |
#define | NVMEDIA_JPEG_DEC_ATTRIBUTE_ALPHA_VALUE |
JPEG decode set alpha. More... | |
#define | NVMEDIA_JPEG_DEC_ATTRIBUTE_COLOR_STANDARD |
JPEG decode set color standard. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_ROTATE_0 |
JPEG decode render flag rotate 0. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_ROTATE_90 |
JPEG decode render flag rotate 90. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_ROTATE_180 |
JPEG decode render flag rotate 180. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_ROTATE_270 |
JPEG decode render flag rotate 270. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_FLIP_HORIZONTAL |
JPEG decode render flag flip horizontal. More... | |
#define | NVMEDIA_IJPD_RENDER_FLAG_FLIP_VERTICAL |
JPEG decode render flag flip vertical. More... | |
#define | NVMEDIA_MAX_JPEG_APP_MARKERS |
JPEG decode max number of app markers supported. More... | |
Typedefs | |
typedef struct NvMediaIJPD | NvMediaIJPD |
An opaque NvMediaIJPD object created by NvMediaIJPDCreate. More... | |
Functions | |
NvMediaStatus | NvMediaIJPDGetVersion (NvMediaVersion *version) |
Retrieves the version information for the NvMedia IJPD library. More... | |
NvMediaIJPD * | NvMediaIJPDCreate (uint16_t maxWidth, uint16_t maxHeight, uint32_t maxBitstreamBytes, bool supportPartialAccel, NvMediaJPEGInstanceId instanceId) |
Creates a JPEG decoder object capable of decoding a JPEG stream into an image surface. More... | |
void | NvMediaIJPDDestroy (NvMediaIJPD *decoder) |
Destroys an NvMedia image JPEG decoder. More... | |
NvMediaStatus | NvMediaIJPDResize (NvMediaIJPD *decoder, uint16_t maxWidth, uint16_t maxHeight, uint32_t maxBitstreamBytes) |
Resizes an existing image JPEG decoder. More... | |
NvMediaStatus | NvMediaIJPDSetAttributes (const NvMediaIJPD *decoder, uint32_t attributeMask, const void *attributes) |
Sets attributes of an existing image JPEG decoder. More... | |
NvMediaStatus | NvMediaIJPDGetInfo (NVMEDIAJPEGDecInfo *info, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams) |
A helper function that determines whether the JPEG decoder HW engine can decode the input JPEG stream. More... | |
NvMediaStatus | NvMediaIJPDRender (const NvMediaIJPD *decoder, NvSciBufObj target, const NvMediaRect *srcRect, const NvMediaRect *dstRect, uint8_t downscaleLog2, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, uint32_t flags, NvMediaJPEGInstanceId instanceId) |
Decodes a JPEG image. More... | |
NvMediaStatus | NvMediaIJPDRenderYUV (const NvMediaIJPD *decoder, NvSciBufObj target, uint8_t downscaleLog2, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, uint32_t flags, NvMediaJPEGInstanceId instanceId) |
Decodes a JPEG image into YUV format. More... | |
NvMediaStatus | NvMediaIJPDRegisterNvSciBufObj (const NvMediaIJPD *decoder, NvSciBufObj bufObj) |
Registers NvSciBufObj for use with a NvMediaIJPD handle. More... | |
NvMediaStatus | NvMediaIJPDUnregisterNvSciBufObj (const NvMediaIJPD *decoder, NvSciBufObj bufObj) |
Un-registers NvSciBufObj which was previously registered with NvMediaIJPD using NvMediaIJPDRegisterNvSciBufObj(). More... | |
NvMediaStatus | NvMediaIJPDFillNvSciBufAttrList (NvMediaJPEGInstanceId instanceId, NvSciBufAttrList attrlist) |
Fills the NvMediaIJPD specific NvSciBuf attributes which than then be used to allocate an NvSciBufObj that NvMediaIJPD can consume. More... | |
NvMediaStatus | NvMediaIJPDFillNvSciSyncAttrList (const NvMediaIJPD *decoder, NvSciSyncAttrList attrlist, NvMediaNvSciSyncClientType clienttype) |
Fills the NvMediaIJPD specific NvSciSync attributes. More... | |
NvMediaStatus | NvMediaIJPDRegisterNvSciSyncObj (const NvMediaIJPD *decoder, NvMediaNvSciSyncObjType syncobjtype, NvSciSyncObj nvscisync) |
Registers an NvSciSyncObj with NvMediaIJPD. More... | |
NvMediaStatus | NvMediaIJPDUnregisterNvSciSyncObj (const NvMediaIJPD *decoder, NvSciSyncObj nvscisync) |
Unregisters an NvSciSyncObj with NvMediaIJPD. More... | |
NvMediaStatus | NvMediaIJPDSetNvSciSyncObjforEOF (const NvMediaIJPD *decoder, NvSciSyncObj nvscisyncEOF) |
Specifies the NvSciSyncObj to be used for an EOF NvSciSyncFence. More... | |
NvMediaStatus | NvMediaIJPDInsertPreNvSciSyncFence (const NvMediaIJPD *decoder, const NvSciSyncFence *prenvscisyncfence) |
Sets an NvSciSyncFence as a prefence for an NvMediaIJPDRender() NvSciSyncFence operation. More... | |
NvMediaStatus | NvMediaIJPDGetEOFNvSciSyncFence (const NvMediaIJPD *decoder, NvSciSyncObj eofnvscisyncobj, NvSciSyncFence *eofnvscisyncfence) |
Gets EOF NvSciSyncFence for an NvMediaIJPDRender() operation. More... | |
#define NVMEDIA_IJPD_MAX_PRENVSCISYNCFENCES (16U) |
Specifies the maximum number of times NvMediaIJPDInsertPreNvSciSyncFence() can be called before each call to NvMediaIJPDFeedFrame().
Definition at line 55 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_FLIP_HORIZONTAL |
JPEG decode render flag flip horizontal.
Definition at line 91 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_FLIP_VERTICAL |
JPEG decode render flag flip vertical.
Definition at line 96 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_0 |
JPEG decode render flag rotate 0.
Definition at line 71 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_180 |
JPEG decode render flag rotate 180.
Definition at line 81 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_270 |
JPEG decode render flag rotate 270.
Definition at line 86 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_90 |
JPEG decode render flag rotate 90.
Definition at line 76 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_VERSION_MAJOR 1 |
Major version number.
Definition at line 45 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_VERSION_MINOR 0 |
Minor version number.
Definition at line 47 of file nvmedia_ijpd.h.
#define NVMEDIA_IJPD_VERSION_PATCH 0 |
Patch version number.
Definition at line 49 of file nvmedia_ijpd.h.
#define NVMEDIA_JPEG_DEC_ATTRIBUTE_ALPHA_VALUE |
JPEG decode set alpha.
Definition at line 61 of file nvmedia_ijpd.h.
#define NVMEDIA_JPEG_DEC_ATTRIBUTE_COLOR_STANDARD |
JPEG decode set color standard.
Definition at line 66 of file nvmedia_ijpd.h.
#define NVMEDIA_MAX_JPEG_APP_MARKERS |
JPEG decode max number of app markers supported.
Definition at line 101 of file nvmedia_ijpd.h.
typedef struct NvMediaIJPD NvMediaIJPD |
An opaque NvMediaIJPD object created by NvMediaIJPDCreate.
Definition at line 174 of file nvmedia_ijpd.h.
Defines color standards.
Definition at line 105 of file nvmedia_ijpd.h.
NvMediaIJPD* NvMediaIJPDCreate | ( | uint16_t | maxWidth, |
uint16_t | maxHeight, | ||
uint32_t | maxBitstreamBytes, | ||
bool | supportPartialAccel, | ||
NvMediaJPEGInstanceId | instanceId | ||
) |
Creates a JPEG decoder object capable of decoding a JPEG stream into an image surface.
Usage considerations
[in] | maxWidth | The maximum width of output surface to support. you can use NvMediaIJPDResize() to enlarge this limit for an existing decoder. |
[in] | maxHeight | The maximum height of output surface to support. You can use NvMediaIJPDResize () to enlarge this limit for an existing decoder. |
[in] | maxBitstreamBytes | The maximum JPEG bitstream size in bytes to support. Use NvMediaIJPDResize () to enlarge this limit for an existing decoder. |
[in] | supportPartialAccel | Indicates that the JPEG decode object supports partial acceleration. If it does, set this argument to the character '1' (true). If it does not, set this argument to the character '0' (false). |
[in] | instanceId | The ID of the engine instance. The following instances are supported:
|
NvMediaIJPD | The new image JPEG decoder handle or NULL if unsuccessful. |
void NvMediaIJPDDestroy | ( | NvMediaIJPD * | decoder | ) |
Destroys an NvMedia image JPEG decoder.
Usage considerations
[in] | decoder | A pointer to the JPEG decoder to destroy. |
NvMediaStatus NvMediaIJPDFillNvSciBufAttrList | ( | NvMediaJPEGInstanceId | instanceId, |
NvSciBufAttrList | attrlist | ||
) |
Fills the NvMediaIJPD specific NvSciBuf attributes which than then be used to allocate an NvSciBufObj that NvMediaIJPD can consume.
This function updates the input NvSciBufAttrList with values equivalent to the following public attribute key-values: NvSciBufGeneralAttrKey_PeerHwEngineArray set to
This function assumes that attrlist is a valid NvSciBufAttrList created by the caller by a call to NvSciBufAttrListCreate.
Usage considerations
[in] | instanceId | The ID of the engine instance. Input range: The following instances are supported:
|
[out] | attrlist | An NvSciBufAttrList where NvMediaIJPD places the NvSciBuf attributes. |
NvMediaStatus NvMediaIJPDFillNvSciSyncAttrList | ( | const NvMediaIJPD * | decoder, |
NvSciSyncAttrList | attrlist, | ||
NvMediaNvSciSyncClientType | clienttype | ||
) |
Fills the NvMediaIJPD specific NvSciSync attributes.
This function assumes that attrlist is a valid NvSciSyncAttrList.
This function updates the input NvSciSyncAttrList with values equivalent to the following public attribute key-values: NvSciSyncAttrKey_RequiredPerm set to
The application must not set these attributes in the NvSciSyncAttrList passed as an input to this function.
Usage considerations
[in] | decoder | A pointer to the NvMediaIJPD object. Input range: Non-NULL - valid pointer address |
[out] | attrlist | A pointer to an NvSciSyncAttrList structure where NvMedia places NvSciSync attributes. |
[in] | clienttype | Indicates whether the NvSciSyncAttrList requested for an NvMediaIJPD signaler or an NvMediaIJPD waiter. Input range: Entries in NvMediaNvSciSyncClientType enumeration |
NvMediaStatus NvMediaIJPDGetEOFNvSciSyncFence | ( | const NvMediaIJPD * | decoder, |
NvSciSyncObj | eofnvscisyncobj, | ||
NvSciSyncFence * | eofnvscisyncfence | ||
) |
Gets EOF NvSciSyncFence for an NvMediaIJPDRender() operation.
The EOF NvSciSyncFence associated with an NvMediaIJPDRender() operation is an NvSciSyncFence. Its expiry indicates that the corresponding NvMediaIJPDRender() operation has finished.
This function returns the EOF NvSciSyncFence associated with the last NvMediaIJPDRender() call. NvMediaIJPDGetEOFNvSciSyncFence() must be called after an NvMediaIJPDRender() call.
For example, in this sequence of code:
expiry of eofnvscisyncfence indicates that the preceding NvMediaIJPDRender() operation has finished.
Usage considerations
[in] | decoder | A pointer to the NvMediaIJPD object. Input range: Non-NULL - valid pointer address |
[in] | eofnvscisyncobj | An EOF NvSciSyncObj associated with the NvSciSyncFence which is being requested. Input range: A valid NvSciSyncObj |
[out] | eofnvscisyncfence | A pointer to the EOF NvSciSyncFence. |
NvMediaStatus NvMediaIJPDGetInfo | ( | NVMEDIAJPEGDecInfo * | info, |
uint32_t | numBitstreamBuffers, | ||
const NvMediaBitstreamBuffer * | bitstreams | ||
) |
A helper function that determines whether the JPEG decoder HW engine can decode the input JPEG stream.
Possible outcomes are:
NvMediaIJPDCreate
() supportPartialAccel parameter.
Usage considerations
[in,out] | info | A pointer to the information to be filled. |
[in] | numBitstreamBuffers | The number of bitstream buffers. |
[in] | bitstreams | The bitstream buffer. |
NvMediaStatus NvMediaIJPDGetVersion | ( | NvMediaVersion * | version | ) |
Retrieves the version information for the NvMedia IJPD library.
Usage considerations
[in] | version | A pointer to a NvMediaVersion structure of the client. |
Possible values are:
NvMediaStatus NvMediaIJPDInsertPreNvSciSyncFence | ( | const NvMediaIJPD * | decoder, |
const NvSciSyncFence * | prenvscisyncfence | ||
) |
Sets an NvSciSyncFence as a prefence for an NvMediaIJPDRender() NvSciSyncFence operation.
You must call NvMediaIJPDInsertPreNvSciSyncFence() before you call NvMediaIJPDRender(). The NvMediaIJPDRender() operation is started only after the expiry of the prenvscisyncfence.
For example, in this sequence of code:
the NvMediaIJPDRender() operation is assured to start only after the expiry of prenvscisyncfence.
You can set a maximum of NVMEDIA_IJPD_MAX_PRENVSCISYNCFENCES prefences by calling NvMediaIJPDInsertPreNvSciSyncFence() before NvMediaIJPDRender(). After the call to NvMediaIJPDRender(), all NvSciSyncFences previously inserted by NvMediaIJPDInsertPreNvSciSyncFence() are removed, and they are not reused for the subsequent NvMediaIJPDRender() calls.
Usage considerations
[in] | decoder | A pointer to the NvMediaIJPD object. Input range: Non-NULL - valid pointer address |
[in] | prenvscisyncfence | A pointer to NvSciSyncFence. Input range: Non-NULL - valid pointer address |
NvMediaStatus NvMediaIJPDRegisterNvSciBufObj | ( | const NvMediaIJPD * | decoder, |
NvSciBufObj | bufObj | ||
) |
Registers NvSciBufObj for use with a NvMediaIJPD handle.
NvMediaIJPD handle maintains a record of all the objects registered using this API and only the registered NvSciBufObj handles are accepted when submitted for decoding via NvMediaIJPDRender. Even duplicated NvSciBufObj objects need to be registered using this API prior.
This needs to be used in tandem with NvMediaIJPDUnregisterNvSciBufObj(). The pair of APIs for registering and unregistering NvSciBufObj are optional, but it is highly recommended to use them as they ensure deterministic execution of NvMediaIJPDRender().
To ensure deterministic execution time of NvMediaIJPDRender API:
Registration of the buffer (output) is always with read-write permissions.
Maximum of 32 NvSciBufObj handles can be registered.
Usage considerations
[in] | decoder | A pointer to the NvMediaIJPD object. Input range: Non-NULL - valid pointer address |
[in] | bufObj | NvSciBufObj object Input range: A valid NvSciBufObj |
NvMediaStatus NvMediaIJPDRegisterNvSciSyncObj | ( | const NvMediaIJPD * | decoder, |
NvMediaNvSciSyncObjType | syncobjtype, | ||
NvSciSyncObj | nvscisync | ||
) |
Registers an NvSciSyncObj with NvMediaIJPD.
Every NvSciSyncObj (even duplicate objects) used by NvMediaIJPD must be registered by a call to this function before it is used. Only the exact same registered NvSciSyncObj can be passed to NvMediaIJPDSetNvSciSyncObjforEOF(), NvMediaIJPDGetEOFNvSciSyncFence(), or NvMediaIJPDUnregisterNvSciSyncObj().
For a given NvMediaIJPD handle, one NvSciSyncObj can be registered as one NvMediaNvSciSyncObjType only. For each NvMediaNvSciSyncObjType, a maximum of 16 NvSciSyncObjs can be registered.
Usage considerations
[in] | decoder | A pointer to the NvMediaIJPD object. Input range: Non-NULL - valid pointer address |
[in] | syncobjtype | Determines how nvscisync is used by decoder. Input range: Entries in NvMediaNvSciSyncObjType enumeration |
[in] | nvscisync | The NvSciSyncObj to be registered with decoder. Input range: A valid NvSciSyncObj |
NvMediaStatus NvMediaIJPDRender | ( | const NvMediaIJPD * | decoder, |
NvSciBufObj | target, | ||
const NvMediaRect * | srcRect, | ||
const NvMediaRect * | dstRect, | ||
uint8_t | downscaleLog2, | ||
uint32_t | numBitstreamBuffers, | ||
const NvMediaBitstreamBuffer * | bitstreams, | ||
uint32_t | flags, | ||
NvMediaJPEGInstanceId | instanceId | ||
) |
Decodes a JPEG image.
The decode pipeline produces a result equivalent to the following sequence:
Downscales the 8x8 block padded image by the downscaleLog2 factor. That is, a "width" by "height" JPEG is downscaled to:
((width + 7) & ~7) >> downscaleLog2
by
((height + 7) & ~7) >> downscaleLog2
The JPEG decoder object must have maxWidth and maxHeight values that are greater than or equal to the post-downscale JPEG image. Additionally, it must have a maxBitstreamBytes value that is greater than or equal to the total number of bytes in the bitstream buffers. You set these values when you create the JPEG decoder object with NvMediaIJPDCreate(). Alternatively, you can user NvMediaIJPDResize() to change the dimensions of an existing JPEG decoder object.
If the JPEG decoder object has inadequate dimensions, NvMediaIJPDRender
() returns NVMEDIA_STATUS_INSUFFICIENT_BUFFERING.
If the JPEG stream requires partial acceleration, created the JPEG decoder object with supportPartialAccel set to '1'. Otherwise, the function returns NVMEDIA_STATUS_BAD_PARAMETER.
Use NvMediaIJPDGetInfo() to determine whether a stream requires paritialAccel.
If the JPEG stream is not supported, the function returns NVMEDIA_STATUS_NOT_SUPPORTED.
Use NvMediaIJPDGetInfo
() to determine whether a stream is unsupported.
NvMediaIJPDRender
() with the NVJPG 1.0 codec does not support rotation.
Usage considerations
[in] | decoder | A pointer to the JPEG decoder to use. |
[out] | target | NvSciBufObj that contains the decoded content, allocated with a call to NvSciBufObjAlloc. Supported surface format attributes: Buffer Type: NvSciBufType_Image Surface Type: RGBA Bit Depth: 8 Layout: NvSciBufImage_PitchLinearType Scan Type: NvSciBufScan_ProgressiveType Plane base address alignment: 256 |
[in] | srcRect | The source rectangle. The rectangle from the post-downscaled image to be transformed and scaled to the dstRect. You can achieve horizontal and/or vertical mirroring by swapping the left-right and/or top-bottom coordinates. If NULL, the full post-downscaled surface is implied. |
[in] | dstRect | The destination rectangle on the output surface. If NULL, a rectangle the full size of the output surface is implied. |
[in] | downscaleLog2 | A value clamped between 0 and 3 inclusive, gives downscale factors of 1 to 8. |
[in] | numBitstreamBuffers | The number of bitstream buffers. |
[in] | bitstreams | The bitstream buffer. NvMediaIJPDRender () copies the data out of these buffers so the caller is free to reuse them as soon as NvMediaIJPDRender () returns. |
[in] | flags | Flags that specify a clockwise rotation of the source in degrees and horizontal and vertical flipping. If both are specified, the image is flipped before it is rotated. You can set the flags argument to any one of the following:
|
[in] | instanceId | The ID of the engine instance. The following instances are supported:
|
NvMediaStatus NvMediaIJPDRenderYUV | ( | const NvMediaIJPD * | decoder, |
NvSciBufObj | target, | ||
uint8_t | downscaleLog2, | ||
uint32_t | numBitstreamBuffers, | ||
const NvMediaBitstreamBuffer * | bitstreams, | ||
uint32_t | flags, | ||
NvMediaJPEGInstanceId | instanceId | ||
) |
Decodes a JPEG image into YUV format.
This function is similar to NvMediaIJPDRender() except that the output surface is in YUV format, not RGBA format. Also, clipping and scaling (other than downscaleLog2 scaling) are not supported, so there are no source or destination rectangle parameters.
NvMediaIJPDRenderYUV
() with the NVJPG 1.0 codec has the following limitations:
Usage considerations
[in] | decoder | A pointer to the JPEG decoder to use. |
[out] | target | NvSciBufObj that contains the decoded content, allocated with a call to NvSciBufObjAlloc. Supported surface format attributes: Buffer Type: NvSciBufType_Image Sub-sampling type: YUV420, YUV422, YUV444 (planar and semi-planar) Bit Depth: 8 Layout: NvSciBufImage_PitchLinearType Scan Type: NvSciBufScan_ProgressiveType Plane base address alignment: 256 |
[in] | downscaleLog2 | A value between 0 and 3 inclusive that gives downscale factors of 1 to 8. |
[in] | numBitstreamBuffers | The number of bitstream buffers. |
[in] | bitstreams | The bitstream buffer. NvMediaIJPDRenderYUV () copies the data out of these buffers so the caller is free to reuse them as soon as NvMediaIJPDRenderYUV () returns. |
[in] | flags | Flags that specify a clockwise rotation of the source in degrees and horizontal and vertical flipping. If both are specified, flipping is performed before rotating. You can set the flags argument to any one of the following:
|
[in] | instanceId | The ID of the engine instance. The following instances are supported:
|
NvMediaStatus NvMediaIJPDResize | ( | NvMediaIJPD * | decoder, |
uint16_t | maxWidth, | ||
uint16_t | maxHeight, | ||
uint32_t | maxBitstreamBytes | ||
) |
Resizes an existing image JPEG decoder.
Usage considerations
[in] | decoder | A pointer to the JPEG decoder to use. |
[in] | maxWidth | The new maximum width of output surface to support. |
[in] | maxHeight | The new maximum height of output surface to support. |
[in] | maxBitstreamBytes | The new maximum JPEG bitstream size in bytes to support. |
NvMediaStatus NvMediaIJPDSetAttributes | ( | const NvMediaIJPD * | decoder, |
uint32_t | attributeMask, | ||
const void * | attributes | ||
) |
Sets attributes of an existing image JPEG decoder.
Usage considerations
[in] | decoder | A pointer to the JPEG decoder to use. |
[in] | attributeMask | An attribute mask. Supported mask are: |
[in] | attributes | Attributes data. Supported attribute structures: |
NvMediaStatus NvMediaIJPDSetNvSciSyncObjforEOF | ( | const NvMediaIJPD * | decoder, |
NvSciSyncObj | nvscisyncEOF | ||
) |
Specifies the NvSciSyncObj to be used for an EOF NvSciSyncFence.
To use NvMediaIJPDGetEOFNvSciSyncFence(), the application must call NvMediaIJPDSetNvSciSyncObjforEOF() before it calls NvMediaIJPDRender().
NvMediaIJPDSetNvSciSyncObjforEOF() currently may be called only once before each call to NvMediaIJPDRender(). The application may choose to call this function only once before the first call to NvMediaIJPDRender().
Usage considerations
[in] | decoder | A pointer to the NvMediaIJPD object. Input range: Non-NULL - valid pointer address |
[in] | nvscisyncEOF | A registered NvSciSyncObj which is to be associated with EOF NvSciSyncFence. Input range: A valid NvSciSyncObj |
NvMediaStatus NvMediaIJPDUnregisterNvSciBufObj | ( | const NvMediaIJPD * | decoder, |
NvSciBufObj | bufObj | ||
) |
Un-registers NvSciBufObj which was previously registered with NvMediaIJPD using NvMediaIJPDRegisterNvSciBufObj().
For all NvSciBufObj handles registered with NvMediaIJPD using NvMediaIJPDRegisterNvSciBufObj API, NvMediaIJPDUnregisterNvSciBufObj must be called before calling NvMediaIJPDDestroy API. For unregistration to succeed, it should be ensured that none of the submitted tasks on the bufObj are pending prior to calling NvMediaIJPDUnregisterNvSciBufObj(). In order to ensure this, NvMediaIJPDUnregisterNvSciSyncObj() should be called prior to this API on all registered NvSciSyncObj. Post this NvMediaIJPDUnregisterNvSciBufObj() can be successfully called on a valid NvSciBufObj.
This needs to be used in tandem with NvMediaIJPDRegisterNvSciBufObj(). The pair of APIs for registering and unregistering NvSciBufObj are optional, but it is highly recommended to use them as they ensure deterministic execution of NvMediaIJPDRender().
To ensure deterministic execution time of NvMediaIJPDRender API:
Usage considerations
[in] | decoder | A pointer to the NvMediaIJPD object. Input range: Non-NULL - valid pointer address |
[in] | bufObj | NvSciBufObj object Input range: A valid NvSciBufObj |
NvMediaStatus NvMediaIJPDUnregisterNvSciSyncObj | ( | const NvMediaIJPD * | decoder, |
NvSciSyncObj | nvscisync | ||
) |
Unregisters an NvSciSyncObj with NvMediaIJPD.
Every NvSciSyncObj registered with NvMediaIJPD by NvMediaIJPDRegisterNvSciSyncObj() must be unregistered before calling NvMediaIJPDUnregisterNvSciBufObj() to unregister the NvSciBufObjs.
Before the application calls this function, it must ensure that any NvMediaIJPDRender() operation that uses the NvSciSyncObj has completed. If this function is called while NvSciSyncObj is still in use by any NvMediaIJPDRender() operation, the API returns NVMEDIA_STATUS_PENDING to indicate the same. NvSciSyncFenceWait() API can be called on the EOF NvSciSyncFence obtained post the last call to NvMediaIJPDRender() to wait for the associated tasks to complete. The EOF NvSciSyncFence would have been previously obtained via a call to NvMediaIJPDGetEOFNvSciSyncFence(). The other option would be to call NvMediaIJPDGetBits() till there is no more output to retrieve.
Usage considerations
[in] | decoder | A pointer to the NvMediaIJPD object. Input range: Non-NULL - valid pointer address |
[in] | nvscisync | An NvSciSyncObj to be unregistered with decoder. Input range: A valid NvSciSyncObj |