Documentation
¶
Index ¶
- Variables
- func AnswerMedia(rtpListenerPort int, audio *AudioConfig, crypt *srtp.Profile) *sdp.MediaDescription
- func CodecByName(name string) media.Codec
- func GetAudio(s *sdp.SessionDescription) *sdp.MediaDescription
- func GetAudioDest(s *sdp.SessionDescription, audio *sdp.MediaDescription) (netip.AddrPort, error)
- func SelectCrypto(offer, answer []srtp.Profile, swap bool) (*srtp.Config, *srtp.Profile, error)
- type Answer
- type AudioConfig
- type CodecInfo
- type Description
- type Encryption
- type MediaConfig
- type MediaDesc
- type Offer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoCommonMedia = errors.New("common audio codec not found") ErrNoCommonCrypto = errors.New("no common encryption profiles") )
Functions ¶
func AnswerMedia ¶
func AnswerMedia(rtpListenerPort int, audio *AudioConfig, crypt *srtp.Profile) *sdp.MediaDescription
func CodecByName ¶
func GetAudio ¶
func GetAudio(s *sdp.SessionDescription) *sdp.MediaDescription
func GetAudioDest ¶
func GetAudioDest(s *sdp.SessionDescription, audio *sdp.MediaDescription) (netip.AddrPort, error)
GetAudioDest returns the RTP dst address:port for an audio m= it first uses media-level c=, then session-level c=.
Types ¶
type Answer ¶
type Answer Description
func ParseAnswer ¶
func (*Answer) Apply ¶
func (d *Answer) Apply(offer *Offer, enc Encryption) (*MediaConfig, error)
type AudioConfig ¶
type AudioConfig struct {
Codec rtp.AudioCodec
Type byte
DTMFType byte
}
func SelectAudio ¶
func SelectAudio(desc MediaDesc, answer bool) (*AudioConfig, error)
type CodecInfo ¶
func OfferCodecs ¶
func OfferCodecs() []CodecInfo
type Description ¶
type Description struct {
SDP sdp.SessionDescription
Addr netip.AddrPort
MediaDesc
}
func Parse ¶
func Parse(data []byte) (*Description, error)
type Encryption ¶
type Encryption int
const ( EncryptionNone Encryption = iota EncryptionAllow EncryptionRequire )
type MediaConfig ¶
type MediaDesc ¶
type MediaDesc struct {
Codecs []CodecInfo
DTMFType byte // set to 0 if there's no DTMF
CryptoProfiles []srtp.Profile
}
func OfferMedia ¶
func OfferMedia(rtpListenerPort int, encrypted Encryption) (MediaDesc, *sdp.MediaDescription, error)
func ParseMedia ¶
func ParseMedia(d *sdp.MediaDescription) (*MediaDesc, error)
type Offer ¶
type Offer Description
func ParseOffer ¶
func (*Offer) Answer ¶
func (d *Offer) Answer(publicIp netip.Addr, rtpListenerPort int, enc Encryption) (*Answer, *MediaConfig, error)
Click to show internal directories.
Click to hide internal directories.