mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Remove track muting.
This commit is contained in:
parent
118ad7a3a7
commit
8fa68f9605
2 changed files with 1 additions and 33 deletions
18
client.go
18
client.go
|
@ -353,9 +353,6 @@ func upLoop(conn *upConnection, track *upTrack) {
|
|||
}
|
||||
|
||||
for _, l := range local {
|
||||
if l.muted() {
|
||||
continue
|
||||
}
|
||||
err := l.track.WriteRTP(&packet)
|
||||
if err != nil && err != io.ErrClosedPipe {
|
||||
log.Printf("%v", err)
|
||||
|
@ -601,9 +598,6 @@ func rtcpDownListener(g *group, conn *downConnection, track *downTrack, s *webrt
|
|||
for _, p := range ps {
|
||||
switch p := p.(type) {
|
||||
case *rtcp.PictureLossIndication:
|
||||
if track.muted() {
|
||||
continue
|
||||
}
|
||||
err := conn.remote.sendPLI(track.remote)
|
||||
if err != nil {
|
||||
log.Printf("sendPLI: %v", err)
|
||||
|
@ -631,9 +625,6 @@ func rtcpDownListener(g *group, conn *downConnection, track *downTrack, s *webrt
|
|||
}
|
||||
}
|
||||
case *rtcp.TransportLayerNack:
|
||||
if track.muted() {
|
||||
continue
|
||||
}
|
||||
sendRecovery(p, track)
|
||||
}
|
||||
}
|
||||
|
@ -671,8 +662,6 @@ func updateUpBitrate(up *upConnection) {
|
|||
bitrate := atomic.LoadUint64(&l.maxBitrate.bitrate)
|
||||
loss := atomic.LoadUint32(&l.loss)
|
||||
if now < ms || now > ms+5000 || bitrate == 0 {
|
||||
// no rate information
|
||||
l.setMuted(false)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -687,17 +676,12 @@ func updateUpBitrate(up *upConnection) {
|
|||
if loss <= 13 {
|
||||
// less than 10% loss, go ahead
|
||||
bitrate = minrate2
|
||||
} else if loss <= 64 || !isvideo {
|
||||
} else if loss <= 64 {
|
||||
if bitrate < minrate1 {
|
||||
bitrate = minrate1
|
||||
}
|
||||
} else {
|
||||
// video track with dramatic loss
|
||||
l.setMuted(true)
|
||||
continue
|
||||
}
|
||||
}
|
||||
l.setMuted(false)
|
||||
if track.maxBitrate > bitrate {
|
||||
track.maxBitrate = bitrate
|
||||
}
|
||||
|
|
16
group.go
16
group.go
|
@ -76,27 +76,11 @@ type timeStampedBitrate struct {
|
|||
type downTrack struct {
|
||||
track *webrtc.Track
|
||||
remote *upTrack
|
||||
isMuted uint32
|
||||
maxBitrate *timeStampedBitrate
|
||||
rate *estimator.Estimator
|
||||
loss uint32
|
||||
}
|
||||
|
||||
func (t *downTrack) muted() bool {
|
||||
return atomic.LoadUint32(&t.isMuted) != 0
|
||||
}
|
||||
|
||||
func (t *downTrack) setMuted(muted bool) {
|
||||
if t.muted() == muted {
|
||||
return
|
||||
}
|
||||
m := uint32(0)
|
||||
if muted {
|
||||
m = 1
|
||||
}
|
||||
atomic.StoreUint32(&t.isMuted, m)
|
||||
}
|
||||
|
||||
type downConnection struct {
|
||||
id string
|
||||
pc *webrtc.PeerConnection
|
||||
|
|
Loading…
Reference in a new issue