Documentation ¶
Index ¶
- Constants
- func EnableDebug(flag bool)
- func EnableLog(flag bool)
- func EnableUltraDebug(flag bool)
- func Max(x, y int) int
- func Min(x, y int) int
- func NextSSRC() uint
- func SetPortRange(minPort, maxPort int) bool
- type ActiveDetectorListener
- type ActiveEncoding
- type ActiveLayersInfo
- type ActiveSpeakerDetector
- func (a *ActiveSpeakerDetector) AddTrack(track *IncomingStreamTrack)
- func (a *ActiveSpeakerDetector) RemoveTrack(track *IncomingStreamTrack)
- func (a *ActiveSpeakerDetector) SetMaxAccumulatedScore(maxAcummulatedScore uint64)
- func (a *ActiveSpeakerDetector) SetMinActivationScore(minActivationScore uint)
- func (a *ActiveSpeakerDetector) SetMinChangePeriod(minChangePeriod uint)
- func (a *ActiveSpeakerDetector) SetNoiseGatingThreshold(noiseGatingThreshold byte)
- func (a *ActiveSpeakerDetector) Stop()
- type BitrateTraversal
- type DTLSStateListener
- type EmulatedTransport
- func (e *EmulatedTransport) CreateIncomingStream(streamInfo *sdp.StreamInfo) *IncomingStream
- func (e *EmulatedTransport) OnIncomingTrack(listener IncomingTrackListener)
- func (e *EmulatedTransport) Pause() bool
- func (e *EmulatedTransport) Play(time uint64) bool
- func (e *EmulatedTransport) Resume() bool
- func (e *EmulatedTransport) Seek(time uint64) bool
- func (e *EmulatedTransport) SetRemoteProperties(audio *sdp.MediaInfo, video *sdp.MediaInfo)
- func (e *EmulatedTransport) Stop()
- type Encoding
- type Endpoint
- func (e *Endpoint) CreateOffer(video *sdp.Capability, audio *sdp.Capability) *sdp.SDPInfo
- func (e *Endpoint) CreateSDPManager(sdpSemantics string, capabilities map[string]*sdp.Capability) SDPManager
- func (e *Endpoint) CreateTransport(remoteSdp *sdp.SDPInfo, localSdp *sdp.SDPInfo, options ...bool) *Transport
- func (e *Endpoint) GetDTLSFingerprint() string
- func (e *Endpoint) GetLocalCandidates() []*sdp.CandidateInfo
- func (e *Endpoint) SetAffinity(cpu int)
- func (e *Endpoint) Stop()
- type ICEStats
- type IncomingAllStats
- type IncomingStats
- type IncomingStream
- func (i *IncomingStream) AddTrack(track *IncomingStreamTrack) error
- func (i *IncomingStream) CreateTrack(track *sdp.TrackInfo) *IncomingStreamTrack
- func (i *IncomingStream) GetAudioTracks() []*IncomingStreamTrack
- func (i *IncomingStream) GetID() string
- func (i *IncomingStream) GetStats() map[string]map[string]*IncomingAllStats
- func (i *IncomingStream) GetStreamInfo() *sdp.StreamInfo
- func (i *IncomingStream) GetTrack(trackID string) *IncomingStreamTrack
- func (i *IncomingStream) GetTracks() []*IncomingStreamTrack
- func (i *IncomingStream) GetVideoTracks() []*IncomingStreamTrack
- func (i *IncomingStream) OnStop(stop func())
- func (i *IncomingStream) OnTrack(ontrack func(*IncomingStreamTrack))
- func (i *IncomingStream) Stop()
- type IncomingStreamTrack
- func (i *IncomingStreamTrack) Attached()
- func (i *IncomingStreamTrack) Detached()
- func (i *IncomingStreamTrack) GetActiveLayers() *ActiveLayersInfo
- func (i *IncomingStreamTrack) GetEncoding(encodingID string) *Encoding
- func (i *IncomingStreamTrack) GetEncodings() []*Encoding
- func (i *IncomingStreamTrack) GetFirstEncoding() *Encoding
- func (i *IncomingStreamTrack) GetID() string
- func (i *IncomingStreamTrack) GetMedia() string
- func (i *IncomingStreamTrack) GetSSRCs() []map[string]native.RTPIncomingSource
- func (i *IncomingStreamTrack) GetStats() map[string]*IncomingAllStats
- func (i *IncomingStreamTrack) GetTrackInfo() *sdp.TrackInfo
- func (i *IncomingStreamTrack) OnAttach(attach func())
- func (i *IncomingStreamTrack) OnDetach(detach func())
- func (i *IncomingStreamTrack) OnMediaFrame(listener func([]byte, uint))
- func (i *IncomingStreamTrack) OnStop(stop func())
- func (i *IncomingStreamTrack) Refresh()
- func (i *IncomingStreamTrack) Stop()
- type IncomingStreamTrackMirrored
- func (t *IncomingStreamTrackMirrored) Attached() bool
- func (t *IncomingStreamTrackMirrored) Detached() bool
- func (t *IncomingStreamTrackMirrored) GetActiveLayers() *ActiveLayersInfo
- func (t *IncomingStreamTrackMirrored) GetID() string
- func (t *IncomingStreamTrackMirrored) GetMedia() string
- func (t *IncomingStreamTrackMirrored) GetSSRCs()
- func (t *IncomingStreamTrackMirrored) GetStats() map[string]*IncomingAllStats
- func (t *IncomingStreamTrackMirrored) GetTrackInfo() *sdp.TrackInfo
- func (t *IncomingStreamTrackMirrored) Refresh()
- func (t *IncomingStreamTrackMirrored) Stop()
- type IncomingTrackListener
- type IncomingTrackStopListener
- type Layer
- type MediaFrameMultiplexer
- type OutgoingStats
- type OutgoingStatss
- type OutgoingStream
- func (o *OutgoingStream) AddTrack(track *OutgoingStreamTrack)
- func (o *OutgoingStream) AttachTo(incomingStream *IncomingStream) []*Transponder
- func (o *OutgoingStream) CreateTrack(track *sdp.TrackInfo) *OutgoingStreamTrack
- func (o *OutgoingStream) Detach()
- func (o *OutgoingStream) GetAudioTracks() []*OutgoingStreamTrack
- func (o *OutgoingStream) GetID() string
- func (o *OutgoingStream) GetStats() map[string]*OutgoingStatss
- func (o *OutgoingStream) GetStreamInfo() *sdp.StreamInfo
- func (o *OutgoingStream) GetTrack(trackID string) *OutgoingStreamTrack
- func (o *OutgoingStream) GetTracks() []*OutgoingStreamTrack
- func (o *OutgoingStream) GetVideoTracks() []*OutgoingStreamTrack
- func (o *OutgoingStream) IsMuted() bool
- func (o *OutgoingStream) Mute(muting bool)
- func (o *OutgoingStream) OnMute(listener func(bool))
- func (o *OutgoingStream) OnStop(listener func())
- func (o *OutgoingStream) OnTrack(listener func(*OutgoingStreamTrack))
- func (o *OutgoingStream) Stop()
- type OutgoingStreamTrack
- func (o *OutgoingStreamTrack) AttachTo(incomingTrack *IncomingStreamTrack) *Transponder
- func (o *OutgoingStreamTrack) Detach()
- func (o *OutgoingStreamTrack) GetID() string
- func (o *OutgoingStreamTrack) GetMedia() string
- func (o *OutgoingStreamTrack) GetSSRCs() map[string]native.RTPOutgoingSource
- func (o *OutgoingStreamTrack) GetStats() *OutgoingStatss
- func (o *OutgoingStreamTrack) GetTrackInfo() *sdp.TrackInfo
- func (o *OutgoingStreamTrack) GetTransponder() *Transponder
- func (o *OutgoingStreamTrack) IsMuted() bool
- func (o *OutgoingStreamTrack) Mute(muting bool)
- func (o *OutgoingStreamTrack) OnMute(mute func(bool))
- func (o *OutgoingStreamTrack) OnStop(stop func())
- func (o *OutgoingStreamTrack) Stop()
- type OutgoingTrackListener
- type Player
- type PlayerEndListener
- type RawStreamer
- type RawStreamerSession
- type Recorder
- type RecorderTrack
- type RecorderTrackStopListener
- type Refresher
- type RenegotiationCallback
- type SDPManager
- type SDPManagerPlanb
- type SDPManagerUnified
- type StreamerSession
- func (s *StreamerSession) GetID() string
- func (s *StreamerSession) GetIncomingStreamTrack() *IncomingStreamTrack
- func (s *StreamerSession) GetLocalPort() int
- func (s *StreamerSession) GetOutgoingStreamTrack() *OutgoingStreamTrack
- func (s *StreamerSession) OnStop(stop func())
- func (s *StreamerSession) SetRemotePort(ip string, port int)
- func (s *StreamerSession) Stop()
- type Transponder
- func (t *Transponder) GetAvailableLayers() *ActiveLayersInfo
- func (t *Transponder) GetIncomingTrack() *IncomingStreamTrack
- func (t *Transponder) GetSelectedEncoding() string
- func (t *Transponder) GetSelectedSpatialLayerId() int
- func (t *Transponder) GetSelectedTemporalLayerId() int
- func (t *Transponder) IsMuted() bool
- func (t *Transponder) Mute(muting bool)
- func (t *Transponder) OnMute(listener func(bool))
- func (t *Transponder) OnStop(stop func())
- func (t *Transponder) SelectEncoding(encodingId string)
- func (t *Transponder) SelectLayer(spatialLayerId, temporalLayerId int)
- func (t *Transponder) SetIncomingTrack(incomingTrack *IncomingStreamTrack) error
- func (t *Transponder) SetMaximumLayers(maxSpatialLayerId, maxTemporalLayerId int)
- func (t *Transponder) SetTargetBitrate(bitrate uint, traversal BitrateTraversal, strict bool) uint
- func (t *Transponder) Stop()
- type Transport
- func (t *Transport) AddRemoteCandidate(candidate *sdp.CandidateInfo)
- func (t *Transport) CreateIncomingStream(streamInfo *sdp.StreamInfo) *IncomingStream
- func (t *Transport) CreateIncomingStreamTrack(media string, trackId string, ssrcs map[string]uint) *IncomingStreamTrack
- func (t *Transport) CreateOutgoingStream(streamInfo *sdp.StreamInfo) *OutgoingStream
- func (t *Transport) CreateOutgoingStreamTrack(media string, trackId string, ssrcs map[string]uint) *OutgoingStreamTrack
- func (t *Transport) CreateOutgoingStreamWithID(streamID string, audio bool, video bool) *OutgoingStream
- func (t *Transport) Dump(filename string, incoming bool, outgoing bool, rtcp bool) bool
- func (t *Transport) GetDTLSState() string
- func (t *Transport) GetICEStats() *ICEStats
- func (t *Transport) GetIncomingStream(streamId string) *IncomingStream
- func (t *Transport) GetIncomingStreams() []*IncomingStream
- func (t *Transport) GetLocalCandidates() []*sdp.CandidateInfo
- func (t *Transport) GetLocalDTLSInfo() *sdp.DTLSInfo
- func (t *Transport) GetLocalICEInfo() *sdp.ICEInfo
- func (t *Transport) GetOutgoingStream(streamId string) *OutgoingStream
- func (t *Transport) GetOutgoingStreams() []*OutgoingStream
- func (t *Transport) GetRemoteCandidates() []*sdp.CandidateInfo
- func (t *Transport) OnDTLSICEState(listener DTLSStateListener)
- func (t *Transport) OnIncomingTrack(listener IncomingTrackListener)
- func (t *Transport) OnOutgoingTrack(listener OutgoingTrackListener)
- func (t *Transport) OnStop(stop TransportStopListener)
- func (t *Transport) RemoveIncomingStream(incomingStream *IncomingStream)
- func (t *Transport) SetBandwidthProbing(probe bool)
- func (t *Transport) SetLocalProperties(audio *sdp.MediaInfo, video *sdp.MediaInfo)
- func (t *Transport) SetMaxProbingBitrate(bitrate uint)
- func (t *Transport) SetRemoteProperties(audio *sdp.MediaInfo, video *sdp.MediaInfo)
- func (t *Transport) Stop()
- type TransportStopListener
Constants ¶
const MaxLayerId = 0xFF
Variables ¶
This section is empty.
Functions ¶
func EnableDebug ¶
func EnableDebug(flag bool)
func EnableUltraDebug ¶
func EnableUltraDebug(flag bool)
func SetPortRange ¶
Types ¶
type ActiveDetectorListener ¶ added in v0.1.4
type ActiveDetectorListener func(*IncomingStreamTrack)
ActiveDetectorListener listener
type ActiveEncoding ¶
ActiveEncoding info
type ActiveLayersInfo ¶
type ActiveLayersInfo struct { Active []*ActiveEncoding Inactive []*ActiveEncoding Layers []*Layer }
ActiveLayersInfo info
type ActiveSpeakerDetector ¶
ActiveSpeakerDetector detector the spkeaking track
func NewActiveSpeakerDetector ¶
func NewActiveSpeakerDetector(listener ActiveDetectorListener) *ActiveSpeakerDetector
NewActiveSpeakerDetector create new active speaker detector
func (*ActiveSpeakerDetector) AddTrack ¶ added in v0.1.4
func (a *ActiveSpeakerDetector) AddTrack(track *IncomingStreamTrack)
AddTrack add incoming track into detector
func (*ActiveSpeakerDetector) RemoveTrack ¶ added in v0.1.4
func (a *ActiveSpeakerDetector) RemoveTrack(track *IncomingStreamTrack)
RemoveTrack remove incoming track from detector
func (*ActiveSpeakerDetector) SetMaxAccumulatedScore ¶ added in v0.1.9
func (a *ActiveSpeakerDetector) SetMaxAccumulatedScore(maxAcummulatedScore uint64)
SetMaxAccumulatedScore maximux activity score accumulated by an speaker
func (*ActiveSpeakerDetector) SetMinActivationScore ¶ added in v0.1.9
func (a *ActiveSpeakerDetector) SetMinActivationScore(minActivationScore uint)
SetMinActivationScore Set minimum activation score to be electible as active speaker
func (*ActiveSpeakerDetector) SetMinChangePeriod ¶
func (a *ActiveSpeakerDetector) SetMinChangePeriod(minChangePeriod uint)
SetMinChangePeriod set min period change callback in ms
func (*ActiveSpeakerDetector) SetNoiseGatingThreshold ¶ added in v0.1.9
func (a *ActiveSpeakerDetector) SetNoiseGatingThreshold(noiseGatingThreshold byte)
SetNoiseGatingThreshold Minimum db level to not be considered as muted
type BitrateTraversal ¶
type BitrateTraversal string
const ( TraversalDefault BitrateTraversal = "default" TraversalSpatialTemporal BitrateTraversal = "spatial-temporal" TraversalTemporalSpatial BitrateTraversal = "temporal-spatial" TraversalZigZagSpatialTemporal BitrateTraversal = "zig-zag-spatial-temporal" TraversalZigZagTemporalSpatial BitrateTraversal = "zig-zag-temporal-spatial" )
type DTLSStateListener ¶ added in v0.1.9
type DTLSStateListener func(state string)
DTLSStateListener listener
type EmulatedTransport ¶ added in v0.1.3
EmulatedTransport pcap file as a transport
func NewEmulatedTransport ¶ added in v0.1.3
func NewEmulatedTransport(pcap string) *EmulatedTransport
NewEmulatedTransport create a transport by pcap file
func (*EmulatedTransport) CreateIncomingStream ¶ added in v0.1.3
func (e *EmulatedTransport) CreateIncomingStream(streamInfo *sdp.StreamInfo) *IncomingStream
CreateIncomingStream create incoming stream base on streaminfo
func (*EmulatedTransport) OnIncomingTrack ¶ added in v0.1.4
func (e *EmulatedTransport) OnIncomingTrack(listener IncomingTrackListener)
OnIncomingTrack register incoming track
func (*EmulatedTransport) Pause ¶ added in v0.1.3
func (e *EmulatedTransport) Pause() bool
Pause pause
func (*EmulatedTransport) Play ¶ added in v0.1.3
func (e *EmulatedTransport) Play(time uint64) bool
Play play at start time
func (*EmulatedTransport) Resume ¶ added in v0.1.3
func (e *EmulatedTransport) Resume() bool
Resume resume to play
func (*EmulatedTransport) Seek ¶ added in v0.1.3
func (e *EmulatedTransport) Seek(time uint64) bool
Seek to some time
func (*EmulatedTransport) SetRemoteProperties ¶ added in v0.1.3
func (e *EmulatedTransport) SetRemoteProperties(audio *sdp.MediaInfo, video *sdp.MediaInfo)
func (*EmulatedTransport) Stop ¶ added in v0.1.3
func (e *EmulatedTransport) Stop()
Stop stop this transport
type Encoding ¶
type Encoding struct {
// contains filtered or unexported fields
}
Encoding info
func (*Encoding) GetDepacketizer ¶
func (e *Encoding) GetDepacketizer() native.StreamTrackDepacketizer
GetDepacketizer get native StreamTrackDepacketizer
func (*Encoding) GetSource ¶
func (e *Encoding) GetSource() native.RTPIncomingSourceGroup
GetSource get native RTPIncomingSourceGroup
type Endpoint ¶
Endpoint is an endpoint represent an UDP server socket. The endpoint will process STUN requests in order to be able to associate the remote ip:port with the registered transport and forward any further data comming from that transport. Being a server it is ICE-lite.
func NewEndpoint ¶
NewEndpoint create a new endpoint with given ip
func NewEndpointWithPort ¶
NewEndpointWithPort create a new endpint with given ip and port
func (*Endpoint) CreateOffer ¶
func (e *Endpoint) CreateOffer(video *sdp.Capability, audio *sdp.Capability) *sdp.SDPInfo
CreateOffer create offer based on audio and video capability It generates a random ICE username and password and gets endpoint fingerprint
func (*Endpoint) CreateSDPManager ¶
func (e *Endpoint) CreateSDPManager(sdpSemantics string, capabilities map[string]*sdp.Capability) SDPManager
CreateSDPManager Create new SDP manager, this object will manage the SDP O/A for you and produce a suitable trasnport.
func (*Endpoint) CreateTransport ¶
func (e *Endpoint) CreateTransport(remoteSdp *sdp.SDPInfo, localSdp *sdp.SDPInfo, options ...bool) *Transport
CreateTransport create a new transport object and register it with the remote ICE username and password disableSTUNKeepAlive - Disable ICE/STUN keep alives, required for server to server transports, set this to false if you do not how to use it
func (*Endpoint) GetDTLSFingerprint ¶
GetDTLSFingerprint Get local DTLS fingerprint for this endpoint. It will be shared by all the transport associated to this endpoint
func (*Endpoint) GetLocalCandidates ¶
func (e *Endpoint) GetLocalCandidates() []*sdp.CandidateInfo
GetLocalCandidates Get local ICE candidates for this endpoint. It will be shared by all the transport associated to this endpoint.
func (*Endpoint) SetAffinity ¶ added in v0.1.9
SetAffinity Set cpu affinity
type ICEStats ¶ added in v0.1.9
type ICEStats struct { RequestsSent int64 RequestsReceived int64 ResponsesSent int64 ResponsesReceived int64 }
ICEStats ice stats for this connection
type IncomingAllStats ¶
type IncomingAllStats struct { Rtt uint MinWaitTime uint MaxWaitTime uint AvgWaitTime float64 Media *IncomingStats Rtx *IncomingStats Fec *IncomingStats Bitrate uint Total uint Remb uint SimulcastIdx int // contains filtered or unexported fields }
IncomingAllStats info
type IncomingStats ¶
type IncomingStats struct { LostPackets uint DropPackets uint NumPackets uint NumRTCPPackets uint TotalBytes uint TotalRTCPBytes uint TotalPLIs uint TotalNACKs uint Bitrate uint Layers []*Layer }
IncomingStats info
type IncomingStream ¶
IncomingStream The incoming streams represent the recived media stream from a remote peer.
func NewIncomingStreamWithEmulatedTransport ¶ added in v0.1.3
func NewIncomingStreamWithEmulatedTransport(transport native.PCAPTransportEmulator, receiver native.RTPReceiverFacade, info *sdp.StreamInfo) *IncomingStream
NewIncomingStreamWithEmulatedTransport Create new incoming stream through PCAPTransportEmulator
func (*IncomingStream) AddTrack ¶
func (i *IncomingStream) AddTrack(track *IncomingStreamTrack) error
AddTrack Adds an incoming stream track created using the Transpocnder.CreateIncomingStreamTrack to this stream
func (*IncomingStream) CreateTrack ¶
func (i *IncomingStream) CreateTrack(track *sdp.TrackInfo) *IncomingStreamTrack
CreateTrack Create new track from a TrackInfo object and add it to this stream
func (*IncomingStream) GetAudioTracks ¶
func (i *IncomingStream) GetAudioTracks() []*IncomingStreamTrack
GetAudioTracks get all audio tracks
func (*IncomingStream) GetStats ¶
func (i *IncomingStream) GetStats() map[string]map[string]*IncomingAllStats
GetStats Get statistics for all tracks in the stream
func (*IncomingStream) GetStreamInfo ¶
func (i *IncomingStream) GetStreamInfo() *sdp.StreamInfo
GetStreamInfo get stream info
func (*IncomingStream) GetTrack ¶
func (i *IncomingStream) GetTrack(trackID string) *IncomingStreamTrack
GetTrack Get track by id
func (*IncomingStream) GetTracks ¶
func (i *IncomingStream) GetTracks() []*IncomingStreamTrack
GetTracks Get all tracks in this stream
func (*IncomingStream) GetVideoTracks ¶
func (i *IncomingStream) GetVideoTracks() []*IncomingStreamTrack
GetVideoTracks get all video tracks
func (*IncomingStream) OnStop ¶ added in v0.1.4
func (i *IncomingStream) OnStop(stop func())
OnStop register stop listener
func (*IncomingStream) OnTrack ¶ added in v0.1.4
func (i *IncomingStream) OnTrack(ontrack func(*IncomingStreamTrack))
OnTrack register addtrack listener
func (*IncomingStream) Stop ¶
func (i *IncomingStream) Stop()
Stop Removes the media strem from the transport and also detaches from any attached incoming stream
type IncomingStreamTrack ¶
type IncomingStreamTrack struct {
// contains filtered or unexported fields
}
IncomingStreamTrack Audio or Video track of a remote media stream
func NewIncomingStreamTrack ¶ added in v0.1.5
func NewIncomingStreamTrack(media string, id string, receiver native.RTPReceiverFacade, sources map[string]native.RTPIncomingSourceGroup) *IncomingStreamTrack
NewIncomingStreamTrack Create incoming audio/video track
func (*IncomingStreamTrack) Attached ¶
func (i *IncomingStreamTrack) Attached()
Attached Signal that this track has been attached.
func (*IncomingStreamTrack) Detached ¶
func (i *IncomingStreamTrack) Detached()
Detached Signal that this track has been detached.
func (*IncomingStreamTrack) GetActiveLayers ¶
func (i *IncomingStreamTrack) GetActiveLayers() *ActiveLayersInfo
GetActiveLayers Get active encodings and layers ordered by bitrate
func (*IncomingStreamTrack) GetEncoding ¶ added in v0.1.5
func (i *IncomingStreamTrack) GetEncoding(encodingID string) *Encoding
GetEncoding get Encoding by id
func (*IncomingStreamTrack) GetEncodings ¶
func (i *IncomingStreamTrack) GetEncodings() []*Encoding
GetEncodings get all encodings
func (*IncomingStreamTrack) GetFirstEncoding ¶
func (i *IncomingStreamTrack) GetFirstEncoding() *Encoding
GetFirstEncoding get the first Encoding
func (*IncomingStreamTrack) GetMedia ¶
func (i *IncomingStreamTrack) GetMedia() string
GetMedia get track media type "video" or "audio"
func (*IncomingStreamTrack) GetSSRCs ¶
func (i *IncomingStreamTrack) GetSSRCs() []map[string]native.RTPIncomingSource
GetSSRCs get all RTPIncomingSource include "media" "rtx" "fec"
func (*IncomingStreamTrack) GetStats ¶
func (i *IncomingStreamTrack) GetStats() map[string]*IncomingAllStats
GetStats Get stats for all encodings
func (*IncomingStreamTrack) GetTrackInfo ¶
func (i *IncomingStreamTrack) GetTrackInfo() *sdp.TrackInfo
GetTrackInfo get track info
func (*IncomingStreamTrack) OnAttach ¶ added in v0.1.4
func (i *IncomingStreamTrack) OnAttach(attach func())
OnAttach run this func when attached
func (*IncomingStreamTrack) OnDetach ¶ added in v0.1.4
func (i *IncomingStreamTrack) OnDetach(detach func())
OnDetach
func (*IncomingStreamTrack) OnMediaFrame ¶ added in v0.1.5
func (i *IncomingStreamTrack) OnMediaFrame(listener func([]byte, uint))
OnMediaFrame callback
func (*IncomingStreamTrack) OnStop ¶ added in v0.1.4
func (i *IncomingStreamTrack) OnStop(stop func())
OnStop register stop callback
func (*IncomingStreamTrack) Refresh ¶
func (i *IncomingStreamTrack) Refresh()
Refresh Request an intra refres
func (*IncomingStreamTrack) Stop ¶
func (i *IncomingStreamTrack) Stop()
Stop Removes the track from the incoming stream and also detaches any attached outgoing track or recorder
type IncomingStreamTrackMirrored ¶ added in v0.1.9
type IncomingStreamTrackMirrored struct {
// contains filtered or unexported fields
}
func NewMirrorIncomingTrack ¶ added in v0.1.9
func NewMirrorIncomingTrack(track *IncomingStreamTrack, timeService native.TimeService) *IncomingStreamTrackMirrored
func (*IncomingStreamTrackMirrored) Attached ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) Attached() bool
func (*IncomingStreamTrackMirrored) Detached ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) Detached() bool
func (*IncomingStreamTrackMirrored) GetActiveLayers ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) GetActiveLayers() *ActiveLayersInfo
func (*IncomingStreamTrackMirrored) GetID ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) GetID() string
func (*IncomingStreamTrackMirrored) GetMedia ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) GetMedia() string
func (*IncomingStreamTrackMirrored) GetSSRCs ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) GetSSRCs()
func (*IncomingStreamTrackMirrored) GetStats ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) GetStats() map[string]*IncomingAllStats
func (*IncomingStreamTrackMirrored) GetTrackInfo ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) GetTrackInfo() *sdp.TrackInfo
func (*IncomingStreamTrackMirrored) Refresh ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) Refresh()
func (*IncomingStreamTrackMirrored) Stop ¶ added in v0.1.9
func (t *IncomingStreamTrackMirrored) Stop()
type IncomingTrackListener ¶ added in v0.1.4
type IncomingTrackListener func(*IncomingStreamTrack, *IncomingStream)
IncomingTrackListener new track listener
type IncomingTrackStopListener ¶ added in v0.1.4
type IncomingTrackStopListener func()
IncomingTrackStopListener stop listener
type Layer ¶
type Layer struct { // EncodingId str EncodingId string // SpatialLayerId int SpatialLayerId int // TemporalLayerId int TemporalLayerId int // SimulcastIdx int SimulcastIdx int // TotalBytes uint TotalBytes uint // NumPackets uint NumPackets uint // Bitrate uint Bitrate uint }
Layer info
type MediaFrameMultiplexer ¶ added in v0.1.9
type MediaFrameMultiplexer struct {
// contains filtered or unexported fields
}
MediaStreamDuplicater we can make a copy of the incoming stream and callback the mediaframe data
func NewMediaFrameMultiplexer ¶ added in v0.1.9
func NewMediaFrameMultiplexer(track *IncomingStreamTrack) *MediaFrameMultiplexer
NewMediaStreamDuplicater duplicate this IncomingStreamTrack and callback the mediaframe
func (*MediaFrameMultiplexer) SetMediaFrameListener ¶ added in v0.1.9
func (d *MediaFrameMultiplexer) SetMediaFrameListener(listener func([]byte, uint))
SetMediaFrameListener set outside mediaframe listener
func (*MediaFrameMultiplexer) Stop ¶ added in v0.1.9
func (d *MediaFrameMultiplexer) Stop()
Stop stop this
type OutgoingStats ¶
type OutgoingStats struct { NumPackets uint NumRTCPPackets uint TotalBytes uint TotalRTCPBytes uint Bitrate uint }
OutgoingStats stats info
type OutgoingStatss ¶
type OutgoingStatss struct { Media *OutgoingStats Rtx *OutgoingStats Fec *OutgoingStats // contains filtered or unexported fields }
OutgoingStatss stats info
type OutgoingStream ¶
OutgoingStream represent the media stream sent to a remote peer
func NewOutgoingStream ¶
func NewOutgoingStream(transport native.DTLSICETransport, info *sdp.StreamInfo) *OutgoingStream
NewOutgoingStream create outgoing stream
func (*OutgoingStream) AddTrack ¶
func (o *OutgoingStream) AddTrack(track *OutgoingStreamTrack)
AddTrack add one outgoing track
func (*OutgoingStream) AttachTo ¶
func (o *OutgoingStream) AttachTo(incomingStream *IncomingStream) []*Transponder
AttachTo Listen media from the incoming stream and send it to the remote peer of the associated transport
func (*OutgoingStream) CreateTrack ¶
func (o *OutgoingStream) CreateTrack(track *sdp.TrackInfo) *OutgoingStreamTrack
CreateTrack Create new track from a TrackInfo object and add it to this stream
func (*OutgoingStream) GetAudioTracks ¶
func (o *OutgoingStream) GetAudioTracks() []*OutgoingStreamTrack
GetAudioTracks Get an array of the media stream audio tracks
func (*OutgoingStream) GetStats ¶
func (o *OutgoingStream) GetStats() map[string]*OutgoingStatss
GetStats Get statistics for all tracks in the stream
func (*OutgoingStream) GetStreamInfo ¶
func (o *OutgoingStream) GetStreamInfo() *sdp.StreamInfo
GetStreamInfo get the stream info
func (*OutgoingStream) GetTrack ¶
func (o *OutgoingStream) GetTrack(trackID string) *OutgoingStreamTrack
GetTrack get one track
func (*OutgoingStream) GetTracks ¶
func (o *OutgoingStream) GetTracks() []*OutgoingStreamTrack
GetTracks get all the tracks
func (*OutgoingStream) GetVideoTracks ¶
func (o *OutgoingStream) GetVideoTracks() []*OutgoingStreamTrack
GetVideoTracks Get an array of the media stream video tracks
func (*OutgoingStream) IsMuted ¶
func (o *OutgoingStream) IsMuted() bool
IsMuted Check if the stream is muted or not
func (*OutgoingStream) Mute ¶
func (o *OutgoingStream) Mute(muting bool)
Mute Mute/Unmute this stream and all the tracks in it
func (*OutgoingStream) OnMute ¶ added in v0.1.4
func (o *OutgoingStream) OnMute(listener func(bool))
OnMute register onmute listener
func (*OutgoingStream) OnStop ¶ added in v0.1.4
func (o *OutgoingStream) OnStop(listener func())
OnStop register onstop listener
func (*OutgoingStream) OnTrack ¶ added in v0.1.4
func (o *OutgoingStream) OnTrack(listener func(*OutgoingStreamTrack))
OnTrack new outgoing track listener
type OutgoingStreamTrack ¶
type OutgoingStreamTrack struct {
// contains filtered or unexported fields
}
OutgoingStreamTrack Audio or Video track of a media stream sent to a remote peer
func (*OutgoingStreamTrack) AttachTo ¶
func (o *OutgoingStreamTrack) AttachTo(incomingTrack *IncomingStreamTrack) *Transponder
AttachTo Listen media from the incoming stream track and send it to the remote peer of the associated transport
func (*OutgoingStreamTrack) Detach ¶
func (o *OutgoingStreamTrack) Detach()
Detach Stop forwarding any previous attached track
func (*OutgoingStreamTrack) GetMedia ¶
func (o *OutgoingStreamTrack) GetMedia() string
GetMedia get media type
func (*OutgoingStreamTrack) GetSSRCs ¶
func (o *OutgoingStreamTrack) GetSSRCs() map[string]native.RTPOutgoingSource
GetSSRCs get ssrcs map
func (*OutgoingStreamTrack) GetStats ¶
func (o *OutgoingStreamTrack) GetStats() *OutgoingStatss
GetStats get stats info
func (*OutgoingStreamTrack) GetTrackInfo ¶
func (o *OutgoingStreamTrack) GetTrackInfo() *sdp.TrackInfo
GetTrackInfo get track info
func (*OutgoingStreamTrack) GetTransponder ¶
func (o *OutgoingStreamTrack) GetTransponder() *Transponder
GetTransponder Get attached transpoder for this track
func (*OutgoingStreamTrack) IsMuted ¶
func (o *OutgoingStreamTrack) IsMuted() bool
IsMuted Check if the track is muted or not
func (*OutgoingStreamTrack) Mute ¶
func (o *OutgoingStreamTrack) Mute(muting bool)
Mute Mute/Unmute the track
func (*OutgoingStreamTrack) OnMute ¶ added in v0.1.4
func (o *OutgoingStreamTrack) OnMute(mute func(bool))
func (*OutgoingStreamTrack) OnStop ¶ added in v0.1.4
func (o *OutgoingStreamTrack) OnStop(stop func())
OnStop
func (*OutgoingStreamTrack) Stop ¶
func (o *OutgoingStreamTrack) Stop()
Stop Removes the track from the outgoing stream and also detaches from any attached incoming track
type OutgoingTrackListener ¶ added in v0.1.4
type OutgoingTrackListener func(*OutgoingStreamTrack, *OutgoingStream)
OutgoingTrackListener new track listener
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player can player the file as webrtc source
func NewPlayer ¶
func NewPlayer(filename string, listener PlayerEndListener) (*Player, error)
NewPlayer create new file player
func (*Player) GetAudioTracks ¶
func (p *Player) GetAudioTracks() []*IncomingStreamTrack
GetAudioTracks audio tracks this file contains
func (*Player) GetTracks ¶
func (p *Player) GetTracks() []*IncomingStreamTrack
GetTracks tracks this file contains
func (*Player) GetVideoTracks ¶
func (p *Player) GetVideoTracks() []*IncomingStreamTrack
GetVideoTracks video tracks this file contains
type PlayerEndListener ¶ added in v0.1.4
type PlayerEndListener func()
PlayerEndListener end listener
type RawStreamer ¶ added in v0.1.5
RawStreamer streamer that can send raw rtp data
func NewRawStreamer ¶ added in v0.1.5
func NewRawStreamer() *RawStreamer
NewRawStreamer create new raw rtp streamer
func (*RawStreamer) CreateSession ¶ added in v0.1.5
func (s *RawStreamer) CreateSession(media *sdp.MediaInfo) *RawStreamerSession
CreateSession create a audio/media session
func (*RawStreamer) RemoveSession ¶ added in v0.1.5
func (s *RawStreamer) RemoveSession(session *RawStreamerSession)
RemoveSession remove a session
type RawStreamerSession ¶ added in v0.1.5
type RawStreamerSession struct {
// contains filtered or unexported fields
}
func NewRawStreamerSession ¶ added in v0.1.5
func NewRawStreamerSession(media *sdp.MediaInfo) *RawStreamerSession
func (*RawStreamerSession) GetID ¶ added in v0.1.5
func (s *RawStreamerSession) GetID() string
func (*RawStreamerSession) GetIncomingStreamTrack ¶ added in v0.1.5
func (s *RawStreamerSession) GetIncomingStreamTrack() *IncomingStreamTrack
func (*RawStreamerSession) Push ¶ added in v0.1.5
func (s *RawStreamerSession) Push(rtp []byte)
func (*RawStreamerSession) Stop ¶ added in v0.1.5
func (s *RawStreamerSession) Stop()
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder represent a file recorder
func NewRecorder ¶
NewRecorder create a new recorder
func (*Recorder) Record ¶
func (r *Recorder) Record(incoming *IncomingStreamTrack)
Record start record an incoming track
func (*Recorder) RecordStream ¶
func (r *Recorder) RecordStream(incoming *IncomingStream)
RecordStream start record an incoming stream
type RecorderTrack ¶
type RecorderTrack struct {
// contains filtered or unexported fields
}
RecorderTrack a track to record
func NewRecorderTrack ¶
func NewRecorderTrack(id string, track *IncomingStreamTrack, encoding *Encoding) *RecorderTrack
NewRecorderTrack create a new recorder track
func (*RecorderTrack) GetEncoding ¶
func (r *RecorderTrack) GetEncoding() *Encoding
GetEncoding get encoding info
func (*RecorderTrack) GetTrack ¶
func (r *RecorderTrack) GetTrack() *IncomingStreamTrack
GetTrack get internal IncomingStreamTrack
func (*RecorderTrack) OnStop ¶ added in v0.1.4
func (r *RecorderTrack) OnStop(stop RecorderTrackStopListener)
OnStop register a stop listener
type RecorderTrackStopListener ¶ added in v0.1.4
type RecorderTrackStopListener func()
type Refresher ¶
func NewRefresher ¶
func (*Refresher) Add ¶
func (r *Refresher) Add(incom *IncomingStreamTrack)
func (*Refresher) AddStream ¶
func (r *Refresher) AddStream(incoming *IncomingStream)
type RenegotiationCallback ¶
type RenegotiationCallback func(transport *Transport)
type SDPManager ¶
type SDPManager interface { GetState() string GetTransport() *Transport CreateLocalDescription() (*sdp.SDPInfo, error) ProcessRemoteDescription(sdp string) (*sdp.SDPInfo, error) }
SDPManager interface
type SDPManagerPlanb ¶
type SDPManagerPlanb struct { OnRenegotiation RenegotiationCallback // contains filtered or unexported fields }
SDPManagerPlanb planb manager
func NewSDPManagerPlanb ¶
func NewSDPManagerPlanb(endpoint *Endpoint, capabilities map[string]*sdp.Capability) *SDPManagerPlanb
func (*SDPManagerPlanb) CreateLocalDescription ¶
func (s *SDPManagerPlanb) CreateLocalDescription() (*sdp.SDPInfo, error)
func (*SDPManagerPlanb) GetState ¶
func (s *SDPManagerPlanb) GetState() string
func (*SDPManagerPlanb) GetTransport ¶
func (s *SDPManagerPlanb) GetTransport() *Transport
func (*SDPManagerPlanb) ProcessRemoteDescription ¶
func (s *SDPManagerPlanb) ProcessRemoteDescription(sdpStr string) (*sdp.SDPInfo, error)
type SDPManagerUnified ¶
type SDPManagerUnified struct { OnRenegotiation RenegotiationCallback // contains filtered or unexported fields }
SDPManagerUnified unified plan manager
func NewSDPManagerUnified ¶
func NewSDPManagerUnified(endpoint *Endpoint, capabilities map[string]*sdp.Capability) *SDPManagerUnified
NewSDPManagerUnified create SDPUnified manager
func (*SDPManagerUnified) CreateLocalDescription ¶
func (s *SDPManagerUnified) CreateLocalDescription() (*sdp.SDPInfo, error)
func (*SDPManagerUnified) GetState ¶
func (s *SDPManagerUnified) GetState() string
func (*SDPManagerUnified) GetTransport ¶
func (s *SDPManagerUnified) GetTransport() *Transport
func (*SDPManagerUnified) ProcessRemoteDescription ¶
func (s *SDPManagerUnified) ProcessRemoteDescription(sdpStr string) (*sdp.SDPInfo, error)
type StreamerSession ¶
type StreamerSession struct {
// contains filtered or unexported fields
}
StreamerSession represent a rtp session
func NewStreamerSession ¶
func NewStreamerSession(media *sdp.MediaInfo) *StreamerSession
NewStreamerSession new StreamerSession with auto selectd port
func NewStreamerSessionWithLocalPort ¶ added in v0.1.13
func NewStreamerSessionWithLocalPort(port int, media *sdp.MediaInfo) *StreamerSession
NewStreamerSessionWithLocalPort create streamer session with pre selected port
func (*StreamerSession) GetIncomingStreamTrack ¶
func (s *StreamerSession) GetIncomingStreamTrack() *IncomingStreamTrack
GetIncomingStreamTrack get asso incoming track,
func (*StreamerSession) GetLocalPort ¶ added in v0.1.13
func (s *StreamerSession) GetLocalPort() int
func (*StreamerSession) GetOutgoingStreamTrack ¶
func (s *StreamerSession) GetOutgoingStreamTrack() *OutgoingStreamTrack
GetOutgoingStreamTrack get asso outgoing track,
func (*StreamerSession) OnStop ¶ added in v0.1.4
func (s *StreamerSession) OnStop(stop func())
OnStop register stop listener
func (*StreamerSession) SetRemotePort ¶ added in v0.1.12
func (s *StreamerSession) SetRemotePort(ip string, port int)
type Transponder ¶
type Transponder struct {
// contains filtered or unexported fields
}
Transponder
func NewTransponder ¶
func NewTransponder(transponderFacade native.RTPStreamTransponderFacade) *Transponder
func (*Transponder) GetAvailableLayers ¶
func (t *Transponder) GetAvailableLayers() *ActiveLayersInfo
GetAvailableLayers Get available encodings and layers
func (*Transponder) GetIncomingTrack ¶
func (t *Transponder) GetIncomingTrack() *IncomingStreamTrack
func (*Transponder) GetSelectedEncoding ¶
func (t *Transponder) GetSelectedEncoding() string
GetSelectedEncoding get selected encoding id
func (*Transponder) GetSelectedSpatialLayerId ¶
func (t *Transponder) GetSelectedSpatialLayerId() int
GetSelectedSpatialLayerId return int
func (*Transponder) GetSelectedTemporalLayerId ¶
func (t *Transponder) GetSelectedTemporalLayerId() int
GetSelectedTemporalLayerId return int
func (*Transponder) IsMuted ¶
func (t *Transponder) IsMuted() bool
func (*Transponder) Mute ¶
func (t *Transponder) Mute(muting bool)
func (*Transponder) OnMute ¶ added in v0.1.4
func (t *Transponder) OnMute(listener func(bool))
OnMute register mute listener
func (*Transponder) OnStop ¶ added in v0.1.4
func (t *Transponder) OnStop(stop func())
OnStop register stop listener
func (*Transponder) SelectEncoding ¶
func (t *Transponder) SelectEncoding(encodingId string)
SelectEncoding by id
func (*Transponder) SelectLayer ¶
func (t *Transponder) SelectLayer(spatialLayerId, temporalLayerId int)
SelectLayer Select SVC temporatl and spatial layers. Only available for VP9 media.
func (*Transponder) SetIncomingTrack ¶
func (t *Transponder) SetIncomingTrack(incomingTrack *IncomingStreamTrack) error
func (*Transponder) SetMaximumLayers ¶
func (t *Transponder) SetMaximumLayers(maxSpatialLayerId, maxTemporalLayerId int)
func (*Transponder) SetTargetBitrate ¶
func (t *Transponder) SetTargetBitrate(bitrate uint, traversal BitrateTraversal, strict bool) uint
type Transport ¶
Transport represent a connection between a local ICE candidate and a remote set of ICE candidates over a single DTLS session
func NewTransport ¶
func NewTransport(bundle native.RTPBundleTransport, remoteIce *sdp.ICEInfo, remoteDtls *sdp.DTLSInfo, remoteCandidates []*sdp.CandidateInfo, localIce *sdp.ICEInfo, localDtls *sdp.DTLSInfo, localCandidates []*sdp.CandidateInfo, disableSTUNKeepAlive bool) *Transport
NewTransport create a new transport
func (*Transport) AddRemoteCandidate ¶
func (t *Transport) AddRemoteCandidate(candidate *sdp.CandidateInfo)
AddRemoteCandidate register a remote candidate info. Only needed for ice-lite to ice-lite endpoints
func (*Transport) CreateIncomingStream ¶
func (t *Transport) CreateIncomingStream(streamInfo *sdp.StreamInfo) *IncomingStream
CreateIncomingStream Create an incoming stream object from the media stream info objet
func (*Transport) CreateIncomingStreamTrack ¶
func (t *Transport) CreateIncomingStreamTrack(media string, trackId string, ssrcs map[string]uint) *IncomingStreamTrack
CreateIncomingStreamTrack Create new incoming stream in this transport. TODO: Simulcast is still not supported You can use IncomingStream's CreateTrack
func (*Transport) CreateOutgoingStream ¶
func (t *Transport) CreateOutgoingStream(streamInfo *sdp.StreamInfo) *OutgoingStream
CreateOutgoingStream Create new outgoing stream in this transport using StreamInfo
func (*Transport) CreateOutgoingStreamTrack ¶
func (t *Transport) CreateOutgoingStreamTrack(media string, trackId string, ssrcs map[string]uint) *OutgoingStreamTrack
CreateOutgoingStreamTrack Create new outgoing track in this transport
func (*Transport) CreateOutgoingStreamWithID ¶
func (t *Transport) CreateOutgoingStreamWithID(streamID string, audio bool, video bool) *OutgoingStream
CreateOutgoingStreamWithID alias CreateOutgoingStream
func (*Transport) Dump ¶ added in v0.1.3
Dump dump incoming and outgoint rtp and rtcp packets into a pcap file
func (*Transport) GetDTLSState ¶ added in v0.1.9
GetDTLSState get dtls state
func (*Transport) GetICEStats ¶ added in v0.1.9
GetICEStats get ice stats
func (*Transport) GetIncomingStream ¶
func (t *Transport) GetIncomingStream(streamId string) *IncomingStream
GetIncomingStream get one incoming stream
func (*Transport) GetIncomingStreams ¶
func (t *Transport) GetIncomingStreams() []*IncomingStream
GetIncomingStreams get all incoming streams
func (*Transport) GetLocalCandidates ¶
func (t *Transport) GetLocalCandidates() []*sdp.CandidateInfo
GetLocalCandidates Get local ICE candidates for this transport
func (*Transport) GetLocalDTLSInfo ¶
GetLocalDTLSInfo Get transport local DTLS info
func (*Transport) GetLocalICEInfo ¶
GetLocalICEInfo Get transport local ICE info
func (*Transport) GetOutgoingStream ¶
func (t *Transport) GetOutgoingStream(streamId string) *OutgoingStream
GetOutgoingStream get one outgoing stream
func (*Transport) GetOutgoingStreams ¶
func (t *Transport) GetOutgoingStreams() []*OutgoingStream
GetOutgoingStreams get all outgoing streams
func (*Transport) GetRemoteCandidates ¶
func (t *Transport) GetRemoteCandidates() []*sdp.CandidateInfo
GetRemoteCandidates Get remote ICE candidates for this transport
func (*Transport) OnDTLSICEState ¶ added in v0.1.9
func (t *Transport) OnDTLSICEState(listener DTLSStateListener)
OnDTLSICEState OnDTLSICEState
func (*Transport) OnIncomingTrack ¶ added in v0.1.4
func (t *Transport) OnIncomingTrack(listener IncomingTrackListener)
OnIncomingTrack register incoming track
func (*Transport) OnOutgoingTrack ¶ added in v0.1.4
func (t *Transport) OnOutgoingTrack(listener OutgoingTrackListener)
OnOutgoingTrack register outgoing track
func (*Transport) OnStop ¶ added in v0.1.4
func (t *Transport) OnStop(stop TransportStopListener)
OnStop register a stop listener
func (*Transport) RemoveIncomingStream ¶ added in v0.1.9
func (t *Transport) RemoveIncomingStream(incomingStream *IncomingStream)
func (*Transport) SetBandwidthProbing ¶
SetBandwidthProbing Enable/Disable bitrate probing This will send padding only RTX packets to allow bandwidth estimation algortithm to probe bitrate beyonf current sent values. The ammoung of probing bitrate would be limited by the sender bitrate estimation and the limit set on the setMaxProbing Bitrate.
func (*Transport) SetLocalProperties ¶
SetLocalProperties Set local RTP properties
func (*Transport) SetMaxProbingBitrate ¶
SetMaxProbingBitrate Set the maximum bitrate to be used if probing is enabled.
func (*Transport) SetRemoteProperties ¶
SetRemoteProperties Set remote RTP properties
type TransportStopListener ¶ added in v0.1.4
type TransportStopListener func()
TransportStopListener listener
Source Files ¶
- activespeakerdetector.go
- emulatedtransport.go
- endpoint.go
- incomingstream.go
- incomingstreamtrack.go
- incomingstreamtrackmirrored.go
- layerinfo.go
- mediaframemultiplexer.go
- module.go
- outgoingstream.go
- outgoingstreamtrack.go
- player.go
- rawstreamer.go
- rawstreamersession.go
- recorder.go
- recordertrack.go
- refresher.go
- sdpmanager.go
- sdpmanagerplanb.go
- sdpmanagerunified.go
- streamersession.go
- transponder.go
- transport.go
- util.go