Documentation
¶
Index ¶
- type RTPQueue
- type Rx
- type Tx
- func (t *Tx) AddTransmitted(ntpTime uint64, ssrc uint32, size int, seqNr uint16, isMark bool) float64
- func (t *Tx) GetStatistics(ntpTime uint64, clear bool) string
- func (t *Tx) GetTargetBitrate(ssrc uint32) float64
- func (t *Tx) IncomingStandardizedFeedback(ntpTime uint64, buf []byte)
- func (t *Tx) IsOkToTransmit(ntpTime uint64, ssrc uint32) float64
- func (t *Tx) NewMediaFrame(ntpTime uint64, ssrc uint32, bytesRTP int)
- func (t *Tx) RegisterNewStream(rtpQueue RTPQueue, ssrc uint32, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RTPQueue ¶
type RTPQueue interface { // SizeOfNextRTP returns the size of the next item in the queue. SizeOfNextRTP() int // SeqNrOfNextRTP returns the RTP sequence number of the next item in the queue SeqNrOfNextRTP() uint16 // SeqNrOfLastRTP returns the RTP sequence number of the last item in the queue SeqNrOfLastRTP() uint16 // BytesInQueue returns the total number of bytes in the queue, i.e. the // sum of the sizes of all items in the queue. BytesInQueue() int // SizeOfQueue returns the number of items in the queue. SizeOfQueue() int // GetDelay returns the delay of the last item in the queue. // ts is given in seconds. GetDelay(ts float64) float64 // GetSizeOfLastFrame returns the size of the latest pushed item. GetSizeOfLastFrame() int // Clear empties the queue. Clear() int }
RTPQueue implements a simple RTP packet queue. One RTPQueue should be used per SSRC stream.
type Rx ¶
type Rx struct {
// contains filtered or unexported fields
}
Rx implements the receiver side of SCReAM
func (*Rx) CreateStandardizedFeedback ¶
CreateStandardizedFeedback creates a feedback packet according to https://tools.ietf.org/wg/avtcore/draft-ietf-avtcore-cc-feedback-message/ Current implementation implements -02 version It is up to the wrapper application to prepend this RTCP with SR or RR when needed
func (*Rx) IsFeedback ¶
IsFeedback returns TRUE if an RTP packet has been received and there is pending feedback
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx implements the sender side of SCReAM
func (*Tx) AddTransmitted ¶
func (t *Tx) AddTransmitted(ntpTime uint64, ssrc uint32, size int, seqNr uint16, isMark bool) float64
AddTransmitted adds a packet to list of transmitted packets. Should be called when an RTP packet was transmitted. AddTransmitted returns the time until IsOkToTransmit can be called again.
func (*Tx) GetStatistics ¶
GetStatistics returns some overall SCReAM statistics.
func (*Tx) GetTargetBitrate ¶
GetTargetBitrate returns the target bitrate for the stream with ssrc. NOTE!, Because SCReAM operates on RTP packets, the target bitrate will also include the RTP overhead. This means that a subsequent call to set the media coder target bitrate must subtract an estimate of the RTP + framing overhead. This is not critical for Video bitrates but can be important when SCReAM is used to congestion control e.g low bitrate audio streams.
Function returns -1 if a loss is detected, this signal can be used to request a new key frame from a video encoder.
func (*Tx) IncomingStandardizedFeedback ¶
IncomingStandardizedFeedback parses an incoming standardized feedback according to https://tools.ietf.org/wg/avtcore/draft-ietf-avtcore-cc-feedback-message/ Current implementation implements -02 version and assumes that SR/RR or other non-CC feedback is stripped.
func (*Tx) IsOkToTransmit ¶
IsOkToTransmit determines if an RTP packet with ssrc can be transmitted. Returns:
0.0: RTP packet with ssrc can be immediately transmitted. AddTransmitted must be called if packet is transmitted as a result of this.
>0.0: Time [s] until this function should be called again. This can be used to start a timer. Note that a call to NewMediaFrame or IncomingFeedback should cause an immediate call to isOkToTransmit.
-1.0: No RTP packet available to transmit or send window is not large enough
func (*Tx) NewMediaFrame ¶
NewMediaFrame should be called for each new video frame. IsOkToTransmit should be called after newMediaFrame
func (*Tx) RegisterNewStream ¶
func (t *Tx) RegisterNewStream(rtpQueue RTPQueue, ssrc uint32, priority, minBitrate, startBitrate, maxBitrate float64)
RegisterNewStream registers a new stream with ssrc using rtpQueue. Priority is in the range ]0.0..1.0] where 1.0 denotes the highest priority. It is recommended that at least one stream has priority 1.0. Bitrates are specified in bps