NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Detailed Description

Video mixer provides a surface to surface based rendering with deinterlacing, inverse telecine, scaling, alpha blending, noise reduction, filtering, and background color support.

Data Structures

struct  NvMediaVideoMixerAttributes
 Holds video mixer attributes. More...
 
struct  NvMediaBackground
 Background descriptor for video mixing. More...
 
struct  NvMediaVideoDesc
 Video descriptor for video mixing. More...
 
struct  NvMediaAlphaSurface
 Holds an Alpha Surface descriptor for video mixing. More...
 

Modules

 Mixer Attributes
 Defines mixer attribute bit masks for constructing attribute masks.
 
 Mixer Features
 Declares and manages objects for specifying mixer features.
 

Macros

#define NVMEDIA_VMP_VERSION_MAJOR   2
 Major Version number. More...
 
#define NVMEDIA_VMP_VERSION_MINOR   2
 Minor Version number. More...
 

Typedefs

typedef void NvMediaVideoMixer
 A handle representing a video mixer object. More...
 

Enumerations

enum  NvMediaDeinterlaceType {
  NVMEDIA_DEINTERLACE_TYPE_BOB,
  NVMEDIA_DEINTERLACE_TYPE_ADVANCED1,
  NVMEDIA_DEINTERLACE_TYPE_ADVANCED2
}
 Defines deinterlace types. More...
 
enum  NvMediaPictureStructure {
  NVMEDIA_PICTURE_STRUCTURE_TOP_FIELD,
  NVMEDIA_PICTURE_STRUCTURE_BOTTOM_FIELD,
  NVMEDIA_PICTURE_STRUCTURE_FRAME
}
 Defines picture structure types. More...
 

Functions

NvMediaStatus NvMediaVideoMixerGetVersion (NvMediaVersion *version)
 Returns the version information for the Video Mixer library. More...
 
NvMediaVideoMixerNvMediaVideoMixerCreate (NvMediaDevice *device, NvMediaSurfaceType surfaceType, uint16_t mixerWidth, uint16_t mixerHeight, float_t sourceAspectRatio, uint16_t videoWidth, uint16_t videoHeight, uint32_t features)
 The principle job of the video mixer is to convert YUV data to RGB, and perform other post-processing at the same time, such as deinterlacing. More...
 
void NvMediaVideoMixerDestroy (NvMediaVideoMixer *mixer)
 Destroys a mixer created by NvMediaVideoMixerCreate. More...
 
void NvMediaVideoMixerSetAttributes (NvMediaVideoMixer *mixer, uint32_t attributeMask, NvMediaVideoMixerAttributes *attributes)
 Sets NvMediaVideoMixer attributes. More...
 
NvMediaStatus NvMediaVideoMixerRenderSurface (NvMediaVideoMixer *mixer, NvMediaVideoSurface *outputSurface, NvMediaBackground *background, NvMediaVideoDesc *video)
 Performs a video post-processing and compositing operation to a surface. More...
 
NvMediaStatus NvMediaVideoMixerRenderSurfaceWithAlpha (NvMediaVideoMixer *mixer, NvMediaVideoSurface *outputSurface, NvMediaBackground *background, NvMediaVideoDesc *video, NvMediaAlphaSurface *alpha)
 Performs post-processing and compositing with alpha channel replacement. More...
 

Macro Definition Documentation

#define NVMEDIA_VMP_VERSION_MAJOR   2

Major Version number.

Definition at line 39 of file nvmedia_vmp.h.

#define NVMEDIA_VMP_VERSION_MINOR   2

Minor Version number.

Definition at line 41 of file nvmedia_vmp.h.

Typedef Documentation

typedef void NvMediaVideoMixer

A handle representing a video mixer object.

Definition at line 206 of file nvmedia_vmp.h.

Enumeration Type Documentation

Defines deinterlace types.

Enumerator
NVMEDIA_DEINTERLACE_TYPE_BOB 

BOB deinterlacing.

NVMEDIA_DEINTERLACE_TYPE_ADVANCED1 

Advanced1 deinterlacing.

NVMEDIA_DEINTERLACE_TYPE_ADVANCED2 

Advanced2 deinterlacing.

Definition at line 210 of file nvmedia_vmp.h.

Defines picture structure types.

Enumerator
NVMEDIA_PICTURE_STRUCTURE_TOP_FIELD 

The picture is a field, and is the top field of the surface.

NVMEDIA_PICTURE_STRUCTURE_BOTTOM_FIELD 

