NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

The 2D Processing API encompasses all NvMedia 2D image processing related functionality.

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...
 
#define NVMEDIA_2D_TASK_STATUS_CHECKSUM_MISMATCH   41u
 Task status value indicating the diagnostics test checksum did not match the expected one. 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_DST_SURFACE
}
 NvMedia 2D checksum mode. More...
 
enum  NvMedia2DContextPriority {
  NVMEDIA_2D_CONTEXT_PRIORITY_HIGHEST,
  NVMEDIA_2D_CONTEXT_PRIORITY_HIGH,
  NVMEDIA_2D_CONTEXT_PRIORITY_ABOVE_MEDIUM,
  NVMEDIA_2D_CONTEXT_PRIORITY_MEDIUM,
  NVMEDIA_2D_CONTEXT_PRIORITY_BELOW_MEDIUM,
  NVMEDIA_2D_CONTEXT_PRIORITY_LOW,
  NVMEDIA_2D_CONTEXT_PRIORITY_BELOW_LOW,
  NVMEDIA_2D_CONTEXT_PRIORITY_LOWEST
}
 Context priority levels for NvMedia2D. More...
 

Functions

NvMedia2DAttributes NvMedia2DGetDefaultAttributes (void)
 Return the default values for NvMedia2DAttributes. More...
 
NvMedia2DLdcWarpMapAttributes NvMedia2DGetDefaultLdcWarpMapAttributes (void)
 Return the default values for NvMedia2DLdcWarpMapAttributes. More...
 
NvMedia2DLdcMaskMapAttributes NvMedia2DGetDefaultLdcMaskMapAttributes (void)
 Return the default values for NvMedia2DLdcMaskMapAttributes. More...
 
NvMedia2DTnrStateAttributes NvMedia2DGetDefaultTnrStateAttributes (void)
 Return the default values for NvMedia2DTnrStateAttributes. More...
 
NvMediaStatus NvMedia2DCreate (NvMedia2D **const handle, NvMedia2DAttributes const *const attr)
 Creates a new NvMedia2D context. More...
 
NvMediaStatus NvMedia2DDestroy (NvMedia2D const *const handle)
 Destroys the NvMedia2D context. More...
 
NvMediaStatus NvMedia2DSetContextPriority (NvMedia2D const *const handle, NvMedia2DContextPriority const priority)
 Set global priority of this context. More...
 
const NvMedia2DCapabilities * NvMedia2DGetCapabilities (NvMedia2D const *const handle)
 Returns the NvMedia2D context capabilities. More...
 
NvMediaStatus NvMedia2DGetComposeParameters (NvMedia2D const *const handle, NvMedia2DComposeParameters *const params)
 Returns an NvMedia2DComposeParameters instance. More...
 
NvMediaStatus NvMedia2DReleaseComposeParameters (NvMedia2D const *const handle, NvMedia2DComposeParameters const params)
 Releases an NvMedia2DComposeParameters instance. More...
 
NvMediaStatus NvMedia2DCompose (NvMedia2D const *const handle, NvMedia2DComposeParameters const params, NvMedia2DComposeResult *const result)
 Performs a 2D compose operation. More...
 
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. More...
 
NvMediaStatus NvMedia2DSetSrcFilter (NvMedia2D const *const handle, NvMedia2DComposeParameters const params, uint32_t const index, NvMedia2DFilter const filter)
 Sets the filter mode for a source layer. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
NvMediaStatus NvMedia2DSetClipRect (NvMedia2D const *const handle, NvMedia2DComposeParameters const params, NvMediaRect const *const clipRect)
 Sets the clip rectangle for the compose operation. More...
 
NvMediaStatus NvMedia2DSetTnrState (NvMedia2D const *const handle, NvMedia2DComposeParameters const params, NvMedia2DTnrState const tnrState)
 Sets the TNR state to use for the compose operation. More...
 
NvMediaStatus NvMedia2DCreateFilterBuffer (NvMedia2D const *const handle, NvMedia2DFilterBuffer *const filterBuffer)
 Creates and returns an NvMedia2DFilterBuffer instance. More...
 
NvMediaStatus NvMedia2DDestroyFilterBuffer (NvMedia2D const *const handle, NvMedia2DFilterBuffer const filterBuffer)
 Destroys an NvMedia2DFilterBuffer instance. More...
 
NvMediaStatus NvMedia2DSetFilterBuffer (NvMedia2D const *const handle, NvMedia2DComposeParameters const params, NvMedia2DFilterBuffer const filterBuffer)
 Sets the filter buffer for an NvMedia2DComposeParameters instance. More...
 
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. More...
 
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. More...
 
NvMediaStatus NvMedia2DCreateLdcWarpMap (NvMedia2D const *const handle, NvMedia2DLdcWarpMapAttributes const *const ldcWarpMapAttr, NvMedia2DLdcWarpMap *const ldcWarpMap)
 Creates and returns an NvMedia2DLdcWarpMap instance. More...
 
NvMediaStatus NvMedia2DDestroyLdcWarpMap (NvMedia2D const *const handle, NvMedia2DLdcWarpMap const ldcWarpMap)
 Destroys an NvMedia2DLdcWarpMap instance. More...
 
NvMediaStatus NvMedia2DCreateLdcMaskMap (NvMedia2D const *const handle, NvMedia2DLdcMaskMapAttributes const *const ldcMaskMapAttr, NvMedia2DLdcMaskMap *const ldcMaskMap)
 Creates and returns an NvMedia2DLdcMaskMap instance. More...
 
NvMediaStatus NvMedia2DDestroyLdcMaskMap (NvMedia2D const *const handle, NvMedia2DLdcMaskMap const ldcMaskMap)
 Destroys an NvMedia2DLdcMaskMap instance. More...
 
