rtp*: remove Read(), return nalus and pts separately

This commit is contained in:
aler9
2021-04-05 17:15:56 +02:00
parent db676cab85
commit dcbd9d8211
8 changed files with 197 additions and 312 deletions

View File

@@ -41,14 +41,14 @@ func main() {
err = <-conn.ReadFrames(func(trackID int, typ gortsplib.StreamType, buf []byte) {
if trackID == h264Track {
// convert RTP frames into H264 NALUs
nts, err := dec.Decode(buf)
nalus, _, err := dec.Decode(buf)
if err != nil {
return
}
// print NALUs
for _, nt := range nts {
fmt.Printf("received H264 NALU of size %d\n", len(nt.NALU))
for _, nalu := range nalus {
fmt.Printf("received H264 NALU of size %d\n", len(nalu))
}
}
})