webrtc

package
v0.0.0-...-168f587 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNotFound          = errors.New("WebRTC Stream Not Found")
	ErrorCodecNotSupported = errors.New("WebRTC Codec Not Supported")
	ErrorClientOffline     = errors.New("WebRTC Client Offline")
	ErrorNotTrackAvailable = errors.New("WebRTC Not Track Available")
	ErrorIgnoreAudioTrack  = errors.New("WebRTC Ignore Audio Track codec not supported WebRTC support only PCM_ALAW or PCM_MULAW")
)

Functions

This section is empty.

Types

type Muxer

type Muxer struct {
	ClientACK *time.Timer
	StreamACK *time.Timer
	Options   Options

	VideoStats VideoReceiverStats
	// contains filtered or unexported fields
}

func NewMuxer

func NewMuxer(options Options) *Muxer

func (*Muxer) Close

func (element *Muxer) Close() error

func (*Muxer) NewPeerConnection

func (element *Muxer) NewPeerConnection(configuration webrtc.Configuration) (*webrtc.PeerConnection, error)

func (*Muxer) WriteHeader

func (element *Muxer) WriteHeader(streams []av.CodecData, sdp64 string) (string, error)

func (*Muxer) WritePacket

func (element *Muxer) WritePacket(pkt av.Packet) (err error)

func (*Muxer) WriteRtpPacket

func (element *Muxer) WriteRtpPacket(sample *media.Sample) (err error)

type Options

type Options struct {
	// ICEServers is a required array of ICE server URLs to connect to (e.g., STUN or TURN server URLs)
	ICEServers []string
	// ICEUsername is an optional username for authenticating with the given ICEServers
	ICEUsername string
	// ICECredential is an optional credential (i.e., password) for authenticating with the given ICEServers
	ICECredential string
	// ICECandidates sets a list of external IP addresses of 1:1
	ICECandidates []string
	// PortMin is an optional minimum (inclusive) ephemeral UDP port range for the ICEServers connections
	PortMin uint16
	// PortMin is an optional maximum (inclusive) ephemeral UDP port range for the ICEServers connections
	PortMax uint16
}

type StatsTimestamp

type StatsTimestamp float64

StatsTimestamp is a timestamp represented by the floating point number of milliseconds since the epoch.

func (StatsTimestamp) Time

func (s StatsTimestamp) Time() time.Time

Time returns the time.Time represented by this timestamp.

type Stream

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

type VideoReceiverStats

type VideoReceiverStats struct {
	// Timestamp is the timestamp associated with this object.
	Timestamp StatsTimestamp `json:"timestamp"`

	// FramesReceived Represents the total number of complete frames received for
	// this receiver. This metric is incremented when the complete frame is received.
	FramesReceived uint32 `json:"framesReceived"`

	FramesDelay uint32 `json:"framesDelay"`

	VideoDelay uint32 `json:"videoDelay"`

	FramesDelayTotal uint32 `json:"framesDelayTotal"`

	FramesDelayAvg uint32 `json:"framesDelayAvg"`
}

VideoReceiverStats contains video metrics related to a specific receiver.

Jump to

Keyboard shortcuts

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