NvMediaStatus NvMedia2DFillLdcWarpMap (NvMedia2D const *const handle, NvMedia2DLdcWarpMap const ldcWarpMap, NvMedia2DLdcWarpMapParameters const *const lcdWarpMapParams)
 Populates an LDC warp map with content. More...
 
NvMediaStatus NvMedia2DFillLdcMaskMap (NvMedia2D const *const handle, NvMedia2DLdcMaskMap const ldcMaskMap, NvMedia2DLdcMaskMapParameters const *const ldcMaskMapParams)
 Populates an LDC mask map with content. More...
 
NvMediaStatus NvMedia2DCreateTnrState (NvMedia2D const *const handle, NvMedia2DTnrStateAttributes const *const tnrStateAttr, NvMedia2DTnrState *const tnrState)
 Creates and returns an NvMedia2DTnrState instance. More...
 
NvMediaStatus NvMedia2DDestroyTnrState (NvMedia2D const *const handle, NvMedia2DTnrState const tnrState)
 Destroys an NvMedia2DTnrState instance. More...
 
NvMediaStatus NvMedia2DSetTnrParameters (NvMedia2D const *const handle, NvMedia2DTnrState const tnrState, NvMedia2DTnrParameters const *const tnrParams)
 Sets Temporal Noise Reduction (TNR) parameters. More...
 
NvMediaStatus NvMedia2DResetTnr (NvMedia2D const *const handle, NvMedia2DTnrState const tnrState)
 Resets TNR algorithm state. More...
 
NvMediaStatus NvMedia2DSetChecksumMode (NvMedia2D const *const handle, NvMedia2DComposeParameters const params, NvMedia2DChecksumMode const checksumMode)
 Sets checksum calculation mode. More...
 
NvMediaStatus NvMedia2DGetChecksum (NvMedia2D const *const handle, NvMedia2DComposeResult const *const result, NvMedia2DChecksum *const checksum)
 Gets a checksum calculated for an NvMedia2DCompose() operation. More...
 
NvMediaStatus NvMedia2DSetBackgroundFill (NvMedia2D const *const handle, NvMedia2DComposeParameters const params, bool const fillBackground)
 Configures the background fill for the NvMedia2DCompose() operation. More...
 
NvMediaStatus NvMedia2DSetDiagnosticsTest (NvMedia2D const *const handle, NvMedia2DComposeParameters const params, uint32_t const testId)
 Sets the diagnostics test ID for an NvMedia2DCompose() operation. More...
 

Macro Definition Documentation

◆ NVMEDIA_2D_CHECKSUM_NUM_BYTES

#define NVMEDIA_2D_CHECKSUM_NUM_BYTES   24u

Number of bytes in NvMedia 2D checksums.

Definition at line 47 of file nvmedia_2d.h.

◆ NVMEDIA_2D_MAX_LDC_REGIONS_X

#define NVMEDIA_2D_MAX_LDC_REGIONS_X   4U

Maximum number of horizontal LDC regions.

Definition at line 41 of file nvmedia_2d.h.

◆ NVMEDIA_2D_MAX_LDC_REGIONS_Y

#define NVMEDIA_2D_MAX_LDC_REGIONS_Y   4U

Maximum number of vertical LDC regions.

Definition at line 44 of file nvmedia_2d.h.

◆ NVMEDIA_2D_TASK_STATUS_CHECKSUM_MISMATCH

#define NVMEDIA_2D_TASK_STATUS_CHECKSUM_MISMATCH   41u

Task status value indicating the diagnostics test checksum did not match the expected one.

Definition at line 51 of file nvmedia_2d.h.

Typedef Documentation

◆ NvMedia2D

typedef struct NvMedia2D NvMedia2D

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.


Usage considerations

  • Maturity: GA
See also
NvMedia2DCreate()

Definition at line 1233 of file nvmedia_2d.h.

◆ NvMedia2DComposeParameters

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.

See also
NvMedia2DGetComposeParameters()
NvMedia2DReleaseComposeParameters()
NvMedia2DInsertPreNvSciSyncFence()
NvMedia2DSetNvSciSyncObjforEOF()
NvMedia2DSetSrcGeometry()
NvMedia2DSetSrcFilter()
NvMedia2DSetSrcLdcTransformMatrix()
NvMedia2DSetSrcLdcWarpMap()
NvMedia2DSetSrcLdcMaskMap()
NvMedia2DSetSrcNvSciBufObj()
NvMedia2DSetDstNvSciBufObj()
NvMedia2DCompose()

Definition at line 581 of file nvmedia_2d.h.

◆ NvMedia2DFilterBuffer

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.

See also
NvMedia2DCreateFilterBuffer()
NvMedia2DDestroyFilterBuffer()

Definition at line 597 of file nvmedia_2d.h.

◆ NvMedia2DLdcMaskMap

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.

See also
NvMedia2DCreateLdcMaskMap()
NvMedia2DDestroyLdcMaskMap()

Definition at line 629 of file nvmedia_2d.h.

◆ NvMedia2DLdcWarpMap

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.

See also
NvMedia2DCreateLdcWarpMap()
NvMedia2DDestroyLdcWarpMap()

Definition at line 613 of file nvmedia_2d.h.

◆ NvMedia2DTnrState

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.

See also
NvMedia2DCreateTnrState()
NvMedia2DDestroyTnrState()

Definition at line 645 of file nvmedia_2d.h.

Enumeration Type Documentation

◆ NvMedia2DBlendMode

Blending to use when compositing surfaces.


Usage considerations

  • Maturity: GA
Enumerator
NVMEDIA_2D_BLEND_MODE_DISABLED 

Disable blending.

