forked from brutella/hap
/
stream_configuration.go
43 lines (37 loc) · 1.38 KB
/
stream_configuration.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
package rtp
type StreamConfiguration struct {
Command SessionControlCommand `tlv8:"1"`
Video VideoParameters `tlv8:"2"`
Audio AudioParameters `tlv8:"3"`
}
const (
SessionControlCommandTypeEnd byte = 0
SessionControlCommandTypeStart = 1
SessionControlCommandTypeSuspend = 2
SessionControlCommandTypeResume = 3
SessionControlCommandTypeReconfigure = 4
)
type SessionControlCommand struct {
Identifier []byte `tlv8:"1"` // docu says 16 bytes but overall size of SessionControlCommand is also 16 bytes?
Type byte `tlv8:"2"`
}
type VideoParameters struct {
CodecType byte `tlv8:"1"`
CodecParams VideoCodecParameters `tlv8:"2"`
Attributes VideoCodecAttributes `tlv8:"3"`
RTP RTPParams `tlv8:"4"`
}
type AudioParameters struct {
CodecType byte `tlv8:"1"`
CodecParams AudioCodecParameters `tlv8:"2"`
RTP RTPParams `tlv8:"3"`
ComfortNoise bool `tlv8:"4"`
}
type RTPParams struct {
PayloadType uint8 `tlv8:"1"`
Ssrc uint32 `tlv8:"2"`
Bitrate uint16 `tlv8:"3"`
Interval float32 `tlv8:"4"` // MinimumRTCP interval
ComfortNoisePayloadType uint8 `tlv8:"5,optional"` // only for audio
MTU uint16 `tlv8:"6,optional"` // only for video
}