The 2D Processing API encompasses all NvMedia 2D image processing related functionality.
6
Data Structures | |
| struct | NvMedia2DAttributes |
| Attributes structure for NvMedia2DCreate(). More... | |
| struct | NvMedia2DLdcWarpMapAttributes |
| Attributes structure for NvMedia2DCreateLdcWarpMap(). More... | |
| struct | NvMedia2DLdcMaskMapAttributes |
| Attributes structure for NvMedia2DCreateLdcMaskMap(). More... | |
| struct | NvMedia2DTnrStateAttributes |
| Attributes structure for NvMedia2DCreateTnrState(). More... | |
| struct | NvMedia2DCapabilities |
| Capabilities of the NvMedia2D context. More... | |
| struct | NvMedia2DComposeResult |
| Stores information returned from NvMedia2DCompose(). More... | |
| struct | NvMedia2DFilterCoefficients5Tap |
| Coefficients values structure for 5-tap custom filter. More... | |
| struct | NvMedia2DFilterCoefficients10Tap |
| Coefficients values structure for 10-tap custom filter. More... | |
| struct | NvMedia2DLdcRegionParameters |
| Holds the NvMedia LDC region configuration. More... | |
| struct | NvMedia2DLdcTransformMatrix |
| Holds configutation for LDC transform matrix. More... | |
| struct | NvMedia2DLdcControlPoint |
| Represents a LDC warp map control point. More... | |
| struct | NvMedia2DLdcWarpMapParameters |
| Holds the NvMedia definition of an LDC Warp Map. More... | |
| struct | NvMedia2DLdcMaskMapParameters |
| Holds the LDC Mask Map information. More... | |
| struct | NvMedia2DTnrParameters |
| Holds the TNR3 initialization parameters. More... | |
| struct | NvMedia2DChecksum |
| Represents a checksum. More... | |
Macros | |
| #define | NVMEDIA_2D_MAX_LDC_REGIONS_X 4U |
| Maximum number of horizontal LDC regions. More... | |
| #define | NVMEDIA_2D_MAX_LDC_REGIONS_Y 4U |
| Maximum number of vertical LDC regions. More... | |
| #define | NVMEDIA_2D_CHECKSUM_NUM_BYTES 24u |
| Number of bytes in NvMedia 2D checksums. More... | |
Typedefs | |
| typedef uint32_t | NvMedia2DComposeParameters |
| Stores configuration for the NvMedia2DCompose() operation. More... | |
| typedef uint32_t | NvMedia2DFilterBuffer |
| Stores a filter buffer which coefficients can be configured. More... | |
| typedef uint32_t | NvMedia2DLdcWarpMap |
| Stores resources for an LDC warp map. More... | |
| typedef uint32_t | NvMedia2DLdcMaskMap |
| Stores resources for an LDC mask map. More... | |
| typedef uint32_t | NvMedia2DTnrState |
| Stores state and resources for TNR operation. More... | |
| typedef struct NvMedia2D | NvMedia2D |
| NvMedia2D Context. More... | |
Enumerations | |
| enum | NvMedia2DFilter { NVMEDIA_2D_FILTER_OFF = 0x1, NVMEDIA_2D_FILTER_LOW, NVMEDIA_2D_FILTER_MEDIUM, NVMEDIA_2D_FILTER_HIGH } |
| 2D filter mode. More... | |
| enum | NvMedia2DTransform { NVMEDIA_2D_TRANSFORM_NONE = 0x0, NVMEDIA_2D_TRANSFORM_ROTATE_90, NVMEDIA_2D_TRANSFORM_ROTATE_180, NVMEDIA_2D_TRANSFORM_ROTATE_270, NVMEDIA_2D_TRANSFORM_FLIP_HORIZONTAL, NVMEDIA_2D_TRANSFORM_INV_TRANSPOSE, NVMEDIA_2D_TRANSFORM_FLIP_VERTICAL, NVMEDIA_2D_TRANSFORM_TRANSPOSE } |
| 2D rotation/transform. More... | |
| enum | NvMedia2DBlendMode { NVMEDIA_2D_BLEND_MODE_DISABLED, NVMEDIA_2D_BLEND_MODE_CONSTANT_ALPHA, NVMEDIA_2D_BLEND_MODE_STRAIGHT_ALPHA, NVMEDIA_2D_BLEND_MODE_PREMULTIPLIED_ALPHA } |
| Blending to use when compositing surfaces. More... | |
| enum | NvMedia2DChecksumMode { NVMEDIA_2D_CHECKSUM_MODE_DISABLED, NVMEDIA_2D_CHECKSUM_MODE_SRC_SURFACE } |
| NvMedia 2D checksum mode. More... | |
| #define NVMEDIA_2D_CHECKSUM_NUM_BYTES 24u |
Number of bytes in NvMedia 2D checksums.
Definition at line 1004 of file nvmedia_2d.h.
| #define NVMEDIA_2D_MAX_LDC_REGIONS_X 4U |
Maximum number of horizontal LDC regions.
Definition at line 41 of file nvmedia_2d.h.
| #define NVMEDIA_2D_MAX_LDC_REGIONS_Y 4U |
Maximum number of vertical LDC regions.
Definition at line 44 of file nvmedia_2d.h.
NvMedia2D Context.
This type represents a context for the NvMedia2D library. This context is an opaque data type that encapsulates the state needed to service the NvMedia2D API calls.
Definition at line 1035 of file nvmedia_2d.h.
| typedef uint32_t NvMedia2DComposeParameters |
Stores configuration for the NvMedia2DCompose() operation.
This object stores the information needed to configure the 2D operation that is executed inside the NvMedia2DCompose() function.
The underlying object cannot be instantiated directly by the client. Instead use the NvMedia2DGetComposeParameters() function to retrieve a handle to an available instance.
Value 0 is never a valid handle value, and can be used to initialize an NvMedia2DComposeParameters handle to a known value.
Definition at line 486 of file nvmedia_2d.h.
| typedef uint32_t NvMedia2DFilterBuffer |
Stores a filter buffer which coefficients can be configured.
The underlying object cannot be instantiated directly by the client. Instead use the NvMedia2DCreateFilterBuffer() function to create and retrieve a handle to an available instance with resources allocated. Use NvMedia2DDestroyFilterBuffer() function to deallocate resources allocated by NvMedia2DCreateFilterBuffer() and release an instance.
Value 0 is never a valid handle value, and can be used to initialize an NvMedia2DFilterBuffer handle to a known value.
Definition at line 502 of file nvmedia_2d.h.
| typedef uint32_t NvMedia2DLdcMaskMap |
Stores resources for an LDC mask map.
The underlying object cannot be instantiated directly by the client. Instead use the NvMedia2DCreateLdcMaskMap() function to create and retrieve a handle to an available instance with resources allocated. Use NvMedia2DDestroyLdcMaskMap() function to deallocate resources allocated by NvMedia2DCreateLdcMaskMap() and release an instance.
Value 0 is never a valid handle value, and can be used to initialize an NvMedia2DLdcMaskMap handle to a known value.
Definition at line 534 of file nvmedia_2d.h.
| typedef uint32_t NvMedia2DLdcWarpMap |
Stores resources for an LDC warp map.
The underlying object cannot be instantiated directly by the client. Instead use the NvMedia2DCreateLdcWarpMap() function to create and retrieve a handle to an available instance with resources allocated. Use NvMedia2DDestroyLdcWarpMap() function to deallocate resources allocated by NvMedia2DCreateLdcWarpMap() and release an instance.
Value 0 is never a valid handle value, and can be used to initialize an NvMedia2DLdcWarpMap handle to a known value.
Definition at line 518 of file nvmedia_2d.h.
| typedef uint32_t NvMedia2DTnrState |
Stores state and resources for TNR operation.
The underlying object cannot be instantiated directly by the client. Instead use the NvMedia2DCreateTnrState() function to create and retrieve a handle to an available instance with resources allocated. Use NvMedia2DDestroyTnrState() function to deallocate resources allocated by NvMedia2DCreateTnrState() and release an instance.
Value 0 is never a valid handle value, and can be used to initialize an NvMedia2DTnrState handle to a known value.
Definition at line 550 of file nvmedia_2d.h.
| enum NvMedia2DBlendMode |
Blending to use when compositing surfaces.
Definition at line 187 of file nvmedia_2d.h.
NvMedia 2D checksum mode.
This enum describes the different checksum calculation modes that are supported by NvMedia 2D.
| Enumerator | |
|---|---|
| NVMEDIA_2D_CHECKSUM_MODE_DISABLED | No checksum calculated. This is the default behavior. |
| NVMEDIA_2D_CHECKSUM_MODE_SRC_SURFACE | Checksum calculated from source surface pixel data. |
Definition at line 1018 of file nvmedia_2d.h.
| enum NvMedia2DFilter |
2D filter mode.
This enum describes the filter modes that are supported by NvMedia 2D.
If no filter mode is explicitly set then an appropriate mode will be automatically selected, depending on the current scaling factor and hardware restrictions.
Definition at line 56 of file nvmedia_2d.h.
| enum NvMedia2DTransform |
2D rotation/transform.
This enum describes the 2D transform to apply during a blit operation.
Transformations are used to rotate and mirror the source surface of a blit operation. The destination rectangle is not affected by any transformation settings.
NvMediaTransform identifies the transformations that can be applied as a combination of rotation and mirroring.
Specifically, given a hypothetical 2x2 image, applying these operations would yield the following results:
Definition at line 155 of file nvmedia_2d.h.
| NvMediaStatus NvMedia2DCompose | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| NvMedia2DComposeResult *const | result | ||
| ) |
Performs a 2D compose operation.
A compose operation transfers pixels from a set of source surfaces to a destination surface, applying a variety of transformations to the pixel values on the way. The surfaces can have different pixel formats. NvMedia 2D does the necessary conversions between the formats.
If the dimensions of the source rectangle do not match the dimensions of the destination rectangle, the operation scales the pixels to fit the destination rectangle. If the source or the destination rectangle is not explicitly set, it will default to match the dimensions of the source or the destination surface, respectively.
If the clip rectangle is not explicitly set, it will default to match the dimensions of the destination rectangle if single source layer is set, or the dimensions of the destination surface if multiple source layers are set.
If no filter mode is explicitly set, then an appropriate mode will be automatically selected, depending on the current scaling factor and hardware restrictions.
This example performs a straight pixel copy between surfaces of the same dimensions (but not necessarily the same bit depth or color format):
Restrictions on dimensions for input and output surfaces:
Additional surface dimension restrictions for chroma sub-sampled YUV formats:
Restrictions on the source rectangle:
Restrictions on the destination and clip rectangle:
Restrictions on the source layers:
If NvMedia2DCapabilities::supports16BitYUVNatively is false, following additional restrictions apply for 16-bit YUV/YUVX/Y formats:
If NvMedia2DCapabilities::supportsNonAlignedRects is false, following additional restrictions apply for chroma sub-sampled YUV formats:
If any of the restrictions are violated, this function will fail with an error code.
Performance considerations:
The result info returned in result is tied to the specific NvMedia2D context instance passed in handle and cannot be used with other context instances.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | params | An NvMedia2DComposeParameters handle. |
| [out] | result | Pointer to NvMedia2DComposeResult struct that will be populated with result info. May be NULL. |
| NVMEDIA_STATUS_OK | Operation submitted successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
| NVMEDIA_STATUS_NOT_SUPPORTED | Requested operation is not supported by current platform (see restrictions on parameters). |
| NVMEDIA_STATUS_TIMED_OUT | No space available in the command buffer for this operation, because previous operations are still pending (see restrictions on concurrency). The caller should wait for the least recently submitted operation to complete and then try again. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to perform the compose operation. This error indicates the system is potentially in an unrecoverable state. |
Usage considerations
| NvMediaStatus NvMedia2DComputeFilterCoefficients10Tap | ( | NvMedia2D const *const | handle, |
| NvMedia2DFilterBuffer const | filterBuffer, | ||
| uint32_t const | index, | ||
| NvMedia2DFilterCoefficients10Tap const *const | lumaX, | ||
| NvMedia2DFilterCoefficients10Tap const *const | lumaY, | ||
| NvMedia2DFilterCoefficients10Tap const *const | chromaX, | ||
| NvMedia2DFilterCoefficients10Tap const *const | chromaY | ||
| ) |
Computes the 10-tap filter coefficients for an NvMedia2DFilterBuffer.
This function computes the filter coefficients values for a specific source layer based on the contents of four NvMedia2DFilterCoefficients10Tap structures.
There is no restriction on multiple parameters pointing to the same NvMedia2DFilterCoefficients10Tap structure
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | filterBuffer | An NvMedia2DFilterBuffer handle. |
| [in] | index | Index of source layer to configure. Must be in range [0, 4]. |
| [in] | lumaX,lumaY | Pointers to NvMedia2DFilterCoefficients10Tap. These configure to the luma component for YUV formats, or all the components for RGB formats. There is one pointer for the horizontal direction, and one pointer for the vertical direction. |
| [in] | chromaX,chromaY | Pointers to NvMedia2DFilterCoefficients10Tap. These configure the chroma component for YUV formats. There is one pointer for the horizontal direction, and one pointer for the vertical direction. |
| NVMEDIA_STATUS_OK | Filter buffer was updated successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
Usage considerations
| NvMediaStatus NvMedia2DComputeFilterCoefficients5Tap | ( | NvMedia2D const *const | handle, |
| NvMedia2DFilterBuffer const | filterBuffer, | ||
| uint32_t const | index, | ||
| NvMedia2DFilterCoefficients5Tap const *const | lumaX, | ||
| NvMedia2DFilterCoefficients5Tap const *const | lumaY, | ||
| NvMedia2DFilterCoefficients5Tap const *const | chromaX, | ||
| NvMedia2DFilterCoefficients5Tap const *const | chromaY | ||
| ) |
Computes the 5-tap filter coefficients for an NvMedia2DFilterBuffer.
This function computes the filter coefficients values for a specific source layer based on the contents of four NvMedia2DFilterCoefficients5Tap structures.
There is no restriction on multiple parameters pointing to the same NvMedia2DFilterCoefficients5Tap structure
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | filterBuffer | An NvMedia2DFilterBuffer handle. |
| [in] | index | Index of source layer to configure. Must be in range [0, 4]. |
| [in] | lumaX,lumaY | Pointers to NvMedia2DFilterCoefficients5Tap. These configure to the luma component for YUV formats, or all the components for RGB formats. There is one pointer for the horizontal direction, and one pointer for the vertical direction. |
| [in] | chromaX,chromaY | Pointers to NvMedia2DFilterCoefficients5Tap. These configure the chroma component for YUV formats. There is one pointer for the horizontal direction, and one pointer for the vertical direction. |
| NVMEDIA_STATUS_OK | Filter buffer was updated successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
Usage considerations
| NvMediaStatus NvMedia2DCreate | ( | NvMedia2D **const | handle, |
| NvMedia2DAttributes const *const | attr | ||
| ) |
Creates a new NvMedia2D context.
This function creates a new instance of an NvMedia2D context, and returns a pointer to that context. Ownership of this context is passed to the caller. When no longer in use, the caller must destroy the context using the NvMedia2DDestroy() function.
| [out] | handle | Pointer to receive the handle to the new NvMedia2D context. |
| [in] | attr | Pointer to NvMedia2DAttributes struct, or NULL for default attributes. |
| NVMEDIA_STATUS_OK | Context created successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | handle is NULL, or attr has bad attribute values. |
| NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
| NVMEDIA_STATUS_NOT_SUPPORTED | NvMedia 2D is not supported on this hardware platform. |
| NVMEDIA_STATUS_OUT_OF_MEMORY | Memory allocation failed for internal data structures or device memory buffers. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to create the context. |
Usage considerations
| NvMediaStatus NvMedia2DCreateFilterBuffer | ( | NvMedia2D const *const | handle, |
| NvMedia2DFilterBuffer *const | filterBuffer | ||
| ) |
Creates and returns an NvMedia2DFilterBuffer instance.
This functions returns a handle to an NvMedia2DFilterBuffer object. The filter buffer can be used to provide custom 5-tap and 10-tap filter coefficients for a compose operation.
The handle returned in filterBuffer is tied to the specific NvMedia2D context instance passed in handle and cannot be used with other context instances.
The buffer instance must be destroyed with NvMedia2DDestroyFilterBuffer() during the De-Init stage, before calling NvMedia2DDestroy().
| [in] | handle | Pointer to the NvMedia2D context. |
| [out] | filterBuffer | Pointer to an NvMedia2DFilterBuffer, which will be populated with the handle. |
| NVMEDIA_STATUS_OK | Buffer created successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
| NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of buffers has been created. |
| NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
| NVMEDIA_STATUS_OUT_OF_MEMORY | Failed to allocate memory for the buffer. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to create the buffer. |
Usage considerations
| NvMediaStatus NvMedia2DCreateLdcMaskMap | ( | NvMedia2D const *const | handle, |
| NvMedia2DLdcMaskMapAttributes const *const | ldcMaskMapAttr, | ||
| NvMedia2DLdcMaskMap *const | ldcMaskMap | ||
| ) |
Creates and returns an NvMedia2DLdcMaskMap instance.
This functions returns a handle to an NvMedia2DLdcMaskMap object. The mask map can be used to control behaviour of an LDC operation.
The handle returned in ldcMaskMap is tied to the specific NvMedia2D context instance passed in handle and cannot be used with other context instances.
The buffer instance must be destroyed with NvMedia2DDestroyLdcMaskMap() during the De-Init stage.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | ldcMaskMapAttr | Pointer to NvMedia2DLdcMaskMapAttributes struct, or NULL for default attributes. |
| [out] | ldcMaskMap | Pointer to an NvMedia2DLdcMaskMap, which will be populated with the handle. |
| NVMEDIA_STATUS_OK | Object created successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
| NVMEDIA_STATUS_NOT_SUPPORTED | LDC mask maps are not supported on current platform. |
| NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of mask maps has been created. |
| NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
| NVMEDIA_STATUS_OUT_OF_MEMORY | Failed to allocate memory for the mask map. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to create the buffer. |
Usage considerations
| NvMediaStatus NvMedia2DCreateLdcWarpMap | ( | NvMedia2D const *const | handle, |
| NvMedia2DLdcWarpMapAttributes const *const | ldcWarpMapAttr, | ||
| NvMedia2DLdcWarpMap *const | ldcWarpMap | ||
| ) |
Creates and returns an NvMedia2DLdcWarpMap instance.
This functions returns a handle to an NvMedia2DLdcWarpMap object. The warp map can be used to control behaviour of an LDC operation.
The handle returned in ldcWarpMap is tied to the specific NvMedia2D context instance passed in handle and cannot be used with other context instances.
The warp map instance must be destroyed with NvMedia2DDestroyLdcWarpMap() during the De-Init stage.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | ldcWarpMapAttr | Pointer to NvMedia2DLdcWarpMapAttributes struct, or NULL for default attributes. |
| [out] | ldcWarpMap | Pointer to an NvMedia2DLdcWarpMap, which will be populated with the handle. |
| NVMEDIA_STATUS_OK | Object created successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
| NVMEDIA_STATUS_NOT_SUPPORTED | LDC operations are not supported on current platform. |
| NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of warp maps has been created. |
| NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
| NVMEDIA_STATUS_OUT_OF_MEMORY | Failed to allocate memory for the warp map. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to create the warp map. |
Usage considerations
| NvMediaStatus NvMedia2DCreateTnrState | ( | NvMedia2D const *const | handle, |
| NvMedia2DTnrStateAttributes const *const | tnrStateAttr, | ||
| NvMedia2DTnrState *const | tnrState | ||
| ) |
Creates and returns an NvMedia2DTnrState instance.
This functions returns a handle to an NvMedia2DTnrState object. The TNR state can be used to control behaviour of a TNR operation.
The handle returned in tnrState is tied to the specific NvMedia2D context instance passed in handle and cannot be used with other context instances.
The TNR state instance must be destroyed with NvMedia2DDestroyTnrState() during the De-Init stage.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | tnrStateAttr | Pointer to NvMedia2DTnrStateAttributes struct, or NULL for default attributes. |
| [out] | tnrState | Pointer to an NvMedia2DTnrState, which will be populated with the handle. |
| NVMEDIA_STATUS_OK | Object created successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
| NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of TNR states has been created. |
| NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
| NVMEDIA_STATUS_OUT_OF_MEMORY | Failed to allocate memory for the TNR state. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to create the TNR state. |
Usage considerations
| NvMediaStatus NvMedia2DDestroy | ( | NvMedia2D const *const | handle | ) |
Destroys the NvMedia2D context.
This function destroys the specified NvMedia2D context.
Before calling this function, the caller must ensure:
| [in] | handle | Pointer to the NvMedia2D context. |
| NVMEDIA_STATUS_OK | Context destroyed successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | handle is NULL. |
| NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
| NVMEDIA_STATUS_PENDING | There are still some NvSciSync or NvSciBuf objects registered against the NvMedia2D context, or there are some NvMedia2DFilterBuffer objects that have not been destroyed. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to destroy the context. The context is in state where the only valid operation is to attempt to destroy it again. |
Usage considerations
| NvMediaStatus NvMedia2DDestroyFilterBuffer | ( | NvMedia2D const *const | handle, |
| NvMedia2DFilterBuffer const | filterBuffer | ||
| ) |
Destroys an NvMedia2DFilterBuffer instance.
This functions destroys an NvMedia2DFilterBuffer object.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | filterBuffer | An NvMedia2DFilterBuffer handle. |
| NVMEDIA_STATUS_OK | Buffer are destroyed successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
| 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 destroy the buffer. The buffer is in state where the only valid operation is to attempt to destroy it again. |
Usage considerations
| NvMediaStatus NvMedia2DDestroyLdcMaskMap | ( | NvMedia2D const *const | handle, |
| NvMedia2DLdcMaskMap const | ldcMaskMap | ||
| ) |
Destroys an NvMedia2DLdcMaskMap instance.
This functions destroys an NvMedia2DLdcMaskMap object.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | ldcMaskMap | An NvMedia2DLdcMaskMap handle. |
| NVMEDIA_STATUS_OK | Object destroyed successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
| NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
| NVMEDIA_STATUS_PENDING | The mask map is still being used by a pending operation. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to destroy the mask map. The mask map is in state where the only valid operation is to attempt to destroy it again. |
Usage considerations
| NvMediaStatus NvMedia2DDestroyLdcWarpMap | ( | NvMedia2D const *const | handle, |
| NvMedia2DLdcWarpMap const | ldcWarpMap | ||
| ) |
Destroys an NvMedia2DLdcWarpMap instance.
This functions destroys an NvMedia2DLdcWarpMap object.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | ldcWarpMap | An NvMedia2DLdcWarpMap handle. |
| NVMEDIA_STATUS_OK | Object destroyed successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
| NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
| NVMEDIA_STATUS_PENDING | The warp map is still being used by a pending operation. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to destroy the warp map. The warp map is in state where the only valid operation is to attempt to destroy it again. |
Usage considerations
| NvMediaStatus NvMedia2DDestroyTnrState | ( | NvMedia2D const *const | handle, |
| NvMedia2DTnrState const | tnrState | ||
| ) |
Destroys an NvMedia2DTnrState instance.
This functions destroys an NvMedia2DTnrState object.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | tnrState | An NvMedia2DTnrState handle. |
| NVMEDIA_STATUS_OK | Object destroyed successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
| NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
| NVMEDIA_STATUS_PENDING | The TNR statemap is still being used by a pending operation. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to destroy the TNR state. The object is in state where the only valid operation is to attempt to destroy it again. |
Usage considerations
| NvMediaStatus NvMedia2DFillLdcMaskMap | ( | NvMedia2D const *const | handle, |
| NvMedia2DLdcMaskMap const | ldcMaskMap, | ||
| NvMedia2DLdcMaskMapParameters const *const | ldcMaskMapParams | ||
| ) |
Populates an LDC mask map with content.
This uses the specified parameters to populate the content of the LDC mask map. The map data accessed through ldcMaskMapParams is copied to the NvMedia2DLdcMaskMap internal data structures.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | ldcMaskMap | An NvMedia2DLdcMaskMap handle. |
| [in] | ldcMaskMapParams | Pointer to NvMedia2DLdcMaskMapParameters. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| NvMediaStatus NvMedia2DFillLdcWarpMap | ( | NvMedia2D const *const | handle, |
| NvMedia2DLdcWarpMap const | ldcWarpMap, | ||
| NvMedia2DLdcWarpMapParameters const *const | lcdWarpMapParams | ||
| ) |
Populates an LDC warp map with content.
This uses the specified parameters to populate the content of the LDC warp map. The map data accessed through ldcWarpMapParams is copied to the NvMedia2DLdcWarpMap internal data structures.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | ldcWarpMap | An NvMedia2DLdcWarpMap handle. |
| [in] | ldcWarpMapParams | Pointer to NvMedia2DLdcWarpMapParameters. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| const NvMedia2DCapabilities* NvMedia2DGetCapabilities | ( | NvMedia2D const *const | handle | ) |
Returns the NvMedia2D context capabilities.
This function returns a pointer to a read-only NvMedia2DCapabilities struct, populated with the capabilities of the NvMedia2D context.
| NvMediaStatus NvMedia2DGetChecksum | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeResult const *const | result, | ||
| NvMedia2DChecksum *const | checksum | ||
| ) |
Gets a checksum calculated for an NvMedia2DCompose() operation.
This function gets a checksum calculated for an NvMedia2DCompose() operation. The operation must have had checksum calculation configured with NvMedia2DSetChecksumMode().
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | result | Pointer to the NvMedia2DComposeResult object of the operation. |
| [out] | checksum | Pointer to an NvMedia2DChecksum object that will be populated with the checksum. |
| NVMEDIA_STATUS_OK | Checksum returned successfully in checksum. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
| NVMEDIA_STATUS_NOT_SUPPORTED | Checksums are not supported on current platform. |
| NVMEDIA_STATUS_PENDING | The operation is still pending. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to read the checksum. |
Usage considerations
| NvMediaStatus NvMedia2DGetComposeParameters | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters *const | params | ||
| ) |
Returns an NvMedia2DComposeParameters instance.
This functions returns a handle to an NvMedia2DComposeParameters object. The object will be initialized and ready to use. The caller takes ownership of this handle. Ownership will be passed back to the NvMedia2D context when it is subsequently used in the NvMedia2DCompose() operation, or explicitly released with NvMedia2DReleaseComposeParameters().
The handle returned in params is tied to the specific NvMedia2D context instance passed in handle and cannot be used with other context instances.
| [in] | handle | Pointer to the NvMedia2D context. |
| [out] | params | Pointer to an NvMedia2DComposeParameters, which will be populated with the handle. |
| NVMEDIA_STATUS_OK | Parameters instance is initialized successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
| NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | There is no free instance available. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to retrieve the parameters object. |
Usage considerations
| NvMedia2DAttributes NvMedia2DGetDefaultAttributes | ( | void | ) |
Return the default values for NvMedia2DAttributes.
This function returns a NvMedia2DAttributes structure with default values.
Default attributes:
Usage considerations
| NvMedia2DLdcMaskMapAttributes NvMedia2DGetDefaultLdcMaskMapAttributes | ( | void | ) |
Return the default values for NvMedia2DLdcMaskMapAttributes.
This function returns a NvMedia2DLdcMaskMapAttributes structure with default values.
Default attributes:
Usage considerations
| NvMedia2DLdcWarpMapAttributes NvMedia2DGetDefaultLdcWarpMapAttributes | ( | void | ) |
Return the default values for NvMedia2DLdcWarpMapAttributes.
This function returns a NvMedia2DLdcWarpMapAttributes structure with default values.
Default attributes:
Usage considerations
| NvMedia2DTnrStateAttributes NvMedia2DGetDefaultTnrStateAttributes | ( | void | ) |
Return the default values for NvMedia2DTnrStateAttributes.
This function returns a NvMedia2DTnrStateAttributes structure with default values.
Default attributes:
Usage considerations
| NvMediaStatus NvMedia2DReleaseComposeParameters | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params | ||
| ) |
Releases an NvMedia2DComposeParameters instance.
This function releases an NvMedia2DComposeParameters instance acquired with NvMedia2DGetComposeParameters() without executing the compose operation described by the parameters. This can be useful in error handling scenarios.
If the operation is submitted with NvMedia2DCompose(), there is no need to call this function.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | params | The NvMedia2DComposeParameters instance to release. |
| NVMEDIA_STATUS_OK | Parameters instance released successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
Usage considerations
| NvMediaStatus NvMedia2DResetTnr | ( | NvMedia2D const *const | handle, |
| NvMedia2DTnrState const | tnrState | ||
| ) |
Resets TNR algorithm state.
This function resets the internal TNR algorithm state. After a successful call to this function, the next frame submitted for TNR processing with NvMedia2DCompose() will be treated by the algorithm as the first one and no previous surface needs to be set for it with NvMedia2DSetTnrPreviousNvSciBufObj().
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | tnrState | An NvMedia2DTnrState handle. |
| NVMEDIA_STATUS_OK | State reset successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| NvMediaStatus NvMedia2DSetChecksumMode | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| NvMedia2DChecksumMode const | checksumMode | ||
| ) |
Sets checksum calculation mode.
This function configures the checksums to calculate for the NvMedia2DCompose() operations performed using params.
NvMedia 2D maintains the checksums from 16 most recent NvMedia2DCompose() operations that had the checksum calculation configured using this function. When more operations are performed, the oldest checksums are overwritten. The client must ensure the checksums are read with NvMedia2DGetChecksum() before they are overwritten by subsequent operations.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | params | An NvMedia2DComposeParameters handle. |
| [in] | checksumMode | The checksum to calculate. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| NvMediaStatus NvMedia2DSetClipRect | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| NvMediaRect const *const | clipRect | ||
| ) |
Sets the clip rectangle for the compose operation.
Write to the destination surface is restricted to the region specified by the clip rectangle.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | params | An NvMedia2DComposeParameters handle. |
| [in] | clipRect | Pointer to an NvMediaRect that contains the clip rectangle, or NULL for default rectangle. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| NvMediaStatus NvMedia2DSetFilterBuffer | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| NvMedia2DFilterBuffer const | filterBuffer | ||
| ) |
Sets the filter buffer for an NvMedia2DComposeParameters instance.
This function updates the NvMedia2DComposeParameters instance to indicate that the specified filter buffer object shall be used to provide the custom filter coefficients for the compose operation. Any updates to the filter buffer object will be reflected in the compose operation described by the NvMedia2DComposeParameters instance. The caller is responsible for ensuring the lifetime of the filter buffer object extends beyond the duration of the compose operation.
After this function returns successfully, there are a few additional limitations on the compose operation:
Due to the filter buffer object being read-only from the compose operation perspective, there is no limitation for the same filter buffer object to be set for multiple NvMedia2DComposeParameters instances.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | params | An NvMedia2DComposeParameters handle. |
| [in] | filterBuffer | An NvMedia2DFilterBuffer handle. |
| NVMEDIA_STATUS_OK | Filter buffer was set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
Usage considerations
| NvMediaStatus NvMedia2DSetSrcBlendMode | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| uint32_t const | index, | ||
| NvMedia2DBlendMode const | blendMode, | ||
| float const | constantAlpha | ||
| ) |
Sets the blend mode 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] | blendMode | Blend mode to set. |
| [in] | constantAlpha | Constant alpha factor to use in blending. Must be in range [0, 1]. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| NvMediaStatus NvMedia2DSetSrcFilter | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| uint32_t const | index, | ||
| NvMedia2DFilter const | filter | ||
| ) |
Sets the filter mode 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] | filter | An NvMedia2DFilter to use when reading the the layer's 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 NvMedia2DSetSrcGeometry | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| uint32_t const | index, | ||
| NvMediaRect const *const | srcRect, | ||
| NvMediaRect const *const | dstRect, | ||
| NvMedia2DTransform const | transform | ||
| ) |
Sets the geometry 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] | dstRect | Pointer to an NvMediaRect that contains the destination rectangle, or NULL for default rectangle. |
| [in] | srcRect | Pointer to an NvMediaRect that contains the source rectangle, or NULL for default rectangle. |
| [in] | transform | An NvMedia2DTransform to apply the content region. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
| NVMEDIA_STATUS_NOT_SUPPORTED | Requested operation is not supported by current platform. |
Usage considerations
| NvMediaStatus NvMedia2DSetSrcLdcMaskMap | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| uint32_t const | index, | ||
| NvMedia2DLdcMaskMap const | ldcMaskMap | ||
| ) |
Sets the LDC mask map for a source layer.
After a successful call to this function, the compose parameters object referred to by params will refer to the LDC mask map object passed in ldcMaskMap. Any updates to the LDC mask map object will be reflected in the compose operation described by params. The caller is responsible for ensuring the lifetime of the LDC mask map object extends beyond the duration of the compose operation.
| [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] | ldcMaskMap | An NvMedia2DLdcMaskMap handle. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| NvMediaStatus NvMedia2DSetSrcLdcTransformMatrix | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| uint32_t const | index, | ||
| NvMedia2DLdcTransformMatrix const *const | ldcIptParams | ||
| ) |
Sets the LDC transform matrix for a source layer.
Only one of LDC transform matrix or LDC warp map can be set for a given source layer of a compose operation.
| [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] | ldcIptParams | Pointer to an NvMedia2DLdcTransformMatrix struct. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| NvMediaStatus NvMedia2DSetSrcLdcWarpMap | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| uint32_t const | index, | ||
| NvMedia2DLdcWarpMap const | ldcWarpMap | ||
| ) |
Sets the LDC warp map for a source layer.
After a successful call to this function, the compose parameters object referred to by params will refer to the LDC warp map object passed in ldcWarpMap. Any updates to the LDC warp map object will be reflected in the compose operation described by params. The caller is responsible for ensuring the lifetime of the LDC warp map object extends beyond the duration of the compose operation.
Only one of LDC transform matrix or LDC warp map can be set for a given source layer of a compose operation.
| [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] | ldcWarpMap | An NvMedia2DLdcWarpMap handle. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| NvMediaStatus NvMedia2DSetTnrParameters | ( | NvMedia2D const *const | handle, |
| NvMedia2DTnrState const | tnrState, | ||
| NvMedia2DTnrParameters const *const | tnrParams | ||
| ) |
Sets Temporal Noise Reduction (TNR) parameters.
This updates the TNR state object to use the specified parameters for the TNR operation.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | tnrState | An NvMedia2DTnrState handle. |
| [in] | tnrParams | Pointer to NvMedia2DTnrParameters. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
| NvMediaStatus NvMedia2DSetTnrState | ( | NvMedia2D const *const | handle, |
| NvMedia2DComposeParameters const | params, | ||
| NvMedia2DTnrState const | tnrState | ||
| ) |
Sets the TNR state to use for the compose operation.
After a successful call to this function, the compose parameters object referred to by params will refer to the TNR state object passed in tnrState. Any updates to the TNR state object will be reflected in the compose operation described by params. The caller is responsible for ensuring the lifetime of the TNR state object extends beyond the duration of the compose operation.
| [in] | handle | Pointer to the NvMedia2D context. |
| [in] | params | An NvMedia2DComposeParameters handle. |
| [in] | tnrState | An NvMedia2DTnrState handle. |
| NVMEDIA_STATUS_OK | Parameters set successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations