MeiCam SDK For iOS  3.14.0
NvsCommonDef.h
Go to the documentation of this file.
1 //================================================================================
2 //
3 // (c) Copyright Meishe Co. Ltd, 2016. All rights reserved.
4 //
5 // This code and information is provided "as is" without warranty of any kind,
6 // either expressed or implied, including but not limited to the implied
7 // warranties of merchantability and/or fitness for a particular purpose.
8 //
9 //--------------------------------------------------------------------------------
10 // Birth Date: Dec 29. 2016
11 // Author: Meishe video team
12 //================================================================================
13 
16 #pragma once
17 
18 #include <stdint.h>
19 
20 #define NVS_EXPORT __attribute__((visibility("default")))
21 
28 typedef enum {
35 
41 
44 
51 typedef enum {
57 
64 typedef enum
65 {
71 
78 typedef enum
79 {
84 
91 typedef enum
92 {
93  NvsVideoColorTransfer_SDR_VIDEO = 0, //SMPTE 170M transfer characteristic curve used by BT.601/BT.709/BT.2020. This is the curve used by most non-HDR video content.
94  NvsVideoColorTransfer_ST2084, //SMPTE ST 2084 transfer function. This is used by some HDR video content
95  NvsVideoColorTransfer_HLG //ARIB STD-B67 hybrid-log-gamma transfer function. This is used by some HDR video content.
97 
104 typedef enum
105 {
106  NvsVideoHDRType_None = 0, //This is used by SDR video content.
107  NvsVideoHDRType_HDR10, //SMPTE ST 2084 transfer function. This is used by some HDR video content
108  NvsVideoHDRType_HLG, //ARIB STD-B67 hybrid-log-gamma transfer function. This is used by some HDR video content.
109  NvsVideoHDRType_HDR10Plus, //This is used by HDR10+ video content, has dynamic meta data.
110  NvsVideoHDRType_DolbyVision, //This is used by dolby vision hdr video content, has dynamic meta data.
111  NvsVideoHDRType_Vivid //This is used by vivid hdr video content, has dynamic meta data.
113 
120 typedef enum NvsRoleInTheme
121 {
126 
133 typedef enum NvsTextAlignment
134 {
142 
150 {
154 
162 {
166 
173 typedef enum NvsCategory
174 {
179 
187 {
194 
202 {
206 
215 typedef enum NvsVideoFrameYUVColorMatrix
217 {
223 
232 
235 {
240 
242 
251 typedef enum NvsVideoFrameColorPrimaries
254 {
259 
261 
269 {
274 
275 
282 typedef enum {
294 
306 
319 
320 
327 typedef enum {
332 
339 typedef struct {
340  int num;
341  int den;
342 } NvsRational;
343 
350 typedef struct {
351  int width;
352  int height;
353 } NvsSize;
354 
361 typedef struct {
362  float left;
363  float right;
364  float bottom;
365  float top;
366 } NvsRect;
367 
374 typedef struct {
375  unsigned int sampleRate;
377  unsigned int channelCount;
379 
386 typedef struct {
387  unsigned int imageWidth;
388  unsigned int imageHeight;
392 
403 typedef struct {
404  float r, g, b, a;
405 } NvsColor;
406 
413 typedef struct {
414  float x, y;
415 } NvsPosition2D;
416 
423 typedef struct {
424  float x, y, z;
425 } NvsPosition3D;
426 
433 typedef struct {
434  double x;
435  double y;
436 } NvsPointD;
437 
438 #define NVS_VIDEO_FRAME_MAX_PLANES 4
439 
446 typedef struct{
449  int planeRowPitch[NVS_VIDEO_FRAME_MAX_PLANES];
450  void* planePtr[NVS_VIDEO_FRAME_MAX_PLANES];
452  int64_t frameTimestamp;
453  bool isRec601;
455 
459 
466 typedef struct{
472 
473 #ifndef NV_AUDIO_MAX_CHANNEL_COUNT
474  #define NV_AUDIO_MAX_CHANNEL_COUNT 8
475 #endif
476 
477 typedef struct{
479  int planeSizeInBytes; // For planar audio: size in bytes of each plane(channel)
480  // For packed audio: size in bytes of total samples
485  int64_t timeStamp;
487 
495 typedef struct{
NvsAudSmpFmt_S32P
@ NvsAudSmpFmt_S32P
signed 32 bit,planer
Definition: NvsCommonDef.h:38
NvsVideoColorTransfer_ST2084
@ NvsVideoColorTransfer_ST2084
Definition: NvsCommonDef.h:94
NvsTextAlignmentBottom
@ NvsTextAlignmentBottom
Definition: NvsCommonDef.h:139
NvsVideoFrameColorPrimaries
NvsVideoFrameColorPrimaries
Definition: NvsCommonDef.h:254
NvsRoleInTheme
NvsRoleInTheme
The role of the clip in the theme.
Definition: NvsCommonDef.h:121
NvsVideoFrameYUVColorMatrix_Bt709
@ NvsVideoFrameYUVColorMatrix_Bt709
ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B.
Definition: NvsCommonDef.h:219
NvsPixelFormat_YUV420
@ NvsPixelFormat_YUV420
YUV 4:2:0 12bpp (Three channels, one luminance channel, the other two are U component and V component...
Definition: NvsCommonDef.h:189
NvsAudioSampleBuffers::sampleRate
int sampleRate
audio sample rate
Definition: NvsCommonDef.h:481
NvsThemeCategory
@ NvsThemeCategory
Theme category.
Definition: NvsCommonDef.h:177
NvsVideoHDRType_HDR10
@ NvsVideoHDRType_HDR10
Definition: NvsCommonDef.h:107
NvsAudioResolution::sampleRate
unsigned int sampleRate
Sampling rate.
Definition: NvsCommonDef.h:375
NvsVideoFrameColorTransfer
NvsVideoFrameColorTransfer
Definition: NvsCommonDef.h:235
NvsRoleInThemeGeneral
@ NvsRoleInThemeGeneral
General.
Definition: NvsCommonDef.h:122
NvsVideoColorTransfer_HLG
@ NvsVideoColorTransfer_HLG
Definition: NvsCommonDef.h:95
NvsRoleInThemeTrailer
@ NvsRoleInThemeTrailer
Trailer.
Definition: NvsCommonDef.h:124
NvsLiveWindowHDRDisplayMode_TONE_MAP_SDR
@ NvsLiveWindowHDRDisplayMode_TONE_MAP_SDR
If the device supports HDR, use HDR display, and use NO HDR mode display if it is not supported.
Definition: NvsCommonDef.h:330
NvsLiveWindowHDRDisplayMode_Device
@ NvsLiveWindowHDRDisplayMode_Device
If the device supports HDR, use HDR display.
Definition: NvsCommonDef.h:329
NvsVideoFrameInfo::isRec601
bool isRec601
Whether color space is BT.601.
Definition: NvsCommonDef.h:453
NvsPointD::y
double y
Definition: NvsCommonDef.h:435
NvsLetterSpacingType
NvsLetterSpacingType
letter spacing type
Definition: NvsCommonDef.h:150
NvsVideoResolutionBitDepth_Auto
@ NvsVideoResolutionBitDepth_Auto
The bit depth of processing pixel is adaptive. For example, for videos with HDR in editing,...
Definition: NvsCommonDef.h:272
NvsLiveWindowFillModePreserveAspectFit
@ NvsLiveWindowFillModePreserveAspectFit
The image is evenly scaled to fit the window, without cropping.
Definition: NvsCommonDef.h:305
NvsVideoFrameInfo::flipHorizontally
bool flipHorizontally
Shows whether current image requires horizontal flip or not.
Definition: NvsCommonDef.h:457
NvsTextAlignmentTop
@ NvsTextAlignmentTop
Definition: NvsCommonDef.h:138
NvsVideoFrameYUVColorMatrix_Bt2020
@ NvsVideoFrameYUVColorMatrix_Bt2020
ITU-R BT2020.
Definition: NvsCommonDef.h:220
NvsLiveWindowFillModePreserveAspectCrop
@ NvsLiveWindowFillModePreserveAspectCrop
The image is evenly filled and cropped if necessary (default mode).
Definition: NvsCommonDef.h:293
NvsRect
Rectangle.
Definition: NvsCommonDef.h:361
NvsAVFileType_Unknown
@ NvsAVFileType_Unknown
Unknown.
Definition: NvsCommonDef.h:52
NvsVideoFrameColorTransfer_SMPTE2084
@ NvsVideoFrameColorTransfer_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems known as "PQ".
Definition: NvsCommonDef.h:237
NvsVideoFrameInfo
Video frame information.
Definition: NvsCommonDef.h:446
NvsLetterSpacingTypeAbsolute
@ NvsLetterSpacingTypeAbsolute
Definition: NvsCommonDef.h:152
NvsVideoFrameYUVColorMatrix_Bt601
@ NvsVideoFrameYUVColorMatrix_Bt601
ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL.
Definition: NvsCommonDef.h:218
NvsTextAlignmentLeft
@ NvsTextAlignmentLeft
Definition: NvsCommonDef.h:135
NOT_USE_ASSET_DEFAULT_PARAM
@ NOT_USE_ASSET_DEFAULT_PARAM
Definition: NvsCommonDef.h:164
NvsCapturedAudioSampleInfo
Audio sample info from capturing.
Definition: NvsCommonDef.h:495
NvsVideoFrameColorPrimaries_DisplayP3
@ NvsVideoFrameColorPrimaries_DisplayP3
RGB color space Display P3 based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999.
Definition: NvsCommonDef.h:257
NvsRect::right
float right
Right.
Definition: NvsCommonDef.h:363
NvsAudioResolution::sampleFormat
NvsAudioSampleFormat sampleFormat
Sampling format.
Definition: NvsCommonDef.h:376
NvsAVFileType_Image
@ NvsAVFileType_Image
Image.
Definition: NvsCommonDef.h:55
NvsVideoHDRType_HDR10Plus
@ NvsVideoHDRType_HDR10Plus
Definition: NvsCommonDef.h:109
NvsVideoFrameInfoExt::colorPrimaries
NvsVideoFrameColorPrimaries colorPrimaries
Definition: NvsCommonDef.h:470
NvsRational
Rational value.
Definition: NvsCommonDef.h:339
NvsAudSmpFmt_DBL
@ NvsAudSmpFmt_DBL
double precision float
Definition: NvsCommonDef.h:34
NvsVideoFrameInfoExt::frameInfo
NvsVideoFrameInfo frameInfo
Definition: NvsCommonDef.h:467
NvsPosition3D
3D coordinate structure
Definition: NvsCommonDef.h:423
USE_ASSET_DEFAULT_PARAM
@ USE_ASSET_DEFAULT_PARAM
Definition: NvsCommonDef.h:163
NvsVideoFrameColorPrimaries_Bt2020
@ NvsVideoFrameColorPrimaries_Bt2020
RGB color space BT.2020 standardized as Rec. ITU-R BT.2020-1.
Definition: NvsCommonDef.h:256
NvsAudSmpFmt_FLTP
@ NvsAudSmpFmt_FLTP
single precision float,planar
Definition: NvsCommonDef.h:39
NvsRect::bottom
float bottom
Bottom.
Definition: NvsCommonDef.h:364
NvsRect::left
float left
Left.
Definition: NvsCommonDef.h:362
NvsVideoFrameInfoExt::colorMatrix
NvsVideoFrameYUVColorMatrix colorMatrix
Definition: NvsCommonDef.h:468
NvsVideoRotation_270
@ NvsVideoRotation_270
Definition: NvsCommonDef.h:69
NvsVideoCodecType
NvsVideoCodecType
Video codec type.
Definition: NvsCommonDef.h:79
NvsAudioSampleBuffers::planeSizeInBytes
int planeSizeInBytes
Definition: NvsCommonDef.h:479
NvsSize::height
int height
Height.
Definition: NvsCommonDef.h:352
NvsVideoFrameColorTransfer_ARIB_STD_B67
@ NvsVideoFrameColorTransfer_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
Definition: NvsCommonDef.h:238
NvsLiveWindowHDRDisplayMode_SDR
@ NvsLiveWindowHDRDisplayMode_SDR
Forced to use SDR display, regardless of whether the device supports HDR display.
Definition: NvsCommonDef.h:328
NvsVideoFrameInfo::frameTimestamp
int64_t frameTimestamp
The captured image's timestamp (in microseconds)
Definition: NvsCommonDef.h:452
NvsVideoRotation_180
@ NvsVideoRotation_180
Definition: NvsCommonDef.h:68
NvsVideoFrameInfo::frameHeight
int frameHeight
The captured image's height (in pixel)
Definition: NvsCommonDef.h:448
NvsAudSmpFmt_S32
@ NvsAudSmpFmt_S32
signed 32 bit
Definition: NvsCommonDef.h:32
NvsAudSmpFmt_DBLP
@ NvsAudSmpFmt_DBLP
double precision float,olanar
Definition: NvsCommonDef.h:40
NvsPointD
2D coordinate point structure. The parameter type is double.
Definition: NvsCommonDef.h:433
NvsAudSmpFmt_S16
@ NvsAudSmpFmt_S16
signed 16 bit
Definition: NvsCommonDef.h:31
NvsAudSmpFmt_U8
@ NvsAudSmpFmt_U8
unsigned 8 bit
Definition: NvsCommonDef.h:30
NvsRational::den
int den
Denominator.
Definition: NvsCommonDef.h:341
NvsAudioSampleBuffers::sampleFormat
NvsAudioSampleFormat sampleFormat
audio sample fromat
Definition: NvsCommonDef.h:483
NvsAVFileType
NvsAVFileType
File type.
Definition: NvsCommonDef.h:51
NvsUserCategory
@ NvsUserCategory
User-defined type.
Definition: NvsCommonDef.h:176
NvsPointD::x
double x
Definition: NvsCommonDef.h:434
NvsLiveWindowFillModeStretch
@ NvsLiveWindowFillModeStretch
The image is scaled to fit the window.
Definition: NvsCommonDef.h:317
NvsAVFileType_Audio
@ NvsAVFileType_Audio
Audio.
Definition: NvsCommonDef.h:54
NvsVideoFrameInfo::isFullRangeYUV
bool isFullRangeYUV
Whether the yuv value range is full range(0-255)
Definition: NvsCommonDef.h:454
NvsGpuVideoFrameFormat_RGBA8
@ NvsGpuVideoFrameFormat_RGBA8
Definition: NvsCommonDef.h:203
NvsVideoRotation
NvsVideoRotation
Video rotation.
Definition: NvsCommonDef.h:65
NvsLiveWindowHDRDisplayMode
NvsLiveWindowHDRDisplayMode
Live Window fill mode.
Definition: NvsCommonDef.h:327
NvsVideoFramePixelFormat
NvsVideoFramePixelFormat
Video frame pixel format.
Definition: NvsCommonDef.h:187
NvsVideoCodecType_H264
@ NvsVideoCodecType_H264
Definition: NvsCommonDef.h:81
NvsVideoHDRType_HLG
@ NvsVideoHDRType_HLG
Definition: NvsCommonDef.h:108
NvsAudSmpFmt_Count
@ NvsAudSmpFmt_Count
Definition: NvsCommonDef.h:42
NvsColor
Self-defined color.
Definition: NvsCommonDef.h:403
NvsVideoCodecType_H265
@ NvsVideoCodecType_H265
Definition: NvsCommonDef.h:82
NvsVideoColorTransfer
NvsVideoColorTransfer
Color Transfer Characteristic.
Definition: NvsCommonDef.h:92
NvsPosition2D::y
float y
Definition: NvsCommonDef.h:414
NvsTextAlignmentCenter
@ NvsTextAlignmentCenter
Definition: NvsCommonDef.h:136
NvsPosition3D::z
float z
Definition: NvsCommonDef.h:424
NvsCapturedAudioSampleInfo::sampleRate
int sampleRate
audio sample rate
Definition: NvsCommonDef.h:496
NvsAudioResolution::channelCount
unsigned int channelCount
Channel count.
Definition: NvsCommonDef.h:377
NvsAudSmpFmt_None
@ NvsAudSmpFmt_None
None.
Definition: NvsCommonDef.h:29
NvsLetterSpacingTypePercentage
@ NvsLetterSpacingTypePercentage
Definition: NvsCommonDef.h:151
NvsDefaultCategory
@ NvsDefaultCategory
Default type.
Definition: NvsCommonDef.h:175
NvsAudSmpFmt_S16P
@ NvsAudSmpFmt_S16P
signed 16 bit,planer
Definition: NvsCommonDef.h:37
NvsVideoFrameInfoExt::colorTransfer
NvsVideoFrameColorTransfer colorTransfer
Definition: NvsCommonDef.h:469
NvsVideoFrameInfo::frameWidth
int frameWidth
The captured image's width (in pixel)
Definition: NvsCommonDef.h:447
NvsTextAlignment
NvsTextAlignment
Text alignment style.
Definition: NvsCommonDef.h:134
NvsColor::r
float r
Definition: NvsCommonDef.h:404
NvsAudSmpFmt_FLT
@ NvsAudSmpFmt_FLT
single precision float
Definition: NvsCommonDef.h:33
NvsVideoCodecType_Unknown
@ NvsVideoCodecType_Unknown
Definition: NvsCommonDef.h:80
NvsVideoResolutionBitDepth_16Bit_Float
@ NvsVideoResolutionBitDepth_16Bit_Float
The bit depth of processing pixel is half float.
Definition: NvsCommonDef.h:271
NvsVideoResolutionBitDepth_8Bit
@ NvsVideoResolutionBitDepth_8Bit
The bit depth of processing pixel is 8bit.
Definition: NvsCommonDef.h:270
NvsVideoHDRType_DolbyVision
@ NvsVideoHDRType_DolbyVision
Definition: NvsCommonDef.h:110
NvsLiveWindowFillMode
NvsLiveWindowFillMode
Live Window fill mode.
Definition: NvsCommonDef.h:282
NVS_VIDEO_FRAME_MAX_PLANES
#define NVS_VIDEO_FRAME_MAX_PLANES
Definition: NvsCommonDef.h:438
NvsAudioResolution
Audio resolution.
Definition: NvsCommonDef.h:374
NvsAudioSampleBuffers::channelCount
int channelCount
audio channel count
Definition: NvsCommonDef.h:482
NvsVideoHDRType
NvsVideoHDRType
HDR type.
Definition: NvsCommonDef.h:105
NvsSize::width
int width
Width.
Definition: NvsCommonDef.h:351
NvsTextAlignmentVCenter
@ NvsTextAlignmentVCenter
Definition: NvsCommonDef.h:140
NvsGpuVideoFrameFormat_RGBA16F
@ NvsGpuVideoFrameFormat_RGBA16F
RGBA format half float per channel.
Definition: NvsCommonDef.h:204
NvsPixelFormat_BGRA
@ NvsPixelFormat_BGRA
BGRA.
Definition: NvsCommonDef.h:190
NvsAudioSampleFormat
NvsAudioSampleFormat
Audio sampling format.
Definition: NvsCommonDef.h:28
NvsTextAlignmentRight
@ NvsTextAlignmentRight
Definition: NvsCommonDef.h:137
NvsVideoFrameYUVColorMatrix
NvsVideoFrameYUVColorMatrix
Definition: NvsCommonDef.h:217
NvsVideoResolution
Video resolution.
Definition: NvsCommonDef.h:386
NvsVideoResolution::bitDepth
NvsVideoResolutionBitDepth bitDepth
Default is 8Bit.
Definition: NvsCommonDef.h:390
NvsVideoRotation_0
@ NvsVideoRotation_0
Definition: NvsCommonDef.h:66
NvsAssetDefaultParam
NvsAssetDefaultParam
Uses the default caption package.
Definition: NvsCommonDef.h:162
NvsGpuVideoFrameFormat
NvsGpuVideoFrameFormat
Video frame pixel format.
Definition: NvsCommonDef.h:202
NvsAudSmpFmt_U8P
@ NvsAudSmpFmt_U8P
unsigned 8 bit,planer
Definition: NvsCommonDef.h:36
NvsVideoHDRType_None
@ NvsVideoHDRType_None
Definition: NvsCommonDef.h:106
NvsPixelFormat_Nv12
@ NvsPixelFormat_Nv12
YUV 4:2:0 12bpp (Two channels, one channel is a continuous luminance channel, and the other channel i...
Definition: NvsCommonDef.h:188
NvsVideoFrameColorPrimaries_Bt709
@ NvsVideoFrameColorPrimaries_Bt709
RGB color space BT.709 standardized as Rec. ITU-R BT.709-5.
Definition: NvsCommonDef.h:255
NvsPosition2D
2D coordinate structure
Definition: NvsCommonDef.h:413
NvsVideoFrameColorTransfer_sRGB
@ NvsVideoFrameColorTransfer_sRGB
Definition: NvsCommonDef.h:236
NvsRect::top
float top
Top.
Definition: NvsCommonDef.h:365
NvsAudioSampleBuffers::timeStamp
int64_t timeStamp
the timestamp of the audio sample buffer in microseconds
Definition: NvsCommonDef.h:485
NvsAudioSampleBuffers::actualSampleCount
int actualSampleCount
actual audio sample count in audioBuffer
Definition: NvsCommonDef.h:484
NvsAudioSampleBuffers
Definition: NvsCommonDef.h:477
NvsVideoRotation_90
@ NvsVideoRotation_90
Definition: NvsCommonDef.h:67
NvsVideoResolution::imageHeight
unsigned int imageHeight
Image height.
Definition: NvsCommonDef.h:388
NvsVideoHDRType_Vivid
@ NvsVideoHDRType_Vivid
Definition: NvsCommonDef.h:111
NvsVideoResolution::imageWidth
unsigned int imageWidth
Image width.
Definition: NvsCommonDef.h:387
NV_AUDIO_MAX_CHANNEL_COUNT
#define NV_AUDIO_MAX_CHANNEL_COUNT
Definition: NvsCommonDef.h:474
NvsRational::num
int num
Numerator.
Definition: NvsCommonDef.h:340
NvsSize
Size.
Definition: NvsCommonDef.h:350
NvsVideoFrameInfo::displayRotation
int displayRotation
Shows the angle at which the current image needs to be rotated.
Definition: NvsCommonDef.h:456
NvsAVFileType_AudioVideo
@ NvsAVFileType_AudioVideo
Video.
Definition: NvsCommonDef.h:53
NvsRoleInThemeTitle
@ NvsRoleInThemeTitle
Title.
Definition: NvsCommonDef.h:123
NvsVideoColorTransfer_SDR_VIDEO
@ NvsVideoColorTransfer_SDR_VIDEO
Definition: NvsCommonDef.h:93
NvsPixelFormat_P010
@ NvsPixelFormat_P010
YUV 4:2:0 24bpp (2 channels, one channel is a continuous luminance channel, and the other channel is ...
Definition: NvsCommonDef.h:192
NvsVideoResolutionBitDepth
NvsVideoResolutionBitDepth
Video frame pixel format.
Definition: NvsCommonDef.h:269
NvsVideoResolution::imagePAR
NvsRational imagePAR
Pixel ratio (only 1:1)
Definition: NvsCommonDef.h:389
NvsCategory
NvsCategory
The type of clip in theme.
Definition: NvsCommonDef.h:174
NvsPixelFormat_RGBA
@ NvsPixelFormat_RGBA
RGBA.
Definition: NvsCommonDef.h:191
NvsVideoFrameInfoExt
Video frame extra information.
Definition: NvsCommonDef.h:466
NvsVideoFrameInfo::pixelFormat
NvsVideoFramePixelFormat pixelFormat
The captured image's format.
Definition: NvsCommonDef.h:451