add CreateDecoder() method to all tracks that can be decoded

This commit is contained in:
aler9
2022-11-14 21:32:49 +01:00
parent 51b8063325
commit 1656e0e823
19 changed files with 222 additions and 196 deletions

View File

@@ -2,7 +2,6 @@ package main
import (
"github.com/aler9/gortsplib"
"github.com/aler9/gortsplib/pkg/rtph264"
"github.com/aler9/gortsplib/pkg/url"
)
@@ -47,10 +46,7 @@ func main() {
}
// setup RTP/H264->H264 decoder
rtpDec := &rtph264.Decoder{
PacketizationMode: track.PacketizationMode,
}
rtpDec.Init()
rtpDec := track.CreateDecoder()
// setup H264->MPEGTS muxer
mpegtsMuxer, err := newMPEGTSMuxer(track.SafeSPS(), track.SafePPS())