-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathindex.d.ts
168 lines (149 loc) · 4.03 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
export interface AudioFrame {
type: 'audio'
audioFormat: AudioFormat
referenceLevel: number
sampleRate: number // Hz
channels: number
samples: number
channelStrideInBytes: number
timestamp: [number, number] // PTP timestamp
timecode: [number, number] // timecode as PTP value
data: Buffer
}
export interface VideoFrame {
type: 'video'
xres: number
yres: number
frameRateN: number
frameRateD: number
fourCC: FourCC
pictureAspectRatio: number
timestamp: [ number, number ] // PTP timestamp
frameFormatType: FrameType
timecode: [ number, number ] // Measured in nanoseconds
lineStrideBytes: number
data: Buffer
}
export interface Receiver {
embedded: unknown
video: (timeout?: number) => Promise<VideoFrame>
audio: (params: {
audioFormat: AudioFormat
referenceLevel: number
}, timeout?: number) => Promise<AudioFrame>
metadata: any
data: any
source: Source
colorFormat: ColorFormat
bandwidth: Bandwidth
allowVideoFields: boolean
}
export interface Sender {
embedded: unknown
video: (frame: VideoFrame) => Promise<void>
audio: (frame: AudioFrame) => Promise<void>
name: string
groups?: string | string[]
clockVideo: boolean
clockAudio: boolean
}
export interface Source {
name: string
urlAddress?: string
ipAddress?: string
}
export const enum FrameType {
Progressive = 1,
Interlaced = 0,
Field0 = 2,
Field1 = 3,
}
export const FORMAT_TYPE_PROGRESSIVE: FrameType
export const FORMAT_TYPE_INTERLACED: FrameType
export const FORMAT_TYPE_FIELD_0: FrameType
export const FORMAT_TYPE_FIELD_1: FrameType
export const enum ColorFormat {
BGRX_BGRA = 0,
UYVY_BGRA = 1,
RGBX_RGBA = 2,
UYVY_RGBA = 3,
Fastest = 100,
Best = 101
}
export const COLOR_FORMAT_BGRX_BGRA: ColorFormat
export const COLOR_FORMAT_UYVY_BGRA: ColorFormat
export const COLOR_FORMAT_RGBX_RGBA: ColorFormat
export const COLOR_FORMAT_UYVY_RGBA: ColorFormat
export const COLOR_FORMAT_BGRX_BGRA_FLIPPED: ColorFormat
export const COLOR_FORMAT_FASTEST: ColorFormat
export const enum FourCC {
UYVY = 1498831189,
UYVA = 1096178005,
P216 = 909193808,
PA16 = 909197648,
YV12 = 842094169,
I420 = 808596553,
NV12 = 842094158,
BGRA = 1095911234,
BGRX = 1481787202,
RGBA = 1094862674,
RGBX = 1480738642
}
export const enum AudioFormat {
Float32Separate = 0,
Float32Interleaved = 1,
Int16Interleaved = 2
}
export const AUDIO_FORMAT_FLOAT_32_SEPARATE: AudioFormat
export const AUDIO_FORMAT_FLOAT_32_INTERLEAVED: AudioFormat
export const AUDIO_FORMAT_INT_16_INTERLEAVED: AudioFormat
export const enum Bandwidth {
MetadataOnly = -10,
AudioOnly = 10,
Lowest = 0,
Highest = 100
}
export const BANDWIDTH_METADATA_ONLY: Bandwidth
export const BANDWIDTH_AUDIO_ONLY: Bandwidth
export const BANDWIDTH_LOWEST: Bandwidth
export const BANDWIDTH_HIGHEST: Bandwidth
export function receive(params: {
source: Source
colorFormat?: ColorFormat
bandwidth?: Bandwidth
allowVideoFields?: boolean
name?: string
}): Promise<Receiver>
export function send(params: {
name: string
groups?: string | string[]
clockVideo?: boolean
clockAudio?: boolean
}): Sender
/** @deprecated use GrandioseFinder instead */
export function find(params: GrandioseFinderOptions, waitMs?: number): Promise<Array<Source>>
export interface GrandioseFinderOptions {
// Should sources on the same system be found?
showLocalSources?: boolean,
// Show only sources in the named groups
groups?: string[] | string,
// Specific IP addresses or machine names to check
// These are possibly on a different VLAN and not visible over MDNS
extraIPs?: string[]
}
/**
* An instance of the NDI source finder.
* This will monitor for sources in the background, and you can poll it for the current list at useful times.
*/
export class GrandioseFinder{
constructor(options?: GrandioseFinderOptions)
/**
* Dispose of the finder once you are finished with it
* Failing to do so will block the application from terminating
*/
dispose(): void
/**
* Get the list of currently known Sources
*/
getCurrentSources(): Array<Source>
}