The picture is a field, and is the bottom field of the surface.

NVMEDIA_PICTURE_STRUCTURE_FRAME 

The picture is a frame, and hence is the entire surface.

Definition at line 221 of file nvmedia_vmp.h.

Function Documentation

NvMediaVideoMixer* NvMediaVideoMixerCreate ( NvMediaDevice device,
NvMediaSurfaceType  surfaceType,
uint16_t  mixerWidth,
uint16_t  mixerHeight,
float_t  sourceAspectRatio,
uint16_t  videoWidth,
uint16_t  videoHeight,
uint32_t  features 
)

The principle job of the video mixer is to convert YUV data to RGB, and perform other post-processing at the same time, such as deinterlacing.

Parameters
[in]deviceThe device this video mixer will use.
[in]surfaceTypeSurface type of the input surface.
[in]mixerWidthVideo mixer width.
[in]mixerHeightVideo mixer height.
[in]sourceAspectRatioAspect ratio of the source video. This determines how the video is going to be presented on the output surface.
[in]videoWidthVideo width.
[in]videoHeightVideo height.
[in]featuresThis selects which features this NvMediaVideoMixer will support. This determines the internal scratch surfaces this function initially creates. At present, the following features are supported and may be OR'd together:
Returns
NvMediaVideoMixer The new video mixer's handle or NULL if unsuccessful.
void NvMediaVideoMixerDestroy ( NvMediaVideoMixer mixer)

Destroys a mixer created by NvMediaVideoMixerCreate.

Parameters
[in]mixerThe mixer to be destroyed.
NvMediaStatus NvMediaVideoMixerGetVersion ( NvMediaVersion version)

Returns the version information for the Video Mixer library.

Parameters
[in]versionA pointer to a NvMediaVersion structure filled by the Video Mixer library.
Returns
NvMediaStatus The status of the operation. Possible values are:
NvMediaStatus NvMediaVideoMixerRenderSurface ( NvMediaVideoMixer mixer,
NvMediaVideoSurface outputSurface,
NvMediaBackground background,
NvMediaVideoDesc video 
)

Performs a video post-processing and compositing operation to a surface.

Parameters
[in]mixerThe mixer object that will perform the mixing/rendering operation.
[in]outputSurfaceDestination surface.
[in]backgroundA background color or image. If set to any value other than NULL, the specific color or surface will be used as the first layer in the mixer's compositing process.
[in]videoVideo input descriptor structure.
Returns
NvMediaStatus Status of the mixing operation. Possible values are:
NvMediaStatus NvMediaVideoMixerRenderSurfaceWithAlpha ( NvMediaVideoMixer mixer,
NvMediaVideoSurface outputSurface,
NvMediaBackground background,
NvMediaVideoDesc video,
NvMediaAlphaSurface alpha 
)

Performs post-processing and compositing with alpha channel replacement.

More specifically, this function does the following:

  1. Performs video post-processing and composites to a surface. For more information, see NvMediaVideoMixerRenderSurface().
  2. Uses the alpha surface to replace the alpha channel in the output of step 1. If NVMEDIA_VMP_ATTR_DESTINATION_PREMULTIPLY_ALPHA is enabled, the output is pre-multiplied by the alpha surface.
Parameters
[in]mixerA pointer to the mixer object that performs the mixing/rendering operation.
[in]outputSurfaceA pointer to the destination surface. This surface type must obtained by /ref NvMediaSurfaceFormatGetType with NVM_SURF_FMT_SET_ATTR_RGBA(attr, RGBA, UINT, 8, PL/BL).
[in]backgroundA pointer to a background color or image. If set to any value other than NULL, the specific color will be used as the background layer.
[in]videoA pointer to the video descriptor structure. This function only supports progressive video.
[in]alphaA pointer to the alpha surface used to replace the alpha channel.
Returns
NvMediaStatus Status of the mixing operation. Possible values are:
void NvMediaVideoMixerSetAttributes ( NvMediaVideoMixer mixer,
uint32_t  attributeMask,
NvMediaVideoMixerAttributes attributes 
)

Sets NvMediaVideoMixer attributes.

Parameters
[in]mixerThe mixer object that will perform the mixing/rendering operation.
[in]attributeMaskDetermines which attributes are set. The value can be any combination of the binary OR of the following attributes:
[in]attributesA pointer to a structure that holds all the attributes but only those are used which are indicated in the attributeMask.