webrtc

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 19 Imported by: 0

README

StateChange

  1. offer = pc.CreateOffer()
  2. pc.SetLocalDescription(offer)
  3. OnICEGatheringStateChange: gathering
  4. OnSignalingStateChange: have-local-offer *. OnICEGatheringStateChange: complete
  5. pc.SetRemoteDescription(answer)
  6. OnSignalingStateChange: stable
  7. OnICEConnectionStateChange: checking
  8. OnICEConnectionStateChange: connected

Documentation

Index

Constants

View Source
const PriorityComponentRTP = 1 * int(256-ice.ComponentRTP)
View Source
const PriorityLocalTCPPassive = (1 << 8) * int((1<<13)*4+8191)
View Source
const PriorityLocalUDP = (1 << 8) * int(65535)
View Source
const PriorityTypeHostTCP = (1 << 24) * int(126-27)
View Source
const PriorityTypeHostUDP = (1 << 24) * int(126)
View Source
const ReceiveMTU = 1472

ReceiveMTU = Ethernet MTU (1500) - IP Header (20) - UDP Header (8) https://ffmpeg.org/ffmpeg-all.html#Muxer

Variables

This section is empty.

Functions

func CandidateManualHostTCPPassive added in v1.3.0

func CandidateManualHostTCPPassive(host, port string, offset int) string

func CandidateManualHostUDP added in v1.3.0

func CandidateManualHostUDP(host, port string, offset int) string

func GetCachedPublicIP

func GetCachedPublicIP() (net.IP, error)

func GetPublicIP

func GetPublicIP() (net.IP, error)

GetPublicIP example from https://github.com/pion/stun

func IsIP

func IsIP(host string) bool

func LookupIP

func LookupIP(address string) (string, error)

func MimeType

func MimeType(codec *core.Codec) string

func NewAPI

func NewAPI() (*webrtc.API, error)

func NewCandidate

func NewCandidate(network, address string) (string, error)

func NewServerAPI added in v1.8.2

func NewServerAPI(address, network string, candidateHost []string) (*webrtc.API, error)

func RegisterDefaultCodecs

func RegisterDefaultCodecs(m *webrtc.MediaEngine) error

func UnmarshalICEServers added in v1.6.1

func UnmarshalICEServers(b []byte) ([]webrtc.ICEServer, error)

func UnmarshalMedias added in v1.3.0

func UnmarshalMedias(descriptions []*sdp.MediaDescription) (medias []*core.Media)

func WithResampling added in v1.4.0

func WithResampling(medias []*core.Media) []*core.Media

WithResampling - will add for consumer: PCMA/0, PCMU/0, PCM/0, PCML/0 so it can add resampling for PCMA/PCMU and repack for PCM/PCML

Types

type Conn

type Conn struct {
	core.Listener

	UserAgent string
	Desc      string
	Mode      core.Mode
	// contains filtered or unexported fields
}

func NewConn added in v1.3.0

func NewConn(pc *webrtc.PeerConnection) *Conn

func (*Conn) AddCandidate

func (c *Conn) AddCandidate(candidate string) error

func (*Conn) AddTrack

func (c *Conn) AddTrack(media *core.Media, codec *core.Codec, track *core.Receiver) error

func (*Conn) Close added in v1.3.0

func (c *Conn) Close() error

func (*Conn) CreateCompleteOffer added in v1.3.0

func (c *Conn) CreateCompleteOffer(medias []*core.Media) (string, error)

func (*Conn) CreateOffer added in v1.3.0

func (c *Conn) CreateOffer(medias []*core.Media) (string, error)

func (*Conn) GetAnswer

func (c *Conn) GetAnswer() (answer string, err error)

func (*Conn) GetCompleteAnswer

func (c *Conn) GetCompleteAnswer() (answer string, err error)

func (*Conn) GetMedias

func (c *Conn) GetMedias() []*core.Media

func (*Conn) GetTrack added in v1.3.0

func (c *Conn) GetTrack(media *core.Media, codec *core.Codec) (*core.Receiver, error)

func (*Conn) MarshalJSON

func (c *Conn) MarshalJSON() ([]byte, error)

func (*Conn) SetAnswer added in v1.3.0

func (c *Conn) SetAnswer(answer string) (err error)

func (*Conn) SetOffer

func (c *Conn) SetOffer(offer string) (err error)

func (*Conn) Start added in v1.3.0

func (c *Conn) Start() error

func (*Conn) Stop added in v1.3.0

func (c *Conn) Stop() error

type Track added in v1.3.0

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

func NewTrack added in v1.3.0

func NewTrack(kind string) *Track

func (*Track) Bind added in v1.3.0

func (t *Track) Bind(context webrtc.TrackLocalContext) (webrtc.RTPCodecParameters, error)

func (*Track) ID added in v1.3.0

func (t *Track) ID() string

func (*Track) Kind added in v1.3.0

func (t *Track) Kind() webrtc.RTPCodecType

func (*Track) RID added in v1.3.0

func (t *Track) RID() string

func (*Track) StreamID added in v1.3.0

func (t *Track) StreamID() string

func (*Track) Unbind added in v1.3.0

func (t *Track) Unbind(context webrtc.TrackLocalContext) error

func (*Track) WriteRTP added in v1.3.0

func (t *Track) WriteRTP(payloadType uint8, packet *rtp.Packet) error

Jump to

Keyboard shortcuts

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