mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
update docs
This commit is contained in:
@@ -52,13 +52,13 @@ func main() {
|
|||||||
buf = make([]byte, 2048)
|
buf = make([]byte, 2048)
|
||||||
var pkt rtp.Packet
|
var pkt rtp.Packet
|
||||||
for {
|
for {
|
||||||
// read packets from the source
|
// read RTP packets from the source
|
||||||
n, _, err := pc.ReadFrom(buf)
|
n, _, err := pc.ReadFrom(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// marshal RTP packets
|
// parse RTP packets
|
||||||
err = pkt.Unmarshal(buf[:n])
|
err = pkt.Unmarshal(buf[:n])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@@ -54,13 +54,13 @@ func main() {
|
|||||||
buf := make([]byte, 2048)
|
buf := make([]byte, 2048)
|
||||||
var pkt rtp.Packet
|
var pkt rtp.Packet
|
||||||
for {
|
for {
|
||||||
// read packets from the source
|
// read RTP packets from the source
|
||||||
n, _, err := pc.ReadFrom(buf)
|
n, _, err := pc.ReadFrom(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// marshal RTP packets
|
// parse RTP packets
|
||||||
err = pkt.Unmarshal(buf[:n])
|
err = pkt.Unmarshal(buf[:n])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@@ -63,13 +63,13 @@ func main() {
|
|||||||
buf := make([]byte, 2048)
|
buf := make([]byte, 2048)
|
||||||
var pkt rtp.Packet
|
var pkt rtp.Packet
|
||||||
for {
|
for {
|
||||||
// read packets from the source
|
// read RTP packets from the source
|
||||||
n, _, err := pc.ReadFrom(buf)
|
n, _, err := pc.ReadFrom(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// marshal RTP packets
|
// parse RTP packets
|
||||||
err = pkt.Unmarshal(buf[:n])
|
err = pkt.Unmarshal(buf[:n])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@@ -52,13 +52,13 @@ func main() {
|
|||||||
buf = make([]byte, 2048)
|
buf = make([]byte, 2048)
|
||||||
var pkt rtp.Packet
|
var pkt rtp.Packet
|
||||||
for {
|
for {
|
||||||
// read packets from the source
|
// read RTP packets from the source
|
||||||
n, _, err := pc.ReadFrom(buf)
|
n, _, err := pc.ReadFrom(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// marshal RTP packets
|
// parse RTP packets
|
||||||
err = pkt.Unmarshal(buf[:n])
|
err = pkt.Unmarshal(buf[:n])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@@ -58,13 +58,13 @@ func main() {
|
|||||||
buf := make([]byte, 2048)
|
buf := make([]byte, 2048)
|
||||||
var pkt rtp.Packet
|
var pkt rtp.Packet
|
||||||
for {
|
for {
|
||||||
// read packets from the source
|
// read RTP packets from the source
|
||||||
n, _, err := pc.ReadFrom(buf)
|
n, _, err := pc.ReadFrom(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// marshal RTP packets
|
// parse RTP packets
|
||||||
err = pkt.Unmarshal(buf[:n])
|
err = pkt.Unmarshal(buf[:n])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@@ -49,13 +49,13 @@ func main() {
|
|||||||
buf = make([]byte, 2048)
|
buf = make([]byte, 2048)
|
||||||
var pkt rtp.Packet
|
var pkt rtp.Packet
|
||||||
for {
|
for {
|
||||||
// read packets from the source
|
// read RTP packets from the source
|
||||||
n, _, err := pc.ReadFrom(buf)
|
n, _, err := pc.ReadFrom(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// marshal RTP packets
|
// parse RTP packets
|
||||||
err = pkt.Unmarshal(buf[:n])
|
err = pkt.Unmarshal(buf[:n])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Reference in New Issue
Block a user