NVIDIA DRIVE OS Linux SDK API Reference

5.2.6 Release
For Test and Development only
nvmedia_vmp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved. All
3  * information contained herein is proprietary and confidential to NVIDIA
4  * Corporation. Any use, reproduction, or disclosure without the written
5  * permission of NVIDIA Corporation is prohibited.
6  */
7 
15 #ifndef _NVMEDIA_VMP_H
16 #define _NVMEDIA_VMP_H
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #include "nvmedia_2d.h"
23 #include "nvmedia_core.h"
24 #include "nvmedia_common.h"
25 #include "nvmedia_surface.h"
26 #include "nvmedia_video.h"
27 
40 #define NVMEDIA_VMP_VERSION_MAJOR 2
41 
42 #define NVMEDIA_VMP_VERSION_MINOR 6
43 
54 #define NVMEDIA_VMP_FEATURE_BACKGROUND_PRESENT (1<<0)
55 
60 #define NVMEDIA_VMP_FEATURE_INTERLACED (1<<1)
61 
66 #define NVMEDIA_VMP_FEATURE_DEINTERLACING (1<<2)
67 
72 #define NVMEDIA_VMP_FEATURE_ADVANCED1_DEINTERLACING (1<<3)
73 
78 #define NVMEDIA_VMP_FEATURE_ADVANCED2_DEINTERLACING (1<<4)
79 
84 #define NVMEDIA_VMP_FEATURE_LIMITED_RGB_INPUT (1<<5)
85 
91 #define NVMEDIA_VMP_FEATURE_INVERSE_TELECINE (1<<6)
92 
97 #define NVMEDIA_VMP_FEATURE_NOISE_REDUCTION (1<<7)
98 
103 #define NVMEDIA_VMP_FEATURE_SHARPENING (1<<8)
104 
110 #define NVMEDIA_VMP_FEATURE_ALPHA_SURFACE_MODE (1<<9)
111 
116 #define NVMEDIA_VMP_FEATURE_PROTECTED (1<<10)
117 
122 #define NVMEDIA_VMP_FEATURE_ENABLE_DFS (1<<11)
123 
136 #define NVMEDIA_VMP_ATTR_BRIGHTNESS (1<<0)
137 
141 #define NVMEDIA_VMP_ATTR_CONTRAST (1<<1)
142 
146 #define NVMEDIA_VMP_ATTR_SATURATION (1<<2)
147 
151 #define NVMEDIA_VMP_ATTR_HUE (1<<3)
152 
156 #define NVMEDIA_VMP_ATTR_COLOR_STANDARD (1<<4)
157 
161 #define NVMEDIA_VMP_ATTR_DEINTERLACE_TYPE (1<<6)
162 
166 #define NVMEDIA_VMP_ATTR_NOISE_REDUCTION (1<<7)
167 
171 #define NVMEDIA_VMP_ATTR_NOISE_REDUCTION_ALGORITHM (1<<8)
172 
176 #define NVMEDIA_VMP_ATTR_SHARPENING (1<<9)
177 
181 #define NVMEDIA_VMP_ATTR_INVERSE_TELECINE (1<<10)
182 
186 #define NVMEDIA_VMP_ATTR_FILTER_QUALITY (1<<11)
187 
191 #define NVMEDIA_VMP_ATTR_DESTINATION_ALPHA (1<<12)
192 
196 #define NVMEDIA_VMP_ATTR_DESTINATION_PREMULTIPLY_ALPHA (1<<13)
197 
201 #define NVMEDIA_VMP_ATTR_TRANSFORM (1<<14)
202 
207 typedef void NvMediaVideoMixer;
208 
211 typedef enum {
219 
222 typedef enum {
230 
239 typedef struct {
241  float_t red;
243  float_t green;
245  float_t blue;
247  float_t alpha;
248 } NvMediaColor;
249 
261  NvMediaVersion *version
262 );
263 
295  NvMediaDevice *device,
296  NvMediaSurfaceType surfaceType,
297  uint16_t mixerWidth,
298  uint16_t mixerHeight,
299  float_t sourceAspectRatio,
300  uint16_t videoWidth,
301  uint16_t videoHeight,
302  uint32_t features
303 );
304 
309 void
311  NvMediaVideoMixer *mixer
312 );
313 
317 typedef struct {
322  float_t brightness;
327  float_t contrast;
332  float_t saturation;
337  float_t hue;
358  float_t noiseReduction;
376  float_t sharpening;
426 
451 void
453  NvMediaVideoMixer *mixer,
454  uint32_t attributeMask,
455  NvMediaVideoMixerAttributes *attributes
456 );
457 
461 typedef struct {
465 
469 typedef struct {
485 
489 typedef struct {
497 
503 
520  NvMediaVideoMixer *mixer,
521  NvMediaVideoSurface *outputSurface,
522  NvMediaBackground *background,
523  NvMediaVideoDesc *video
524 );
525 
553  NvMediaVideoMixer *mixer,
554  NvMediaVideoSurface *outputSurface,
555  NvMediaBackground *background,
556  NvMediaVideoDesc *video,
557  NvMediaAlphaSurface *alpha
558 );
559 
562 /*
563  * \defgroup history_nvmedia_vmp History
564  * Provides change history for the NvMedia Video Mixer API.
565  *
566  * \section history_nvmedia_vmp Version History
567  *
568  * <b> Version 1.0 </b> March 21, 2017
569  * - Initial release
570  *
571  * <b> Version 2.0 </b> May 17, 2017
572  * - Removed NvMediaVideoMixerRender and NvMediaVideoMixerRenderWithAlpha functions
573  * - Removed multi-layer rendering
574  * - Removed secondary video and graphics layer support
575  * - Added NvMediaVideoMixerGetVersion function
576  * - Added destination surface transformation
577  * - Changed NvMediaVideoMixer function definition
578  * - All NvMedia data types are moved to standard data types
579  *
580  * <b> Version 2.1 </b> September 7, 2017
581  * - Added feature \ref NVMEDIA_VMP_FEATURE_ENABLE_DFS to enable DFS for mixer
582  * hardware block
583  *
584  * <b> Version 2.2 </b> March 16, 2018
585  * - Move \ref NvMediaNoiseReductionAlgorithm structure definition to nvmedia_common.h header file
586  *
587  * <b> Version 2.3 </b> January 21, 2019
588  * - Added header include nvmedia_2d.h
589  *
590  * <b> Version 2.4 </b> February 4, 2019
591  * - Moved \ref NvMediaColor from nvmedia_core.h to this header
592  *
593  * <b> Version 2.5 </b> February 6, 2019
594  * - Added required header include nvmedia_surface.h
595  *
596  * <b> Version 2.6 </b> February 26, 2021
597  * - Removed redundant header include nvmedia_vop.h
598  */
599 
600 
601 #ifdef __cplusplus
602 }; /* extern "C" */
603 #endif
604 
605 #endif /* _NVMEDIA_VMP_H */
NvMediaVideoMixerAttributes::hue
float_t hue
A value clamped to between -PI and PI, initialized to 0.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:337
nvmedia_video.h
NVIDIA Media Interface: Video Surface Processing
NvMediaVideoDesc
Video descriptor for video mixing.
Definition: nvmedia_vmp.h:469
nvmedia_surface.h
NVIDIA Media Interface: Surface Handling
NvMediaColor::alpha
float_t alpha
Alpha color component.
Definition: nvmedia_vmp.h:247
NvMediaVideoMixerAttributes::noiseReduction
float_t noiseReduction
Holds a value confined to the range 0.0 to 1.0, initialized 0.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:358
NvMediaColor::red
float_t red
Red color component.
Definition: nvmedia_vmp.h:241
NvMediaDeinterlaceType
NvMediaDeinterlaceType
Defines deinterlace types.
Definition: nvmedia_vmp.h:211
NvMediaVideoMixerAttributes::filterQuality
NvMediaFilterQuality filterQuality
Filter quality.
Definition: nvmedia_vmp.h:392
NvMediaVideoDesc::next
NvMediaVideoSurface * next
Frame/field that follow the current frame/field, NULL if unavailable.
Definition: nvmedia_vmp.h:473
NvMediaVideoDesc::previous2
NvMediaVideoSurface * previous2
Frame/field prior to previous frame/field, NULL if unavailable.
Definition: nvmedia_vmp.h:479
NvMediaColor
Holds a constant RGBA color.
Definition: nvmedia_vmp.h:239
NvMediaAlphaSurface
Holds an Alpha Surface descriptor for video mixing.
Definition: nvmedia_vmp.h:489
NvMediaVideoMixerAttributes::brightness
float_t brightness
A value clamped to between -1.0 and 1.0, initialized to 0.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:322
nvmedia_2d.h
NVIDIA Media Interface: 2D Processing Control
NvMediaAlphaSurface::srcRect
NvMediaRect * srcRect
Holds the source rectangle.
Definition: nvmedia_vmp.h:501
NvMediaVideoMixerAttributes::deinterlaceType
NvMediaDeinterlaceType deinterlaceType
Deintelacing type for input video.
Definition: nvmedia_vmp.h:352
NvMediaBackground
Background descriptor for video mixing.
Definition: nvmedia_vmp.h:461
nvmedia_common.h
NVIDIA Media Interface: Common Types for Video/Image Encode/Decode
NvMediaDevice
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:348
NVMEDIA_DEINTERLACE_TYPE_ADVANCED2
@ NVMEDIA_DEINTERLACE_TYPE_ADVANCED2
Advanced2 deinterlacing.
Definition: nvmedia_vmp.h:217
NvMediaVideoMixerDestroy
void NvMediaVideoMixerDestroy(NvMediaVideoMixer *mixer)
Destroys a mixer created by NvMediaVideoMixerCreate.
NVMEDIA_PICTURE_STRUCTURE_BOTTOM_FIELD
@ NVMEDIA_PICTURE_STRUCTURE_BOTTOM_FIELD
The picture is a field, and is the bottom field of the surface.
Definition: nvmedia_vmp.h:226
NvMediaVersion
Holds NvMedia version information.
Definition: nvmedia_core.h:237
NvMediaVideoMixerAttributes::contrast
float_t contrast
A value clamped to between 0.0 and 10.0, initialized to 1.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:327
NvMediaVideoMixerRenderSurface
NvMediaStatus NvMediaVideoMixerRenderSurface(NvMediaVideoMixer *mixer, NvMediaVideoSurface *outputSurface, NvMediaBackground *background, NvMediaVideoDesc *video)
Performs a video post-processing and compositing operation to a surface.
NvMediaVideoDesc::dstRect
NvMediaRect * dstRect
Destination rectangle, If NULL, a rectangle the full size of the NvMediaVideoMixer is implied.
Definition: nvmedia_vmp.h:483
NvMediaColorStandard
NvMediaColorStandard
Defines color standards.
Definition: nvmedia_core.h:108
NvMediaFilterQuality
NvMediaFilterQuality
Defines filter quality levels.
Definition: nvmedia_common.h:46
NvMediaAlphaSurface::alphaSurface
NvMediaVideoSurface * alphaSurface
Holds a pointer to the surface.
Definition: nvmedia_vmp.h:496
NvMediaVideoSurface
A handle representing a video surface object.
Definition: nvmedia_video.h:58
NvMediaTransform
NvMediaTransform
Defines transformations.
Definition: nvmedia_2d.h:127
NVMEDIA_PICTURE_STRUCTURE_TOP_FIELD
@ NVMEDIA_PICTURE_STRUCTURE_TOP_FIELD
The picture is a field, and is the top field of the surface.
Definition: nvmedia_vmp.h:224
NvMediaRect
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:133
NvMediaVideoMixerAttributes::saturation
float_t saturation
A value clamped to between 0.0 and 10.0, initialized to 1.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:332
nvmedia_core.h
NVIDIA Media Interface: Core
NvMediaSurfaceType
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
Definition: nvmedia_surface.h:550
NvMediaVideoMixerAttributes::destinationAlpha
float_t destinationAlpha
Holds a value confined to the range 0.0 and 1.0.
Definition: nvmedia_vmp.h:398
NvMediaNoiseReductionAlgorithm
NvMediaNoiseReductionAlgorithm
Noise Reduction Algorithm.
Definition: nvmedia_common.h:118
NvMediaStatus
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:180
NVMEDIA_DEINTERLACE_TYPE_BOB
@ NVMEDIA_DEINTERLACE_TYPE_BOB
BOB deinterlacing.
Definition: nvmedia_vmp.h:213
NvMediaVideoMixerCreate
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...
NvMediaPictureStructure
NvMediaPictureStructure
Defines picture structure types.
Definition: nvmedia_vmp.h:222
NVMEDIA_DEINTERLACE_TYPE_ADVANCED1
@ NVMEDIA_DEINTERLACE_TYPE_ADVANCED1
Advanced1 deinterlacing.
Definition: nvmedia_vmp.h:215
NvMediaVideoMixerAttributes
Holds video mixer attributes.
Definition: nvmedia_vmp.h:317
NvMediaColor::blue
float_t blue
Blue color component.
Definition: nvmedia_vmp.h:245
NvMediaVideoDesc::current
NvMediaVideoSurface * current
Current frame/field.
Definition: nvmedia_vmp.h:475
NVMEDIA_PICTURE_STRUCTURE_FRAME
@ NVMEDIA_PICTURE_STRUCTURE_FRAME
The picture is a frame, and hence is the entire surface.
Definition: nvmedia_vmp.h:228
NvMediaVideoMixerAttributes::premultiplyAlpha
NvMediaBool premultiplyAlpha
Holds a flag that specifies to pre-multiply the output surface by the alpha channel.
Definition: nvmedia_vmp.h:410
NvMediaBackground::backgroundColor
NvMediaColor backgroundColor
Background color.
Definition: nvmedia_vmp.h:463
NvMediaColor::green
float_t green
Green color component.
Definition: nvmedia_vmp.h:243
NvMediaVideoDesc::pictureStructure
NvMediaPictureStructure pictureStructure
Picture structure.
Definition: nvmedia_vmp.h:471
NvMediaVideoDesc::srcRect
NvMediaRect * srcRect
Source rectangle, If NULL, a rectangle the full size of the NvMediaVideoSurface is implied.
Definition: nvmedia_vmp.h:481
NvMediaBool
uint32_t NvMediaBool
A boolean value, holding NVMEDIA_TRUE or NVMEDIA_FALSE.
Definition: nvmedia_core.h:80
NvMediaVideoMixerAttributes::noiseReductionAlgorithm
NvMediaNoiseReductionAlgorithm noiseReductionAlgorithm
Holds a Noise Reduction Algorithm, which must be one of the following:
Definition: nvmedia_vmp.h:370
NvMediaVideoDesc::previous
NvMediaVideoSurface * previous
Frame/field prior to the current frame/field, NULL if unavailable.
Definition: nvmedia_vmp.h:477
NvMediaVideoMixerGetVersion
NvMediaStatus NvMediaVideoMixerGetVersion(NvMediaVersion *version)
Returns the version information for the Video Mixer library.
NvMediaVideoMixerSetAttributes
void NvMediaVideoMixerSetAttributes(NvMediaVideoMixer *mixer, uint32_t attributeMask, NvMediaVideoMixerAttributes *attributes)
Sets NvMediaVideoMixer attributes.
NvMediaVideoMixerAttributes::dstTransform
NvMediaTransform dstTransform
Specifies one of the destination transformation:
Definition: nvmedia_vmp.h:424
NvMediaVideoMixerAttributes::colorStandard
NvMediaColorStandard colorStandard
Color standard for input video.
Definition: nvmedia_vmp.h:345
NvMediaVideoMixer
void NvMediaVideoMixer
A handle representing a video mixer object.
Definition: nvmedia_vmp.h:207
NvMediaVideoMixerRenderSurfaceWithAlpha
NvMediaStatus NvMediaVideoMixerRenderSurfaceWithAlpha(NvMediaVideoMixer *mixer, NvMediaVideoSurface *outputSurface, NvMediaBackground *background, NvMediaVideoDesc *video, NvMediaAlphaSurface *alpha)
Performs post-processing and compositing with alpha channel replacement.
NvMediaVideoMixerAttributes::inverseTelecine
NvMediaBool inverseTelecine
A boolean initialized to NVMEDIA_FALSE at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:384
NvMediaVideoMixerAttributes::sharpening
float_t sharpening
A value confined to the range 0.0 and 1.0, initialized 0.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:376