sdp

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodecMapFromNames

func CodecMapFromNames(names []string, rtx bool, rtcpfbs []*RTCPFeedbackInfo) map[string]*CodecInfo

Types

type CandidateInfo

type CandidateInfo struct {
	// contains filtered or unexported fields
}

func NewCandidateInfo

func NewCandidateInfo(foundation string, componentID int, transport string,
	priority int, address string, port int, ctype string, relAddr string, relPort int) *CandidateInfo

func (*CandidateInfo) Clone

func (c *CandidateInfo) Clone() *CandidateInfo

func (*CandidateInfo) GetAddress

func (c *CandidateInfo) GetAddress() string

func (*CandidateInfo) GetComponentID

func (c *CandidateInfo) GetComponentID() int

func (*CandidateInfo) GetFoundation

func (c *CandidateInfo) GetFoundation() string

func (*CandidateInfo) GetPort

func (c *CandidateInfo) GetPort() int

func (*CandidateInfo) GetPriority

func (c *CandidateInfo) GetPriority() int

func (*CandidateInfo) GetRelAddr

func (c *CandidateInfo) GetRelAddr() string

func (*CandidateInfo) GetRelPort

func (c *CandidateInfo) GetRelPort() int

func (*CandidateInfo) GetTransport

func (c *CandidateInfo) GetTransport() string

func (*CandidateInfo) GetType

func (c *CandidateInfo) GetType() string

type Capability

type Capability struct {
	Codecs     []string        `json:"codecs"`
	Rtx        bool            `json:"rtx,omitempty"`
	Rtcpfbs    []*RtcpFeedback `json:"rtcpfbs,omitempty"`
	Extensions []string        `json:"extensions,omitempty"`
	Simulcast  bool            `json:"simulcast,omitempty"`
}

func CapabilityFromJSON

func CapabilityFromJSON(cap []byte) (*Capability, error)

type CodecInfo

type CodecInfo struct {
	// contains filtered or unexported fields
}

func NewCodecInfo

func NewCodecInfo(codec string, ctype int) *CodecInfo

func (*CodecInfo) AddParam

func (c *CodecInfo) AddParam(key, value string)

func (*CodecInfo) AddParams

func (c *CodecInfo) AddParams(params map[string]string)

func (*CodecInfo) AddRTCPFeedback

func (c *CodecInfo) AddRTCPFeedback(rtcpfb *RTCPFeedbackInfo)

func (*CodecInfo) Clone

func (c *CodecInfo) Clone() *CodecInfo

func (*CodecInfo) GetCodec

func (c *CodecInfo) GetCodec() string

func (*CodecInfo) GetParam

func (c *CodecInfo) GetParam(key string) string

func (*CodecInfo) GetParams

func (c *CodecInfo) GetParams() map[string]string

func (*CodecInfo) GetRTCPFeedbacks

func (c *CodecInfo) GetRTCPFeedbacks() []*RTCPFeedbackInfo

func (*CodecInfo) GetRTX

func (c *CodecInfo) GetRTX() int

func (*CodecInfo) GetType

func (c *CodecInfo) GetType() int

func (*CodecInfo) HasParam

func (c *CodecInfo) HasParam(key string) bool

func (*CodecInfo) HasRTX

func (c *CodecInfo) HasRTX() bool

func (*CodecInfo) SetRTX

func (c *CodecInfo) SetRTX(rtx int)

func (*CodecInfo) SetType

func (c *CodecInfo) SetType(ctype int)

type DTLSInfo

type DTLSInfo struct {
	// contains filtered or unexported fields
}

func NewDTLSInfo

func NewDTLSInfo(setup Setup, hash string, fingerprint string) *DTLSInfo

func (*DTLSInfo) Clone

func (d *DTLSInfo) Clone() *DTLSInfo

func (*DTLSInfo) GetFingerprint

func (d *DTLSInfo) GetFingerprint() string

func (*DTLSInfo) GetHash

func (d *DTLSInfo) GetHash() string

func (*DTLSInfo) GetSetup

func (d *DTLSInfo) GetSetup() Setup

func (*DTLSInfo) SetSetup

func (d *DTLSInfo) SetSetup(setup Setup)

type Direction

type Direction uint8
const (
	SENDRECV Direction = iota + 1
	SENDONLY
	RECVONLY
	INACTIVE
)

func DirectionbyValue

func DirectionbyValue(direction string) Direction

