Buffer size config for video and audio. (#2498)

* Buffer size config for video and audio.

There was only one buffer size in config.
In upstream, config value was used for video.
Audio used a hard coded value of 200 packets.

But, in the down stream sequencer, the config value was used for both
video and audio. So, if video was set up for high bit rate (deep
buffers), audio sequencer ended up using a lot of memory too in
sequencer.

Split config to be able to control that and also not hard code audio.

Another optimisation here would be to not instantiate sequencer unkess
NACK is negotiated.

* deprecate packet_buffer_size
This commit is contained in:
Raja Subramanian
2024-02-21 22:58:56 +05:30
committed by GitHub
parent bd7950f56c
commit 6895eff496
7 changed files with 34 additions and 16 deletions
+3 -3
View File
@@ -28,17 +28,17 @@ type FactoryOfBufferFactory struct {
audioPool *sync.Pool
}
func NewFactoryOfBufferFactory(trackingPackets int) *FactoryOfBufferFactory {
func NewFactoryOfBufferFactory(trackingPacketsVideo int, trackingPacketsAudio int) *FactoryOfBufferFactory {
return &FactoryOfBufferFactory{
videoPool: &sync.Pool{
New: func() interface{} {
b := make([]byte, trackingPackets*bucket.MaxPktSize)
b := make([]byte, trackingPacketsVideo*bucket.MaxPktSize)
return &b
},
},
audioPool: &sync.Pool{
New: func() interface{} {
b := make([]byte, bucket.MaxPktSize*200)
b := make([]byte, trackingPacketsAudio*bucket.MaxPktSize)
return &b
},
},