The color and alpha channels of the source surfaces are copied to the
destination surface as is. The constant alpha factor is ignored. This is
the default mode.
NVMEDIA_2D_BLEND_MODE_CONSTANT_ALPHA 

Ignore the alpha channel values.

Ignore the alpha channel values in the pixel data and only use the
constant alpha factor that was passed when configuring blending.

The color channels are blended with:

`result = src * constantAlpha + dst * (1 - constantAlpha)`
NVMEDIA_2D_BLEND_MODE_STRAIGHT_ALPHA 

Treat color and alpha channels independently.

Use the product of the alpha channel values in the pixel data and the
constant alpha factor to interpolate between color channel values of the
blended surfaces.

The color channels are blended with:

`result = src * srcAlpha * constantAlpha + dst * (1 - srcAlpha * constantAlpha)`
NVMEDIA_2D_BLEND_MODE_PREMULTIPLIED_ALPHA 

Treat color channels as having the alpha channel premultiplied.

As NVMEDIA_2D_BLEND_MODE_STRAIGHT_ALPHA, but assume color channel values
have been premultiplied by the alpha channel value.

The color channels are blended with:

`result = src * constantAlpha + dst * (1 - srcAlpha * constantAlpha)`

Definition at line 203 of file nvmedia_2d.h.

◆ NvMedia2DChecksumMode

NvMedia 2D checksum mode.

This enum describes the different checksum calculation modes that are supported by NvMedia 2D.


Usage considerations

  • Maturity: GA
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.

NVMEDIA_2D_CHECKSUM_MODE_DST_SURFACE 

Checksum calculated from destination surface pixel data.

Definition at line 1157 of file nvmedia_2d.h.

◆ NvMedia2DContextPriority

Context priority levels for NvMedia2D.

Priority values are sorted in descending order. A comparison operation on the enum values can be used to determine the priority order.

Note
Certain priority levels may require special permissions on some platforms.


Usage considerations

  • Maturity: GA
Enumerator
NVMEDIA_2D_CONTEXT_PRIORITY_HIGHEST 

The highest priority level.

Useful for safety critical applications.

This level is typically only available to safety critical contexts.
NVMEDIA_2D_CONTEXT_PRIORITY_HIGH 

High priority level.

This level is typically only available to safety critical contexts.
NVMEDIA_2D_CONTEXT_PRIORITY_ABOVE_MEDIUM 

Above medium priority level.

NVMEDIA_2D_CONTEXT_PRIORITY_MEDIUM 

Medium priority level.

This is the default priority level for safety critical contexts.
NVMEDIA_2D_CONTEXT_PRIORITY_BELOW_MEDIUM 

Below medium priority level.

NVMEDIA_2D_CONTEXT_PRIORITY_LOW 

Low priority level.

This is the default priority level for non-safety critical contexts.
NVMEDIA_2D_CONTEXT_PRIORITY_BELOW_LOW 

Below low priority level.

NVMEDIA_2D_CONTEXT_PRIORITY_LOWEST 

The lowest priority level.

Useful for non-interactive tasks.

Definition at line 1179 of file nvmedia_2d.h.

◆ 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.


Usage considerations

  • Maturity: GA
See also
NvMedia2DSetFilterBuffer()
Enumerator
NVMEDIA_2D_FILTER_OFF 

Filtering is disabled.

This mode results in nearest-neighbor filtering being used.
NVMEDIA_2D_FILTER_LOW 

Low quality filtering.

This mode results in bilinear filtering being used.
NVMEDIA_2D_FILTER_MEDIUM 

Medium quality filtering.

This mode results in 5-tap filtering being used. By default, the filter
used is a Lanczos filter. The coefficients can be overridden with
NvMedia2DSetFilterBuffer().
NVMEDIA_2D_FILTER_HIGH 

Highest quality filtering.

This mode results in 10-tap filtering being used. By default, the filter
used is a Lanczos filter. The coefficients can be overridden with
NvMedia2DSetFilterBuffer().

Definition at line 66 of file nvmedia_2d.h.

◆ 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:

INPUT OUTPUT
+---+---+ +---+---+
| 0 | 1 | IDENTITY | 0 | 1 |
+---+---+ ---------------> +---+---+
| 2 | 3 | | 2 | 3 |
+---+---+ +---+---+
+---+---+ +---+---+
| 0 | 1 | ROTATE_90 | 1 | 3 |
+---+---+ ---------------> +---+---+
| 2 | 3 | | 0 | 2 |
+---+---+ +---+---+
+---+---+ +---+---+
| 0 | 1 | ROTATE_180 | 3 | 2 |
+---+---+ ---------------> +---+---+
| 2 | 3 | | 1 | 0 |
+---+---+ +---+---+
+---+---+ +---+---+
| 0 | 1 | ROTATE_270 | 2 | 0 |
+---+---+ ---------------> +---+---+
| 2 | 3 | | 3 | 1 |
+---+---+ +---+---+
+---+---+ +---+---+
| 0 | 1 | FLIP_HORIZONTAL | 1 | 0 |
+---+---+ ---------------> +---+---+
| 2 | 3 | | 3 | 2 |
+---+---+ +---+---+
+---+---+ +---+---+
| 0 | 1 | INVTRANSPOSE | 3 | 1 |
+---+---+ ---------------> +---+---+
| 2 | 3 | | 2 | 0 |
+---+---+ +---+---+
+---+---+ +---+---+
| 0 | 1 | FLIP_VERTICAL | 2 | 3 |
+---+---+ ---------------> +---+---+
| 2 | 3 | | 0 | 1 |
+---+---+ +---+---+
+---+---+ +---+---+
| 0 | 1 | TRANSPOSE | 0 | 2 |
+---+---+ ---------------> +---+---+
| 2 | 3 | | 1 | 3 |
+---+---+ +---+---+


