美摄SDK For iOS  3.14.0
NvsCommonDef.h
浏览该文件的文档.
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 平面格式
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
片段在主题中的角色
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 ( 3通道, 一个亮度通道, 另两个为U分量和V分量通道, 所有通道都是连续的 )
Definition: NvsCommonDef.h:189
NvsAudioSampleBuffers::sampleRate
int sampleRate
音频采样率
Definition: NvsCommonDef.h:481
NvsThemeCategory
@ NvsThemeCategory
主题类型
Definition: NvsCommonDef.h:177
NvsVideoHDRType_HDR10
@ NvsVideoHDRType_HDR10
Definition: NvsCommonDef.h:107
NvsAudioResolution::sampleRate
unsigned int sampleRate
采样率
Definition: NvsCommonDef.h:375
NvsVideoFrameColorTransfer
NvsVideoFrameColorTransfer
Definition: NvsCommonDef.h:235
NvsRoleInThemeGeneral
@ NvsRoleInThemeGeneral
通用
Definition: NvsCommonDef.h:122
NvsVideoColorTransfer_HLG
@ NvsVideoColorTransfer_HLG
Definition: NvsCommonDef.h:95
NvsRoleInThemeTrailer
@ NvsRoleInThemeTrailer
片尾
Definition: NvsCommonDef.h:124
NvsLiveWindowHDRDisplayMode_TONE_MAP_SDR
@ NvsLiveWindowHDRDisplayMode_TONE_MAP_SDR
如果设备支持HDR,就使用HDR进行显示,如果设备不支持,使用HDR转换为SDR进行显示
Definition: NvsCommonDef.h:330
NvsLiveWindowHDRDisplayMode_Device
@ NvsLiveWindowHDRDisplayMode_Device
如果设备支持HDR,就使用HDR进行显示
Definition: NvsCommonDef.h:329
NvsVideoFrameInfo::isRec601
bool isRec601
色彩空间是否是BT.601
Definition: NvsCommonDef.h:453
NvsPointD::y
double y
Definition: NvsCommonDef.h:435
NvsLetterSpacingType
NvsLetterSpacingType
字间距类型
Definition: NvsCommonDef.h:150
NvsVideoResolutionBitDepth_Auto
@ NvsVideoResolutionBitDepth_Auto
图像像素的位深度为自适应,比如在编辑中有HDR的视频,SDK内部处理HDR视频会使用半精度浮点
Definition: NvsCommonDef.h:272
NvsLiveWindowFillModePreserveAspectFit
@ NvsLiveWindowFillModePreserveAspectFit
图像均匀地缩放来适合窗口,没有裁剪。
Definition: NvsCommonDef.h:305
NvsVideoFrameInfo::flipHorizontally
bool flipHorizontally
显示当前图像需要不需要水平翻转
Definition: NvsCommonDef.h:457
NvsTextAlignmentTop
@ NvsTextAlignmentTop
Definition: NvsCommonDef.h:138
NvsVideoFrameYUVColorMatrix_Bt2020
@ NvsVideoFrameYUVColorMatrix_Bt2020
ITU-R BT2020
Definition: NvsCommonDef.h:220
NvsLiveWindowFillModePreserveAspectCrop
@ NvsLiveWindowFillModePreserveAspectCrop
图像按比例均匀填充,必要时进行裁剪(默认模式)
Definition: NvsCommonDef.h:293
NvsRect
矩形
Definition: NvsCommonDef.h:361
NvsAVFileType_Unknown
@ NvsAVFileType_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
视频帧信息
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
回调的采集音频信息
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
采样格式
Definition: NvsCommonDef.h:376
NvsAVFileType_Image
@ NvsAVFileType_Image
图片
Definition: NvsCommonDef.h:55
NvsVideoHDRType_HDR10Plus
@ NvsVideoHDRType_HDR10Plus
Definition: NvsCommonDef.h:109
NvsVideoFrameInfoExt::colorPrimaries
NvsVideoFrameColorPrimaries colorPrimaries
Definition: NvsCommonDef.h:470
NvsRational
比例值
Definition: NvsCommonDef.h:339
NvsAudSmpFmt_DBL
@ NvsAudSmpFmt_DBL
双精度浮点数
Definition: NvsCommonDef.h:34
NvsVideoFrameInfoExt::frameInfo
NvsVideoFrameInfo frameInfo
Definition: NvsCommonDef.h:467
NvsPosition3D
三维坐标结构
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
单精度浮点数 平面格式
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
视频编码类型
Definition: NvsCommonDef.h:79
NvsAudioSampleBuffers::planeSizeInBytes
int planeSizeInBytes
Definition: NvsCommonDef.h:479
NvsSize::height
int 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
强制使用SDR的方式进行显示,不进行HDR到SDR转化,不管设备支不支持HDR显示
Definition: NvsCommonDef.h:328
NvsVideoFrameInfo::frameTimestamp
int64_t frameTimestamp
获取到图像的时间戳(单位微秒)
Definition: NvsCommonDef.h:452
NvsVideoRotation_180
@ NvsVideoRotation_180
Definition: NvsCommonDef.h:68
NvsVideoFrameInfo::frameHeight
int frameHeight
获取到图像的高度(以像素为单位)
Definition: NvsCommonDef.h:448
NvsAudSmpFmt_S32
@ NvsAudSmpFmt_S32
signed 32 bit
Definition: NvsCommonDef.h:32
NvsAudSmpFmt_DBLP
@ NvsAudSmpFmt_DBLP
双精度浮点数 平面格式
Definition: NvsCommonDef.h:40
NvsPointD
二维坐标点结构。 参数类型为双精度浮点数。
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
分母
Definition: NvsCommonDef.h:341
NvsAudioSampleBuffers::sampleFormat
NvsAudioSampleFormat sampleFormat
音频数据格式
Definition: NvsCommonDef.h:483
NvsAVFileType
NvsAVFileType
文件类型
Definition: NvsCommonDef.h:51
NvsUserCategory
@ NvsUserCategory
用户自定义类型
Definition: NvsCommonDef.h:176
NvsPointD::x
double x
Definition: NvsCommonDef.h:434
NvsLiveWindowFillModeStretch
@ NvsLiveWindowFillModeStretch
图像被缩放来适合窗口
Definition: NvsCommonDef.h:317
NvsAVFileType_Audio
@ NvsAVFileType_Audio
音频
Definition: NvsCommonDef.h:54
NvsVideoFrameInfo::isFullRangeYUV
bool isFullRangeYUV
YUV取值范围是否是fullRange(0-255)
Definition: NvsCommonDef.h:454
NvsGpuVideoFrameFormat_RGBA8
@ NvsGpuVideoFrameFormat_RGBA8
Definition: NvsCommonDef.h:203
NvsVideoRotation
NvsVideoRotation
视频旋转角度
Definition: NvsCommonDef.h:65
NvsLiveWindowHDRDisplayMode
NvsLiveWindowHDRDisplayMode
Live Window 填充模式
Definition: NvsCommonDef.h:327
NvsVideoFramePixelFormat
NvsVideoFramePixelFormat
视频帧像素格式
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
自定义颜色类
Definition: NvsCommonDef.h:403
NvsVideoCodecType_H265
@ NvsVideoCodecType_H265
Definition: NvsCommonDef.h:82
NvsVideoColorTransfer
NvsVideoColorTransfer
颜色转换曲线
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
采样率
Definition: NvsCommonDef.h:496
NvsAudioResolution::channelCount
unsigned int channelCount
声道数
Definition: NvsCommonDef.h:377
NvsAudSmpFmt_None
@ NvsAudSmpFmt_None
Definition: NvsCommonDef.h:29
NvsLetterSpacingTypePercentage
@ NvsLetterSpacingTypePercentage
Definition: NvsCommonDef.h:151
NvsDefaultCategory
@ NvsDefaultCategory
默认类型
Definition: NvsCommonDef.h:175
NvsAudSmpFmt_S16P
@ NvsAudSmpFmt_S16P
signed 16 bit 平面格式
Definition: NvsCommonDef.h:37
NvsVideoFrameInfoExt::colorTransfer
NvsVideoFrameColorTransfer colorTransfer
Definition: NvsCommonDef.h:469
NvsVideoFrameInfo::frameWidth
int frameWidth
获取到图像的宽度(以像素为单位)
Definition: NvsCommonDef.h:447
NvsTextAlignment
NvsTextAlignment
字幕对齐方式
Definition: NvsCommonDef.h:134
NvsColor::r
float r
Definition: NvsCommonDef.h:404
NvsAudSmpFmt_FLT
@ NvsAudSmpFmt_FLT
单精度浮点数
Definition: NvsCommonDef.h:33
NvsVideoCodecType_Unknown
@ NvsVideoCodecType_Unknown
Definition: NvsCommonDef.h:80
NvsVideoResolutionBitDepth_16Bit_Float
@ NvsVideoResolutionBitDepth_16Bit_Float
图像像素的位深度为半精度浮点
Definition: NvsCommonDef.h:271
NvsVideoResolutionBitDepth_8Bit
@ NvsVideoResolutionBitDepth_8Bit
图像像素的位深度为8Bit
Definition: NvsCommonDef.h:270
NvsVideoHDRType_DolbyVision
@ NvsVideoHDRType_DolbyVision
Definition: NvsCommonDef.h:110
NvsLiveWindowFillMode
NvsLiveWindowFillMode
Live Window 填充模式
Definition: NvsCommonDef.h:282
NVS_VIDEO_FRAME_MAX_PLANES
#define NVS_VIDEO_FRAME_MAX_PLANES
Definition: NvsCommonDef.h:438
NvsAudioResolution
音频解析度
Definition: NvsCommonDef.h:374
NvsAudioSampleBuffers::channelCount
int channelCount
音频数据通道数
Definition: NvsCommonDef.h:482
NvsVideoHDRType
NvsVideoHDRType
HDR 视频类型
Definition: NvsCommonDef.h:105
NvsSize::width
int width
宽度
Definition: NvsCommonDef.h:351
NvsTextAlignmentVCenter
@ NvsTextAlignmentVCenter
Definition: NvsCommonDef.h:140
NvsGpuVideoFrameFormat_RGBA16F
@ NvsGpuVideoFrameFormat_RGBA16F
RGBA格式每个通道是半精度浮点(half float)
Definition: NvsCommonDef.h:204
NvsPixelFormat_BGRA
@ NvsPixelFormat_BGRA
BGRA
Definition: NvsCommonDef.h:190
NvsAudioSampleFormat
NvsAudioSampleFormat
音频采样格式
Definition: NvsCommonDef.h:28
NvsTextAlignmentRight
@ NvsTextAlignmentRight
Definition: NvsCommonDef.h:137
NvsVideoFrameYUVColorMatrix
NvsVideoFrameYUVColorMatrix
Definition: NvsCommonDef.h:217
NvsVideoResolution
视频解析度
Definition: NvsCommonDef.h:386
NvsVideoResolution::bitDepth
NvsVideoResolutionBitDepth bitDepth
默认是8Bit
Definition: NvsCommonDef.h:390
NvsVideoRotation_0
@ NvsVideoRotation_0
Definition: NvsCommonDef.h:66
NvsAssetDefaultParam
NvsAssetDefaultParam
使用默认的字幕包属性
Definition: NvsCommonDef.h:162
NvsGpuVideoFrameFormat
NvsGpuVideoFrameFormat
视频帧像素格式
Definition: NvsCommonDef.h:202
NvsAudSmpFmt_U8P
@ NvsAudSmpFmt_U8P
unsigned 8 bit 平面格式
Definition: NvsCommonDef.h:36
NvsVideoHDRType_None
@ NvsVideoHDRType_None
Definition: NvsCommonDef.h:106
NvsPixelFormat_Nv12
@ NvsPixelFormat_Nv12
YUV 4:2:0 12bpp ( 2通道, 一个通道是连续的亮度通道, 另一通道为VU分量交错 )
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
二维坐标结构
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
音频数据的时间戳(单位微秒)
Definition: NvsCommonDef.h:485
NvsAudioSampleBuffers::actualSampleCount
int actualSampleCount
在audioBuffer中的有效采样数量
Definition: NvsCommonDef.h:484
NvsAudioSampleBuffers
Definition: NvsCommonDef.h:477
NvsVideoRotation_90
@ NvsVideoRotation_90
Definition: NvsCommonDef.h:67
NvsVideoResolution::imageHeight
unsigned int imageHeight
图像高度
Definition: NvsCommonDef.h:388
NvsVideoHDRType_Vivid
@ NvsVideoHDRType_Vivid
Definition: NvsCommonDef.h:111
NvsVideoResolution::imageWidth
unsigned int imageWidth
图像宽度
Definition: NvsCommonDef.h:387
NV_AUDIO_MAX_CHANNEL_COUNT
#define NV_AUDIO_MAX_CHANNEL_COUNT
Definition: NvsCommonDef.h:474
NvsRational::num
int num
分子
Definition: NvsCommonDef.h:340
NvsSize
尺寸
Definition: NvsCommonDef.h:350
NvsVideoFrameInfo::displayRotation
int displayRotation
显示当前图像需要旋转的角度
Definition: NvsCommonDef.h:456
NvsAVFileType_AudioVideo
@ NvsAVFileType_AudioVideo
视频
Definition: NvsCommonDef.h:53
NvsRoleInThemeTitle
@ NvsRoleInThemeTitle
片头
Definition: NvsCommonDef.h:123
NvsVideoColorTransfer_SDR_VIDEO
@ NvsVideoColorTransfer_SDR_VIDEO
Definition: NvsCommonDef.h:93
NvsPixelFormat_P010
@ NvsPixelFormat_P010
YUV 4:2:0 24bpp ( 2通道, 一个通道是连续的亮度通道, 另一通道为VU分量交错 每个通道占用16位,高10位有效)
Definition: NvsCommonDef.h:192
NvsVideoResolutionBitDepth
NvsVideoResolutionBitDepth
视频帧像素格式
Definition: NvsCommonDef.h:269
NvsVideoResolution::imagePAR
NvsRational imagePAR
像素比(仅支持1:1)
Definition: NvsCommonDef.h:389
NvsCategory
NvsCategory
片段在主题中的类型
Definition: NvsCommonDef.h:174
NvsPixelFormat_RGBA
@ NvsPixelFormat_RGBA
RGBA
Definition: NvsCommonDef.h:191
NvsVideoFrameInfoExt
视频帧扩展信息
Definition: NvsCommonDef.h:466
NvsVideoFrameInfo::pixelFormat
NvsVideoFramePixelFormat pixelFormat
获取到图像的格式
Definition: NvsCommonDef.h:451