The NvMedia 2D NvSci API encompasses all NvMedia 2D handling for NvSciBuf NvSciSync related functions.
6
NvMediaStatus NvMedia2DFillNvSciBufAttrList | ( | NvMedia2D *const | handle, |
NvSciBufAttrList const | attrList | ||
) |
Fills the NvMedia 2D specific NvSciBuf attributes.
This function updates the input NvSciBufAttrList with values equivalent to the following public attribute key-values:
NvSciBufGeneralAttrKey_PeerHwEngineArray set to
[in] | handle | Not used. Can be NULL. |
[out] | attrList | Pointer to an NvSciBufAttrList struct that will be populated with the NvSciBuf attributes. |
NVMEDIA_STATUS_OK | Attributes filled successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | The attributes have already been filled, or attrList is invalid. |
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to populate the attribute list. |
Usage considerations
NvMediaStatus NvMedia2DFillNvSciSyncAttrList | ( | NvMedia2D *const | handle, |
NvSciSyncAttrList const | attrList, | ||
NvMediaNvSciSyncClientType const | clientType | ||
) |
Fills the NvMedia 2D specific NvSciSync attributes.
This function updates the input NvSciSyncAttrList with values equivalent to the following public attribute key-values:
NvSciSyncAttrKey_RequiredPerm set to
NvSciSyncAttrKey_PrimitiveInfo set to
The application must not set these attributes for the same NvSciSyncAttrList that is passed to this function.
[in] | handle | Pointer to the NvMedia2D context. |
[out] | attrList | Pointer to an NvSciSyncAttrList struct that will be populated with the NvSciSync attributes. |
[in] | clientType | An NvMediaNvSciSyncClientType, to indicate whether the attributes filled should be for a waiter or a signaler. The value should be either:
|
NVMEDIA_STATUS_OK | Attributes filled successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | The attributes have already been filled, or one of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to populate the attribute list. |
Usage considerations
NvMediaStatus NvMedia2DGetEOFNvSciSyncFence | ( | NvMedia2D *const | handle, |
NvMedia2DComposeResult const *const | result, | ||
NvSciSyncFence *const | syncFence | ||
) |
Gets an EOF NvSciSyncFence for an NvMedia2DCompose() operation.
The expiry of an EOF NvSciSyncFence associated with an NvMedia2DCompose() operation indicates that the corresponding NvMedia2DCompose() operation has finished.
To be able to get the EOF fence using this function, the NvSciSyncObj to be used for EOF event needs to have been set for the NvMedia2DComposeParameters handle used with the NvMedia2DCompose() operation with NvMedia2DSetNvSciSyncObjforEOF().
For example, in this sequence of code:
expiry of syncFence indicates that the preceding NvMedia2DCompose() operation has finished.
For a given NvSciSyncObj used for the EOF event, the EOF fence for an NvMedia2DCompose() operation can be queried using this function only until the next operation using the same NvSciSyncObj for the EOF event is submitted. When more operations are submitted, the NvMedia2DComposeResult structs for the previous operations are no longer considered valid by this function.
[in] | handle | Pointer to the NvMedia2D context. |
[in] | result | Pointer to the NvMedia2DComposeResult struct. |
[out] | syncFence | Pointer to an NvSciSyncFence that will be populated with the EOF fence. |
NVMEDIA_STATUS_OK | EOF fence returned successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | No NvSciSyncObj was set for the operation EOF event, or one of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to get the fence object. |
Usage considerations
NvMediaStatus NvMedia2DInsertPreNvSciSyncFence | ( | NvMedia2D *const | handle, |
NvMedia2DComposeParameters const | params, | ||
NvSciSyncFence const *const | syncFence | ||
) |
Insert an NvSciSyncFence as a pre-fence.
This function inserts the specified NvSciSyncFence as a pre-fence to the compose operation. The NvMedia2DCompose() operation is started only after the expiry of the syncFence.
For example, in this sequence of code:
the NvMedia2DCompose () operation is assured to start only after the expiry of syncFence.
You can set a maximum of 16 prefences by calling NvMedia2DInsertPreNvSciSyncFence().
[in] | handle | Pointer to the NvMedia2D context. |
[in] | params | An NvMedia2DComposeParameters handle. |
[in] | syncFence | Pointer to an NvSciSyncFence. |
NVMEDIA_STATUS_OK | Pre-fence inserted successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | The sync object is not registered as an PRESYNC type with NvMedia 2D, or one of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of registered pre-fences has been reached. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to insert the pre-fence. |
Usage considerations
NvMediaStatus NvMedia2DRegisterNvSciBufObj | ( | NvMedia2D *const | handle, |
NvSciBufObj const | bufObj | ||
) |
Register an NvSciBufObj with NvMedia 2D.
Every NvSciBufObj (even duplicate objects) used by NvMedia 2D must be registered by a call to this function before it is used. Only the exact same registered NvSciBufObj can be passed to NvMedia2DSetSrcNvSciBufObj() and NvMedia2DSetDstNvSciBufObj() functions.
[in] | handle | Pointer to the NvMedia2D context. |
[in] | bufObj | The NvSciBufObj to be registered. |
NVMEDIA_STATUS_OK | Buffer registered successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | Returned when:
|
NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of registered buffers has been reached. |
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to register the buffer. |
Usage considerations
NvMediaStatus NvMedia2DRegisterNvSciSyncObj | ( | NvMedia2D *const | handle, |
NvMediaNvSciSyncObjType const | syncObjType, | ||
NvSciSyncObj const | syncObj | ||
) |
Register an NvSciSyncObj with NvMedia 2D.
Every NvSciSyncObj (even duplicate objects) used by NvMedia 2D must be registered by a call to this function before it is used.
Only the exact same registered NvSciSyncObj can be passed to NvMedia2DSetNvSciSyncObjforEOF() or NvMedia2DUnregisterNvSciSyncObj(). Also the NvSciSyncObjs associated with any NvSciSyncFences passed to NvMedia2DInsertPreNvSciSyncFence() must be registered.
For a given NvMedia2D handle, one NvSciSyncObj can be registered as one NvMediaNvSciSyncObjType only.
[in] | handle | Pointer to the NvMedia2D context. |
[in] | syncObjType | An NvMediaNvSciSyncClientType, to indicate what event the sync object will represent. |
[in] | syncObj | The NvSciSyncObj to be registered. |
NVMEDIA_STATUS_OK | Sync object registered successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of registered sync objects has been reached. |
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to register the sync object. |
Usage considerations
NvMediaStatus NvMedia2DSetDstNvSciBufObj | ( | NvMedia2D *const | handle, |
NvMedia2DComposeParameters const | params, | ||
NvSciBufObj | dstSurface | ||
) |
Sets the surface for the destination.
[in] | handle | Pointer to the NvMedia2D context. |
[in] | params | An NvMedia2DComposeParameters handle. |
[in] | dstSurface | The NvSciBufObj to be used for the destination surface. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMedia2DSetNvSciSyncObjforEOF | ( | NvMedia2D *const | handle, |
NvMedia2DComposeParameters const | params, | ||
NvSciSyncObj | syncObj | ||
) |
Specifies the NvSciSyncObj to be used for EOF event.
[in] | handle | Pointer to the NvMedia2D context. |
[in] | params | An NvMedia2DComposeParameters handle. |
[in] | syncObj | The NvSciSyncObj to be used for the EOF fence. |
NVMEDIA_STATUS_OK | EOF fence set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | The sync object is not registered as an EOF event type with NvMedia 2D, or one of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMedia2DSetSrcNvSciBufObj | ( | NvMedia2D *const | handle, |
NvMedia2DComposeParameters const | params, | ||
uint32_t const | index, | ||
NvSciBufObj | srcSurface | ||
) |
Sets the surface for a source layer.
[in] | handle | Pointer to the NvMedia2D context. |
[in] | params | An NvMedia2DComposeParameters handle. |
[in] | index | Index of source layer to configure. Must be in range [0, 15]. |
[in] | srcSurface | The NvSciBufObj to be used for the source surface. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMedia2DUnregisterNvSciBufObj | ( | NvMedia2D *const | handle, |
NvSciBufObj | bufObj | ||
) |
Unregisters an NvSciBufObj with NvMedia2D.
Every NvSciBufObj registered with NvMedia2D by NvMedia2DRegisterNvSciBufObj() must be unregistered before you call NvMedia2DDestroy().
[in] | handle | Pointer to the NvMedia2D context. |
[in] | bufObj | The NvSciBufObj to be unregistered. |
NVMEDIA_STATUS_OK | Buffer unregistered successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_PENDING | The buffer is still being used by a pending operation. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to unregister the buffer. |
Usage considerations
NvMediaStatus NvMedia2DUnregisterNvSciSyncObj | ( | NvMedia2D *const | handle, |
NvSciSyncObj | syncObj | ||
) |
Unregisters an NvSciSyncObj with NvMedia2D.
Every NvSciSyncObj registered with NvMedia2D by NvMedia2DRegisterNvSciSyncObj() must be unregistered before you call NvMedia2DDestroy().
Before the application calls this function, it must ensure that any NvMedia2DCompose() operation that uses the NvSciSyncObj has completed. If this function is called while NvSciSyncObj is still in use by any NvMedia2DCompose() operation, behavior is undefined.
[in] | handle | Pointer to the NvMedia2D context. |
[in] | syncObj | The NvSciSyncObj to be unregistered. |
NVMEDIA_STATUS_OK | Sync object unregistered successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_PENDING | The sync object is still being used by a pending operation. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to unregister the sync object. |
Usage considerations