client: parse incoming RTP/H264 packets; fix RTCP receiver jitter

This commit is contained in:
aler9
2022-04-07 20:14:45 +02:00
committed by Alessandro Ros
parent 3c104d3727
commit f4efe9ceb5
13 changed files with 174 additions and 128 deletions

View File

@@ -5,7 +5,6 @@ import (
"github.com/aler9/gortsplib"
"github.com/aler9/gortsplib/pkg/base"
"github.com/pion/rtp"
)
// This example shows how to
@@ -46,8 +45,8 @@ func main() {
defer publisher.Close()
// called when a RTP packet arrives
reader.OnPacketRTP = func(trackID int, pkt *rtp.Packet) {
publisher.WritePacketRTP(trackID, pkt, true)
reader.OnPacketRTP = func(ctx *gortsplib.ClientOnPacketRTPCtx) {
publisher.WritePacketRTP(ctx.TrackID, ctx.Packet, ctx.PTSEqualsDTS)
}
// start reading tracks