func (Direction) Reverse

func (d Direction) Reverse() Direction

func (Direction) String

func (d Direction) String() string

type DirectionWay

type DirectionWay uint8
const (
	SEND DirectionWay = iota + 1
	RECV
)

func DirectionWaybyValue

func DirectionWaybyValue(d string) DirectionWay

func (DirectionWay) Reverse

func (d DirectionWay) Reverse() DirectionWay

func (DirectionWay) String

func (d DirectionWay) String() string

type ICEInfo

type ICEInfo struct {
	// contains filtered or unexported fields
}

func GenerateICEInfo

func GenerateICEInfo(lite bool) *ICEInfo

func ICEInfoGenerate

func ICEInfoGenerate(lite bool) *ICEInfo

func NewICEInfo

func NewICEInfo(ufrag, password string) *ICEInfo

func (*ICEInfo) Clone

func (c *ICEInfo) Clone() *ICEInfo

func (*ICEInfo) GetPassword

func (c *ICEInfo) GetPassword() string

func (*ICEInfo) GetUfrag

func (c *ICEInfo) GetUfrag() string

func (*ICEInfo) IsEndOfCandidate

func (c *ICEInfo) IsEndOfCandidate() bool

func (*ICEInfo) IsLite

func (c *ICEInfo) IsLite() bool

func (*ICEInfo) SetEndOfCandidate

func (c *ICEInfo) SetEndOfCandidate(endOfCandidate bool)

func (*ICEInfo) SetLite

func (c *ICEInfo) SetLite(lite bool)

type MediaInfo

type MediaInfo struct {
	// contains filtered or unexported fields
}

func MediaInfoCreate

func MediaInfoCreate(mType string, capability *Capability) *MediaInfo

func NewMediaInfo

func NewMediaInfo(id string, mtype string) *MediaInfo

func (*MediaInfo) AddCodec

func (m *MediaInfo) AddCodec(codecInfo *CodecInfo)

func (*MediaInfo) AddExtension

func (m *MediaInfo) AddExtension(id int, name string)

func (*MediaInfo) AddRID

func (m *MediaInfo) AddRID(ridInfo *RIDInfo)

func (*MediaInfo) Answer

func (m *MediaInfo) Answer(supportedMedia *MediaInfo) *MediaInfo

func (*MediaInfo) AnswerCapability

func (m *MediaInfo) AnswerCapability(cap *Capability) *MediaInfo

func (*MediaInfo) Clone

func (m *MediaInfo) Clone() *MediaInfo

func (*MediaInfo) GetBitrate

func (m *MediaInfo) GetBitrate() int

func (*MediaInfo) GetCodec

func (m *MediaInfo) GetCodec(codec string) *CodecInfo

GetCodec should return array

func (*MediaInfo) GetCodecForType

func (m *MediaInfo) GetCodecForType(pt int) *CodecInfo

func (*MediaInfo) GetCodecs

func (m *MediaInfo) GetCodecs() map[int]*CodecInfo

func (*MediaInfo) GetDirection

func (m *MediaInfo) GetDirection() Direction

func (*MediaInfo) GetExtensions

func (m *MediaInfo) GetExtensions() map[int]string

func (*MediaInfo) GetID

func (m *MediaInfo) GetID() string

func (*MediaInfo) GetRID

func (m *MediaInfo) GetRID(id string) *RIDInfo

func (*MediaInfo) GetRIDS

func (m *MediaInfo) GetRIDS() map[string]*RIDInfo

func (*MediaInfo) GetSimulcast

func (m *MediaInfo) GetSimulcast() bool

func (*MediaInfo) GetSimulcastInfo

func (m *MediaInfo) GetSimulcastInfo() *SimulcastInfo

func (*MediaInfo) GetType

func (m *MediaInfo) GetType() string

func (*MediaInfo) HasExtension

func (m *MediaInfo) HasExtension(uri string) bool

func (*MediaInfo) HasRTX

func (m *MediaInfo) HasRTX() bool

func (*MediaInfo) SetBitrate

func (m *MediaInfo) SetBitrate(bitrate int)

func (*MediaInfo) SetCodecs

func (m *MediaInfo) SetCodecs(codecs map[int]*CodecInfo)

func (*MediaInfo) SetDirection

func (m *MediaInfo) SetDirection(direction Direction)

func (*MediaInfo) SetID

func (m *MediaInfo) SetID(id string)