Usage considerations

  • Maturity: GA
Enumerator
NVMEDIA_2D_TRANSFORM_NONE 

No transform. This is the default behavior.

NVMEDIA_2D_TRANSFORM_ROTATE_90 

Rotate 90 degrees anti-clockwise.

NVMEDIA_2D_TRANSFORM_ROTATE_180 

Rotate 180 degrees.

NVMEDIA_2D_TRANSFORM_ROTATE_270 

Rotate 270 degrees anti-clockwise.

NVMEDIA_2D_TRANSFORM_FLIP_HORIZONTAL 

Flip horizontally (mirror along Y axis).

NVMEDIA_2D_TRANSFORM_INV_TRANSPOSE 

Apply inverse transpose (mirror along diagonal axis from top-right to bottom-left).

NVMEDIA_2D_TRANSFORM_FLIP_VERTICAL 

Flip vertically (mirror along X axis).

NVMEDIA_2D_TRANSFORM_TRANSPOSE 

Apply transpose (mirror along diagonal axis from top-left to bottom-right).

Definition at line 168 of file nvmedia_2d.h.

Function Documentation

◆ NvMedia2DCompose()

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:

  • Width must be within the range: [16, 16384]
  • Height must be within the range: [16, 16384]

Additional surface dimension restrictions for chroma sub-sampled YUV formats:

  • 444:
    • Width: no restriction
    • Height: no restriction
  • 422:
    • Width: must be a multiple of 2
    • Height: no restriction
  • 422R:
    • Width: no restriction
    • Height: must be a multiple of 2
  • 420:
    • Width: must be a multiple of 2
    • Height: must be a multiple of 2

Restrictions on the source rectangle:

  • Must be within the bounds of the source surface.
  • Width and height must be greater than zero.

Restrictions on the destination and clip rectangle:

  • Must be within the bounds of the destination surface.
  • Width and height must be greater than zero.

Restrictions on the source layers:

If NvMedia2DCapabilities::supports16BitYUVNatively is false, following additional restrictions apply for 16-bit YUV/YUVX/Y formats:

  • Only scaling and cropping are supported. Pixel format conversion, transformations or multi-surface composition is not supported.
  • Surface width must be within the range: [16, 8192]
  • Surface height must be within the range: [16, 8192]
  • With 422 chroma sub-sampling, surface width must be at least 32
  • With 422R chroma sub-sampling, surface height must be at least 32
  • With 420 chroma sub-sampling, both surface width and surface height must be at least 32
  • Destination rectangle top-left corner must be zero.

If NvMedia2DCapabilities::supportsNonAlignedRects is false, following additional restrictions apply for chroma sub-sampled YUV formats:

  • All destination and clip rectangle corners must be aligned to a a multiple of 2.

Restrictions on concurrency:

  • There can be a maximum of 16 operations submitted through the same NvMedia2D handle pending simultaneously.

If any of the restrictions are violated, this function will fail with an error code.

Performance considerations:

  • Using block linear memory layout for surfaces generally provides better performance than pitch linear layout.
  • Using (semi-)planar YUV formats generally provides better performance than interleaved (Y8U8Y8V8 etc.) formats.
  • The hardware accelerator utilized by NvMedia 2D accesses the destination surface in "tiles" of size NvMedia2DCapabilities::tileWidth x NvMedia2DCapabilities::tileHeight pixels. Using destination surface size and destination rectangle dimensions that are exact multiples of the tile size most optimally aligns with this hardware access pattern.
  • If NvMedia2DCapabilities::supports16BitYUVNatively is false, operations with 16-bit (semi-)planar YUV format surfaces will be processed with multiple harware accelerator passes.

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[out]resultPointer to NvMedia2DComposeResult struct that will be populated with result info. May be NULL.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKOperation submitted successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • some of the compose parameters configured through params have invalid values (see restrictions on parameters).
NVMEDIA_STATUS_NOT_SUPPORTEDRequested operation is not supported by current platform (see restrictions on parameters).
NVMEDIA_STATUS_TIMED_OUTNo 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_ERRORAn internal failure occurred when trying to perform the compose operation. This error indicates the system is potentially in an unrecoverable state.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Async
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DCapabilities
NvMedia2DComposeParameters
NvMedia2DGetComposeParameters()
NvMedia2DInsertPreNvSciSyncFence()
NvMedia2DSetNvSciSyncObjforEOF()
NvMedia2DSetSrcGeometry()
NvMedia2DSetSrcFilter()
NvMedia2DSetSrcBlendMode()
NvMedia2DSetSrcLdcTransformMatrix()
NvMedia2DSetSrcLdcWarpMap()
NvMedia2DSetSrcLdcMaskMap()
NvMedia2DSetSrcNvSciBufObj()
NvMedia2DSetDstNvSciBufObj()
NvMedia2DGetEOFNvSciSyncFence()

◆ NvMedia2DComputeFilterCoefficients10Tap()

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

Parameters
[in]handlePointer to the NvMedia2D context.
[in]filterBufferAn NvMedia2DFilterBuffer handle.
[in]indexIndex of source layer to configure. Must be in range [0, 4].
[in]lumaX,lumaYPointers 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,chromaYPointers 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.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKFilter buffer was updated successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL.
  • filterBuffer is invalid.
  • index is out of range.
  • lumaX is NULL.
  • lumaY is NULL.
  • chromaX is NULL.
  • chromaY is NULL.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DFilterBuffer
NvMedia2DFilterCoefficients10Tap
NvMedia2DCreateFilterBuffer()

◆ NvMedia2DComputeFilterCoefficients5Tap()

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

