Rename group package and defaults to halls
This commit is contained in:
+17
-17
@@ -17,7 +17,7 @@ import (
|
||||
"git.stormux.org/storm/skald/codecs"
|
||||
"git.stormux.org/storm/skald/conn"
|
||||
"git.stormux.org/storm/skald/estimator"
|
||||
"git.stormux.org/storm/skald/group"
|
||||
"git.stormux.org/storm/skald/hall"
|
||||
"git.stormux.org/storm/skald/ice"
|
||||
"git.stormux.org/storm/skald/jitter"
|
||||
"git.stormux.org/storm/skald/packetcache"
|
||||
@@ -193,8 +193,8 @@ func (down *rtpDownConnection) getTracks() []*rtpDownTrack {
|
||||
return tracks
|
||||
}
|
||||
|
||||
func newDownConn(c group.Client, id string, remote conn.Up) (*rtpDownConnection, error) {
|
||||
api, err := c.Group().API()
|
||||
func newDownConn(c hall.Client, id string, remote conn.Up) (*rtpDownConnection, error) {
|
||||
api, err := c.Hall().API()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -504,7 +504,7 @@ func (up *rtpUpTrack) hasRtcpFb(tpe, parameter string) bool {
|
||||
|
||||
type rtpUpConnection struct {
|
||||
id string
|
||||
client group.Client
|
||||
client hall.Client
|
||||
label string
|
||||
pc *webrtc.PeerConnection
|
||||
iceCandidates []*webrtc.ICECandidateInit
|
||||
@@ -599,7 +599,7 @@ func (up *rtpUpConnection) flushICECandidates() error {
|
||||
}
|
||||
|
||||
// pushConnNow pushes a connection to all of the clients in a group
|
||||
func pushConnNow(up *rtpUpConnection, g *group.Group, cs []group.Client) {
|
||||
func pushConnNow(up *rtpUpConnection, g *hall.Hall, cs []hall.Client) {
|
||||
up.mu.Lock()
|
||||
up.pushed = true
|
||||
replace := up.replace
|
||||
@@ -616,12 +616,12 @@ func pushConnNow(up *rtpUpConnection, g *group.Group, cs []group.Client) {
|
||||
}
|
||||
|
||||
// pushConn schedules a call to pushConnNow
|
||||
func pushConn(up *rtpUpConnection, g *group.Group, cs []group.Client) {
|
||||
func pushConn(up *rtpUpConnection, g *hall.Hall, cs []hall.Client) {
|
||||
up.mu.Lock()
|
||||
up.pushed = false
|
||||
up.mu.Unlock()
|
||||
|
||||
go func(g *group.Group, cs []group.Client) {
|
||||
go func(g *hall.Hall, cs []hall.Client) {
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
up.mu.Lock()
|
||||
pushed := up.pushed
|
||||
@@ -633,14 +633,14 @@ func pushConn(up *rtpUpConnection, g *group.Group, cs []group.Client) {
|
||||
}(g, cs)
|
||||
}
|
||||
|
||||
func newUpConn(c group.Client, id string, label string, offer string) (*rtpUpConnection, error) {
|
||||
func newUpConn(c hall.Client, id string, label string, offer string) (*rtpUpConnection, error) {
|
||||
var o sdp.SessionDescription
|
||||
err := o.Unmarshal([]byte(offer))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
api, err := c.Group().API()
|
||||
api, err := c.Hall().API()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -686,10 +686,10 @@ func newUpConn(c group.Client, id string, label string, offer string) (*rtpUpCon
|
||||
|
||||
up.mu.Unlock()
|
||||
|
||||
pushConn(up, c.Group(), c.Group().GetClients(c))
|
||||
pushConn(up, c.Hall(), c.Hall().GetClients(c))
|
||||
})
|
||||
|
||||
pushConn(up, c.Group(), c.Group().GetClients(c))
|
||||
pushConn(up, c.Hall(), c.Hall().GetClients(c))
|
||||
go rtcpUpSender(up)
|
||||
|
||||
return up, nil
|
||||
@@ -890,7 +890,7 @@ func sadd(x, y uint64) uint64 {
|
||||
|
||||
func maxUpBitrate(t *rtpUpTrack) uint64 {
|
||||
minrate := ^uint64(0)
|
||||
maxrate := uint64(group.MinBitrate)
|
||||
maxrate := uint64(hall.MinBitrate)
|
||||
maxsid := 0
|
||||
maxtid := 0
|
||||
local := t.getLocal()
|
||||
@@ -902,8 +902,8 @@ func maxUpBitrate(t *rtpUpTrack) uint64 {
|
||||
if maxtid < tid {
|
||||
maxtid = tid
|
||||
}
|
||||
if r < group.MinBitrate {
|
||||
r = group.MinBitrate
|
||||
if r < hall.MinBitrate {
|
||||
r = hall.MinBitrate
|
||||
}
|
||||
if minrate > r {
|
||||
minrate = r
|
||||
@@ -997,14 +997,14 @@ func sendUpRTCP(up *rtpUpConnection) error {
|
||||
if t.Kind() == webrtc.RTPCodecTypeAudio {
|
||||
rate = sadd(rate, 100*1024)
|
||||
} else if t.Label() == "l" {
|
||||
rate = sadd(rate, group.LowBitrate)
|
||||
rate = sadd(rate, hall.LowBitrate)
|
||||
} else {
|
||||
rate = sadd(rate, maxUpBitrate(t))
|
||||
}
|
||||
}
|
||||
|
||||
if rate > group.MaxBitrate {
|
||||
rate = group.MaxBitrate
|
||||
if rate > hall.MaxBitrate {
|
||||
rate = hall.MaxBitrate
|
||||
}
|
||||
if len(ssrcs) > 0 {
|
||||
packets = append(packets,
|
||||
|
||||
Reference in New Issue
Block a user