func (*MediaInfo) SetSimulcast

func (m *MediaInfo) SetSimulcast(simulcast bool)

func (*MediaInfo) SetSimulcastInfo

func (m *MediaInfo) SetSimulcastInfo(info *SimulcastInfo)

type RIDInfo

type RIDInfo struct {
	// contains filtered or unexported fields
}

func NewRIDInfo

func NewRIDInfo(id string, direction DirectionWay) *RIDInfo

func (*RIDInfo) AddParam

func (r *RIDInfo) AddParam(id, param string)

func (*RIDInfo) Clone

func (r *RIDInfo) Clone() *RIDInfo

func (*RIDInfo) GetDirection

func (r *RIDInfo) GetDirection() DirectionWay

func (*RIDInfo) GetFormats

func (r *RIDInfo) GetFormats() []int

func (*RIDInfo) GetID

func (r *RIDInfo) GetID() string

func (*RIDInfo) GetParams

func (r *RIDInfo) GetParams() map[string]string

func (*RIDInfo) SetDirection

func (r *RIDInfo) SetDirection(direction DirectionWay)

func (*RIDInfo) SetFormats

func (r *RIDInfo) SetFormats(formats []string)

func (*RIDInfo) SetParams

func (r *RIDInfo) SetParams(params map[string]string)

type RTCPFeedbackInfo

type RTCPFeedbackInfo struct {
	// contains filtered or unexported fields
}

func NewRTCPFeedbackInfo

func NewRTCPFeedbackInfo(id string, params []string) *RTCPFeedbackInfo

func (*RTCPFeedbackInfo) Clone

func (r *RTCPFeedbackInfo) Clone() *RTCPFeedbackInfo

func (*RTCPFeedbackInfo) GetID

func (r *RTCPFeedbackInfo) GetID() string

func (*RTCPFeedbackInfo) GetParams

func (r *RTCPFeedbackInfo) GetParams() []string

type RtcpFeedback

type RtcpFeedback struct {
	ID     string   `json:"id,omitempty"`
	Params []string `json:"params,omitempty"`
}

type SDPInfo

type SDPInfo struct {
	// contains filtered or unexported fields
}

func Create

func Create(ice *ICEInfo, dtls *DTLSInfo, candidates []*CandidateInfo, capabilities map[string]*Capability) *SDPInfo

func NewSDPInfo

func NewSDPInfo() *SDPInfo

func Parse

func Parse(sdp string) (*SDPInfo, error)

func (*SDPInfo) AddCandidate

func (s *SDPInfo) AddCandidate(candidate *CandidateInfo)

func (*SDPInfo) AddCandidates

func (s *SDPInfo) AddCandidates(candidates []*CandidateInfo)

func (*SDPInfo) AddMedia

func (s *SDPInfo) AddMedia(media *MediaInfo)

func (*SDPInfo) AddStream

func (s *SDPInfo) AddStream(stream *StreamInfo)

func (*SDPInfo) Answer

func (s *SDPInfo) Answer(ice *ICEInfo, dtls *DTLSInfo, candidates []*CandidateInfo, medias map[string]*Capability) *SDPInfo

func (*SDPInfo) Clone

func (s *SDPInfo) Clone() *SDPInfo

func (*SDPInfo) GetAudioMedia

func (s *SDPInfo) GetAudioMedia() *MediaInfo

func (*SDPInfo) GetCandidates

func (s *SDPInfo) GetCandidates() []*CandidateInfo

func (*SDPInfo) GetDTLS

func (s *SDPInfo) GetDTLS() *DTLSInfo

func (*SDPInfo) GetFirstStream

func (s *SDPInfo) GetFirstStream() *StreamInfo

func (*SDPInfo) GetICE

func (s *SDPInfo) GetICE() *ICEInfo

func (*SDPInfo) GetMedia

func (s *SDPInfo) GetMedia(mtype string) *MediaInfo

func (*SDPInfo) GetMediaByID

func (s *SDPInfo) GetMediaByID(mid string) *MediaInfo

func (*SDPInfo) GetMedias

func (s *SDPInfo) GetMedias() []*MediaInfo

func (*SDPInfo) GetMediasByType

func (s *SDPInfo) GetMediasByType(mtype string) []*MediaInfo

func (*SDPInfo) GetStream

func (s *SDPInfo) GetStream(id string) *StreamInfo

func (*SDPInfo) GetStreamByMediaID

