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" go-version: "1.20"
- run: | - run: |
go mod download
go mod tidy go mod tidy
git diff --exit-code git diff --exit-code

View File

@@ -1,4 +1,3 @@
# gortsplib # gortsplib
[![Test](https://github.com/aler9/gortsplib/workflows/test/badge.svg)](https://github.com/aler9/gortsplib/actions?query=workflow:test) [![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. // This can be a security issue.
// It defaults to false. // It defaults to false.
AnyPortEnable bool 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). // If nil, it is chosen automatically (first UDP, then, if it fails, TCP).
// It defaults to nil. // It defaults to nil.
Transport *Transport Transport *Transport
// If the client is reading with UDP, it must receive // 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. // It defaults to 3 seconds.
InitialUDPReadTimeout time.Duration InitialUDPReadTimeout time.Duration
// read buffer count. // read buffer count.

View File

@@ -48,7 +48,7 @@ func main() {
// Client allows to set additional client options // Client allows to set additional client options
c := &gortsplib.Client{ 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, Transport: nil,
// timeout of read operations // timeout of read operations
ReadTimeout: 10 * time.Second, ReadTimeout: 10 * time.Second,

View File

@@ -19,7 +19,7 @@ import (
func main() { func main() {
// Client allows to set additional client options // Client allows to set additional client options
c := &gortsplib.Client{ 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, Transport: nil,
// timeout of read operations // timeout of read operations
ReadTimeout: 10 * time.Second, ReadTimeout: 10 * time.Second,

View File

@@ -32,7 +32,8 @@ func getCodecAndClock(rtpMap string) (string, string) {
return parts2[0], parts2[1] 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 { type Format interface {
// String returns a description of the format. // String returns a description of the format.
String() string String() string
@@ -48,7 +49,7 @@ type Format interface {
// Marshal encodes the format in SDP format. // Marshal encodes the format in SDP format.
Marshal() (string, string) 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 PTSEqualsDTS(*rtp.Packet) bool
} }

View File

@@ -6,7 +6,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpsimpleaudio" "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 { type G711 struct {
// whether to use mu-law. Otherwise, A-law is used. // whether to use mu-law. Otherwise, A-law is used.
MULaw bool MULaw bool

View File

@@ -6,7 +6,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpsimpleaudio" "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{} type G722 struct{}
// String implements Format. // String implements Format.

View File

@@ -61,7 +61,7 @@ type Generic struct {
ClockRat int 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 { func (t *Generic) Init() error {
t.ClockRat, _ = findClockRate(t.PayloadTyp, t.RTPMap) t.ClockRat, _ = findClockRate(t.PayloadTyp, t.RTPMap)
return nil 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 { type H264 struct {
PayloadTyp uint8 PayloadTyp uint8
SPS []byte SPS []byte

View File

@@ -12,7 +12,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtph265" "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 { type H265 struct {
PayloadTyp uint8 PayloadTyp uint8
VPS []byte VPS []byte

View File

@@ -9,7 +9,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtplpcm" "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 { type LPCM struct {
PayloadTyp uint8 PayloadTyp uint8
BitDepth int BitDepth int

View File

@@ -6,7 +6,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpmjpeg" "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{} type MJPEG struct{}
// String implements Format. // String implements Format.

View File

@@ -4,7 +4,7 @@ import (
"github.com/pion/rtp" "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{} type MPEG2Audio struct{}
// String implements Format. // String implements Format.

View File

@@ -4,7 +4,7 @@ import (
"github.com/pion/rtp" "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{} type MPEG2Video struct{}
// String implements Format. // String implements Format.

View File

@@ -12,7 +12,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpmpeg4audio" "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 { type MPEG4Audio struct {
PayloadTyp uint8 PayloadTyp uint8
Config *mpeg4audio.Config Config *mpeg4audio.Config

View File

@@ -10,7 +10,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpsimpleaudio" "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 { type Opus struct {
PayloadTyp uint8 PayloadTyp uint8
SampleRate int SampleRate int

View File

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

View File

@@ -10,7 +10,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpvp8" "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 { type VP8 struct {
PayloadTyp uint8 PayloadTyp uint8
MaxFR *int MaxFR *int

View File

@@ -10,7 +10,7 @@ import (
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpvp9" "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 { type VP9 struct {
PayloadTyp uint8 PayloadTyp uint8
MaxFR *int MaxFR *int

View File

@@ -58,7 +58,8 @@ const (
TypeApplication Type = "application" 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 { type Media struct {
// Media type. // Media type.
Type Type Type Type