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

@@ -6,7 +6,6 @@ import (
"github.com/aler9/gortsplib"
"github.com/aler9/gortsplib/pkg/base"
"github.com/aler9/gortsplib/pkg/rtpaac"
"github.com/pion/rtp"
)
// This example shows how to
@@ -58,13 +57,13 @@ func main() {
dec.Init()
// called when a RTP packet arrives
c.OnPacketRTP = func(trackID int, pkt *rtp.Packet) {
if trackID != aacTrack {
c.OnPacketRTP = func(ctx *gortsplib.ClientOnPacketRTPCtx) {
if ctx.TrackID != aacTrack {
return
}
// decode AAC AUs from the RTP packet
aus, _, err := dec.Decode(pkt)
aus, _, err := dec.Decode(ctx.Packet)
if err != nil {
return
}