mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
update examples
This commit is contained in:
@@ -33,8 +33,8 @@ func main() {
|
|||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
// read track frames
|
// read track frames
|
||||||
err = <-conn.ReadFrames(func(id int, typ gortsplib.StreamType, buf []byte) {
|
err = <-conn.ReadFrames(func(trackID int, typ gortsplib.StreamType, buf []byte) {
|
||||||
fmt.Printf("frame from track %d, type %v: %v\n", id, typ, buf)
|
fmt.Printf("frame from track %d, type %v: %v\n", trackID, typ, buf)
|
||||||
})
|
})
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@@ -53,8 +53,8 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// read track frames
|
// read track frames
|
||||||
err = <-conn.ReadFrames(func(id int, typ gortsplib.StreamType, buf []byte) {
|
err = <-conn.ReadFrames(func(trackID int, typ gortsplib.StreamType, buf []byte) {
|
||||||
fmt.Printf("frame from track %d, type %v: %v\n", id, typ, buf)
|
fmt.Printf("frame from track %d, type %v: %v\n", trackID, typ, buf)
|
||||||
})
|
})
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@@ -25,8 +25,8 @@ func main() {
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
// read track frames
|
// read track frames
|
||||||
done := conn.ReadFrames(func(id int, typ gortsplib.StreamType, buf []byte) {
|
done := conn.ReadFrames(func(trackID int, typ gortsplib.StreamType, buf []byte) {
|
||||||
fmt.Printf("frame from track %d, type %v: %v\n", id, typ, buf)
|
fmt.Printf("frame from track %d, type %v: %v\n", trackID, typ, buf)
|
||||||
})
|
})
|
||||||
|
|
||||||
// wait
|
// wait
|
||||||
|
@@ -21,8 +21,8 @@ func main() {
|
|||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
// read track frames
|
// read track frames
|
||||||
err = <-conn.ReadFrames(func(id int, typ gortsplib.StreamType, buf []byte) {
|
err = <-conn.ReadFrames(func(trackID int, typ gortsplib.StreamType, buf []byte) {
|
||||||
fmt.Printf("frame from track %d, type %v: %v\n", id, typ, buf)
|
fmt.Printf("frame from track %d, type %v: %v\n", trackID, typ, buf)
|
||||||
})
|
})
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user