mirror of
https://github.com/aler9/gortsplib
synced 2025-09-27 03:25:52 +08:00
use a single TCP outgoing buffer each client / session (#665)
this saves memory.
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user