From b9042282ab99c1bbaac4ef833fcc43de520bee2e Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Thu, 23 Sep 2021 20:02:51 +0200 Subject: [PATCH] update doc --- examples/client-publish-options/main.go | 4 ++-- examples/client-publish-pause/main.go | 4 ++-- examples/client-publish/main.go | 4 ++-- examples/client-read-h264/main.go | 4 ++-- examples/client-read-options/main.go | 2 +- examples/client-read-partial/main.go | 2 +- examples/client-read-pause/main.go | 2 +- examples/client-read-save-to-disk/main.go | 4 ++-- examples/client-read/main.go | 2 +- pkg/rtcpreceiver/rtcpreceiver.go | 6 +++--- pkg/rtcpsender/rtcpsender.go | 2 +- serverconn.go | 2 +- serversession.go | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/client-publish-options/main.go b/examples/client-publish-options/main.go index f2a20f48..ac01fed3 100644 --- a/examples/client-publish-options/main.go +++ b/examples/client-publish-options/main.go @@ -61,13 +61,13 @@ func main() { buf := make([]byte, 2048) for { - // read RTP frames from the source + // read RTP packets from the source n, _, err := pc.ReadFrom(buf) if err != nil { panic(err) } - // write RTP frames + // write RTP packets err = conn.WriteFrame(0, gortsplib.StreamTypeRTP, buf[:n]) if err != nil { panic(err) diff --git a/examples/client-publish-pause/main.go b/examples/client-publish-pause/main.go index c6d77b60..4d2af4a2 100644 --- a/examples/client-publish-pause/main.go +++ b/examples/client-publish-pause/main.go @@ -57,13 +57,13 @@ func main() { buf := make([]byte, 2048) for { - // read RTP frames from the source + // read RTP packets from the source n, _, err := pc.ReadFrom(buf) if err != nil { break } - // write RTP frames + // write RTP packets err = conn.WriteFrame(0, gortsplib.StreamTypeRTP, buf[:n]) if err != nil { break diff --git a/examples/client-publish/main.go b/examples/client-publish/main.go index 4b9366db..c305100c 100644 --- a/examples/client-publish/main.go +++ b/examples/client-publish/main.go @@ -49,13 +49,13 @@ func main() { buf := make([]byte, 2048) for { - // read RTP frames from the source + // read RTP packets from the source n, _, err := pc.ReadFrom(buf) if err != nil { panic(err) } - // write RTP frames + // write RTP packets err = conn.WriteFrame(0, gortsplib.StreamTypeRTP, buf[:n]) if err != nil { panic(err) diff --git a/examples/client-read-h264/main.go b/examples/client-read-h264/main.go index 020b4eb3..bfb79164 100644 --- a/examples/client-read-h264/main.go +++ b/examples/client-read-h264/main.go @@ -37,10 +37,10 @@ func main() { // instantiate a RTP/H264 decoder dec := rtph264.NewDecoder() - // read RTP frames + // read RTP packets err = conn.ReadFrames(func(trackID int, streamType gortsplib.StreamType, payload []byte) { if streamType == gortsplib.StreamTypeRTP && trackID == h264Track { - // convert RTP frames into H264 NALUs + // convert RTP packets into H264 NALUs nalus, _, err := dec.Decode(payload) if err != nil { return diff --git a/examples/client-read-options/main.go b/examples/client-read-options/main.go index 131d56d4..62335aa4 100644 --- a/examples/client-read-options/main.go +++ b/examples/client-read-options/main.go @@ -29,7 +29,7 @@ func main() { } defer conn.Close() - // read RTP frames + // read RTP packets err = conn.ReadFrames(func(trackID int, streamType gortsplib.StreamType, payload []byte) { fmt.Printf("frame from track %d, type %v, size %d\n", trackID, streamType, len(payload)) }) diff --git a/examples/client-read-partial/main.go b/examples/client-read-partial/main.go index a0e8cc99..2f6a05de 100644 --- a/examples/client-read-partial/main.go +++ b/examples/client-read-partial/main.go @@ -51,7 +51,7 @@ func main() { panic(err) } - // read RTP frames + // read RTP packets err = conn.ReadFrames(func(trackID int, streamType gortsplib.StreamType, payload []byte) { fmt.Printf("frame from track %d, type %v, size %d\n", trackID, streamType, len(payload)) }) diff --git a/examples/client-read-pause/main.go b/examples/client-read-pause/main.go index b9809419..8ccbede3 100644 --- a/examples/client-read-pause/main.go +++ b/examples/client-read-pause/main.go @@ -22,7 +22,7 @@ func main() { defer conn.Close() for { - // read RTP frames + // read RTP packets done := make(chan struct{}) go func() { defer close(done) diff --git a/examples/client-read-save-to-disk/main.go b/examples/client-read-save-to-disk/main.go index c3c3f065..03432794 100644 --- a/examples/client-read-save-to-disk/main.go +++ b/examples/client-read-save-to-disk/main.go @@ -77,7 +77,7 @@ func main() { }) mux.SetPCRPID(256) - // read RTP frames + // read RTP packets err = conn.ReadFrames(func(trackID int, streamType gortsplib.StreamType, payload []byte) { if trackID != h264TrackID { return @@ -94,7 +94,7 @@ func main() { return } - // convert RTP frames into H264 NALUs + // convert RTP packets into H264 NALUs nalus, pts, err := dec.DecodeRTP(&pkt) if err != nil { return diff --git a/examples/client-read/main.go b/examples/client-read/main.go index fafe5763..74656d63 100644 --- a/examples/client-read/main.go +++ b/examples/client-read/main.go @@ -17,7 +17,7 @@ func main() { } defer conn.Close() - // read RTP frames + // read RTP packets err = conn.ReadFrames(func(trackID int, streamType gortsplib.StreamType, payload []byte) { fmt.Printf("frame from track %d, type %v, size %d\n", trackID, streamType, len(payload)) }) diff --git a/pkg/rtcpreceiver/rtcpreceiver.go b/pkg/rtcpreceiver/rtcpreceiver.go index 1650fffa..367a1e58 100644 --- a/pkg/rtcpreceiver/rtcpreceiver.go +++ b/pkg/rtcpreceiver/rtcpreceiver.go @@ -53,7 +53,7 @@ func New(receiverSSRC *uint32, clockRate int) *RTCPReceiver { } } -// ProcessFrame extracts the needed data from RTP or RTCP frames. +// ProcessFrame extracts the needed data from RTP or RTCP packets. func (rr *RTCPReceiver) ProcessFrame(ts time.Time, streamType base.StreamType, payload []byte) { rr.mutex.Lock() defer rr.mutex.Unlock() @@ -115,8 +115,8 @@ func (rr *RTCPReceiver) ProcessFrame(ts time.Time, streamType base.StreamType, p } } } else { - // we can afford to unmarshal all RTCP frames - // since they are sent with a frequency much lower than the one of RTP frames + // we can afford to unmarshal all RTCP packets + // since they are sent with a frequency much lower than the one of RTP packets frames, err := rtcp.Unmarshal(payload) if err == nil { for _, frame := range frames { diff --git a/pkg/rtcpsender/rtcpsender.go b/pkg/rtcpsender/rtcpsender.go index d71b97dc..62ca83c4 100644 --- a/pkg/rtcpsender/rtcpsender.go +++ b/pkg/rtcpsender/rtcpsender.go @@ -32,7 +32,7 @@ func New(clockRate int) *RTCPSender { } } -// ProcessFrame extracts the needed data from RTP or RTCP frames. +// ProcessFrame extracts the needed data from RTP or RTCP packets. func (rs *RTCPSender) ProcessFrame(ts time.Time, streamType base.StreamType, payload []byte) { rs.mutex.Lock() defer rs.mutex.Unlock() diff --git a/serverconn.go b/serverconn.go index c837ff8d..2e61b599 100644 --- a/serverconn.go +++ b/serverconn.go @@ -512,7 +512,7 @@ func (sc *ServerConn) handleRequestOuter(req *base.Request) error { sc.tcpFrameBuffer = multibuffer.New(uint64(sc.s.ReadBufferCount), uint64(sc.s.ReadBufferSize)) } else { // when playing, tcpFrameBuffer is only used to receive RTCP receiver reports, - // that are much smaller than RTP frames and are sent at a fixed interval + // that are much smaller than RTP packets and are sent at a fixed interval // (about 2 frames every 10 secs). // decrease RAM consumption by allocating less buffers. sc.tcpFrameBuffer = multibuffer.New(8, uint64(sc.s.ReadBufferSize)) diff --git a/serversession.go b/serversession.go index 5c9075c5..ff3332ed 100644 --- a/serversession.go +++ b/serversession.go @@ -836,7 +836,7 @@ func (ss *ServerSession) handleRequest(sc *ServerConn, req *base.Request) (*base if *ss.setuppedProtocol == base.StreamProtocolUDP { if *ss.setuppedDelivery == base.StreamDeliveryUnicast { for trackID, track := range ss.setuppedTracks { - // readers can send RTCP frames + // readers can send RTCP packets sc.s.udpRTCPListener.addClient(ss.ip(), track.udpRTCPPort, ss, trackID, false) // open the firewall by sending packets to the counterpart