webrtc

package
v0.0.0-...-bdbcc17 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeSDP

func DecodeSDP(in string, sdp *webrtc.SessionDescription) error

DecodeSDP decodes the input from base64 into the given SDP.

func EncodeSDP

func EncodeSDP(sdp *webrtc.SessionDescription) (string, error)

EncodeSDP encodes the given SDP in base64.

Types

type LoggerFactory

type LoggerFactory struct {
	Logger golog.Logger
}

LoggerFactory wraps a golog.Logger for use with pion's webrtc logging system.

func (LoggerFactory) NewLogger

func (lf LoggerFactory) NewLogger(scope string) logging.LeveledLogger

NewLogger returns a new webrtc logger under the given scope.

type TrackLocalStaticSample

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

TrackLocalStaticSample is a TrackLocal that has a pre-set codec and accepts Samples. If you wish to send a RTP Packet use trackLocalStaticRTP

func NewTrackLocalStaticSample

func NewTrackLocalStaticSample(c webrtc.RTPCodecCapability, id, streamID string) (*TrackLocalStaticSample, error)

NewTrackLocalStaticSample returns a TrackLocalStaticSample

func (*TrackLocalStaticSample) Bind

func (s *TrackLocalStaticSample) Bind(t webrtc.TrackLocalContext) (webrtc.RTPCodecParameters, error)

Bind is called by the PeerConnection after negotiation is complete This asserts that the code requested is supported by the remote peer. If so it setups all the state (SSRC and PayloadType) to have a call

func (*TrackLocalStaticSample) Codec

func (s *TrackLocalStaticSample) Codec() webrtc.RTPCodecCapability

Codec gets the Codec of the track

func (*TrackLocalStaticSample) ID

ID is the unique identifier for this Track. This should be unique for the stream, but doesn't have to globally unique. A common example would be 'audio' or 'video' and StreamID would be 'desktop' or 'webcam'

func (*TrackLocalStaticSample) Kind

func (s *TrackLocalStaticSample) Kind() webrtc.RTPCodecType

Kind controls if this TrackLocal is audio or video

func (*TrackLocalStaticSample) StreamID

func (s *TrackLocalStaticSample) StreamID() string

StreamID is the group this track belongs too. This must be unique

func (*TrackLocalStaticSample) Unbind

func (s *TrackLocalStaticSample) Unbind(t webrtc.TrackLocalContext) error

Unbind implements the teardown logic when the track is no longer needed. This happens because a track has been stopped.

func (*TrackLocalStaticSample) WriteFrame

func (s *TrackLocalStaticSample) WriteFrame(frame []byte) error

WriteFrame writes a frane to the TrackLocalStaticSample If one PeerConnection fails the packets will still be sent to all PeerConnections. The error message will contain the ID of the failed PeerConnections so you can remove them

Jump to

Keyboard shortcuts

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