NVIDIA DRIVE 5.0 Linux SDK API Reference

5.0.5.0 Release

 All Data Structures 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
 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   1
 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...
 
enum  NvMediaNoiseReductionAlgorithm {
  NVMEDIA_NOISE_REDUCTION_ALGORITHM_ORIGINAL,
  NVMEDIA_NOISE_REDUCTION_ALGORITHM_OUTDOOR_LOW_LIGHT,
  NVMEDIA_NOISE_REDUCTION_ALGORITHM_OUTDOOR_MEDIUM_LIGHT,
  NVMEDIA_NOISE_REDUCTION_ALGORITHM_OUTDOOR_HIGH_LIGHT,
  NVMEDIA_NOISE_REDUCTION_ALGORITHM_INDOOR_LOW_LIGHT,
  NVMEDIA_NOISE_REDUCTION_ALGORITHM_INDOOR_MEDIUM_LIGHT,
  NVMEDIA_NOISE_REDUCTION_ALGORITHM_INDOOR_HIGH_LIGHT
}
 Noise Reduction Algorithm. 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   1

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.

Noise Reduction Algorithm.

Enumerator
NVMEDIA_NOISE_REDUCTION_ALGORITHM_ORIGINAL 

Original (default) noise reduction algorithm.

NVMEDIA_NOISE_REDUCTION_ALGORITHM_OUTDOOR_LOW_LIGHT 

Noise reduction algorithm for outdoor low light condition.

NVMEDIA_NOISE_REDUCTION_ALGORITHM_OUTDOOR_MEDIUM_LIGHT 

Noise reduction algorithm for outdoor medium light condition.

NVMEDIA_NOISE_REDUCTION_ALGORITHM_OUTDOOR_HIGH_LIGHT 

Noise reduction algorithm for outdoor high light condition.

NVMEDIA_NOISE_REDUCTION_ALGORITHM_INDOOR_LOW_LIGHT 

Noise reduction algorithm for indoor low light condition.

NVMEDIA_NOISE_REDUCTION_ALGORITHM_INDOOR_MEDIUM_LIGHT 

Noise reduction algorithm for indoor medium light condition.

NVMEDIA_NOISE_REDUCTION_ALGORITHM_INDOOR_HIGH_LIGHT 

Noise reduction algorithm for indoor high light condition.

Definition at line 232 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 NvMediaVideoMixerCreate will create up-front. At present, the following features are supported and may be OR'd together:
NVMEDIA_VMP_FEATURE_BACKGROUND_PRESENT
NVMEDIA_VMP_FEATURE_INTERLACED
NVMEDIA_VMP_FEATURE_DEINTERLACING
NVMEDIA_VMP_FEATURE_ADVANCED1_DEINTERLACING
NVMEDIA_VMP_FEATURE_ADVANCED2_DEINTERLACING
NVMEDIA_VMP_FEATURE_LIMITED_RGB_INPUT
NVMEDIA_VMP_FEATURE_INVERSE_TELECINE
NVMEDIA_VMP_FEATURE_NOISE_REDUCTION
NVMEDIA_VMP_FEATURE_SHARPENING
NVMEDIA_VMP_FEATURE_ALPHA_SURFACE_MODE
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:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER if the pointer is invalid.
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:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER
NvMediaStatus NvMediaVideoMixerRenderSurfaceWithAlpha ( NvMediaVideoMixer mixer,
NvMediaVideoSurface outputSurface,
NvMediaBackground background,
NvMediaVideoDesc video,
NvMediaAlphaSurface alpha 
)

Performs post-processing and compositing with alpha channel replacement.

More specifically, this funciton 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 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 the alpha channel.
Returns
NvMediaStatus Status of the mixing operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER
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:
NVMEDIA_VMP_ATTR_BRIGHTNESS
NVMEDIA_VMP_ATTR_CONTRAST
NVMEDIA_VMP_ATTR_SATURATION
NVMEDIA_VMP_ATTR_HUE
NVMEDIA_VMP_ATTR_COLOR_STANDARD
NVMEDIA_VMP_ATTR_DEINTERLACE_TYPE
NVMEDIA_VMP_ATTR_NOISE_REDUCTION
NVMEDIA_VMP_ATTR_NOISE_REDUCTION_ALGORITHM
NVMEDIA_VMP_ATTR_SHARPENING
NVMEDIA_VMP_ATTR_INVERSE_TELECINE
NVMEDIA_VMP_ATTR_FILTER_QUALITY
NVMEDIA_VMP_ATTR_DESTINATION_ALPHA
NVMEDIA_VMP_ATTR_DESTINATION_PREMULTIPLY_ALPHA
NVMEDIA_VMP_ATTR_TRANSFORM
[in]attributesA pointer to a structure that holds all the attributes but only those are used which are indicated in the attributeMask.