forked from metal3d/kurento-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
complexTypes.go
418 lines (347 loc) · 10.2 KB
/
complexTypes.go
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
package kurento
// Media Profile.
// Currently WEBM and MP4 are supported.
type MediaProfileSpecType string
// Implement fmt.Stringer interface
func (t MediaProfileSpecType) String() string {
return string(t)
}
const (
MEDIAPROFILESPECTYPE_WEBM MediaProfileSpecType = "WEBM"
MEDIAPROFILESPECTYPE_MP4 MediaProfileSpecType = "MP4"
MEDIAPROFILESPECTYPE_WEBM_VIDEO_ONLY MediaProfileSpecType = "WEBM_VIDEO_ONLY"
MEDIAPROFILESPECTYPE_WEBM_AUDIO_ONLY MediaProfileSpecType = "WEBM_AUDIO_ONLY"
MEDIAPROFILESPECTYPE_MP4_VIDEO_ONLY MediaProfileSpecType = "MP4_VIDEO_ONLY"
MEDIAPROFILESPECTYPE_MP4_AUDIO_ONLY MediaProfileSpecType = "MP4_AUDIO_ONLY"
)
type IceCandidate struct {
Candidate string
SdpMid string
SdpMLineIndex int
}
func (t IceCandidate) CustomSerialize() map[string]interface{} {
ret := make(map[string]interface{})
ret["candidate"] = t.Candidate
ret["sdpMid"] = t.SdpMid
ret["sdpMLineIndex"] = t.SdpMLineIndex
return ret
}
// States of an ICE component.
type IceComponentState string
// Implement fmt.Stringer interface
func (t IceComponentState) String() string {
return string(t)
}
const (
ICECOMPONENTSTATE_DISCONNECTED IceComponentState = "DISCONNECTED"
ICECOMPONENTSTATE_GATHERING IceComponentState = "GATHERING"
ICECOMPONENTSTATE_CONNECTING IceComponentState = "CONNECTING"
ICECOMPONENTSTATE_CONNECTED IceComponentState = "CONNECTED"
ICECOMPONENTSTATE_READY IceComponentState = "READY"
ICECOMPONENTSTATE_FAILED IceComponentState = "FAILED"
)
type ServerInfo struct {
Version string
Modules []ModuleInfo
Type ServerType
Capabilities []string
}
// Indicates if the server is a real media server or a proxy
type ServerType string
// Implement fmt.Stringer interface
func (t ServerType) String() string {
return string(t)
}
const (
SERVERTYPE_KMS ServerType = "KMS"
SERVERTYPE_KCS ServerType = "KCS"
)
// Details of gstreamer dot graphs
type GstreamerDotDetails string
// Implement fmt.Stringer interface
func (t GstreamerDotDetails) String() string {
return string(t)
}
const (
GSTREAMERDOTDETAILS_SHOW_MEDIA_TYPE GstreamerDotDetails = "SHOW_MEDIA_TYPE"
GSTREAMERDOTDETAILS_SHOW_CAPS_DETAILS GstreamerDotDetails = "SHOW_CAPS_DETAILS"
GSTREAMERDOTDETAILS_SHOW_NON_DEFAULT_PARAMS GstreamerDotDetails = "SHOW_NON_DEFAULT_PARAMS"
GSTREAMERDOTDETAILS_SHOW_STATES GstreamerDotDetails = "SHOW_STATES"
GSTREAMERDOTDETAILS_SHOW_ALL GstreamerDotDetails = "SHOW_ALL"
)
type ModuleInfo struct {
Version string
Name string
Factories []string
}
// State of the media.
type MediaState string
// Implement fmt.Stringer interface
func (t MediaState) String() string {
return string(t)
}
const (
MEDIASTATE_DISCONNECTED MediaState = "DISCONNECTED"
MEDIASTATE_CONNECTED MediaState = "CONNECTED"
)
// State of the connection.
type ConnectionState string
// Implement fmt.Stringer interface
func (t ConnectionState) String() string {
return string(t)
}
const (
CONNECTIONSTATE_DISCONNECTED ConnectionState = "DISCONNECTED"
CONNECTIONSTATE_CONNECTED ConnectionState = "CONNECTED"
)
// Type of media stream to be exchanged.
// Can take the values AUDIO, DATA or VIDEO.
type MediaType string
// Implement fmt.Stringer interface
func (t MediaType) String() string {
return string(t)
}
const (
MEDIATYPE_AUDIO MediaType = "AUDIO"
MEDIATYPE_DATA MediaType = "DATA"
MEDIATYPE_VIDEO MediaType = "VIDEO"
)
// Type of filter to be created.
// Can take the values AUDIO, VIDEO or AUTODETECT.
type FilterType string
// Implement fmt.Stringer interface
func (t FilterType) String() string {
return string(t)
}
const (
FILTERTYPE_AUDIO FilterType = "AUDIO"
FILTERTYPE_AUTODETECT FilterType = "AUTODETECT"
FILTERTYPE_VIDEO FilterType = "VIDEO"
)
// Codec used for transmission of video.
type VideoCodec string
// Implement fmt.Stringer interface
func (t VideoCodec) String() string {
return string(t)
}
const (
VIDEOCODEC_VP8 VideoCodec = "VP8"
VIDEOCODEC_H264 VideoCodec = "H264"
VIDEOCODEC_RAW VideoCodec = "RAW"
)
// Codec used for transmission of audio.
type AudioCodec string
// Implement fmt.Stringer interface
func (t AudioCodec) String() string {
return string(t)
}
const (
AUDIOCODEC_OPUS AudioCodec = "OPUS"
AUDIOCODEC_PCMU AudioCodec = "PCMU"
AUDIOCODEC_RAW AudioCodec = "RAW"
)
type Fraction struct {
Numerator int
Denominator int
}
type AudioCaps struct {
Codec AudioCodec
Bitrate int
}
type VideoCaps struct {
Codec VideoCodec
Framerate Fraction
}
type ElementConnectionData struct {
Source MediaElement
Sink MediaElement
Type MediaType
SourceDescription string
SinkDescription string
}
type Tag struct {
Key string
Value string
}
// The type of the object.
type StatsType string
// Implement fmt.Stringer interface
func (t StatsType) String() string {
return string(t)
}
const (
STATSTYPE_inboundrtp StatsType = "inboundrtp"
STATSTYPE_outboundrtp StatsType = "outboundrtp"
STATSTYPE_session StatsType = "session"
STATSTYPE_datachannel StatsType = "datachannel"
STATSTYPE_track StatsType = "track"
STATSTYPE_transport StatsType = "transport"
STATSTYPE_candidatepair StatsType = "candidatepair"
STATSTYPE_localcandidate StatsType = "localcandidate"
STATSTYPE_remotecandidate StatsType = "remotecandidate"
)
type Stats struct {
Id string
Type StatsType
Timestamp float64
}
type RTCStats struct {
}
type RTCRTPStreamStats struct {
Ssrc string
AssociateStatsId string
IsRemote bool
MediaTrackId string
TransportId string
CodecId string
FirCount int64
PliCount int64
NackCount int64
SliCount int64
Remb int64
PacketsLost int64
FractionLost float64
}
type RTCCodec struct {
PayloadType int64
Codec string
ClockRate int64
Channels int64
Parameters string
}
type RTCInboundRTPStreamStats struct {
PacketsReceived int64
BytesReceived int64
Jitter float64
}
type RTCOutboundRTPStreamStats struct {
PacketsSent int64
BytesSent int64
TargetBitrate float64
RoundTripTime float64
}
type RTCPeerConnectionStats struct {
DataChannelsOpened int64
DataChannelsClosed int64
}
type RTCMediaStreamStats struct {
StreamIdentifier string
TrackIds []string
}
type RTCMediaStreamTrackStats struct {
TrackIdentifier string
RemoteSource bool
SsrcIds []string
FrameWidth int64
FrameHeight int64
FramesPerSecond float64
FramesSent int64
FramesReceived int64
FramesDecoded int64
FramesDropped int64
FramesCorrupted int64
AudioLevel float64
EchoReturnLoss float64
EchoReturnLossEnhancement float64
}
// Represents the state of the RTCDataChannel
type RTCDataChannelState string
// Implement fmt.Stringer interface
func (t RTCDataChannelState) String() string {
return string(t)
}
const (
RTCDATACHANNELSTATE_connecting RTCDataChannelState = "connecting"
RTCDATACHANNELSTATE_open RTCDataChannelState = "open"
RTCDATACHANNELSTATE_closing RTCDataChannelState = "closing"
RTCDATACHANNELSTATE_closed RTCDataChannelState = "closed"
)
type RTCDataChannelStats struct {
Label string
Protocol string
Datachannelid int64
State RTCDataChannelState
MessagesSent int64
BytesSent int64
MessagesReceived int64
BytesReceived int64
}
type RTCTransportStats struct {
BytesSent int64
BytesReceived int64
RtcpTransportStatsId string
ActiveConnection bool
SelectedCandidatePairId string
LocalCertificateId string
RemoteCertificateId string
}
// Types of candidates
type RTCStatsIceCandidateType string
// Implement fmt.Stringer interface
func (t RTCStatsIceCandidateType) String() string {
return string(t)
}
const (
RTCSTATSICECANDIDATETYPE_host RTCStatsIceCandidateType = "host"
RTCSTATSICECANDIDATETYPE_serverreflexive RTCStatsIceCandidateType = "serverreflexive"
RTCSTATSICECANDIDATETYPE_peerreflexive RTCStatsIceCandidateType = "peerreflexive"
RTCSTATSICECANDIDATETYPE_relayed RTCStatsIceCandidateType = "relayed"
)
type RTCIceCandidateAttributes struct {
IpAddress string
PortNumber int64
Transport string
CandidateType RTCStatsIceCandidateType
Priority int64
AddressSourceUrl string
}
// Represents the state of the checklist for the local and remote candidates in a
// pair.
type RTCStatsIceCandidatePairState string
// Implement fmt.Stringer interface
func (t RTCStatsIceCandidatePairState) String() string {
return string(t)
}
const (
RTCSTATSICECANDIDATEPAIRSTATE_frozen RTCStatsIceCandidatePairState = "frozen"
RTCSTATSICECANDIDATEPAIRSTATE_waiting RTCStatsIceCandidatePairState = "waiting"
RTCSTATSICECANDIDATEPAIRSTATE_inprogress RTCStatsIceCandidatePairState = "inprogress"
RTCSTATSICECANDIDATEPAIRSTATE_failed RTCStatsIceCandidatePairState = "failed"
RTCSTATSICECANDIDATEPAIRSTATE_succeeded RTCStatsIceCandidatePairState = "succeeded"
RTCSTATSICECANDIDATEPAIRSTATE_cancelled RTCStatsIceCandidatePairState = "cancelled"
)
type RTCIceCandidatePairStats struct {
TransportId string
LocalCandidateId string
RemoteCandidateId string
State RTCStatsIceCandidatePairState
Priority int64
Nominated bool
Writable bool
Readable bool
BytesSent int64
BytesReceived int64
RoundTripTime float64
AvailableOutgoingBitrate float64
AvailableIncomingBitrate float64
}
type RTCCertificateStats struct {
Fingerprint string
FingerprintAlgorithm string
Base64Certificate string
IssuerCertificateId string
}
type CodecConfiguration struct {
Name string
Properties map[string]interface{}
}
type RembParams struct {
PacketsRecvIntervalTop int
ExponentialFactor float64
LinealFactorMin int
LinealFactorGrade float64
DecrementFactor float64
ThresholdFactor float64
UpLosses int
RembOnConnect int
}