change way tracks are initialized

A config object is now required to initialize tracks.
Config objects are provided for H264 and AAC.
This allows to pass parameters easily and treat AAC
parameters explicitly.
This commit is contained in:
aler9
2021-08-25 19:16:51 +02:00
parent accfc7cd5d
commit d744a2e0d3
13 changed files with 283 additions and 165 deletions

View File

@@ -36,7 +36,7 @@ func main() {
fmt.Println("stream connected")
// create a H264 track
track, err := gortsplib.NewTrackH264(96, sps, pps)
track, err := gortsplib.NewTrackH264(96, &gortsplib.TrackConfigH264{sps, pps})
if err != nil {
panic(err)
}