NVIDIA DRIVE OS Linux API Reference

5.1.6.1 Release
For Test and Development only

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvmedia_vmp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2019, 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 #include "nvmedia_vop.h"
28 
41 #define NVMEDIA_VMP_VERSION_MAJOR 2
42 
43 #define NVMEDIA_VMP_VERSION_MINOR 5
44 
55 #define NVMEDIA_VMP_FEATURE_BACKGROUND_PRESENT (1<<0)
56 
61 #define NVMEDIA_VMP_FEATURE_INTERLACED (1<<1)
62 
67 #define NVMEDIA_VMP_FEATURE_DEINTERLACING (1<<2)
68 
73 #define NVMEDIA_VMP_FEATURE_ADVANCED1_DEINTERLACING (1<<3)
74 
79 #define NVMEDIA_VMP_FEATURE_ADVANCED2_DEINTERLACING (1<<4)
80 
85 #define NVMEDIA_VMP_FEATURE_LIMITED_RGB_INPUT (1<<5)
86 
92 #define NVMEDIA_VMP_FEATURE_INVERSE_TELECINE (1<<6)
93 
98 #define NVMEDIA_VMP_FEATURE_NOISE_REDUCTION (1<<7)
99 
104 #define NVMEDIA_VMP_FEATURE_SHARPENING (1<<8)
105 
111 #define NVMEDIA_VMP_FEATURE_ALPHA_SURFACE_MODE (1<<9)
112 
117 #define NVMEDIA_VMP_FEATURE_PROTECTED (1<<10)
118 
123 #define NVMEDIA_VMP_FEATURE_ENABLE_DFS (1<<11)
124 
137 #define NVMEDIA_VMP_ATTR_BRIGHTNESS (1<<0)
138 
142 #define NVMEDIA_VMP_ATTR_CONTRAST (1<<1)
143 
147 #define NVMEDIA_VMP_ATTR_SATURATION (1<<2)
148 
152 #define NVMEDIA_VMP_ATTR_HUE (1<<3)
153 
157 #define NVMEDIA_VMP_ATTR_COLOR_STANDARD (1<<4)
158 
162 #define NVMEDIA_VMP_ATTR_DEINTERLACE_TYPE (1<<6)
163 
167 #define NVMEDIA_VMP_ATTR_NOISE_REDUCTION (1<<7)
168 
172 #define NVMEDIA_VMP_ATTR_NOISE_REDUCTION_ALGORITHM (1<<8)
173 
177 #define NVMEDIA_VMP_ATTR_SHARPENING (1<<9)
178 
182 #define NVMEDIA_VMP_ATTR_INVERSE_TELECINE (1<<10)
183 
187 #define NVMEDIA_VMP_ATTR_FILTER_QUALITY (1<<11)
188 
192 #define NVMEDIA_VMP_ATTR_DESTINATION_ALPHA (1<<12)
193 
197 #define NVMEDIA_VMP_ATTR_DESTINATION_PREMULTIPLY_ALPHA (1<<13)
198 
202 #define NVMEDIA_VMP_ATTR_TRANSFORM (1<<14)
203 
208 typedef void NvMediaVideoMixer;
209 
212 typedef enum {
220 
223 typedef enum {
231 
240 typedef struct {
242  float_t red;
244  float_t green;
246  float_t blue;
248  float_t alpha;
249 } NvMediaColor;
250 
262  NvMediaVersion *version
263 );
264 
294 NvMediaVideoMixer *
296  NvMediaDevice *device,
297  NvMediaSurfaceType surfaceType,
298  uint16_t mixerWidth,
299  uint16_t mixerHeight,
300  float_t sourceAspectRatio,
301  uint16_t videoWidth,
302  uint16_t videoHeight,
303  uint32_t features
304 );
305 
310 void
312  NvMediaVideoMixer *mixer
313 );
314 
318 typedef struct {
323  float_t brightness;
328  float_t contrast;
333  float_t saturation;
338  float_t hue;
359  float_t noiseReduction;
377  float_t sharpening;
427 
452 void
454  NvMediaVideoMixer *mixer,
455  uint32_t attributeMask,
456  NvMediaVideoMixerAttributes *attributes
457 );
458 
462 typedef struct {
466 
470 typedef struct {
486 
490 typedef struct {
498 
504 
521  NvMediaVideoMixer *mixer,
522  NvMediaVideoSurface *outputSurface,
523  NvMediaBackground *background,
524  NvMediaVideoDesc *video
525 );
526 
554  NvMediaVideoMixer *mixer,
555  NvMediaVideoSurface *outputSurface,
556  NvMediaBackground *background,
557  NvMediaVideoDesc *video,
558  NvMediaAlphaSurface *alpha
559 );
560 
563 /*
564  * \defgroup history_nvmedia_vmp History
565  * Provides change history for the NvMedia Video Mixer API.
566  *
567  * \section history_nvmedia_vmp Version History
568  *
569  * <b> Version 1.0 </b> March 21, 2017
570  * - Initial release
571  *
572  * <b> Version 2.0 </b> May 17, 2017
573  * - Removed NvMediaVideoMixerRender and NvMediaVideoMixerRenderWithAlpha functions
574  * - Removed multi-layer rendering
575  * - Removed secondary video and graphics layer support
576  * - Added NvMediaVideoMixerGetVersion function
577  * - Added destination surface transformation
578  * - Changed NvMediaVideoMixer function definition
579  * - All NvMedia data types are moved to standard data types
580  *
581  * <b> Version 2.1 </b> September 7, 2017
582  * - Added feature \ref NVMEDIA_VMP_FEATURE_ENABLE_DFS to enable DFS for mixer
583  * hardware block
584  *
585  * <b> Version 2.2 </b> March 16, 2018
586  * - Move \ref NvMediaNoiseReductionAlgorithm structure definition to nvmedia_common.h header file
587  *
588  * <b> Version 2.3 </b> January 21, 2019
589  * - Added header include nvmedia_2d.h
590  *
591  * <b> Version 2.4 </b> February 4, 2019
592  * - Moved \ref NvMediaColor from nvmedia_core.h to this header
593  *
594  * <b> Version 2.5 </b> February 6, 2019
595  * - Added required header include nvmedia_surface.h
596  */
597 
598 
599 #ifdef __cplusplus
600 }; /* extern "C" */
601 #endif
602 
603 #endif /* _NVMEDIA_VMP_H */
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
NvMediaBool premultiplyAlpha
Holds a flag that specifies to pre-multiply the output surface by the alpha channel.
Definition: nvmedia_vmp.h:411
NvMediaVideoSurface * previous2
Frame/field prior to previous frame/field, NULL if unavailable.
Definition: nvmedia_vmp.h:480
NvMediaStatus NvMediaVideoMixerRenderSurface(NvMediaVideoMixer *mixer, NvMediaVideoSurface *outputSurface, NvMediaBackground *background, NvMediaVideoDesc *video)
Performs a video post-processing and compositing operation to a surface.
NvMediaRect * srcRect
Holds the source rectangle.
Definition: nvmedia_vmp.h:502
Video descriptor for video mixing.
Definition: nvmedia_vmp.h:470
uint32_t NvMediaBool
A boolean value, holding NVMEDIA_TRUE or NVMEDIA_FALSE.
Definition: nvmedia_core.h:80
NvMediaNoiseReductionAlgorithm noiseReductionAlgorithm
Holds a Noise Reduction Algorithm, which must be one of the following:
Definition: nvmedia_vmp.h:371
float_t contrast
A value clamped to between 0.0 and 10.0, initialized to 1.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:328
NVIDIA Media Interface: Surface Handling
NvMediaPictureStructure
Defines picture structure types.
Definition: nvmedia_vmp.h:223
Holds a constant RGBA color.
Definition: nvmedia_vmp.h:240
NvMediaBool inverseTelecine
A boolean initialized to NVMEDIA_FALSE at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:385
NvMediaNoiseReductionAlgorithm
Noise Reduction Algorithm.
NVIDIA Media Interface: 2D Processing Control
void NvMediaVideoMixer
A handle representing a video mixer object.
Definition: nvmedia_vmp.h:208
Advanced2 deinterlacing.
Definition: nvmedia_vmp.h:218
Holds NvMedia version information.
Definition: nvmedia_core.h:226
float_t saturation
A value clamped to between 0.0 and 10.0, initialized to 1.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:333
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:337
NVIDIA Media Interface: Common Types for Video/Image Encode/Decode
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:359
NvMediaColorStandard
Defines color standards.
Definition: nvmedia_core.h:108
NvMediaVideoSurface * alphaSurface
Holds a pointer to the surface.
Definition: nvmedia_vmp.h:497
NvMediaFilterQuality filterQuality
Filter quality.
Definition: nvmedia_vmp.h:393
NVIDIA Media Interface: Core
The picture is a field, and is the bottom field of the surface.
Definition: nvmedia_vmp.h:227
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:169
void NvMediaVideoMixerSetAttributes(NvMediaVideoMixer *mixer, uint32_t attributeMask, NvMediaVideoMixerAttributes *attributes)
Sets NvMediaVideoMixer attributes.
NvMediaDeinterlaceType
Defines deinterlace types.
Definition: nvmedia_vmp.h:212
float_t brightness
A value clamped to between -1.0 and 1.0, initialized to 0.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:323
NvMediaTransform
Defines transformations.
Definition: nvmedia_2d.h:127
NvMediaStatus NvMediaVideoMixerRenderSurfaceWithAlpha(NvMediaVideoMixer *mixer, NvMediaVideoSurface *outputSurface, NvMediaBackground *background, NvMediaVideoDesc *video, NvMediaAlphaSurface *alpha)
Performs post-processing and compositing with alpha channel replacement.
The picture is a field, and is the top field of the surface.
Definition: nvmedia_vmp.h:225
NvMediaRect * dstRect
Destination rectangle, If NULL, a rectangle the full size of the NvMediaVideoMixer is implied...
Definition: nvmedia_vmp.h:484
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:133
NvMediaDeinterlaceType deinterlaceType
Deintelacing type for input video.
Definition: nvmedia_vmp.h:353
NvMediaFilterQuality
Defines filter quality levels.
Holds video mixer attributes.
Definition: nvmedia_vmp.h:318
BOB deinterlacing.
Definition: nvmedia_vmp.h:214
NVIDIA Media Interface: Video Surface Processing
NvMediaColorStandard colorStandard
Color standard for input video.
Definition: nvmedia_vmp.h:346
NvMediaStatus NvMediaVideoMixerGetVersion(NvMediaVersion *version)
Returns the version information for the Video Mixer library.
Holds an Alpha Surface descriptor for video mixing.
Definition: nvmedia_vmp.h:490
void NvMediaVideoMixerDestroy(NvMediaVideoMixer *mixer)
Destroys a mixer created by NvMediaVideoMixerCreate.
float_t sharpening
A value confined to the range 0.0 and 1.0, initialized 0.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:377
float_t hue
A value clamped to between -PI and PI, initialized to 0.0 at NvMediaVideoMixer creation.
Definition: nvmedia_vmp.h:338
float_t blue
Blue color component.
Definition: nvmedia_vmp.h:246
NvMediaTransform dstTransform
Specifies one of the destination transformation:
Definition: nvmedia_vmp.h:425
float_t green
Green color component.
Definition: nvmedia_vmp.h:244
NvMediaVideoSurface * previous
Frame/field prior to the current frame/field, NULL if unavailable.
Definition: nvmedia_vmp.h:478
Advanced1 deinterlacing.
Definition: nvmedia_vmp.h:216
NVIDIA Media Interface: Video Output Processing (VOP)
NvMediaPictureStructure pictureStructure
Picture structure.
Definition: nvmedia_vmp.h:472
NvMediaColor backgroundColor
Background color.
Definition: nvmedia_vmp.h:464
Background descriptor for video mixing.
Definition: nvmedia_vmp.h:462
The picture is a frame, and hence is the entire surface.
Definition: nvmedia_vmp.h:229
NvMediaVideoSurface * current
Current frame/field.
Definition: nvmedia_vmp.h:476
float_t alpha
Alpha color component.
Definition: nvmedia_vmp.h:248
A handle representing a video surface object.
Definition: nvmedia_video.h:58
float_t red
Red color component.
Definition: nvmedia_vmp.h:242
float_t destinationAlpha
Holds a value confined to the range 0.0 and 1.0.
Definition: nvmedia_vmp.h:399
NvMediaRect * srcRect
Source rectangle, If NULL, a rectangle the full size of the NvMediaVideoSurface is implied...
Definition: nvmedia_vmp.h:482
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...
NvMediaVideoSurface * next
Frame/field that follow the current frame/field, NULL if unavailable.
Definition: nvmedia_vmp.h:474