Defines and manages objects for defining video RAM surfaces.
NvMediaVideoSurfaces are video RAM surfaces storing YUV or RGBA data. They may be used as sources for the video mixer and they may be used as rendering targets/references by the video decoder. NvMediaVideoSurfaces are created with NvMediaVideoSurfaceCreateNew() and destroyed with NvMediaVideoSurfaceDestroy().
|
NvMediaVideoSurface * | NvMediaVideoSurfaceCreateNew (NvMediaDevice *device, NvMediaSurfaceType type, NvMediaSurfAllocAttr *attrs, uint32_t numAllocAttrs, uint32_t flags) |
| Allocates a video surface object. More...
|
|
void | NvMediaVideoSurfaceDestroy (NvMediaVideoSurface *surface) |
| Destroys a video surface object. More...
|
|
NvMediaStatus | NvMediaVideoSurfaceLock (NvMediaVideoSurface *surface, NvMediaVideoSurfaceMap *surfaceMap) |
| Locks a video surface and returns the associated mapped pointers pointing to the Y, U and V surfaces that a software video decoder can fill up. More...
|
|
void | NvMediaVideoSurfaceUnlock (NvMediaVideoSurface *surface) |
| Unlocks a video surface. More...
|
|
NvMediaStatus | NvMediaVideoSurfacePutBits (NvMediaVideoSurface *videoSurface, NvMediaRect *dstRect, void **srcPntrs, uint32_t *srcPitches) |
| NvMediaVideoSurfacePutBits reads a client memory buffer and writes the content into an NvMedia video surface. More...
|
|
NvMediaStatus | NvMediaVideoSurfaceGetBits (NvMediaVideoSurface *videoSurface, NvMediaRect *srcRect, void **dstPntrs, uint32_t *dstPitches) |
| Reads an NvMedia video surface and writes the content into a client memory buffer. More...
|
|
Allocates a video surface object.
Upon creation, the contents are in an undefined state.
- Parameters
-
[in] | device | A pointer to the device's resource manager connection, which is used for the allocation. |
[in] | type | Surface format type obtained from NvMediaSurfaceFormatGetType API. |
[in] | attrs | An array of surface allocation attributes for surface creation. |
[in] | numAllocAttrs | Number of attributes in the array. |
[in] | flags | Flags for module hint (used in future). |
- Returns
- NvMediaVideoSurface The new surfaces's handle or NULL if unsuccessful.
Destroys a video surface object.
- Parameters
-
[in] | surface | The video surface to destroy. |
Reads an NvMedia video surface and writes the content into a client memory buffer.
- Parameters
-
[in] | videoSurface | Source NvMediaVideoSurface type surface. The surface must be locked using NvMediaVideoSurfaceLock prior to calling this function. |
[in] | srcRect | Structure containing co-ordinates of the rectangle in the source surface from which the client surface is to be copied. Setting srcRect to NULL implies rectangle of full surface size. |
[out] | dstPntrs | Array of pointers to the destination surface planes |
[in] | dstPitches | Array of pitch values for the destination surface planes |
- Returns
- NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER if any of the input parameters is invalid.
NVMEDIA_STATUS_ERROR if videoSurface is not locked.
Locks a video surface and returns the associated mapped pointers pointing to the Y, U and V surfaces that a software video decoder can fill up.
- Parameters
-
[in] | surface | Video surface object |
[out] | surfaceMap | Surface pointers and pitches |
- Returns
- NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_ERROR
NvMediaVideoSurfacePutBits reads a client memory buffer and writes the content into an NvMedia video surface.
- Parameters
-
[out] | videoSurface | Destination NvMediaVideoSurface type surface. The surface must be locked using NvMediaVideoSurfaceLock prior to calling this function. |
[in] | dstRect | Structure containing co-ordinates of the rectangle in the destination surface to which the client surface is to be copied. Setting dstRect to NULL implies rectangle of full surface size. |
[in] | srcPntrs | Array of pointers to the client surface planes |
[in] | srcPitches | Array of pitch values for the client surface planes |
- Returns
- NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER if any of the input parameters is invalid.
NVMEDIA_STATUS_ERROR if videoSurface is not locked.
Unlocks a video surface.
Internal engines cannot use a surface until it is locked.
- Parameters
-
[in] | surface | Video surface object |