use a single TCP outgoing buffer each client / session (#665)

this saves memory.
This commit is contained in:
Alessandro Ros
2024-12-24 10:24:24 +01:00
committed by GitHub
parent 6750427282
commit 5506eb2f7f
8 changed files with 78 additions and 87 deletions

View File

@@ -1,8 +1,6 @@
package gortsplib
import (
"time"
"github.com/pion/rtcp"
"github.com/pion/rtp"
@@ -71,19 +69,6 @@ func (cf *clientFormat) stop() {
}
}
func (cf *clientFormat) writePacketRTP(byts []byte, pkt *rtp.Packet, ntp time.Time) error {
cf.rtcpSender.ProcessPacket(pkt, ntp, cf.format.PTSEqualsDTS(pkt))
ok := cf.cm.c.writer.push(func() error {
return cf.cm.writePacketRTPInQueue(byts)
})
if !ok {
return liberrors.ErrClientWriteQueueFull{}
}
return nil
}
func (cf *clientFormat) readRTPUDP(pkt *rtp.Packet) {
packets, lost := cf.udpReorderer.Process(pkt)
if lost != 0 {