Documentation ¶
Index ¶
- Variables
- type Synchronizer
- func (s *Synchronizer) AddTrack(track TrackRemote, identity string) *TrackSynchronizer
- func (s *Synchronizer) End()
- func (s *Synchronizer) GetEndedAt() int64
- func (s *Synchronizer) GetStartedAt() int64
- func (s *Synchronizer) OnRTCP(packet rtcp.Packet)
- func (s *Synchronizer) RemoveTrack(trackID string)
- type TrackRemote
- type TrackStats
- type TrackSynchronizer
- func (t *TrackSynchronizer) GetFrameDuration() time.Duration
- func (t *TrackSynchronizer) GetPTS(pkt *rtp.Packet) (time.Duration, error)
- func (t *TrackSynchronizer) GetTrackStats() TrackStats
- func (t *TrackSynchronizer) Initialize(pkt *rtp.Packet)
- func (t *TrackSynchronizer) InsertFrame(pkt *rtp.Packet) time.Duration
- func (t *TrackSynchronizer) InsertFrameBefore(pkt *rtp.Packet, next *rtp.Packet) (time.Duration, bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBackwardsPTS = errors.New("backwards pts")
Functions ¶
This section is empty.
Types ¶
type Synchronizer ¶
a single Synchronizer is shared between all audio and video writers
func NewSynchronizer ¶
func NewSynchronizer(onStarted func()) *Synchronizer
func (*Synchronizer) AddTrack ¶
func (s *Synchronizer) AddTrack(track TrackRemote, identity string) *TrackSynchronizer
func (*Synchronizer) End ¶
func (s *Synchronizer) End()
func (*Synchronizer) GetEndedAt ¶
func (s *Synchronizer) GetEndedAt() int64
func (*Synchronizer) GetStartedAt ¶
func (s *Synchronizer) GetStartedAt() int64
func (*Synchronizer) OnRTCP ¶
func (s *Synchronizer) OnRTCP(packet rtcp.Packet)
OnRTCP syncs a/v using sender reports
func (*Synchronizer) RemoveTrack ¶
func (s *Synchronizer) RemoveTrack(trackID string)
type TrackRemote ¶
type TrackRemote interface { ID() string Codec() webrtc.RTPCodecParameters Kind() webrtc.RTPCodecType SSRC() webrtc.SSRC }
type TrackStats ¶
type TrackSynchronizer ¶
func (*TrackSynchronizer) GetFrameDuration ¶
func (t *TrackSynchronizer) GetFrameDuration() time.Duration
GetFrameDuration returns frame duration in seconds
func (*TrackSynchronizer) GetPTS ¶
GetPTS will reset sequence numbers and/or offsets if necessary Packets are expected to be in order
func (*TrackSynchronizer) GetTrackStats ¶
func (t *TrackSynchronizer) GetTrackStats() TrackStats
func (*TrackSynchronizer) Initialize ¶
func (t *TrackSynchronizer) Initialize(pkt *rtp.Packet)
Initialize should be called as soon as the first packet is received
func (*TrackSynchronizer) InsertFrame ¶
func (t *TrackSynchronizer) InsertFrame(pkt *rtp.Packet) time.Duration
InsertFrame is used to inject frames (usually blank) into the stream It updates the timestamp and sequence number of the packet, as well as offsets for all future packets
func (*TrackSynchronizer) InsertFrameBefore ¶
func (t *TrackSynchronizer) InsertFrameBefore(pkt *rtp.Packet, next *rtp.Packet) (time.Duration, bool)
InsertFrameBefore updates the packet and offsets only if it is at least one frame duration before next
Click to show internal directories.
Click to hide internal directories.