update docs (#203)

This commit is contained in:
Alessandro Ros
2023-03-13 18:53:36 +01:00
committed by GitHub
parent 4b7fed505b
commit 253be9913e
21 changed files with 23 additions and 23 deletions

View File

@@ -32,6 +32,5 @@ jobs:
go-version: "1.20"
- run: |
go mod download
go mod tidy
git diff --exit-code

View File

@@ -1,4 +1,3 @@
# gortsplib
[![Test](https://github.com/aler9/gortsplib/workflows/test/badge.svg)](https://github.com/aler9/gortsplib/actions?query=workflow:test)

View File

@@ -162,12 +162,12 @@ type Client struct {
// This can be a security issue.
// It defaults to false.
AnyPortEnable bool
// the stream transport (UDP, Multicast or TCP).
// transport protocol (UDP, Multicast or TCP).
// If nil, it is chosen automatically (first UDP, then, if it fails, TCP).
// It defaults to nil.
Transport *Transport
// If the client is reading with UDP, it must receive
// at least a packet within this timeout.
// at least a packet within this timeout, otherwise it switches to TCP.
// It defaults to 3 seconds.
InitialUDPReadTimeout time.Duration
// read buffer count.

View File

@@ -48,7 +48,7 @@ func main() {
// Client allows to set additional client options
c := &gortsplib.Client{
// the stream transport (UDP or TCP). If nil, it is chosen automatically
// transport protocol (UDP or TCP). If nil, it is chosen automatically
Transport: nil,
// timeout of read operations
ReadTimeout: 10 * time.Second,

View File

@@ -19,7 +19,7 @@ import (
func main() {
// Client allows to set additional client options
c := &gortsplib.Client{
// the stream transport (UDP, Multicast or TCP). If nil, it is chosen automatically
// transport protocol (UDP, Multicast or TCP). If nil, it is chosen automatically
Transport: nil,
// timeout of read operations
ReadTimeout: 10 * time.Second,

View File

@@ -32,7 +32,8 @@ func getCodecAndClock(rtpMap string) (string, string) {
return parts2[0], parts2[1]
}
// Format is a RTSP format.
// Format is a format of a media.
// It defines a codec and a payload type used to ship the media.
type Format interface {
// String returns a description of the format.
String() string
@@ -48,7 +49,7 @@ type Format interface {
// Marshal encodes the format in SDP format.
Marshal() (string, string)
// PTSEqualsDTS checks whether PTS is equal to DTS in the RTP packet.
// PTSEqualsDTS checks whether PTS is equal to DTS in RTP packets.
PTSEqualsDTS(*rtp.Packet) bool
}

View File

@@ -6,7 +6,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpsimpleaudio"
)
// G711 is a G711 format, encoded with mu-law or A-law.
// G711 is a format that uses the G711 codec, encoded with mu-law or A-law.
type G711 struct {
// whether to use mu-law. Otherwise, A-law is used.
MULaw bool

View File

@@ -6,7 +6,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpsimpleaudio"
)
// G722 is a G722 format.
// G722 is a format that uses the G722 codec.
type G722 struct{}
// String implements Format.

View File

@@ -61,7 +61,7 @@ type Generic struct {
ClockRat int
}
// Init initializes a Generic.
// Init computes the clock rate of the format. It it mandatory to call it.
func (t *Generic) Init() error {
t.ClockRat, _ = findClockRate(t.PayloadTyp, t.RTPMap)
return nil

View File

@@ -70,7 +70,7 @@ func rtpH264ContainsIDR(pkt *rtp.Packet) bool {
}
}
// H264 is a H264 format.
// H264 is a format that uses the H264 codec.
type H264 struct {
PayloadTyp uint8
SPS []byte

View File

@@ -12,7 +12,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtph265"
)
// H265 is a H265 format.
// H265 is a format that uses the H265 codec.
type H265 struct {
PayloadTyp uint8
VPS []byte

View File

@@ -9,7 +9,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtplpcm"
)
// LPCM is an uncompressed, Linear PCM format.
// LPCM is a format that uses the uncompressed, Linear PCM codec.
type LPCM struct {
PayloadTyp uint8
BitDepth int

View File

@@ -6,7 +6,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpmjpeg"
)
// MJPEG is a Motion-JPEG format.
// MJPEG is a format that uses the Motion-JPEG codec.
type MJPEG struct{}
// String implements Format.

View File

@@ -4,7 +4,7 @@ import (
"github.com/pion/rtp"
)
// MPEG2Audio is a MPEG-1 or MPEG-2 audio format.
// MPEG2Audio is a format that uses a MPEG-1 or MPEG-2 audio codec.
type MPEG2Audio struct{}
// String implements Format.

View File

@@ -4,7 +4,7 @@ import (
"github.com/pion/rtp"
)
// MPEG2Video is a MPEG-1 or MPEG-2 video format.
// MPEG2Video is a format that uses a MPEG-1 or MPEG-2 video codec.
type MPEG2Video struct{}
// String implements Format.

View File

@@ -12,7 +12,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpmpeg4audio"
)
// MPEG4Audio is a MPEG-4 audio format.
// MPEG4Audio is a format that uses a MPEG-4 audio codec.
type MPEG4Audio struct {
PayloadTyp uint8
Config *mpeg4audio.Config

View File

@@ -10,7 +10,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpsimpleaudio"
)
// Opus is a Opus format.
// Opus is a format that uses the Opus codec.
type Opus struct {
PayloadTyp uint8
SampleRate int

View File

@@ -9,7 +9,7 @@ import (
"github.com/pion/rtp"
)
// Vorbis is a Vorbis format.
// Vorbis is a format that uses the Vorbis codec.
type Vorbis struct {
PayloadTyp uint8
SampleRate int

View File

@@ -10,7 +10,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpvp8"
)
// VP8 is a VP8 format.
// VP8 is a format that uses the VP8 codec.
type VP8 struct {
PayloadTyp uint8
MaxFR *int

View File

@@ -10,7 +10,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpvp9"
)
// VP9 is a VP9 format.
// VP9 is a format that uses the VP9 codec.
type VP9 struct {
PayloadTyp uint8
MaxFR *int

View File

@@ -58,7 +58,8 @@ const (
TypeApplication Type = "application"
)
// Media is a media stream. It contains one or more format.
// Media is a media stream.
// It contains one or more formats.
type Media struct {
// Media type.
Type Type