Parameters
[in]handlePointer to the NvMedia2D context.
[in]filterBufferAn NvMedia2DFilterBuffer handle.
[in]indexIndex of source layer to configure. Must be in range [0, 4].
[in]lumaX,lumaYPointers 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,chromaYPointers 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.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKFilter buffer was updated successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL.
  • filterBuffer is invalid.
  • index is out of range.
  • lumaX is NULL.
  • lumaY is NULL.
  • chromaX is NULL.
  • chromaY is NULL.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DFilterBuffer
NvMedia2DFilterCoefficients5Tap
NvMedia2DCreateFilterBuffer()

◆ NvMedia2DCreate()

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.

Parameters
[out]handlePointer to receive the handle to the new NvMedia2D context.
[in]attrPointer to NvMedia2DAttributes struct, or NULL for default attributes.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKContext created successfully.
NVMEDIA_STATUS_BAD_PARAMETERhandle is NULL, or attr has bad attribute values.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_NOT_SUPPORTEDNvMedia 2D is not supported on this hardware platform.
NVMEDIA_STATUS_OUT_OF_MEMORYMemory allocation failed for internal data structures or device memory buffers.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to create the context.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DAttributes
NvMedia2D
NvMedia2DGetDefaultAttributes()
NvMedia2DDestroy()

◆ NvMedia2DCreateFilterBuffer()

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().

Parameters
[in]handlePointer to the NvMedia2D context.
[out]filterBufferPointer to an NvMedia2DFilterBuffer, which will be populated with the handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKBuffer created successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL
  • filterBuffer is NULL.
NVMEDIA_STATUS_INSUFFICIENT_BUFFERINGMaximum number of buffers has been created.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_OUT_OF_MEMORYFailed to allocate memory for the buffer.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to create the buffer.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DAttributes
NvMedia2DFilterBuffer
NvMedia2DDestroyFilterBuffer()

◆ NvMedia2DCreateLdcMaskMap()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]ldcMaskMapAttrPointer to NvMedia2DLdcMaskMapAttributes struct, or NULL for default attributes.
[out]ldcMaskMapPointer to an NvMedia2DLdcMaskMap, which will be populated with the handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKObject created successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL
  • ldcMaskMap is NULL.
NVMEDIA_STATUS_NOT_SUPPORTEDLDC mask maps are not supported on current platform.
NVMEDIA_STATUS_INSUFFICIENT_BUFFERINGMaximum number of mask maps has been created.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_OUT_OF_MEMORYFailed to allocate memory for the mask map.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to create the buffer.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DLdcMaskMapAttributes
NvMedia2DLdcMaskMap
NvMedia2DGetDefaultLdcMaskMapAttributes()
NvMedia2DDestroyLdcMaskMap()

◆ NvMedia2DCreateLdcWarpMap()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]ldcWarpMapAttrPointer to NvMedia2DLdcWarpMapAttributes struct, or NULL for default attributes.
[out]ldcWarpMapPointer to an NvMedia2DLdcWarpMap, which will be populated with the handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKObject created successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL
  • ldcWarpMap is NULL.
NVMEDIA_STATUS_NOT_SUPPORTEDLDC operations are not supported on current platform.
NVMEDIA_STATUS_INSUFFICIENT_BUFFERINGMaximum number of warp maps has been created.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_OUT_OF_MEMORYFailed to allocate memory for the warp map.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to create the warp map.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DLdcWarpMapAttributes
NvMedia2DLdcWarpMap
NvMedia2DGetDefaultLdcWarpMapAttributes()
NvMedia2DDestroyLdcWarpMap()

◆ NvMedia2DCreateTnrState()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]tnrStateAttrPointer to NvMedia2DTnrStateAttributes struct, or NULL for default attributes.
[out]tnrStatePointer to an NvMedia2DTnrState, which will be populated with the handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKObject created successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL
  • tnrState is NULL.
NVMEDIA_STATUS_INSUFFICIENT_BUFFERINGMaximum number of TNR states has been created.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_OUT_OF_MEMORYFailed to allocate memory for the TNR state.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to create the TNR state.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DTnrStateAttributes
NvMedia2DTnrState
NvMedia2DGetDefaultTnrStateAttributes()
NvMedia2DDestroyTnrState()

◆ NvMedia2DDestroy()

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:

  • There are no NvSciSync or NvSyncBuf objects still registered against the NvMedia2D context.
  • There are no NvMedia2DFilterBuffer objects still alive.
  • All previous 2D operations submitted using NvMedia2DCompose() have
    Parameters
    [in]handlePointer to the NvMedia2D context.
    Returns
    An NvMediaStatus return code.
    Return values
    NVMEDIA_STATUS_OKContext destroyed successfully.
    NVMEDIA_STATUS_BAD_PARAMETERhandle is NULL.
    NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
    NVMEDIA_STATUS_PENDINGThere 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_ERRORAn 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.
    Precondition
  • handle must be valid NvMedia2D handle created with NvMedia2DCreate().


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA
See also
NvMedia2D
NvMedia2DCreate()

◆ NvMedia2DDestroyFilterBuffer()

NvMediaStatus NvMedia2DDestroyFilterBuffer ( NvMedia2D const *const  handle,
NvMedia2DFilterBuffer const  filterBuffer 
)

Destroys an NvMedia2DFilterBuffer instance.

This functions destroys an NvMedia2DFilterBuffer object.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]filterBufferAn NvMedia2DFilterBuffer handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKBuffer are destroyed successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL.
  • filterBuffer is invalid.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_PENDINGThe buffer is still being used by a pending operation.
NVMEDIA_STATUS_ERRORAn 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.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA
See also
NvMedia2DFilterBuffer
NvMedia2DCreateFilterBuffer()

◆ NvMedia2DDestroyLdcMaskMap()

