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,8 +5,6 @@ import (
"time"
"github.com/aler9/gortsplib"
"github.com/pion/rtcp"
"github.com/pion/rtp"
)
// This example shows how to
@@ -23,12 +21,12 @@ func main() {
// timeout of write operations
WriteTimeout: 10 * time.Second,
// called when a RTP packet arrives
OnPacketRTP: func(trackID int, pkt *rtp.Packet) {
log.Printf("RTP packet from track %d, payload type %d\n", trackID, pkt.Header.PayloadType)
OnPacketRTP: func(ctx *gortsplib.ClientOnPacketRTPCtx) {
log.Printf("RTP packet from track %d, payload type %d\n", ctx.TrackID, ctx.Packet.Header.PayloadType)
},
// called when a RTCP packet arrives
OnPacketRTCP: func(trackID int, pkt rtcp.Packet) {
log.Printf("RTCP packet from track %d, type %T\n", trackID, pkt)
OnPacketRTCP: func(ctx *gortsplib.ClientOnPacketRTCPCtx) {
log.Printf("RTCP packet from track %d, type %T\n", ctx.TrackID, ctx.Packet)
},
}