rtpaac, rtph264: remove Decoder.Decode()

This commit is contained in:
aler9
2021-09-28 15:22:22 +02:00
parent 4a89eccddd
commit 308802c5a1
5 changed files with 70 additions and 68 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/aler9/gortsplib"
"github.com/aler9/gortsplib/pkg/rtph264"
"github.com/pion/rtp"
)
// This example shows how to
@@ -47,8 +48,15 @@ func main() {
return
}
// convert RTP packets into H264 NALUs
nalus, _, err := dec.Decode(payload)
// parse RTP packets
var pkt rtp.Packet
err := pkt.Unmarshal(payload)
if err != nil {
return
}
// decode H264 NALUs from RTP packets
nalus, _, err := dec.DecodeRTP(&pkt)
if err != nil {
return
}