func (s *SDPInfo) GetStreamByMediaID(mid string) *StreamInfo

func (*SDPInfo) GetStreams

func (s *SDPInfo) GetStreams() map[string]*StreamInfo

func (*SDPInfo) GetTrackByMediaID

func (s *SDPInfo) GetTrackByMediaID(mid string) *TrackInfo

func (*SDPInfo) GetVersion

func (s *SDPInfo) GetVersion() int

func (*SDPInfo) GetVideoMedia

func (s *SDPInfo) GetVideoMedia() *MediaInfo

func (*SDPInfo) RemoveAllStreams

func (s *SDPInfo) RemoveAllStreams()

func (*SDPInfo) RemoveStream

func (s *SDPInfo) RemoveStream(stream *StreamInfo)

func (*SDPInfo) ReplaceMedia

func (s *SDPInfo) ReplaceMedia(media *MediaInfo) bool

func (*SDPInfo) SetDTLS

func (s *SDPInfo) SetDTLS(dtls *DTLSInfo)

func (*SDPInfo) SetICE

func (s *SDPInfo) SetICE(ice *ICEInfo)

func (*SDPInfo) SetVersion

func (s *SDPInfo) SetVersion(version int)

func (*SDPInfo) String

func (s *SDPInfo) String() string

func (*SDPInfo) Unify

func (s *SDPInfo) Unify() *SDPInfo

Unify return an unified plan version of the SDP info

type Setup

type Setup string
const (
	SETUPACTIVE   Setup = "active"
	SETUPPASSIVE  Setup = "passive"
	SETUPACTPASS  Setup = "actpass"
	SETUPINACTIVE Setup = "inactive"
)

func SetupByValue

func SetupByValue(s string) Setup

func (Setup) Reverse

func (s Setup) Reverse() Setup

func (Setup) String

func (s Setup) String() string

type SimulcastInfo

type SimulcastInfo struct {
	// contains filtered or unexported fields
}

func NewSimulcastInfo

func NewSimulcastInfo() *SimulcastInfo

func (*SimulcastInfo) AddSimulcastAlternativeStreams

func (s *SimulcastInfo) AddSimulcastAlternativeStreams(direction DirectionWay, streams []*SimulcastStreamInfo)

func (*SimulcastInfo) AddSimulcastStream

func (s *SimulcastInfo) AddSimulcastStream(direction DirectionWay, stream *SimulcastStreamInfo)

func (*SimulcastInfo) Clone

func (s *SimulcastInfo) Clone() *SimulcastInfo

func (*SimulcastInfo) GetSimulcastStreams

func (s *SimulcastInfo) GetSimulcastStreams(direction DirectionWay) [][]*SimulcastStreamInfo

type SimulcastStreamInfo

type SimulcastStreamInfo struct {
	// contains filtered or unexported fields
}

func NewSimulcastStreamInfo

func NewSimulcastStreamInfo(id string, paused bool) *SimulcastStreamInfo

func (*SimulcastStreamInfo) Clone

func (*SimulcastStreamInfo) GetID

func (s *SimulcastStreamInfo) GetID() string

func (*SimulcastStreamInfo) IsPaused

func (s *SimulcastStreamInfo) IsPaused() bool

type SourceGroupInfo

type SourceGroupInfo struct {
	// contains filtered or unexported fields
}

func NewSourceGroupInfo

func NewSourceGroupInfo(semantics string, ssrcs []uint) *SourceGroupInfo

func (*SourceGroupInfo) Clone

func (s *SourceGroupInfo) Clone() *SourceGroupInfo

func (*SourceGroupInfo) GetSSRCs

func (s *SourceGroupInfo) GetSSRCs() []uint

func (*SourceGroupInfo) GetSemantics

func (s *SourceGroupInfo) GetSemantics() string

type SourceInfo

type SourceInfo struct {
	// contains filtered or unexported fields
}

func NewSourceInfo

func NewSourceInfo(ssrc uint) *SourceInfo

func (*SourceInfo) Clone

func (s *SourceInfo) Clone() *SourceInfo

func (*SourceInfo) GetCName

func (s *SourceInfo) GetCName() string

func (*SourceInfo) GetSSRC

func (s *SourceInfo) GetSSRC() uint

func (*SourceInfo) GetStreamID

func (s *SourceInfo) GetStreamID() string

func (*SourceInfo) GetTrackID

func (s *SourceInfo) GetTrackID() string

