client: turn ReadFrames into OnPacketRTP, OnPacketRTCP

This commit is contained in:
aler9
2021-11-04 11:05:51 +01:00
committed by Alessandro Ros
parent b4aadd8e4c
commit a22116e66e
12 changed files with 353 additions and 318 deletions

View File

@@ -128,7 +128,7 @@ func (sh *serverHandler) OnPacketRTP(ctx *gortsplib.ServerHandlerOnPacketRTPCtx)
sh.mutex.Lock()
defer sh.mutex.Unlock()
// if we are the publisher, route packet to readers
// if we are the publisher, route the RTP packet to readers
if ctx.Session == sh.publisher {
sh.stream.WritePacketRTP(ctx.TrackID, ctx.Payload)
}
@@ -139,7 +139,7 @@ func (sh *serverHandler) OnPacketRTCP(ctx *gortsplib.ServerHandlerOnPacketRTPCtx
sh.mutex.Lock()
defer sh.mutex.Unlock()
// if we are the publisher, route packet to readers
// if we are the publisher, route the RTCP packet to readers
if ctx.Session == sh.publisher {
sh.stream.WritePacketRTCP(ctx.TrackID, ctx.Payload)
}