sdp

package
v0.42.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MPL-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	FORMAT_TYPE_ULAW            = "0"
	FORMAT_TYPE_ALAW            = "8"
	FORMAT_TYPE_OPUS            = "96"
	FORMAT_TYPE_TELEPHONE_EVENT = "101"
)
View Source
const (
	// https://datatracker.ietf.org/doc/html/rfc4566#section-6
	ModeRecvonly string = "recvonly"
	ModeSendrecv string = "sendrecv"
	ModeSendonly string = "sendonly"
	ModeInactive string = "inactive"
)

Variables

This section is empty.

Functions

func FormatNumeric

func FormatNumeric(f string) (uint8, error)

func GenerateForAudio

func GenerateForAudio(originIP net.IP, connectionIP net.IP, rtpPort int, mode string, fmts Formats) []byte

GenerateForAudio is minimal AUDIO SDP setup mode -> consts like ModeRecvOnly, ModeSendrecv

func GetCurrentNTPTimestamp

func GetCurrentNTPTimestamp() uint64

func NTPTimestamp

func NTPTimestamp(now time.Time) uint64

func Unmarshal

func Unmarshal(data []byte, sdptr *SessionDescription) error

Unmarshal is non validate version of sdp parsing Validation of values needs to be seperate NOT OPTIMIZED

Types

type ConnectionInformation

type ConnectionInformation struct {
	NetworkType string
	AddressType string
	IP          net.IP
	TTL         int
	Range       int
}

c=<nettype> <addrtype> <connection-address> https://tools.ietf.org/html/rfc4566#section-5.7

type Formats

type Formats []string

func NewFormats

func NewFormats(fmts ...string) Formats

func (Formats) String

func (fmts Formats) String() string

func (Formats) ToNumeric

func (fmts Formats) ToNumeric() (nfmts []int, err error)
If the <proto> sub-field is "RTP/AVP" or "RTP/SAVP" the <fmt>//

sub-fields contain RTP payload type numbers.

type MediaDescription

type MediaDescription struct {
	MediaType string

	Port        int
	PortNumbers int

	Proto string

	Formats []string
}

MediaDescription represents a media type. m=<media> <port>/<number of ports> <proto> <fmt> ... https://tools.ietf.org/html/rfc4566#section-5.14

func (*MediaDescription) String

func (m *MediaDescription) String() string

type SessionDescription

type SessionDescription map[string][]string

func (SessionDescription) ConnectionInformation

func (sd SessionDescription) ConnectionInformation() (ci ConnectionInformation, err error)

func (SessionDescription) MediaDescription

func (sd SessionDescription) MediaDescription(mediaType string) (MediaDescription, error)

func (SessionDescription) MediaDirection added in v0.28.0

func (sd SessionDescription) MediaDirection() string

func (SessionDescription) SessionInformation added in v0.26.3

func (sd SessionDescription) SessionInformation() (i SessionInformation, err error)

func (SessionDescription) Value

func (sd SessionDescription) Value(key string) string

func (SessionDescription) Values

func (sd SessionDescription) Values(key string) []string

type SessionInformation added in v0.26.3

type SessionInformation struct {
	Origin         string
	SessionID      uint64
	SessionVersion uint64
	NetworkType    string
	AddressType    string
	Address        string // Informational address
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址