* file output * wake under lock * keep track of RTX bytes separately * packet group * Packet group of 50ms * Minor refactoring * rate calculator * send bit rate * WIP * comment * reduce packet infos size * extended twcc seq num * fix packet info * WIP * queuing delay * refactor * config * callbacks * fixes * clean up * remove debug file, fix rate calculation * fmt * fix probes * format * notes * check loss * tweak detection settings * 24-bit wrap * clean up a bit * limit symbol list to number of packets * fmt * clean up * lost * fixes * fmt * rename * fixes * fmt * use min/max * hold on early warning of congestion * make note about need for all optimal allocation on hold release * estimate trend in congested state * tweaks * quantized * fmt * TrendDetector generics * CTR trend * tweaks * config * config * comments * clean up * consistent naming * pariticpant level setting * log usage mode * feedback
51 lines
1.2 KiB
Go
51 lines
1.2 KiB
Go
// Copyright 2023 LiveKit, Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package pacer
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
|
|
"github.com/pion/rtp"
|
|
"github.com/pion/webrtc/v3"
|
|
)
|
|
|
|
type ExtensionData struct {
|
|
ID uint8
|
|
Payload []byte
|
|
}
|
|
|
|
type Packet struct {
|
|
Header *rtp.Header
|
|
Extensions []ExtensionData
|
|
Payload []byte
|
|
IsRTX bool
|
|
AbsSendTimeExtID uint8
|
|
TransportWideExtID uint8
|
|
WriteStream webrtc.TrackLocalWriter
|
|
Pool *sync.Pool
|
|
PoolEntity *[]byte
|
|
}
|
|
|
|
type Pacer interface {
|
|
Enqueue(p Packet)
|
|
Stop()
|
|
|
|
SetInterval(interval time.Duration)
|
|
SetBitrate(bitrate int)
|
|
}
|
|
|
|
// ------------------------------------------------
|