Blit functions define valid parameters for a blit.
Data Structures | |
struct | NvMedia2DBlitParameters |
Stores configuration for the NvMedia2DBlitEx() operation. More... | |
struct | NvMedia2DBlitParametersOut |
Stores information returned from NvMedia2DBlitEx(). More... | |
Typedefs | |
typedef struct NvMedia2D | NvMedia2D |
NvMedia2D Context. More... | |
Enumerations | |
enum | NvMedia2DBlitParamField { NVMEDIA_2D_BLIT_PARAMS_FILTER = (1u << 0), NVMEDIA_2D_BLIT_PARAMS_FLAGS = (1u << 1), NVMEDIA_2D_BLIT_PARAMS_DST_TRANSFORM = (1u << 2), NVMEDIA_2D_BLIT_PARAMS_COLOR_STD = (1u << 3) } |
Parameter flags for NvMedia2DBlitEx(). More... | |
Functions | |
NvMedia2D * | NvMedia2DCreate (NvMediaDevice *device) |
Creates a new NvMedia2D context. More... | |
void | NvMedia2DDestroy (NvMedia2D *i2d) |
Destroys the NvMedia2D context. More... | |
NvMediaStatus | NvMedia2DDestroyEx (NvMedia2D *i2d) |
Destroys the NvMedia2D context. More... | |
NvMediaStatus | NvMedia2DBlitEx (const NvMedia2D *i2d, const NvMediaImage *dstSurface, const NvMediaRect *dstRect, const NvMediaImage *srcSurface, const NvMediaRect *srcRect, const NvMedia2DBlitParameters *params, NvMedia2DBlitParametersOut *paramsOut) |
Performs a 2D blit operation. More... | |
NvMediaStatus | NvMedia2DCopyPlaneNew (const NvMedia2D *i2d, NvMediaImage *dstSurface, uint32_t dstPlane, NvMediaImage *srcSurface, uint32_t srcPlane) |
Copies a plane of a YUV image to another YUV image. More... | |
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 311 of file multimedia/tvmr/include/nvmedia_2d.h.
Parameter flags for NvMedia2DBlitEx().
This enum defines the valid parameters that can be passed to the NvMedia2DBlitEx() function. These flags form a bitset of boolean values that are allowed to be passed in the validFields field of the NvMedia2DBlitParameters struct.
Enumerator | |
---|---|
NVMEDIA_2D_BLIT_PARAMS_FILTER | Enable NvMedia2DBlitParameters.filter field. |
NVMEDIA_2D_BLIT_PARAMS_FLAGS | Enable NvMedia2DBlitParameters.flags field. |
NVMEDIA_2D_BLIT_PARAMS_DST_TRANSFORM | Enable NvMedia2DBlitParameters.dstTransform field. |
NVMEDIA_2D_BLIT_PARAMS_COLOR_STD | Enable NvMedia2DBlitParameters.colorStandard field. |
Definition at line 196 of file multimedia/tvmr/include/nvmedia_2d.h.
NvMediaStatus NvMedia2DBlitEx | ( | const NvMedia2D * | i2d, |
const NvMediaImage * | dstSurface, | ||
const NvMediaRect * | dstRect, | ||
const NvMediaImage * | srcSurface, | ||
const NvMediaRect * | srcRect, | ||
const NvMedia2DBlitParameters * | params, | ||
NvMedia2DBlitParametersOut * | paramsOut | ||
) |
Performs a 2D blit operation.
A blit transfers pixels from a source surface to a destination surface, applying a variety of transformations to the pixel values on the way.
The interface is designed to simplify the typical uses of normal pixel copy by not requiring advanced blit parameters to be set unless they are actually required.
Set params to NULL to invoke a standard pixel copy blit without additional transformations. If the dimensions of the source rectangle do not match the dimensions of the destination rectangle, the blit scales the pixels to fit the destination rectangle. The filtering mode for scale defaults to NVMEDIA_2D_STRETCH_FILTER_LOW. You can use additional filtering modes by setting the corresponding parameter in NvMedia2DBlitParameters.
Set srcRect or dstRect to NULL to default to a source or destination rectangle the size of the full source or destination surface.
This example performs a straight pixel copy between surfaces of the same dimensions (but not necessarily the same bit depth or color format):
Default values (when not specified by caller):
Restrictions on dimensions for input and output surfaces:
Additional restrictions for chroma sub-sampled YUV formats:
Restrictions on the source rectangle:
Restrictions on the destination rectangle:
[in] | i2d | Pointer to the NvMedia2D context. |
[in] | dstSurface | Pointer to an NvMediaImage object to be used as the destination surface. |
[in] | dstRect | Pointer to an NvMediaRect that contains the destination rectangle, or NULL for default rectangle. |
[in] | srcSurface | Pointer to an NvMediaImage object to be used as the source surface. |
[in] | srcRect | Pointer to an NvMediaRect that contains the source rectangle, or NULL for default rectangle. |
[in] | params | Pointer to NvMedia2DBlitParameters struct, or NULL for default blit parameters. |
[out] | paramsOut | Pointer to NvMedia2DBlitParametersOut struct. This parameter is for internal use only, and can be set to 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. |
NVMEDIA_STATUS_TIMED_OUT | No space available in the command buffer for this operation, because previous operations are still pending. The caller should wait for the least recently submitted operation to complete and then try again. |
NVMEDIA_STATUS_UNDEFINED_STATE | There was en error when trying to submit the operation to hardware. This error indicates the system is potentially in an unrecoverable state. |
NVMEDIA_STATUS_ERROR | The operation cannot be handled due to either:
|
Usage considerations
NvMediaStatus NvMedia2DCopyPlaneNew | ( | const NvMedia2D * | i2d, |
NvMediaImage * | dstSurface, | ||
uint32_t | dstPlane, | ||
NvMediaImage * | srcSurface, | ||
uint32_t | srcPlane | ||
) |
Copies a plane of a YUV image to another YUV image.
The source and the destination must have the same format.
[in] | i2d | Pointer to the NvMedia2D context. |
[in] | dstSurface | Pointer to an NvMediaImage object to be used as the destination surface. |
[in] | dstPlane | Index of the YUV plane in destination surface. |
[in] | srcSurface | Pointer to an NvMediaImage object to be used as the source surface. |
[in] | srcPlane | Index of the YUV plane in source surface. |
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. |
NVMEDIA_STATUS_TIMED_OUT | No space available in the command buffer for this operation, because previous operations are still pending. The caller should wait for the least recently submitted operation to complete and then try again. |
NVMEDIA_STATUS_UNDEFINED_STATE | There was en error when trying to submit the operation to hardware. This error indicates the system is potentially in an unrecoverable state. |
NvMedia2D* NvMedia2DCreate | ( | NvMediaDevice * | device | ) |
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 NvMedia2DDestroyEx() function.
Usage considerations
[in] | device | Pointer to an NvMediaDevice object. This parameter is no longer used and can be set to NULL. |
void NvMedia2DDestroy | ( | NvMedia2D * | i2d | ) |
Destroys the NvMedia2D context.
Usage considerations
[in] | i2d | Pointer to the NvMedia2D context. May be NULL. |
NvMediaStatus NvMedia2DDestroyEx | ( | NvMedia2D * | i2d | ) |
Destroys the NvMedia2D context.
This function destroys the specified NvMedia2D context.
Before calling this function, the caller must ensure:
[in] | i2d | Pointer to the NvMedia2D context. |
NVMEDIA_STATUS_OK | Context destroyed successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | i2d is NULL. |
NVMEDIA_STATUS_ERROR | There are still some NvSciSync objects registered against the NvMedia 2D context. |