Documentation ¶
Overview ¶
Package format contains format definitions.
Index ¶
- type Format
- type G711
- func (t *G711) ClockRate() int
- func (t *G711) CreateDecoder() *rtpsimpleaudio.Decoder
- func (t *G711) CreateEncoder() *rtpsimpleaudio.Encoder
- func (t *G711) Marshal() (string, map[string]string)
- func (t *G711) PTSEqualsDTS(*rtp.Packet) bool
- func (t *G711) PayloadType() uint8
- func (t *G711) String() string
- type G722
- func (t *G722) ClockRate() int
- func (t *G722) CreateDecoder() *rtpsimpleaudio.Decoder
- func (t *G722) CreateEncoder() *rtpsimpleaudio.Encoder
- func (t *G722) Marshal() (string, map[string]string)
- func (t *G722) PTSEqualsDTS(*rtp.Packet) bool
- func (t *G722) PayloadType() uint8
- func (t *G722) String() string
- type Generic
- type H264
- func (t *H264) ClockRate() int
- func (t *H264) CreateDecoder() *rtph264.Decoder
- func (t *H264) CreateEncoder() *rtph264.Encoder
- func (t *H264) Marshal() (string, map[string]string)
- func (t *H264) PTSEqualsDTS(pkt *rtp.Packet) bool
- func (t *H264) PayloadType() uint8
- func (t *H264) SafePPS() []byte
- func (t *H264) SafeSPS() []byte
- func (t *H264) SafeSetPPS(v []byte)
- func (t *H264) SafeSetSPS(v []byte)
- func (t *H264) String() string
- type H265
- func (t *H265) ClockRate() int
- func (t *H265) CreateDecoder() *rtph265.Decoder
- func (t *H265) CreateEncoder() *rtph265.Encoder
- func (t *H265) Marshal() (string, map[string]string)
- func (t *H265) PTSEqualsDTS(*rtp.Packet) bool
- func (t *H265) PayloadType() uint8
- func (t *H265) SafePPS() []byte
- func (t *H265) SafeSPS() []byte
- func (t *H265) SafeSetPPS(v []byte)
- func (t *H265) SafeSetSPS(v []byte)
- func (t *H265) SafeSetVPS(v []byte)
- func (t *H265) SafeVPS() []byte
- func (t *H265) String() string
- type LPCM
- type MJPEG
- func (t *MJPEG) ClockRate() int
- func (t *MJPEG) CreateDecoder() *rtpmjpeg.Decoder
- func (t *MJPEG) CreateEncoder() *rtpmjpeg.Encoder
- func (t *MJPEG) Marshal() (string, map[string]string)
- func (t *MJPEG) PTSEqualsDTS(*rtp.Packet) bool
- func (t *MJPEG) PayloadType() uint8
- func (t *MJPEG) String() string
- type MPEG2Audio
- type MPEG2Video
- type MPEG4Audio
- func (t *MPEG4Audio) ClockRate() int
- func (t *MPEG4Audio) CreateDecoder() *rtpmpeg4audio.Decoder
- func (t *MPEG4Audio) CreateEncoder() *rtpmpeg4audio.Encoder
- func (t *MPEG4Audio) Marshal() (string, map[string]string)
- func (t *MPEG4Audio) PTSEqualsDTS(*rtp.Packet) bool
- func (t *MPEG4Audio) PayloadType() uint8
- func (t *MPEG4Audio) String() string
- type Opus
- func (t *Opus) ClockRate() int
- func (t *Opus) CreateDecoder() *rtpsimpleaudio.Decoder
- func (t *Opus) CreateEncoder() *rtpsimpleaudio.Encoder
- func (t *Opus) Marshal() (string, map[string]string)
- func (t *Opus) PTSEqualsDTS(*rtp.Packet) bool
- func (t *Opus) PayloadType() uint8
- func (t *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 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 // Marshal encodes the format in SDP format. Marshal() (string, 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 format of a media. It defines a codec and a payload type used to ship the media.
type G711 ¶
type G711 struct { // whether to use mu-law. Otherwise, A-law is used. MULaw bool }
G711 is a format that uses the G711 codec, encoded with mu-law or A-law.
func (*G711) CreateDecoder ¶
func (t *G711) CreateDecoder() *rtpsimpleaudio.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*G711) CreateEncoder ¶
func (t *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 format that uses the G722 codec.
func (*G722) CreateDecoder ¶
func (t *G722) CreateDecoder() *rtpsimpleaudio.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*G722) CreateEncoder ¶
func (t *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 RTPMap string FMTP map[string]string // clock rate of the format. Filled automatically. ClockRat int }
Generic is a generic 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 format that uses the H264 codec.
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.
type H265 ¶
type H265 struct { PayloadTyp uint8 VPS []byte SPS []byte PPS []byte MaxDONDiff int // contains filtered or unexported fields }
H265 is a format that uses the H265 codec.
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.
type LPCM ¶
LPCM is a format that uses the uncompressed, Linear PCM codec.
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 format that uses the Motion-JPEG codec.
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 format that uses a MPEG-1 or MPEG-2 audio codec.
func (*MPEG2Audio) Marshal ¶
func (t *MPEG2Audio) Marshal() (string, map[string]string)
Marshal implements Format.
func (*MPEG2Audio) PTSEqualsDTS ¶
func (t *MPEG2Audio) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG2Audio) PayloadType ¶
func (t *MPEG2Audio) PayloadType() uint8
PayloadType implements Format.
type MPEG2Video ¶
type MPEG2Video struct{}
MPEG2Video is a format that uses a MPEG-1 or MPEG-2 video codec.
func (*MPEG2Video) Marshal ¶
func (t *MPEG2Video) Marshal() (string, map[string]string)
Marshal implements Format.
func (*MPEG2Video) PTSEqualsDTS ¶
func (t *MPEG2Video) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG2Video) PayloadType ¶
func (t *MPEG2Video) PayloadType() uint8
PayloadType implements Format.
type MPEG4Audio ¶
type MPEG4Audio struct { PayloadTyp uint8 Config *mpeg4audio.Config SizeLength int IndexLength int IndexDeltaLength int }
MPEG4Audio is a format that uses a MPEG-4 audio codec.
func (*MPEG4Audio) CreateDecoder ¶
func (t *MPEG4Audio) CreateDecoder() *rtpmpeg4audio.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*MPEG4Audio) CreateEncoder ¶
func (t *MPEG4Audio) CreateEncoder() *rtpmpeg4audio.Encoder
CreateEncoder creates an encoder able to encode the content of the format.
func (*MPEG4Audio) Marshal ¶
func (t *MPEG4Audio) Marshal() (string, map[string]string)
Marshal implements Format.
func (*MPEG4Audio) PTSEqualsDTS ¶
func (t *MPEG4Audio) PTSEqualsDTS(*rtp.Packet) bool
PTSEqualsDTS implements Format.
func (*MPEG4Audio) PayloadType ¶
func (t *MPEG4Audio) PayloadType() uint8
PayloadType implements Format.
type Opus ¶
Opus is a format that uses the Opus codec.
func (*Opus) CreateDecoder ¶
func (t *Opus) CreateDecoder() *rtpsimpleaudio.Decoder
CreateDecoder creates a decoder able to decode the content of the format.
func (*Opus) CreateEncoder ¶
func (t *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 format that uses the VP8 codec.
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 format that uses the VP9 codec.
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.