NvMediaStatus NvMedia2DDestroyLdcMaskMap ( NvMedia2D const *const  handle,
NvMedia2DLdcMaskMap const  ldcMaskMap 
)

Destroys an NvMedia2DLdcMaskMap instance.

This functions destroys an NvMedia2DLdcMaskMap object.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]ldcMaskMapAn NvMedia2DLdcMaskMap handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKObject destroyed successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL.
  • ldcMaskMap is invalid.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_PENDINGThe mask map is still being used by a pending operation.
NVMEDIA_STATUS_ERRORAn 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.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA
See also
NvMedia2DLdcMaskMap
NvMedia2DCreateLdcMaskMap()

◆ NvMedia2DDestroyLdcWarpMap()

NvMediaStatus NvMedia2DDestroyLdcWarpMap ( NvMedia2D const *const  handle,
NvMedia2DLdcWarpMap const  ldcWarpMap 
)

Destroys an NvMedia2DLdcWarpMap instance.

This functions destroys an NvMedia2DLdcWarpMap object.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]ldcWarpMapAn NvMedia2DLdcWarpMap handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKObject destroyed successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL.
  • ldcWarpMap is invalid.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_PENDINGThe warp map is still being used by a pending operation.
NVMEDIA_STATUS_ERRORAn 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.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA
See also
NvMedia2DLdcWarpMap
NvMedia2DCreateLdcWarpMap()

◆ NvMedia2DDestroyTnrState()

NvMediaStatus NvMedia2DDestroyTnrState ( NvMedia2D const *const  handle,
NvMedia2DTnrState const  tnrState 
)

Destroys an NvMedia2DTnrState instance.

This functions destroys an NvMedia2DTnrState object.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]tnrStateAn NvMedia2DTnrState handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKObject destroyed successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL.
  • tnrState is invalid.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_PENDINGThe TNR statemap is still being used by a pending operation.
NVMEDIA_STATUS_ERRORAn 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.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA
See also
NvMedia2DTnrState
NvMedia2DCreateTnrState()

◆ NvMedia2DFillLdcMaskMap()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]ldcMaskMapAn NvMedia2DLdcMaskMap handle.
[in]ldcMaskMapParamsPointer to NvMedia2DLdcMaskMapParameters.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • ldcMaskMap is invalid
  • ldcMaskMapParams is NULL.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMediai2DLdcMaskMap
NvMediai2DLdcMaskMapParameters

◆ NvMedia2DFillLdcWarpMap()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]ldcWarpMapAn NvMedia2DLdcWarpMap handle.
[in]ldcWarpMapParamsPointer to NvMedia2DLdcWarpMapParameters.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • ldcWarpMap is invalid
  • ldcWarpMapParams is NULL.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMediai2DLdcWarpMap
NvMediai2DLdcWarpMapParameters

◆ NvMedia2DGetCapabilities()

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.

Parameters
[in]handleThe NvMedia2D context handle.
Returns
Pointer to a read-only NvMedia2DCapabilities struct. Ownership of this pointer is retained by the NvMedia2D context. The return value will be a null pointer if the specified context is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA
See also
NvMedia2DCapabilities

◆ NvMedia2DGetChecksum()

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().

Parameters
[in]handlePointer to the NvMedia2D context.
[in]resultPointer to the NvMedia2DComposeResult object of the operation.
[out]checksumPointer to an NvMedia2DChecksum object that will be populated with the checksum.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKChecksum returned successfully in checksum.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • result is NULL
  • result indicates no operation was submitted
  • No checksum was found for operation represented by result
  • checksum is NULL.
NVMEDIA_STATUS_NOT_SUPPORTEDChecksums are not supported on current platform.
NVMEDIA_STATUS_PENDINGThe operation is still pending.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to read the checksum.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DChecksum
NvMedia2DSetChecksumMode()

◆ NvMedia2DGetComposeParameters()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[out]paramsPointer to an NvMedia2DComposeParameters, which will be populated with the handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters instance is initialized successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL
  • params is NULL.
NVMEDIA_STATUS_INSUFFICIENT_BUFFERINGThere is no free instance available.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to retrieve the parameters object.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DReleaseComposeParameters()
NvMedia2DCompose()

◆ NvMedia2DGetDefaultAttributes()

NvMedia2DAttributes NvMedia2DGetDefaultAttributes ( void  )

Return the default values for NvMedia2DAttributes.

This function returns a NvMedia2DAttributes structure with default values.

Default attributes:

  • numComposeParameters: 1
  • maxRegisteredBuffers: 64
  • maxRegisteredSyncs: 16
  • maxFilterBuffers: 0
  • maxLdcWarpMaps: 16
  • maxLdcMaskMaps: 16
  • maxTnrStates: 16
  • enableDiagnostics: false
  • numaNodeId: 0
  • flags: undefined
Returns
A NvMedia2DAttributes structure with default values.
Precondition
None.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DAttributes

◆ NvMedia2DGetDefaultLdcMaskMapAttributes()

NvMedia2DLdcMaskMapAttributes NvMedia2DGetDefaultLdcMaskMapAttributes ( void  )

Return the default values for NvMedia2DLdcMaskMapAttributes.

This function returns a NvMedia2DLdcMaskMapAttributes structure with default values.

Default attributes:

  • maxDstWidth: 0
  • maxDstHeight: 0
Returns
A NvMedia2DLdcMaskMapAttributes structure with default values.
Precondition
None.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DLdcMaskMapAttributes

◆ NvMedia2DGetDefaultLdcWarpMapAttributes()

NvMedia2DLdcWarpMapAttributes NvMedia2DGetDefaultLdcWarpMapAttributes ( void  )

Return the default values for NvMedia2DLdcWarpMapAttributes.

This function returns a NvMedia2DLdcWarpMapAttributes structure with default values.