func (*SourceInfo) SetCName

func (s *SourceInfo) SetCName(cname string)

func (*SourceInfo) SetStreamID

func (s *SourceInfo) SetStreamID(streamID string)

func (*SourceInfo) SetTrackID

func (s *SourceInfo) SetTrackID(trackID string)

type StreamInfo

type StreamInfo struct {
	// contains filtered or unexported fields
}

func NewStreamInfo

func NewStreamInfo(streamID string) *StreamInfo

func (*StreamInfo) AddTrack

func (s *StreamInfo) AddTrack(track *TrackInfo)

func (*StreamInfo) Clone

func (s *StreamInfo) Clone() *StreamInfo

func (*StreamInfo) GetFirstTrack

func (s *StreamInfo) GetFirstTrack(media string) *TrackInfo

func (*StreamInfo) GetID

func (s *StreamInfo) GetID() string

func (*StreamInfo) GetTrack

func (s *StreamInfo) GetTrack(trackID string) *TrackInfo

func (*StreamInfo) GetTracks

func (s *StreamInfo) GetTracks() map[string]*TrackInfo

func (*StreamInfo) RemoveAllTracks

func (s *StreamInfo) RemoveAllTracks()

func (*StreamInfo) RemoveTrack

func (s *StreamInfo) RemoveTrack(track *TrackInfo)

func (*StreamInfo) RemoveTrackById

func (s *StreamInfo) RemoveTrackById(trackId string)

type TrackEncodingInfo

type TrackEncodingInfo struct {
	// contains filtered or unexported fields
}

func NewTrackEncodingInfo

func NewTrackEncodingInfo(id string, paused bool) *TrackEncodingInfo

func (*TrackEncodingInfo) AddCodec

func (t *TrackEncodingInfo) AddCodec(codec *CodecInfo)

func (*TrackEncodingInfo) AddParam

func (t *TrackEncodingInfo) AddParam(id, param string)

func (*TrackEncodingInfo) Clone

func (*TrackEncodingInfo) GetCodecs

func (t *TrackEncodingInfo) GetCodecs() map[string]*CodecInfo

func (*TrackEncodingInfo) GetID

func (t *TrackEncodingInfo) GetID() string

func (*TrackEncodingInfo) GetParams

func (t *TrackEncodingInfo) GetParams() map[string]string

func (*TrackEncodingInfo) IsPaused

func (t *TrackEncodingInfo) IsPaused() bool

func (*TrackEncodingInfo) SetParams

func (t *TrackEncodingInfo) SetParams(params map[string]string)

type TrackInfo

type TrackInfo struct {
	// contains filtered or unexported fields
}

func NewTrackInfo

func NewTrackInfo(id, media string) *TrackInfo

func (*TrackInfo) AddAlternativeEncodings

func (t *TrackInfo) AddAlternativeEncodings(alternatives []*TrackEncodingInfo)

func (*TrackInfo) AddEncoding

func (t *TrackInfo) AddEncoding(encoding *TrackEncodingInfo)

func (*TrackInfo) AddSSRC

func (t *TrackInfo) AddSSRC(ssrc uint)

func (*TrackInfo) AddSourceGroup

func (t *TrackInfo) AddSourceGroup(group *SourceGroupInfo)

func (*TrackInfo) Clone

func (t *TrackInfo) Clone() *TrackInfo

func (*TrackInfo) GetEncodings

func (t *TrackInfo) GetEncodings() [][]*TrackEncodingInfo

func (*TrackInfo) GetID

func (t *TrackInfo) GetID() string

func (*TrackInfo) GetMedia

func (t *TrackInfo) GetMedia() string

func (*TrackInfo) GetMediaID

func (t *TrackInfo) GetMediaID() string

func (*TrackInfo) GetSSRCS

func (t *TrackInfo) GetSSRCS() []uint

func (*TrackInfo) GetSourceGroup

func (t *TrackInfo) GetSourceGroup(schematics string) *SourceGroupInfo

func (*TrackInfo) GetSourceGroupS

func (t *TrackInfo) GetSourceGroupS() []*SourceGroupInfo

func (*TrackInfo) SetEncodings

func (t *TrackInfo) SetEncodings(encodings [][]*TrackEncodingInfo)

func (*TrackInfo) SetMediaID

func (t *TrackInfo) SetMediaID(mediaID string)

Jump to

Keyboard shortcuts

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