Documentation ¶
Overview ¶
Package formats contains RTP format definitions, decoders and encoders.
Index ¶
- type AV1
- type Format
- type G711
- func (f *G711) ClockRate() int
- func (f *G711) CreateDecoder() *rtpsimpleaudio.Decoder
- func (f *G711) CreateEncoder() *rtpsimpleaudio.Encoder
- func (f *G711) FMTP() map[string]string
- func (f *G711) PTSEqualsDTS(*rtp.Packet) bool
- func (f *G711) PayloadType() uint8
- func (f *G711) RTPMap() string
- func (f *G711) String() string
- type G722
- func (f *G722) ClockRate() int
- func (f *G722) CreateDecoder() *rtpsimpleaudio.Decoder
- func (f *G722) CreateEncoder() *rtpsimpleaudio.Encoder
- func (f *G722) FMTP() map[string]string
- func (f *G722) PTSEqualsDTS(*rtp.Packet) bool
- func (f *G722) PayloadType() uint8
- func (f *G722) RTPMap() string
- func (f *G722) String() string
- type Generic
- type H264
- func (f *H264) ClockRate() int
- func (f *H264) CreateDecoder() *rtph264.Decoder
- func (f *H264) CreateEncoder() *rtph264.Encoder
- func (f *H264) FMTP() map[string]string
- func (f *H264) PTSEqualsDTS(pkt *rtp.Packet) bool
- func (f *H264) PayloadType() uint8
- func (f *H264) RTPMap() string
- func (f *H264) SafeParams() ([]byte, []byte)
- func (f *H264) SafeSetParams(sps []byte, pps []byte)
- func (f *H264) String() string
- type H265
- func (f *H265) ClockRate() int
- func (f *H265) CreateDecoder() *rtph265.Decoder
- func (f *H265) CreateEncoder() *rtph265.Encoder
- func (f *H265) FMTP() map[string]string
- func (f *H265) PTSEqualsDTS(*rtp.Packet) bool
- func (f *H265) PayloadType() uint8
- func (f *H265) RTPMap() string
- func (f *H265) SafeParams() ([]byte, []byte, []byte)
- func (f *H265) SafeSetParams(vps []byte, sps []byte, pps []byte)
- func (f *H265) String() string
- type LPCM
- func (f *LPCM) ClockRate() int
- func (f *LPCM) CreateDecoder() *rtplpcm.Decoder
- func (f *LPCM) CreateEncoder() *rtplpcm.Encoder
- func (f *LPCM) FMTP() map[string]string
- func (f *LPCM) PTSEqualsDTS(*rtp.Packet) bool
- func (f *LPCM) PayloadType() uint8
- func (f *LPCM) RTPMap() string
- func (f *LPCM) String() string
- type MJPEG
- func (f *MJPEG) ClockRate() int
- func (f *MJPEG) CreateDecoder() *rtpmjpeg.Decoder
- func (f *MJPEG) CreateEncoder() *rtpmjpeg.Encoder
- func (f *MJPEG) FMTP() map[string]string
- func (f *MJPEG) PTSEqualsDTS(*rtp.Packet) bool
- func (f *MJPEG) PayloadType() uint8
- func (f *MJPEG) RTPMap() string
- func (f *MJPEG) String() string
- type MPEG2Audio
- func (f *MPEG2Audio) ClockRate() int
- func (f *MPEG2Audio) CreateDecoder() *rtpmpeg2audio.Decoder
- func (f *MPEG2Audio) CreateEncoder() *rtpmpeg2audio.Encoder
- func (f *MPEG2Audio) FMTP() map[string]string
- func (f *MPEG2Audio) PTSEqualsDTS(*rtp.Packet) bool
- func (f *MPEG2Audio) PayloadType() uint8
- func (f *MPEG2Audio) RTPMap() string
- func (f *MPEG2Audio) String() string
- type MPEG2Video
- type MPEG4Audio
- type MPEG4AudioGeneric
- func (f *MPEG4AudioGeneric) ClockRate() int
- func (f *MPEG4AudioGeneric) CreateDecoder() *rtpmpeg4audio.Decoder
- func (f *MPEG4AudioGeneric) CreateEncoder() *rtpmpeg4audio.Encoder
- func (f *MPEG4AudioGeneric) FMTP() map[string]string
- func (f *MPEG4AudioGeneric) PTSEqualsDTS(*rtp.Packet) bool
- func (f *MPEG4AudioGeneric) PayloadType() uint8
- func (f *MPEG4AudioGeneric) RTPMap() string
- func (f *MPEG4AudioGeneric) String() string
- type MPEG4AudioLATM
- type MPEG4Video
- type MPEG4VideoES
- func (f *MPEG4VideoES) ClockRate() int
- func (f *MPEG4VideoES) CreateDecoder() *rtpmpeg4video.Decoder
- func (f *MPEG4VideoES) CreateEncoder() *rtpmpeg4video.Encoder
- func (f *MPEG4VideoES) FMTP() map[string]string
- func (f *MPEG4VideoES) PTSEqualsDTS(*rtp.Packet) bool
- func (f *MPEG4VideoES) PayloadType() uint8
- func (f *MPEG4VideoES) RTPMap() string
- func (f *MPEG4VideoES) String() string
- type MPEGTS
- type Opus
- func (f *Opus) ClockRate() int
- func (f *Opus) CreateDecoder() *rtpsimpleaudio.Decoder
- func (f *Opus) CreateEncoder() *rtpsimpleaudio.Encoder
- func (f *Opus) FMTP() map[string]string
- func (f *Opus) PTSEqualsDTS(*rtp.Packet) bool
- func (f *Opus) PayloadType() uint8
- func (f *Opus) RTPMap() string
- func (f *Opus) String() string
- type VP8
- type VP9
- type Vorbis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AV1 ¶
AV1 is a RTP format that uses the AV1 codec. Specification: https://aomediacodec.github.io/av1-rtp-spec/
func (*AV1) CreateDecoder ¶
CreateDecoder creates a decoder able to decode the content of the format.
func (*AV1) CreateEncoder ¶
CreateEncoder creates an encoder able to encode the content of the format.
func (*AV1) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type Format ¶
type Format interface { // String returns a description of the format. String() string // ClockRate returns the clock rate. ClockRate() int // PayloadType returns the payload type. PayloadType() uint8 // RTPMap returns the rtpmap attribute. RTPMap() string // FMTP returns the fmtp attribute. FMTP() map[string]string // PTSEqualsDTS checks whether PTS is equal to DTS in RTP packets. PTSEqualsDTS(*rtp.Packet) bool // contains filtered or unexported methods }
Format is a RTP format of a media. It defines a codec and a payload type used to transmit the media.
type G711 ¶
type G711 struct { // whether to use mu-law. Otherwise, A-law is used. MULaw bool }
G711 is a RTP format that uses the G711 codec, encoded with mu-law or A-law. Specification: https://datatracker.ietf.org/doc/html/rfc3551
func (*G711) CreateDecoder ¶
func (f *G711) CreateDecoder() *rtpsimpleaudio.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*G711) CreateEncoder ¶
func (f *G711) CreateEncoder() *rtpsimpleaudio.Encoder
CreateEncoder creates an encoder able to encode the content of the format.
func (*G711) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type G722 ¶
type G722 struct{}
G722 is a RTP format that uses the G722 codec. Specification: https://datatracker.ietf.org/doc/html/rfc3551
func (*G722) CreateDecoder ¶
func (f *G722) CreateDecoder() *rtpsimpleaudio.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*G722) CreateEncoder ¶
func (f *G722) CreateEncoder() *rtpsimpleaudio.Encoder
CreateEncoder creates an encoder able to encode the content of the format.
func (*G722) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type Generic ¶
type Generic struct { PayloadTyp uint8 RTPMa string FMT map[string]string // clock rate of the format. Filled automatically. ClockRat int }
Generic is a generic RTP format.
func (*Generic) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type H264 ¶
type H264 struct { PayloadTyp uint8 SPS []byte PPS []byte PacketizationMode int // contains filtered or unexported fields }
H264 is a RTP format that uses the H264 codec, defined in MPEG-4 part 10. Specification: https://datatracker.ietf.org/doc/html/rfc6184
func (*H264) CreateDecoder ¶
CreateDecoder creates a decoder able to decode the content of the format.
func (*H264) CreateEncoder ¶
CreateEncoder creates an encoder able to encode the content of the format.
func (*H264) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
func (*H264) SafeParams ¶
SafeParams returns the codec parameters.
func (*H264) SafeSetParams ¶
SafeSetParams sets the codec parameters.
type H265 ¶
type H265 struct { PayloadTyp uint8 VPS []byte SPS []byte PPS []byte MaxDONDiff int // contains filtered or unexported fields }
H265 is a RTP format that uses the H265 codec. Specification: https://datatracker.ietf.org/doc/html/rfc7798
func (*H265) CreateDecoder ¶
CreateDecoder creates a decoder able to decode the content of the format.
func (*H265) CreateEncoder ¶
CreateEncoder creates an encoder able to encode the content of the format.
func (*H265) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
func (*H265) SafeParams ¶
SafeParams returns the codec parameters.
func (*H265) SafeSetParams ¶
SafeSetParams sets the codec parameters.
type LPCM ¶
LPCM is a RTP format that uses the uncompressed, Linear PCM codec. Specification: https://datatracker.ietf.org/doc/html/rfc3190
func (*LPCM) CreateDecoder ¶
CreateDecoder creates a decoder able to decode the content of the format.
func (*LPCM) CreateEncoder ¶
CreateEncoder creates an encoder able to encode the content of the format.
func (*LPCM) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type MJPEG ¶
type MJPEG struct{}
MJPEG is a RTP format that uses the Motion-JPEG codec. Specification: https://datatracker.ietf.org/doc/html/rfc2435
func (*MJPEG) CreateDecoder ¶
CreateDecoder creates a decoder able to decode the content of the format.
func (*MJPEG) CreateEncoder ¶
CreateEncoder creates an encoder able to encode the content of the format.
func (*MJPEG) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type MPEG2Audio ¶
type MPEG2Audio struct{}
MPEG2Audio is a RTP format that uses a MPEG-1 or MPEG-2 Audio codec. Specification: https://datatracker.ietf.org/doc/html/rfc2250
func (*MPEG2Audio) CreateDecoder ¶
func (f *MPEG2Audio) CreateDecoder() *rtpmpeg2audio.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*MPEG2Audio) CreateEncoder ¶
func (f *MPEG2Audio) CreateEncoder() *rtpmpeg2audio.Encoder
CreateEncoder creates an encoder able to encode the content of the format.
func (*MPEG2Audio) PTSEqualsDTS ¶
func (f *MPEG2Audio) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG2Audio) PayloadType ¶
func (f *MPEG2Audio) PayloadType() uint8
PayloadType implements Format.
type MPEG2Video ¶
type MPEG2Video struct{}
MPEG2Video is a RTP format that uses a MPEG-1 or MPEG-2 Video codec. Specification: https://datatracker.ietf.org/doc/html/rfc2250
func (*MPEG2Video) PTSEqualsDTS ¶
func (f *MPEG2Video) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG2Video) PayloadType ¶
func (f *MPEG2Video) PayloadType() uint8
PayloadType implements Format.
type MPEG4AudioGeneric ¶
type MPEG4AudioGeneric struct { PayloadTyp uint8 ProfileLevelID int Config *mpeg4audio.Config SizeLength int IndexLength int IndexDeltaLength int }
MPEG4AudioGeneric is a RTP format that uses a MPEG-4 Audio codec. Specification: https://datatracker.ietf.org/doc/html/rfc3640
func (*MPEG4AudioGeneric) ClockRate ¶
func (f *MPEG4AudioGeneric) ClockRate() int
ClockRate implements Format.
func (*MPEG4AudioGeneric) CreateDecoder ¶
func (f *MPEG4AudioGeneric) CreateDecoder() *rtpmpeg4audio.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*MPEG4AudioGeneric) CreateEncoder ¶
func (f *MPEG4AudioGeneric) CreateEncoder() *rtpmpeg4audio.Encoder
CreateEncoder creates an encoder able to encode the content of the format.
func (*MPEG4AudioGeneric) FMTP ¶
func (f *MPEG4AudioGeneric) FMTP() map[string]string
FMTP implements Format.
func (*MPEG4AudioGeneric) PTSEqualsDTS ¶
func (f *MPEG4AudioGeneric) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG4AudioGeneric) PayloadType ¶
func (f *MPEG4AudioGeneric) PayloadType() uint8
PayloadType implements Format.
func (*MPEG4AudioGeneric) RTPMap ¶
func (f *MPEG4AudioGeneric) RTPMap() string
RTPMap implements Format.
func (*MPEG4AudioGeneric) String ¶
func (f *MPEG4AudioGeneric) String() string
String implements Format.
type MPEG4AudioLATM ¶
type MPEG4AudioLATM struct { PayloadTyp uint8 ProfileLevelID int Bitrate *int CPresent *bool Config *mpeg4audio.StreamMuxConfig SBREnabled *bool }
MPEG4AudioLATM is a RTP format that uses a MPEG-4 Audio codec. Specification: https://datatracker.ietf.org/doc/html/rfc6416#section-7.3
func (*MPEG4AudioLATM) ClockRate ¶
func (f *MPEG4AudioLATM) ClockRate() int
ClockRate implements Format.
func (*MPEG4AudioLATM) FMTP ¶
func (f *MPEG4AudioLATM) FMTP() map[string]string
FMTP implements Format.
func (*MPEG4AudioLATM) PTSEqualsDTS ¶
func (f *MPEG4AudioLATM) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG4AudioLATM) PayloadType ¶
func (f *MPEG4AudioLATM) PayloadType() uint8
PayloadType implements Format.
type MPEG4VideoES ¶
MPEG4VideoES is a RTP format that uses a MPEG-4 Video codec. Specification: https://datatracker.ietf.org/doc/html/rfc6416#section-7.1
func (*MPEG4VideoES) ClockRate ¶
func (f *MPEG4VideoES) ClockRate() int
ClockRate implements Format.
func (*MPEG4VideoES) CreateDecoder ¶
func (f *MPEG4VideoES) CreateDecoder() *rtpmpeg4video.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*MPEG4VideoES) CreateEncoder ¶
func (f *MPEG4VideoES) CreateEncoder() *rtpmpeg4video.Encoder
CreateEncoder creates an encoder able to encode the content of the format.
func (*MPEG4VideoES) PTSEqualsDTS ¶
func (f *MPEG4VideoES) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG4VideoES) PayloadType ¶
func (f *MPEG4VideoES) PayloadType() uint8
PayloadType implements Format.
type MPEGTS ¶
type MPEGTS struct{}
MPEGTS is a RTP format that uses MPEG-TS to wrap underlying tracks. Specification: https://datatracker.ietf.org/doc/html/rfc2250
func (*MPEGTS) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type Opus ¶
Opus is a RTP format that uses the Opus codec. Specification: https://datatracker.ietf.org/doc/html/rfc7587
func (*Opus) CreateDecoder ¶
func (f *Opus) CreateDecoder() *rtpsimpleaudio.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*Opus) CreateEncoder ¶
func (f *Opus) CreateEncoder() *rtpsimpleaudio.Encoder
CreateEncoder creates an encoder able to encode the content of the format.
func (*Opus) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type VP8 ¶
VP8 is a RTP format that uses the VP8 codec. Specification: https://datatracker.ietf.org/doc/html/rfc7741
func (*VP8) CreateDecoder ¶
CreateDecoder creates a decoder able to decode the content of the format.
func (*VP8) CreateEncoder ¶
CreateEncoder creates an encoder able to encode the content of the format.
func (*VP8) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type VP9 ¶
VP9 is a RTP format that uses the VP9 codec. Specification: https://datatracker.ietf.org/doc/html/draft-ietf-payload-vp9-16
func (*VP9) CreateDecoder ¶
CreateDecoder creates a decoder able to decode the content of the format.
func (*VP9) CreateEncoder ¶
CreateEncoder creates an encoder able to encode the content of the format.
func (*VP9) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type Vorbis ¶
Vorbis is a RTP format that uses the Vorbis codec. Specification: https://datatracker.ietf.org/doc/html/rfc5215
func (*Vorbis) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package rtpav1 contains a RTP/AV1 decoder and encoder.
|
Package rtpav1 contains a RTP/AV1 decoder and encoder. |
Package rtph264 contains a RTP/H264 decoder and encoder.
|
Package rtph264 contains a RTP/H264 decoder and encoder. |
Package rtph265 contains a RTP/H265 decoder and encoder.
|
Package rtph265 contains a RTP/H265 decoder and encoder. |
Package rtplpcm contains a RTP/LPCM decoder and encoder.
|
Package rtplpcm contains a RTP/LPCM decoder and encoder. |
Package rtpmjpeg contains a RTP/M-JPEG decoder and encoder.
|
Package rtpmjpeg contains a RTP/M-JPEG decoder and encoder. |
headers
Package headers contains RTP/M-JPEG headers.
|
Package headers contains RTP/M-JPEG headers. |
Package rtpmpeg2audio contains a RTP/MPEG-2 Audio decoder and encoder.
|
Package rtpmpeg2audio contains a RTP/MPEG-2 Audio decoder and encoder. |
Package rtpmpeg4audio contains a RTP/MPEG-4 Audio decoder and encoder.
|
Package rtpmpeg4audio contains a RTP/MPEG-4 Audio decoder and encoder. |
Package rtpmpeg4video contains a RTP/MPEG-4 Video decoder and encoder.
|
Package rtpmpeg4video contains a RTP/MPEG-4 Video decoder and encoder. |
Package rtpsimpleaudio contains a RTP decoder and encoder for audio codecs that fit in a single packet.
|
Package rtpsimpleaudio contains a RTP decoder and encoder for audio codecs that fit in a single packet. |
Package rtpvp8 contains a RTP/VP8 decoder and encoder.
|
Package rtpvp8 contains a RTP/VP8 decoder and encoder. |
Package rtpvp9 contains a RTP/VP9 decoder and encoder.
|
Package rtpvp9 contains a RTP/VP9 decoder and encoder. |