Default attributes:

  • maxWarpMapWidth: 0
  • maxWarpMapHeight: 0
Returns
A NvMedia2DLdcWarpMapAttributes structure with default values.
Precondition
None.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DLdcWarpMapAttributes

◆ NvMedia2DGetDefaultTnrStateAttributes()

NvMedia2DTnrStateAttributes NvMedia2DGetDefaultTnrStateAttributes ( void  )

Return the default values for NvMedia2DTnrStateAttributes.

This function returns a NvMedia2DTnrStateAttributes structure with default values.

Default attributes:

  • maxDstWidth: 0
  • maxDstHeight: 0
Returns
A NvMedia2DTnrStateAttributes structure with default values.
Precondition
None.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DTnrStateAttributes

◆ NvMedia2DReleaseComposeParameters()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsThe NvMedia2DComposeParameters instance to release.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters instance released successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL
  • params is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DGetComposeParameters()

◆ NvMedia2DResetTnr()

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().

Parameters
[in]handlePointer to the NvMedia2D context.
[in]tnrStateAn NvMedia2DTnrState handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKState reset successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • tnrState is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DTnrState

◆ NvMedia2DSetBackgroundFill()

NvMediaStatus NvMedia2DSetBackgroundFill ( NvMedia2D const *const  handle,
NvMedia2DComposeParameters const  params,
bool const  fillBackground 
)

Configures the background fill for the NvMedia2DCompose() operation.

This function configures whether the NvMedia2DCompose() operation should fill the area inside the clip rectangle but outside any destination rectangle with a solid background color.

The default behavior is to fill the background.

The support for non-filled background can be checked with NvMedia2DCapabilities::supportsNonFilledBackground.

If NvMedia2DCapabilities::supportsCompose is false, this function will fail with NVMEDIA_STATUS_NOT_SUPPORTED.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]fillBackgroundWhether to fill the background.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid.
NVMEDIA_STATUS_NOT_SUPPORTEDRequested operation is not supported on current platform.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DCapabilities::supportsCompose
NvMedia2DCapabilities::supportsNonFilledBackground

◆ NvMedia2DSetChecksumMode()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]checksumModeThe checksum to calculate.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • checksumMode is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DChecksumMode
NvMedia2DGetChecksum()

◆ NvMedia2DSetClipRect()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]clipRectPointer to an NvMediaRect that contains the clip rectangle, or NULL for default rectangle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid.
NVMEDIA_STATUS_NOT_SUPPORTEDRequested operation is not supported on current platform.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DCompose()

◆ NvMedia2DSetContextPriority()

NvMediaStatus NvMedia2DSetContextPriority ( NvMedia2D const *const  handle,
NvMedia2DContextPriority const  priority 
)

Set global priority of this context.

This function sets a global system-wide priority to the NvMedia2D context. The implementation prioritizes hardware resource allocation for higher-priority contexts, helping them maintain stable latency and throughput even under heavy system load from lower-priority contexts.

This function can be called at any time. All future tasks submitted to hardware after a call to this function will be processed based on the priority level.

For contexts with the same priority, the implementation may decide which context is processed first.

Note
Access to certain high priority levels may be restricted on some platforms and may require specific permissions.
Parameters
[in]handleThe NvMedia2D context handle.
[in]priorityThe NvMedia2DContextPriority to set.
Returns
An NvMediaStatus status code.
Return values
NVMEDIA_STATUS_OKPriority was set successfully.
NVMEDIA_STATUS_BAD_PARAMETERhandle is NULL or priority is invalid.
NVMEDIA_STATUS_NOT_SUPPORTEDRequested operation is not supported by current platform.
NVMEDIA_STATUS_ERRORAn internal error occurred when trying to set the priority.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: Experimental
See also
NvMedia2DContextPriority

◆ NvMedia2DSetDiagnosticsTest()

NvMediaStatus NvMedia2DSetDiagnosticsTest ( NvMedia2D const *const  handle,
NvMedia2DComposeParameters const  params,
uint32_t const  testId 
)

Sets the diagnostics test ID for an NvMedia2DCompose() operation.

This function updates the NvMedia2DComposeParameters instance to indicate that a diagnostics test should be run instead of a regular compose operation when NvMedia2DCompose() is called.

When a diagnostics test ID is set, any other compose parameters (source/ destination surfaces, filters, LDC, TNR, etc.) are ignored. The diagnostics test uses its own pre-allocated internal resources.

The result of the diagnostic test is indicated in the task status that can be queried from the EOF fence:

  • NvSciSyncTaskStatus_Success: test passed
  • NVMEDIA_2D_TASK_STATUS_CHECKSUM_MISMATCH: calculated checksum did not match the expected one
  • Other: an internal failure

Because of this, EOF sync object must always be set with NvMedia2DSetNvSciSyncObjforEOF() prior to calling NvMedia2DCompose() for diagnostics tests when using NvSci API.

