sdp

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MPL-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FORMAT_TYPE_ULAW            = "0"
	FORMAT_TYPE_ALAW            = "8"
	FORMAT_TYPE_OPUS            = "96"
	FORMAT_TYPE_TELEPHONE_EVENT = "101"
)

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 Mode, fmts Formats) []byte

GenerateForAudio is minimal AUDIO SDP setup

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 Mode

type Mode string
const (
	// https://datatracker.ietf.org/doc/html/rfc4566#section-6
	ModeRecvonly Mode = "recvonly"
	ModeSendrecv Mode = "sendrecv"
	ModeSendonly Mode = "sendonly"
)

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) Value

func (sd SessionDescription) Value(key string) string

func (SessionDescription) Values

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

Jump to

Keyboard shortcuts

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