The NvMediaIJPE object takes uncompressed image data and turns it into a jpeg bitstream.
6
Data Structures | |
struct | NvMediaJPHuffmanTableSpecfication |
image JPEG encoder HuffmanTable. More... | |
struct | NvMediaJPEncAttributes |
image JPEG encoder attributes. More... | |
Macros | |
#define | NVMEDIA_IJPE_VERSION_MAJOR 2 |
Major Version number. More... | |
#define | NVMEDIA_IJPE_VERSION_MINOR 0 |
Minor Version number. More... | |
#define | NVMEDIA_IJPE_VERSION_PATCH 0 |
Patch Version number. More... | |
#define | NVMEDIA_IJPE_MAX_PRENVSCISYNCFENCES (16U) |
Specifies the maximum number of times NvMediaIJPEInsertPreNvSciSyncFence() can be called before each call to NvMediaIJPEFeedFrame(). More... | |
#define | NVMEDIA_JPEG_ENC_FLAG_NONE |
JPEG encoder flag empty. More... | |
#define | NVMEDIA_JPEG_ENC_FLAG_SKIP_SOI |
JPEG encoder flag to skip SOI marker. More... | |
#define | NVMEDIA_IMAGE_JPEG_ATTRIBUTE_QUALITY |
Quality. More... | |
#define | NVMEDIA_IMAGE_JPEG_ATTRIBUTE_RESTARTINTERVAL |
Restart interval. More... | |
#define | NVMEDIA_IMAGE_JPEG_ATTRIBUTE_TARGETSIZE |
encode frame target size More... | |
#define | NVMEDIA_IMAGE_JPEG_ATTRIBUTE_QUANTTABLE |
Luma/Chroma quant table. More... | |
#define | NVMEDIA_IMAGE_JPEG_ATTRIBUTE_HUFFTABLE |
Huffmann table. More... | |
Typedefs | |
typedef struct NvMediaIJPE | NvMediaIJPE |
An opaque NvMediaIJPE object created by NvMediaIJPECreate. More... | |
Functions | |
NvMediaStatus | NvMediaIJPEGetVersion (NvMediaVersion *version) |
Retrieves the version information for the NvMedia IJPE library. More... | |
NvMediaIJPE * | NvMediaIJPECreate (NvSciBufAttrList bufAttrList, uint8_t maxOutputBuffering, uint32_t maxBitstreamBytes, NvMediaJPEGInstanceId instanceId) |
Creates a JPEG encoder object capable of turning a stream of surfaces of the inputFormat into a JPEG stream. More... | |
NvMediaIJPE * | NvMediaIJPECreateEx (uint8_t maxOutputBuffering, uint32_t maxBitstreamBytes, NvMediaJPEGInstanceId instanceId) |
Creates a JPEG encoder object capable of turning a stream of surfaces of the inputFormat into a JPEG stream. More... | |
void | NvMediaIJPEDestroy (NvMediaIJPE *encoder) |
Destroys an NvMedia image JPEG encoder. More... | |
NvMediaStatus | NvMediaIJPEFeedFrame (const NvMediaIJPE *encoder, NvSciBufObj bufObj, uint8_t quality, NvMediaJPEGInstanceId instanceId) |
Encodes the specified bufObj with input quality. More... | |
NvMediaStatus | NvMediaIJPEFeedFrameQuant (const NvMediaIJPE *encoder, NvSciBufObj bufObj, uint8_t *lumaQuant, uint8_t *chromaQuant, NvMediaJPEGInstanceId instanceId) |
Encodes the specified bufObj with input Luma and Chroma quant tables. More... | |
NvMediaStatus | NvMediaIJPEFeedFrameRateControl (const NvMediaIJPE *encoder, NvSciBufObj bufObj, uint8_t *lumaQuant, uint8_t *chromaQuant, uint32_t targetImageSize, NvMediaJPEGInstanceId instanceId) |
Encodes the specified bufObj with input Luma and Chroma quant tables and targetImageSize. More... | |
NvMediaStatus | NvMediaIJPESetAttributes (const NvMediaIJPE *encoder, uint32_t attributeMask, const void *attributes) |
Sets the JPEG encoder attributes. More... | |
NvMediaStatus | NvMediaIJPEGetBits (const NvMediaIJPE *encoder, uint32_t *numBytes, void *buffer, uint32_t flags) |
Returns a frame's worth of bitstream into the provided buffer. More... | |
NvMediaStatus | NvMediaIJPEBitsAvailable (const NvMediaIJPE *encoder, uint32_t *numBytesAvailable, NvMediaBlockingType blockingType, uint32_t millisecondTimeout) |
Returns the encode status and number of bytes available for the next frame (if any). More... | |
NvMediaStatus | NvMediaIJPERegisterNvSciBufObj (const NvMediaIJPE *encoder, NvSciBufObj bufObj) |
Registers NvSciBufObj for use with a NvMediaIJPE handle. More... | |
NvMediaStatus | NvMediaIJPEUnregisterNvSciBufObj (const NvMediaIJPE *encoder, NvSciBufObj bufObj) |
Un-registers NvSciBufObj which was previously registered with NvMediaIJPE using NvMediaIJPERegisterNvSciBufObj(). More... | |
NvMediaStatus | NvMediaIJPEFillNvSciBufAttrList (NvMediaJPEGInstanceId instanceId, NvSciBufAttrList attrlist) |
Fills the NvMediaIJPE specific NvSciBuf attributes which than then be used to allocate an NvSciBufObj that NvMediaIJPE can consume. More... | |
NvMediaStatus | NvMediaIJPEFillNvSciSyncAttrList (const NvMediaIJPE *encoder, NvSciSyncAttrList attrlist, NvMediaNvSciSyncClientType clienttype) |
Fills the NvMediaIJPE specific NvSciSync attributes. More... | |
NvMediaStatus | NvMediaIJPERegisterNvSciSyncObj (const NvMediaIJPE *encoder, NvMediaNvSciSyncObjType syncobjtype, NvSciSyncObj nvscisync) |
Registers an NvSciSyncObj with NvMediaIJPE. More... | |
NvMediaStatus | NvMediaIJPEUnregisterNvSciSyncObj (const NvMediaIJPE *encoder, NvSciSyncObj nvscisync) |
Unregisters an NvSciSyncObj with NvMediaIJPE. More... | |
NvMediaStatus | NvMediaIJPESetNvSciSyncObjforEOF (const NvMediaIJPE *encoder, NvSciSyncObj nvscisyncEOF) |
Specifies the NvSciSyncObj to be used for an EOF NvSciSyncFence. More... | |
NvMediaStatus | NvMediaIJPEInsertPreNvSciSyncFence (const NvMediaIJPE *encoder, const NvSciSyncFence *prenvscisyncfence) |
Sets an NvSciSyncFence as a prefence for an NvMediaIJPEFeedFrame() NvSciSyncFence operation. More... | |
NvMediaStatus | NvMediaIJPEGetEOFNvSciSyncFence (const NvMediaIJPE *encoder, NvSciSyncObj eofnvscisyncobj, NvSciSyncFence *eofnvscisyncfence) |
Gets EOF NvSciSyncFence for an NvMediaIJPEFeedFrame() operation. More... | |
#define NVMEDIA_IJPE_MAX_PRENVSCISYNCFENCES (16U) |
Specifies the maximum number of times NvMediaIJPEInsertPreNvSciSyncFence() can be called before each call to NvMediaIJPEFeedFrame().
Definition at line 56 of file nvmedia_ijpe.h.
#define NVMEDIA_IJPE_VERSION_MAJOR 2 |
Major Version number.
Definition at line 46 of file nvmedia_ijpe.h.
#define NVMEDIA_IJPE_VERSION_MINOR 0 |
Minor Version number.
Definition at line 48 of file nvmedia_ijpe.h.
#define NVMEDIA_IJPE_VERSION_PATCH 0 |
Patch Version number.
Definition at line 50 of file nvmedia_ijpe.h.
#define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_HUFFTABLE |
Huffmann table.
Definition at line 95 of file nvmedia_ijpe.h.
#define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_QUALITY |
Quality.
Definition at line 75 of file nvmedia_ijpe.h.
#define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_QUANTTABLE |
Luma/Chroma quant table.
Definition at line 90 of file nvmedia_ijpe.h.
#define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_RESTARTINTERVAL |
Restart interval.
Definition at line 80 of file nvmedia_ijpe.h.
#define NVMEDIA_IMAGE_JPEG_ATTRIBUTE_TARGETSIZE |
encode frame target size
Definition at line 85 of file nvmedia_ijpe.h.
#define NVMEDIA_JPEG_ENC_FLAG_NONE |
JPEG encoder flag empty.
Definition at line 62 of file nvmedia_ijpe.h.
#define NVMEDIA_JPEG_ENC_FLAG_SKIP_SOI |
JPEG encoder flag to skip SOI marker.
Normally, app inserts EXIF data in jpeg image which occurs after SOI marker. This flag be used to skip SOI marker insertion.
Definition at line 69 of file nvmedia_ijpe.h.
typedef struct NvMediaIJPE NvMediaIJPE |
An opaque NvMediaIJPE object created by NvMediaIJPECreate.
Definition at line 160 of file nvmedia_ijpe.h.
NvMediaStatus NvMediaIJPEBitsAvailable | ( | const NvMediaIJPE * | encoder, |
uint32_t * | numBytesAvailable, | ||
NvMediaBlockingType | blockingType, | ||
uint32_t | millisecondTimeout | ||
) |
Returns the encode status and number of bytes available for the next frame (if any).
The specific behavior depends on the specified blockingType. It is safe to call this function from a separate thread.
Usage considerations
[in] | encoder | The encoder to use. |
[in] | numBytesAvailable | The number of bytes available in the next encoded frame. This is valid only when the return value is NVMEDIA_STATUS_OK. |
[in] | blockingType | The following are the supported blocking types:
|
[in] | millisecondTimeout | Timeout in milliseconds or NVMEDIA_VIDEO_ENCODER_TIMEOUT_INFINITE if a timeout is not desired. |
NvMediaIJPE* NvMediaIJPECreate | ( | NvSciBufAttrList | bufAttrList, |
uint8_t | maxOutputBuffering, | ||
uint32_t | maxBitstreamBytes, | ||
NvMediaJPEGInstanceId | instanceId | ||
) |
Creates a JPEG encoder object capable of turning a stream of surfaces of the inputFormat into a JPEG stream.
Surfaces are fed to the encoder with NvMediaIJPEFeedFrame() and bitstream buffers are retrieved with NvMediaIJPEGetBits().
Usage considerations
[in] | bufAttrList | NvSciBufAttrList that contains reconciled attributes that characterizes the input surface that needs to be encoded Input range: An NvSciBufObjGetAttrList called with a valid NvSciBufObj that will contain the input content Supported surface format attributes: Buffer Type: NvSciBufType_Image Layout: NvSciBufImage_PitchLinearType Scan Type: NvSciBufScan_ProgressiveType Plane base address alignment: 256 Sub-sampling type: YUV420 (planar/semi-planar) Bit Depth: 8 |
[in] | maxOutputBuffering | This determines how many frames of encoded bitstream can be held by the NvMediaIJPE object before it must be retrieved using NvMediaIJPEGetBits(). If maxOutputBuffering frames worth of encoded bitstream are yet unretrieved by NvMediaIJPEGetBits (), then NvMediaIJPEFeedFrame() returns NVMEDIA_STATUS_INSUFFICIENT_BUFFERING. One or more frames must be retrieved with NvMediaIJPEGetBits () before frame feeding can continue. Input range: The values between 1 and 16, in increments of 1 |
[in] | maxBitstreamBytes | Determines the maximum bytes that JPEG encoder can produce for each feed frame. |
[in] | instanceId | The ID of the engine instance. Input range: The following instances are supported:
|
NvMediaIJPE | The new image JPEG encoder device's handle or NULL if unsuccessful. |
NvMediaIJPE* NvMediaIJPECreateEx | ( | uint8_t | maxOutputBuffering, |
uint32_t | maxBitstreamBytes, | ||
NvMediaJPEGInstanceId | instanceId | ||
) |
Creates a JPEG encoder object capable of turning a stream of surfaces of the inputFormat into a JPEG stream.
Surfaces are fed to the encoder with NvMediaIJPEFeedFrame() and bitstream buffers are retrieved with NvMediaIJPEGetBits().
Usage considerations
[in] | maxOutputBuffering | This determines how many frames of encoded bitstream can be held by the NvMediaIJPE object before it must be retrieved using NvMediaIJPEGetBits(). If maxOutputBuffering frames worth of encoded bitstream are yet unretrieved by NvMediaIJPEGetBits (), then NvMediaIJPEFeedFrame() returns NVMEDIA_STATUS_INSUFFICIENT_BUFFERING. One or more frames must be retrieved with NvMediaIJPEGetBits () before frame feeding can continue. Input range: The values between 1 and 16, in increments of 1 |
[in] | maxBitstreamBytes | Determines the maximum bytes that JPEG encoder can produce for each feed frame. |
[in] | instanceId | The ID of the engine instance. Input range: The following instances are supported:
|
NvMediaIJPE | The new image JPEG encoder device's handle or NULL if unsuccessful. |
void NvMediaIJPEDestroy | ( | NvMediaIJPE * | encoder | ) |
Destroys an NvMedia image JPEG encoder.
Usage considerations
[in] | encoder | The JPEG encoder to destroy. |
NvMediaStatus NvMediaIJPEFeedFrame | ( | const NvMediaIJPE * | encoder, |
NvSciBufObj | bufObj, | ||
uint8_t | quality, | ||
NvMediaJPEGInstanceId | instanceId | ||
) |
Encodes the specified bufObj with input quality.
Usage considerations
[in] | encoder | The encoder to use. Input range: Non-NULL - valid pointer address |
[in] | bufObj | Input bufObj that contains the input content that needs to be encoded, allocated with a call to NvSciBufObjAlloc. The characteristics of the allocated NvSciBufObj should be equivalent to the bufAttrList passed in NvMediaIJPECreate. There is no limit on the size of this surface. Input range: A valid NvSciBufObj |
[in] | quality | This specifies the encode quality. JPEG encode will generate quant tables for luma and chroma according to the quality value Input range: The values between 1 and 100, in increments of 1 |
[in] | instanceId | The ID of the engine instance. Input range: The following instances are supported:
|
NvMediaStatus NvMediaIJPEFeedFrameQuant | ( | const NvMediaIJPE * | encoder, |
NvSciBufObj | bufObj, | ||
uint8_t * | lumaQuant, | ||
uint8_t * | chromaQuant, | ||
NvMediaJPEGInstanceId | instanceId | ||
) |
Encodes the specified bufObj with input Luma and Chroma quant tables.
Usage considerations
[in] | encoder | The encoder to use. Input range: Non-NULL - valid pointer address |
[in] | bufObj | Input bufObj that contains the input content that needs to be encoded, allocated with a call to NvSciBufObjAlloc. The characteristics of the allocated NvSciBufObj should be equivalent to the bufAttrList passed in NvMediaIJPECreate. There is no limit on the size of this surface. Input range: A valid NvSciBufObj |
[in] | lumaQuant | This specifies Luma quant table used for encode Input range: Non-NULL - valid pointer address |
[in] | chromaQuant | This specifies Chroma quant table used for encode Input range: Non-NULL - valid pointer address |
[in] | instanceId | The ID of the engine instance. Input range: The following instances are supported:
|
NvMediaStatus NvMediaIJPEFeedFrameRateControl | ( | const NvMediaIJPE * | encoder, |
NvSciBufObj | bufObj, | ||
uint8_t * | lumaQuant, | ||
uint8_t * | chromaQuant, | ||
uint32_t | targetImageSize, | ||
NvMediaJPEGInstanceId | instanceId | ||
) |
Encodes the specified bufObj with input Luma and Chroma quant tables and targetImageSize.
Usage considerations
[in] | encoder | The encoder to use. Input range: Non-NULL - valid pointer address |
[in] | bufObj | Input bufObj that contains the input content that needs to be encoded, allocated with a call to NvSciBufObjAlloc. The characteristics of the allocated NvSciBufObj should be equivalent to the bufAttrList passed in NvMediaIJPECreate. There is no limit on the size of this surface. Input range: A valid NvSciBufObj |
[in] | lumaQuant | This specifies Luma quant table used for encode Input range: Non-NULL - valid pointer address |
[in] | chromaQuant | This specifies Chroma quant table used for encode Input range: Non-NULL - valid pointer address |
[in] | targetImageSize | This specifies target image size in bytes Input range: Non-NULL - valid pointer address |
[in] | instanceId | The ID of the engine instance. Input range: The following instances are supported:
|
NvMediaStatus NvMediaIJPEFillNvSciBufAttrList | ( | NvMediaJPEGInstanceId | instanceId, |
NvSciBufAttrList | attrlist | ||
) |
Fills the NvMediaIJPE specific NvSciBuf attributes which than then be used to allocate an NvSciBufObj that NvMediaIJPE 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 | A pointer to an NvSciBufAttrList structure where NvMediaIJPE places the NvSciBuf attributes. |
NvMediaStatus NvMediaIJPEFillNvSciSyncAttrList | ( | const NvMediaIJPE * | encoder, |
NvSciSyncAttrList | attrlist, | ||
NvMediaNvSciSyncClientType | clienttype | ||
) |
Fills the NvMediaIJPE 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] | encoder | A pointer to the NvMediaIJPE 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 NvMediaIJPE signaler or an NvMediaIJPE waiter. Input range: Entries in NvMediaNvSciSyncClientType enumeration |
NvMediaStatus NvMediaIJPEGetBits | ( | const NvMediaIJPE * | encoder, |
uint32_t * | numBytes, | ||
void * | buffer, | ||
uint32_t | flags | ||
) |
Returns a frame's worth of bitstream into the provided buffer.
numBytes returns the size of this bitstream. It is safe to call this function from a separate thread. The return value and behavior is the same as that of NvMediaIJPEBitsAvailable() when called with NVMEDIA_ENCODE_BLOCKING_TYPE_NEVER except that when NVMEDIA_STATUS_OK is returned, the buffer will be filled in addition to the numBytes.
Before calling this function:
Usage considerations
[in] | encoder | The encoder to use. |
[out] | numBytes | Returns the size of the filled bitstream. |
[in,out] | buffer | The buffer to be filled with the encoded data. If buffer is NULL, this function returns without copying the encoded bitstream. |
[in] | flags | The flags for special handlings Current support flag NVMEDIA_JPEG_ENC_FLAG_NONE or NVMEDIA_JPEG_ENC_FLAG_SKIP_SOI |
NvMediaStatus NvMediaIJPEGetEOFNvSciSyncFence | ( | const NvMediaIJPE * | encoder, |
NvSciSyncObj | eofnvscisyncobj, | ||
NvSciSyncFence * | eofnvscisyncfence | ||
) |
Gets EOF NvSciSyncFence for an NvMediaIJPEFeedFrame() operation.
The EOF NvSciSyncFence associated with an NvMediaIJPEFeedFrame() operation is an NvSciSyncFence. Its expiry indicates that the corresponding NvMediaIJPEFeedFrame() operation has finished.
This function returns the EOF NvSciSyncFence associated with the last NvMediaIJPEFeedFrame() call. NvMediaIJPEGetEOFNvSciSyncFence() must be called after an NvMediaIJPEFeedFrame() call.
For example, in this sequence of code:
expiry of eofnvscisyncfence indicates that the preceding NvMediaIJPEFeedFrame() operation has finished.
Usage considerations
[in] | encoder | A pointer to the NvMediaIJPE 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 NvMediaIJPEGetVersion | ( | NvMediaVersion * | version | ) |
Retrieves the version information for the NvMedia IJPE library.
Usage considerations
[in] | version | A pointer to a NvMediaVersion structure of the client. |
NvMediaStatus NvMediaIJPEInsertPreNvSciSyncFence | ( | const NvMediaIJPE * | encoder, |
const NvSciSyncFence * | prenvscisyncfence | ||
) |
Sets an NvSciSyncFence as a prefence for an NvMediaIJPEFeedFrame() NvSciSyncFence operation.
You must call NvMediaIJPEInsertPreNvSciSyncFence() before you call NvMediaIJPEFeedFrame(). The NvMediaIJPEFeedFrame() operation is started only after the expiry of the prenvscisyncfence.
For example, in this sequence of code:
the NvMediaIJPEFeedFrame() operation is assured to start only after the expiry of prenvscisyncfence.
You can set a maximum of NVMEDIA_IJPE_MAX_PRENVSCISYNCFENCES prefences by calling NvMediaIJPEInsertPreNvSciSyncFence() before NvMediaIJPEFeedFrame(). After the call to NvMediaIJPEFeedFrame(), all NvSciSyncFences previously inserted by NvMediaIJPEInsertPreNvSciSyncFence() are removed, and they are not reused for the subsequent NvMediaIJPEFeedFrame() calls.
Usage considerations
[in] | encoder | A pointer to the NvMediaIJPE object. Input range: Non-NULL - valid pointer address |
[in] | prenvscisyncfence | A pointer to NvSciSyncFence. Input range: Non-NULL - valid pointer address |
NvMediaStatus NvMediaIJPERegisterNvSciBufObj | ( | const NvMediaIJPE * | encoder, |
NvSciBufObj | bufObj | ||
) |
Registers NvSciBufObj for use with a NvMediaIJPE handle.
NvMediaIJPE handle maintains a record of all the objects registered using this API and only the registered NvSciBufObj handles are accepted when submitted for encoding via NvMediaIJPEFeedFrame. Even duplicated NvSciBufObj objects need to be registered using this API prior.
This needs to be used in tandem with NvMediaIJPEUnregisterNvSciBufObj(). 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 NvMediaIJPEFeedFrame().
To ensure deterministic execution time of NvMediaIJPEFeedFrame API:
Registration of the bufObj (input) is always with read-only permission.
Maximum of 32 NvSciBufObj handles can be registered.
Usage considerations
[in] | encoder | A pointer to the NvMediaIJPE object. Input range: Non-NULL - valid pointer address |
[in] | bufObj | NvSciBufObj object Input range: A valid NvSciBufObj |
NvMediaStatus NvMediaIJPERegisterNvSciSyncObj | ( | const NvMediaIJPE * | encoder, |
NvMediaNvSciSyncObjType | syncobjtype, | ||
NvSciSyncObj | nvscisync | ||
) |
Registers an NvSciSyncObj with NvMediaIJPE.
Every NvSciSyncObj (even duplicate objects) used by NvMediaIJPE must be registered by a call to this function before it is used. Only the exact same registered NvSciSyncObj can be passed to NvMediaIJPESetNvSciSyncObjforEOF(), NvMediaIJPEGetEOFNvSciSyncFence(), or NvMediaIJPEUnregisterNvSciSyncObj().
For a given NvMediaIJPE handle, one NvSciSyncObj can be registered as one NvMediaNvSciSyncObjType only. For each NvMediaNvSciSyncObjType, a maximum of 16 NvSciSyncObjs can be registered.
Usage considerations
[in] | encoder | A pointer to the NvMediaIJPE object. Input range: Non-NULL - valid pointer address |
[in] | syncobjtype | Determines how nvscisync is used by encoder. Input range: Entries in NvMediaNvSciSyncObjType enumeration |
[in] | nvscisync | The NvSciSyncObj to be registered with encoder. Input range: A valid NvSciSyncObj |
NvMediaStatus NvMediaIJPESetAttributes | ( | const NvMediaIJPE * | encoder, |
uint32_t | attributeMask, | ||
const void * | attributes | ||
) |
Sets the JPEG encoder attributes.
These go into effect at the next encode frame.
Usage considerations
[in] | encoder | The encoder to use. |
[in] | attributeMask | Attribute mask. |
[in] | attributes | Attributes data. Supported attribute structures: |
NvMediaStatus NvMediaIJPESetNvSciSyncObjforEOF | ( | const NvMediaIJPE * | encoder, |
NvSciSyncObj | nvscisyncEOF | ||
) |
Specifies the NvSciSyncObj to be used for an EOF NvSciSyncFence.
To use NvMediaIJPEGetEOFNvSciSyncFence(), the application must call NvMediaIJPESetNvSciSyncObjforEOF() before it calls NvMediaIJPEFeedFrame().
NvMediaIJPESetNvSciSyncObjforEOF() currently may be called only once before each call to NvMediaIJPEFeedFrame(). The application may choose to call this function only once before the first call to NvMediaIJPEFeedFrame().
Usage considerations
[in] | encoder | A pointer to the NvMediaIJPE 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 NvMediaIJPEUnregisterNvSciBufObj | ( | const NvMediaIJPE * | encoder, |
NvSciBufObj | bufObj | ||
) |
Un-registers NvSciBufObj which was previously registered with NvMediaIJPE using NvMediaIJPERegisterNvSciBufObj().
For all NvSciBufObj handles registered with NvMediaIJPE using NvMediaIJPERegisterNvSciBufObj API, NvMediaIJPEUnregisterNvSciBufObj must be called before calling NvMediaIJPEDestroy API. For unregistration to succeed, it should be ensured that none of the submitted tasks on the bufObj are pending prior to calling NvMediaIJPEUnregisterNvSciBufObj. In order to ensure this, NvMediaIJPEGetBits API needs to be called prior to unregistration, until the output of all the submitted tasks are retrieved, following which NvMediaIJPEUnregisterNvSciSyncObj should be called on all registered NvSciSyncObj.
This needs to be used in tandem with NvMediaIJPERegisterNvSciBufObj(). 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 NvMediaIJPEFeedFrame().
To ensure deterministic execution time of NvMediaIJPEFeedFrame API:
Usage considerations
[in] | encoder | A pointer to the NvMediaIJPE object. Input range: Non-NULL - valid pointer address |
[in] | bufObj | NvSciBufObj object Input range: A valid NvSciBufObj |
NvMediaStatus NvMediaIJPEUnregisterNvSciSyncObj | ( | const NvMediaIJPE * | encoder, |
NvSciSyncObj | nvscisync | ||
) |
Unregisters an NvSciSyncObj with NvMediaIJPE.
Every NvSciSyncObj registered with NvMediaIJPE by NvMediaIJPERegisterNvSciSyncObj() must be unregistered before calling NvMediaIJPEUnregisterNvSciBufObj() to unregister the NvSciBufObjs.
Before the application calls this function, it must ensure that any NvMediaIJPEFeedFrame() operation that uses the NvSciSyncObj has completed. If this function is called while NvSciSyncObj is still in use by any NvMediaIJPEFeedFrame() 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 NvMediaIJPEFeedFrame() to wait for the associated tasks to complete. The EOF NvSciSyncFence would have been previously obtained via a call to NvMediaIJPEGetEOFNvSciSyncFence(). The other option would be to call NvMediaIJPEGetBits() till there is no more output to retrieve.
Usage considerations
[in] | encoder | A pointer to the NvMediaIJPE object. Input range: Non-NULL - valid pointer address |
[in] | nvscisync | An NvSciSyncObj to be unregistered with encoder. Input range: A valid NvSciSyncObj |