Documentation ¶
Overview ¶
Package format contains RTP format definitions, decoders and encoders.
Index ¶
- type AC3
- func (f *AC3) ClockRate() int
- func (f *AC3) Codec() string
- func (f *AC3) CreateDecoder() (*rtpac3.Decoder, error)
- func (f *AC3) CreateEncoder() (*rtpac3.Encoder, error)
- func (f *AC3) FMTP() map[string]string
- func (f *AC3) PTSEqualsDTS(*rtp.Packet) bool
- func (f *AC3) PayloadType() uint8
- func (f *AC3) RTPMap() string
- type AV1
- func (f *AV1) ClockRate() int
- func (f *AV1) Codec() string
- func (f *AV1) CreateDecoder() (*rtpav1.Decoder, error)
- func (f *AV1) CreateEncoder() (*rtpav1.Encoder, error)
- func (f *AV1) FMTP() map[string]string
- func (f *AV1) PTSEqualsDTS(*rtp.Packet) bool
- func (f *AV1) PayloadType() uint8
- func (f *AV1) RTPMap() string
- type Format
- type G711
- func (f *G711) ClockRate() int
- func (f *G711) Codec() string
- func (f *G711) CreateDecoder() (*rtplpcm.Decoder, error)
- func (f *G711) CreateEncoder() (*rtplpcm.Encoder, error)
- func (f *G711) FMTP() map[string]string
- func (f *G711) PTSEqualsDTS(*rtp.Packet) bool
- func (f *G711) PayloadType() uint8
- func (f *G711) RTPMap() string
- type G722
- func (f *G722) ClockRate() int
- func (f *G722) Codec() string
- func (f *G722) CreateDecoder() (*rtpsimpleaudio.Decoder, error)
- func (f *G722) CreateEncoder() (*rtpsimpleaudio.Encoder, error)
- func (f *G722) FMTP() map[string]string
- func (f *G722) PTSEqualsDTS(*rtp.Packet) bool
- func (f *G722) PayloadType() uint8
- func (f *G722) RTPMap() string
- type G726
- type Generic
- type H264
- func (f *H264) ClockRate() int
- func (f *H264) Codec() string
- func (f *H264) CreateDecoder() (*rtph264.Decoder, error)
- func (f *H264) CreateEncoder() (*rtph264.Encoder, error)
- 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)
- type H265
- func (f *H265) ClockRate() int
- func (f *H265) Codec() string
- func (f *H265) CreateDecoder() (*rtph265.Decoder, error)
- func (f *H265) CreateEncoder() (*rtph265.Encoder, error)
- func (f *H265) FMTP() map[string]string
- func (f *H265) PTSEqualsDTS(pkt *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)
- type LPCM
- func (f *LPCM) ClockRate() int
- func (f *LPCM) Codec() string
- func (f *LPCM) CreateDecoder() (*rtplpcm.Decoder, error)
- func (f *LPCM) CreateEncoder() (*rtplpcm.Encoder, error)
- func (f *LPCM) FMTP() map[string]string
- func (f *LPCM) PTSEqualsDTS(*rtp.Packet) bool
- func (f *LPCM) PayloadType() uint8
- func (f *LPCM) RTPMap() string
- type MJPEG
- func (f *MJPEG) ClockRate() int
- func (f *MJPEG) Codec() string
- func (f *MJPEG) CreateDecoder() (*rtpmjpeg.Decoder, error)
- func (f *MJPEG) CreateEncoder() (*rtpmjpeg.Encoder, error)
- func (f *MJPEG) FMTP() map[string]string
- func (f *MJPEG) PTSEqualsDTS(*rtp.Packet) bool
- func (f *MJPEG) PayloadType() uint8
- func (f *MJPEG) RTPMap() string
- type MPEG1Audio
- func (f *MPEG1Audio) ClockRate() int
- func (f *MPEG1Audio) Codec() string
- func (f *MPEG1Audio) CreateDecoder() (*rtpmpeg1audio.Decoder, error)
- func (f *MPEG1Audio) CreateEncoder() (*rtpmpeg1audio.Encoder, error)
- func (f *MPEG1Audio) FMTP() map[string]string
- func (f *MPEG1Audio) PTSEqualsDTS(*rtp.Packet) bool
- func (f *MPEG1Audio) PayloadType() uint8
- func (f *MPEG1Audio) RTPMap() string
- type MPEG1Video
- func (f *MPEG1Video) ClockRate() int
- func (f *MPEG1Video) Codec() string
- func (f *MPEG1Video) CreateDecoder() (*rtpmpeg1video.Decoder, error)
- func (f *MPEG1Video) CreateEncoder() (*rtpmpeg1video.Encoder, error)
- func (f *MPEG1Video) FMTP() map[string]string
- func (f *MPEG1Video) PTSEqualsDTS(*rtp.Packet) bool
- func (f *MPEG1Video) PayloadType() uint8
- func (f *MPEG1Video) RTPMap() string
- type MPEG4Audio
- func (f *MPEG4Audio) ClockRate() int
- func (f *MPEG4Audio) Codec() string
- func (f *MPEG4Audio) CreateDecoder() (*rtpmpeg4audio.Decoder, error)
- func (f *MPEG4Audio) CreateEncoder() (*rtpmpeg4audio.Encoder, error)
- func (f *MPEG4Audio) FMTP() map[string]string
- func (f *MPEG4Audio) GetConfig() *mpeg4audio.Config
- func (f *MPEG4Audio) PTSEqualsDTS(*rtp.Packet) bool
- func (f *MPEG4Audio) PayloadType() uint8
- func (f *MPEG4Audio) RTPMap() string
- type MPEG4Video
- func (f *MPEG4Video) ClockRate() int
- func (f *MPEG4Video) Codec() string
- func (f *MPEG4Video) CreateDecoder() (*rtpmpeg4video.Decoder, error)
- func (f *MPEG4Video) CreateEncoder() (*rtpmpeg4video.Encoder, error)
- func (f *MPEG4Video) FMTP() map[string]string
- func (f *MPEG4Video) PTSEqualsDTS(*rtp.Packet) bool
- func (f *MPEG4Video) PayloadType() uint8
- func (f *MPEG4Video) RTPMap() string
- func (f *MPEG4Video) SafeParams() []byte
- func (f *MPEG4Video) SafeSetParams(config []byte)
- type MPEGTS
- type Opus
- func (f *Opus) ClockRate() int
- func (f *Opus) Codec() string
- func (f *Opus) CreateDecoder() (*rtpsimpleaudio.Decoder, error)
- func (f *Opus) CreateEncoder() (*rtpsimpleaudio.Encoder, error)
- func (f *Opus) FMTP() map[string]string
- func (f *Opus) PTSEqualsDTS(*rtp.Packet) bool
- func (f *Opus) PayloadType() uint8
- func (f *Opus) RTPMap() string
- type Speex
- type VP8
- func (f *VP8) ClockRate() int
- func (f *VP8) Codec() string
- func (f *VP8) CreateDecoder() (*rtpvp8.Decoder, error)
- func (f *VP8) CreateEncoder() (*rtpvp8.Encoder, error)
- func (f *VP8) FMTP() map[string]string
- func (f *VP8) PTSEqualsDTS(*rtp.Packet) bool
- func (f *VP8) PayloadType() uint8
- func (f *VP8) RTPMap() string
- type VP9
- func (f *VP9) ClockRate() int
- func (f *VP9) Codec() string
- func (f *VP9) CreateDecoder() (*rtpvp9.Decoder, error)
- func (f *VP9) CreateEncoder() (*rtpvp9.Encoder, error)
- func (f *VP9) FMTP() map[string]string
- func (f *VP9) PTSEqualsDTS(*rtp.Packet) bool
- func (f *VP9) PayloadType() uint8
- func (f *VP9) RTPMap() string
- type Vorbis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AC3 ¶ added in v4.2.0
AC3 is the RTP format for the AC-3 codec. Specification: https://datatracker.ietf.org/doc/html/rfc4184
func (*AC3) CreateDecoder ¶ added in v4.2.0
CreateDecoder creates a decoder able to decode the content of the format.
func (*AC3) CreateEncoder ¶ added in v4.2.0
CreateEncoder creates an encoder able to encode the content of the format.
func (*AC3) PTSEqualsDTS ¶ added in v4.2.0
PTSEqualsDTS implements Format.
func (*AC3) PayloadType ¶ added in v4.2.0
PayloadType implements Format.
type AV1 ¶
AV1 is the RTP format for 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 { // Codec returns the codec name. Codec() 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 media format. It defines the payload type of RTP packets and how to encode/decode them.
type G711 ¶
G711 is the RTP format for the G711 codec, encoded with mu-law or A-law. Specification: https://datatracker.ietf.org/doc/html/rfc3551
func (*G711) CreateDecoder ¶
CreateDecoder creates a decoder able to decode the content of the format.
func (*G711) CreateEncoder ¶
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 the RTP format for the G722 codec. Specification: https://datatracker.ietf.org/doc/html/rfc3551
func (*G722) CreateDecoder ¶
func (f *G722) CreateDecoder() (*rtpsimpleaudio.Decoder, error)
CreateDecoder creates a decoder able to decode the content of the format.
func (*G722) CreateEncoder ¶
func (f *G722) CreateEncoder() (*rtpsimpleaudio.Encoder, error)
CreateEncoder creates an encoder able to encode the content of the format.
func (*G722) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type G726 ¶
G726 is the RTP format for the G726 codec. Specification: https://datatracker.ietf.org/doc/html/rfc3551
func (*G726) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type Generic ¶
type Generic struct { PayloadTyp uint8 RTPMa string FMT map[string]string // clock rate of the format. Filled when calling Init(). 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 the RTP format for the H264 codec. 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 the RTP format for 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.
type LPCM ¶
LPCM is the RTP format for the LPCM codec. Specification: https://datatracker.ietf.org/doc/html/rfc3190 Specification: https://datatracker.ietf.org/doc/html/rfc3551
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 the RTP format for 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 MPEG1Audio ¶
type MPEG1Audio struct{}
MPEG1Audio is the RTP format for a MPEG-1/2 Audio codec. Specification: https://datatracker.ietf.org/doc/html/rfc2250
func (*MPEG1Audio) CreateDecoder ¶
func (f *MPEG1Audio) CreateDecoder() (*rtpmpeg1audio.Decoder, error)
CreateDecoder creates a decoder able to decode the content of the format.
func (*MPEG1Audio) CreateEncoder ¶
func (f *MPEG1Audio) CreateEncoder() (*rtpmpeg1audio.Encoder, error)
CreateEncoder creates an encoder able to encode the content of the format.
func (*MPEG1Audio) PTSEqualsDTS ¶
func (f *MPEG1Audio) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG1Audio) PayloadType ¶
func (f *MPEG1Audio) PayloadType() uint8
PayloadType implements Format.
type MPEG1Video ¶
type MPEG1Video struct{}
MPEG1Video is the RTP format for a MPEG-1/2 Video codec. Specification: https://datatracker.ietf.org/doc/html/rfc2250
func (*MPEG1Video) CreateDecoder ¶ added in v4.1.0
func (f *MPEG1Video) CreateDecoder() (*rtpmpeg1video.Decoder, error)
CreateDecoder creates a decoder able to decode the content of the format.
func (*MPEG1Video) CreateEncoder ¶ added in v4.1.0
func (f *MPEG1Video) CreateEncoder() (*rtpmpeg1video.Encoder, error)
CreateEncoder creates an encoder able to encode the content of the format.
func (*MPEG1Video) PTSEqualsDTS ¶
func (f *MPEG1Video) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG1Video) PayloadType ¶
func (f *MPEG1Video) PayloadType() uint8
PayloadType implements Format.
type MPEG4Audio ¶
type MPEG4Audio struct { // payload type of packets. PayloadTyp uint8 // use LATM format (RFC6416) instead of generic format (RFC3640). LATM bool // profile level ID. ProfileLevelID int // generic only Config *mpeg4audio.Config SizeLength int IndexLength int IndexDeltaLength int // LATM only Bitrate *int CPresent bool StreamMuxConfig *mpeg4audio.StreamMuxConfig SBREnabled *bool }
MPEG4Audio is the RTP format for a MPEG-4 Audio codec. Specification: https://datatracker.ietf.org/doc/html/rfc3640 Specification: https://datatracker.ietf.org/doc/html/rfc6416#section-7.3
func (*MPEG4Audio) ClockRate ¶ added in v4.2.0
func (f *MPEG4Audio) ClockRate() int
ClockRate implements Format.
func (*MPEG4Audio) Codec ¶ added in v4.2.0
func (f *MPEG4Audio) Codec() string
Codec implements Format.
func (*MPEG4Audio) CreateDecoder ¶ added in v4.2.0
func (f *MPEG4Audio) CreateDecoder() (*rtpmpeg4audio.Decoder, error)
CreateDecoder creates a decoder able to decode the content of the format.
func (*MPEG4Audio) CreateEncoder ¶ added in v4.2.0
func (f *MPEG4Audio) CreateEncoder() (*rtpmpeg4audio.Encoder, error)
CreateEncoder creates an encoder able to encode the content of the format.
func (*MPEG4Audio) FMTP ¶ added in v4.2.0
func (f *MPEG4Audio) FMTP() map[string]string
FMTP implements Format.
func (*MPEG4Audio) GetConfig ¶ added in v4.2.0
func (f *MPEG4Audio) GetConfig() *mpeg4audio.Config
GetConfig returns the MPEG-4 Audio configuration.
func (*MPEG4Audio) PTSEqualsDTS ¶ added in v4.2.0
func (f *MPEG4Audio) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG4Audio) PayloadType ¶ added in v4.2.0
func (f *MPEG4Audio) PayloadType() uint8
PayloadType implements Format.
func (*MPEG4Audio) RTPMap ¶ added in v4.2.0
func (f *MPEG4Audio) RTPMap() string
RTPMap implements Format.
type MPEG4Video ¶
type MPEG4Video struct { PayloadTyp uint8 ProfileLevelID int Config []byte // contains filtered or unexported fields }
MPEG4Video is the RTP format for a MPEG-4 Video codec. Specification: https://datatracker.ietf.org/doc/html/rfc6416#section-7.1
func (*MPEG4Video) ClockRate ¶ added in v4.2.0
func (f *MPEG4Video) ClockRate() int
ClockRate implements Format.
func (*MPEG4Video) Codec ¶ added in v4.2.0
func (f *MPEG4Video) Codec() string
Codec implements Format.
func (*MPEG4Video) CreateDecoder ¶ added in v4.2.0
func (f *MPEG4Video) CreateDecoder() (*rtpmpeg4video.Decoder, error)
CreateDecoder creates a decoder able to decode the content of the format.
func (*MPEG4Video) CreateEncoder ¶ added in v4.2.0
func (f *MPEG4Video) CreateEncoder() (*rtpmpeg4video.Encoder, error)
CreateEncoder creates an encoder able to encode the content of the format.
func (*MPEG4Video) FMTP ¶ added in v4.2.0
func (f *MPEG4Video) FMTP() map[string]string
FMTP implements Format.
func (*MPEG4Video) PTSEqualsDTS ¶ added in v4.2.0
func (f *MPEG4Video) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG4Video) PayloadType ¶ added in v4.2.0
func (f *MPEG4Video) PayloadType() uint8
PayloadType implements Format.
func (*MPEG4Video) RTPMap ¶ added in v4.2.0
func (f *MPEG4Video) RTPMap() string
RTPMap implements Format.
func (*MPEG4Video) SafeParams ¶ added in v4.2.0
func (f *MPEG4Video) SafeParams() []byte
SafeParams returns the codec parameters.
func (*MPEG4Video) SafeSetParams ¶ added in v4.2.0
func (f *MPEG4Video) SafeSetParams(config []byte)
SafeSetParams sets the codec parameters.
type MPEGTS ¶
type MPEGTS struct{}
MPEGTS is the RTP format for MPEG-TS. Specification: https://datatracker.ietf.org/doc/html/rfc2250
func (*MPEGTS) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type Opus ¶
Opus is the RTP format for the Opus codec. Specification: https://datatracker.ietf.org/doc/html/rfc7587
func (*Opus) CreateDecoder ¶
func (f *Opus) CreateDecoder() (*rtpsimpleaudio.Decoder, error)
CreateDecoder creates a decoder able to decode the content of the format.
func (*Opus) CreateEncoder ¶
func (f *Opus) CreateEncoder() (*rtpsimpleaudio.Encoder, error)
CreateEncoder creates an encoder able to encode the content of the format.
func (*Opus) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type Speex ¶
Speex is the RTP format for the Speex codec. Specification: https://datatracker.ietf.org/doc/html/rfc5574
func (*Speex) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
type VP8 ¶
VP8 is the RTP format for 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 the RTP format for 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 the RTP format for the Vorbis codec. Specification: https://datatracker.ietf.org/doc/html/rfc5215
func (*Vorbis) PTSEqualsDTS ¶
PTSEqualsDTS implements Format.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package rtpac3 contains a RTP/AC-3 decoder and encoder.
|
Package rtpac3 contains a RTP/AC-3 decoder and encoder. |
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. |
Package rtpmpeg1audio contains a RTP/MPEG-1/2 Audio decoder and encoder.
|
Package rtpmpeg1audio contains a RTP/MPEG-1/2 Audio decoder and encoder. |
Package rtpmpeg1video contains a RTP/MPEG-1/2 Video decoder and encoder.
|
Package rtpmpeg1video contains a RTP/MPEG-1/2 Video 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. |