mirror of
https://github.com/aler9/gortsplib
synced 2025-10-06 07:37:07 +08:00
update examples
This commit is contained in:
@@ -25,7 +25,7 @@ func main() {
|
|||||||
readerDone := make(chan struct{})
|
readerDone := make(chan struct{})
|
||||||
defer func() { <-readerDone }()
|
defer func() { <-readerDone }()
|
||||||
|
|
||||||
// read frames
|
// read frames from the server
|
||||||
conn.OnFrame(func(id int, typ gortsplib.StreamType, buf []byte, err error) {
|
conn.OnFrame(func(id int, typ gortsplib.StreamType, buf []byte, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("ERR: %v\n", err)
|
fmt.Printf("ERR: %v\n", err)
|
||||||
@@ -33,7 +33,6 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("frame from track %d, type %v: %v\n",
|
fmt.Printf("frame from track %d, type %v: %v\n", id, typ, buf)
|
||||||
id, typ, buf)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ func main() {
|
|||||||
readerDone := make(chan struct{})
|
readerDone := make(chan struct{})
|
||||||
defer func() { <-readerDone }()
|
defer func() { <-readerDone }()
|
||||||
|
|
||||||
// read frames
|
// read frames from the server
|
||||||
conn.OnFrame(func(id int, typ gortsplib.StreamType, buf []byte, err error) {
|
conn.OnFrame(func(id int, typ gortsplib.StreamType, buf []byte, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("ERR: %v\n", err)
|
fmt.Printf("ERR: %v\n", err)
|
||||||
@@ -30,7 +30,6 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("frame from track %d, type %v: %v\n",
|
fmt.Printf("frame from track %d, type %v: %v\n", id, typ, buf)
|
||||||
id, typ, buf)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user