mirror of
https://github.com/livekit/livekit.git
synced 2026-08-28 20:08:16 +00:00
Add config for active red encoding (#1476)
This commit is contained in:
@@ -176,6 +176,8 @@ keys:
|
||||
# update_interval: 500
|
||||
# # to prevent speaker updates from too jumpy, smooth out values over N samples
|
||||
# smooth_intervals: 4
|
||||
# # enable red encoding downtrack for opus only audio up track
|
||||
# active_red_encoding: true
|
||||
|
||||
# turn server
|
||||
# turn:
|
||||
|
||||
@@ -150,6 +150,8 @@ type AudioConfig struct {
|
||||
// smoothing for audioLevel values sent to the client.
|
||||
// audioLevel will be an average of `smooth_intervals`, 0 to disable
|
||||
SmoothIntervals uint32 `yaml:"smooth_intervals"`
|
||||
// enable red encoding downtrack for opus only audio up track
|
||||
ActiveREDEncoding bool `yaml:"active_red_encoding"`
|
||||
}
|
||||
|
||||
type StreamTrackerPacketConfig struct {
|
||||
|
||||
@@ -70,6 +70,7 @@ func NewMediaTrack(params MediaTrackParams) *MediaTrack {
|
||||
ParticipantVersion: params.ParticipantVersion,
|
||||
ReceiverConfig: params.ReceiverConfig,
|
||||
SubscriberConfig: params.SubscriberConfig,
|
||||
AudioConfig: params.AudioConfig,
|
||||
Telemetry: params.Telemetry,
|
||||
Logger: params.Logger,
|
||||
})
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/logger"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/pkg/sfu"
|
||||
"github.com/livekit/livekit-server/pkg/sfu/buffer"
|
||||
@@ -74,6 +75,7 @@ type MediaTrackReceiverParams struct {
|
||||
ParticipantVersion uint32
|
||||
ReceiverConfig ReceiverConfig
|
||||
SubscriberConfig DirectionConfig
|
||||
AudioConfig config.AudioConfig
|
||||
Telemetry telemetry.TelemetryService
|
||||
Logger logger.Logger
|
||||
}
|
||||
@@ -474,7 +476,7 @@ func (t *MediaTrackReceiver) AddSubscriber(sub types.LocalParticipant) (types.Su
|
||||
StreamId: streamId,
|
||||
UpstreamCodecs: potentialCodecs,
|
||||
Logger: tLogger,
|
||||
DisableRed: t.trackInfo.GetDisableRed(),
|
||||
DisableRed: t.trackInfo.GetDisableRed() || !t.params.AudioConfig.ActiveREDEncoding,
|
||||
})
|
||||
return t.MediaTrackSubscriptions.AddSubscriber(sub, wr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user