-
Notifications
You must be signed in to change notification settings - Fork 18
/
trackencodinginfo.go
64 lines (47 loc) · 1.13 KB
/
trackencodinginfo.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
package sdp
type TrackEncodingInfo struct {
id string
paused bool
codecs map[string]*CodecInfo
params map[string]string
}
func NewTrackEncodingInfo(id string, paused bool) *TrackEncodingInfo {
info := &TrackEncodingInfo{
id: id,
paused: paused,
codecs: map[string]*CodecInfo{},
params: map[string]string{},
}
return info
}
func (t *TrackEncodingInfo) Clone() *TrackEncodingInfo {
cloned := NewTrackEncodingInfo(t.id, t.paused)
for k, v := range t.codecs {
cloned.codecs[k] = v.Clone()
}
for k, v := range t.params {
cloned.params[k] = v
}
return cloned
}
func (t *TrackEncodingInfo) GetID() string {
return t.id
}
func (t *TrackEncodingInfo) GetCodecs() map[string]*CodecInfo {
return t.codecs
}
func (t *TrackEncodingInfo) AddCodec(codec *CodecInfo) {
t.codecs[codec.GetCodec()] = codec
}
func (t *TrackEncodingInfo) GetParams() map[string]string {
return t.params
}
func (t *TrackEncodingInfo) SetParams(params map[string]string) {
t.params = params
}
func (t *TrackEncodingInfo) AddParam(id, param string) {
t.params[id] = param
}
func (t *TrackEncodingInfo) IsPaused() bool {
return t.paused
}