This example runs a diagnostic test with id 0.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]testIdThe diagnostics test ID to run. Must be in range [0, NvMedia2DCapabilities::numDiagnosticsTests[.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKTest ID was set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL.
  • params is invalid.
  • testId is out of range.
NVMEDIA_STATUS_NOT_SUPPORTEDDiagnostics is not supported or not enabled for this context.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: Experimental
See also
NvMedia2DAttributes::enableDiagnostics
NvMedia2DCapabilities::numDiagnosticsTests
NVMEDIA_2D_TASK_STATUS_CHECKSUM_MISMATCH

◆ NvMedia2DSetFilterBuffer()

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:

  • Only the first 5 source layers can be used (indexes 0 to 4).
  • If a source layer's NvMedia2DFilter is set to NVMEDIA_2D_FILTER_MEDIUM or NVMEDIA_2D_FILTER_HIGH, the custom 5-tap or 10-tap coefficients, respectively, for such layer shall have been properly set in the NvMedia2DFilterBuffer.

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]filterBufferAn NvMedia2DFilterBuffer handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKFilter buffer was set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value, either:
  • handle is NULL.
  • params is invalid.
  • filterBuffer is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DFilterBuffer
NvMedia2DCreateFilterBuffer()
NvMedia2DFilter
NvMedia2DSetSrcFilter()
NvMedia2DComputeFilterCoefficients5Tap()
NvMedia2DComputeFilterCoefficients10Tap()

◆ NvMedia2DSetSrcBlendMode()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]indexIndex of source layer to configure. Must be in range [0, 15].
[in]blendModeBlend mode to set.
[in]constantAlphaConstant alpha factor to use in blending. Must be in range [0, 1].
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • index is out of range
  • blendMode is invalid
  • constantAlpha is out of range
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DBlendMode
NvMedia2DCompose()

◆ NvMedia2DSetSrcFilter()

NvMediaStatus NvMedia2DSetSrcFilter ( NvMedia2D const *const  handle,
NvMedia2DComposeParameters const  params,
uint32_t const  index,
NvMedia2DFilter const  filter 
)

Sets the filter mode for a source layer.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]indexIndex of source layer to configure. Must be in range [0, 15].
[in]filterAn NvMedia2DFilter to use when reading the the layer's source surface.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • index is out of range
  • filter is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DCompose()

◆ NvMedia2DSetSrcGeometry()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]indexIndex of source layer to configure. Must be in range [0, 15].
[in]dstRectPointer to an NvMediaRect that contains the destination rectangle, or NULL for default rectangle.
[in]srcRectPointer to an NvMediaRect that contains the source rectangle, or NULL for default rectangle.
[in]transformAn NvMedia2DTransform to apply the content region.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • index is out of range
  • srcRect is invalid
  • dstRect is invalid
  • transform is invalid.
NVMEDIA_STATUS_NOT_SUPPORTEDRequested operation is not supported by current platform.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DCompose()

◆ NvMedia2DSetSrcLdcMaskMap()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]indexIndex of source layer to configure. Must be in range [0, 15].
[in]ldcMaskMapAn NvMedia2DLdcMaskMap handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • index is out of range
  • ldcMaskMap is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DLdcMaskMap
NvMedia2DCompose()

◆ NvMedia2DSetSrcLdcTransformMatrix()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]indexIndex of source layer to configure. Must be in range [0, 15].
[in]ldcIptParamsPointer to an NvMedia2DLdcTransformMatrix struct.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • index is out of range
  • ldcIptParams is NULL.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DLdcWarpMap
NvMedia2DCompose()

◆ NvMedia2DSetSrcLdcWarpMap()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]indexIndex of source layer to configure. Must be in range [0, 15].
[in]ldcWarpMapAn NvMedia2DLdcWarpMap handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • index is out of range
  • ldcWarpMap is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DLdcWarpMap
NvMedia2DCompose()

◆ NvMedia2DSetTnrParameters()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]tnrStateAn NvMedia2DTnrState handle.
[in]tnrParamsPointer to NvMedia2DTnrParameters.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • tnrState is invalid
  • tnrParams is NULL.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DTnrState
NvMedia2DTnrParameters

◆ NvMedia2DSetTnrState()

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.

Parameters
[in]handlePointer to the NvMedia2D context.
[in]paramsAn NvMedia2DComposeParameters handle.
[in]tnrStateAn NvMedia2DTnrState handle.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKParameters set successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • tnrState is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different NvMedia2D handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Maturity: GA
See also
NvMedia2DComposeParameters
NvMedia2DTnrState
NvMedia2DCompose()
NvMedia2DComposeResult
Stores information returned from NvMedia2DCompose().
Definition: nvmedia_2d.h:660
NvMedia2DSetDstNvSciBufObj
NvMediaStatus NvMedia2DSetDstNvSciBufObj(NvMedia2D const *const handle, NvMedia2DComposeParameters const params, NvSciBufObj const dstSurface)
Sets the surface for the destination.
NvMedia2DCompose
NvMediaStatus NvMedia2DCompose(NvMedia2D const *const handle, NvMedia2DComposeParameters const params, NvMedia2DComposeResult *const result)
Performs a 2D compose operation.
NvMedia2DGetComposeParameters
NvMediaStatus NvMedia2DGetComposeParameters(NvMedia2D const *const handle, NvMedia2DComposeParameters *const params)
Returns an NvMedia2DComposeParameters instance.
NvMedia2DSetSrcNvSciBufObj
NvMediaStatus NvMedia2DSetSrcNvSciBufObj(NvMedia2D const *const handle, NvMedia2DComposeParameters const params, uint32_t const index, NvSciBufObj const srcSurface)
Sets the surface for a source layer.
NvMedia2DSetDiagnosticsTest
NvMediaStatus NvMedia2DSetDiagnosticsTest(NvMedia2D const *const handle, NvMedia2DComposeParameters const params, uint32_t const testId)
Sets the diagnostics test ID for an NvMedia2DCompose() operation.
NvMedia2DComposeParameters
uint32_t NvMedia2DComposeParameters
Stores configuration for the NvMedia2DCompose() operation.
Definition: nvmedia_2d.h:581
handle
const WFDCommitType const WFDHandle handle
Definition: wfdext.h:532
NvMedia2DSetNvSciSyncObjforEOF
NvMediaStatus NvMedia2DSetNvSciSyncObjforEOF(NvMedia2D const *const handle, NvMedia2DComposeParameters const params, NvSciSyncObj const syncObj)
Specifies the NvSciSyncObj to be used for EOF event.