mirror of
https://github.com/livekit/livekit.git
synced 2026-03-29 09:19:53 +00:00
Add option to force simuclast codec. (#4226)
This commit is contained in:
@@ -97,6 +97,7 @@ type MediaTrackParams struct {
|
|||||||
PreferVideoSizeFromMedia bool
|
PreferVideoSizeFromMedia bool
|
||||||
EnableRTPStreamRestartDetection bool
|
EnableRTPStreamRestartDetection bool
|
||||||
UpdateTrackInfoByVideoSizeChange bool
|
UpdateTrackInfoByVideoSizeChange bool
|
||||||
|
ForceBackupCodecPolicySimulcast bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMediaTrack(params MediaTrackParams, ti *livekit.TrackInfo) *MediaTrack {
|
func NewMediaTrack(params MediaTrackParams, ti *livekit.TrackInfo) *MediaTrack {
|
||||||
@@ -105,6 +106,10 @@ func NewMediaTrack(params MediaTrackParams, ti *livekit.TrackInfo) *MediaTrack {
|
|||||||
backupCodecPolicy: ti.BackupCodecPolicy,
|
backupCodecPolicy: ti.BackupCodecPolicy,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if t.params.ForceBackupCodecPolicySimulcast {
|
||||||
|
t.backupCodecPolicy = livekit.BackupCodecPolicy_SIMULCAST
|
||||||
|
}
|
||||||
|
|
||||||
if t.backupCodecPolicy != livekit.BackupCodecPolicy_SIMULCAST && len(ti.Codecs) > 1 {
|
if t.backupCodecPolicy != livekit.BackupCodecPolicy_SIMULCAST && len(ti.Codecs) > 1 {
|
||||||
t.regressionTargetCodec = mime.NormalizeMimeType(ti.Codecs[1].MimeType)
|
t.regressionTargetCodec = mime.NormalizeMimeType(ti.Codecs[1].MimeType)
|
||||||
t.params.Logger.Debugw("track enabled codec regression", "regressionCodec", t.regressionTargetCodec)
|
t.params.Logger.Debugw("track enabled codec regression", "regressionCodec", t.regressionTargetCodec)
|
||||||
|
|||||||
@@ -222,6 +222,7 @@ type ParticipantParams struct {
|
|||||||
UseSinglePeerConnection bool
|
UseSinglePeerConnection bool
|
||||||
EnableDataTracks bool
|
EnableDataTracks bool
|
||||||
EnableRTPStreamRestartDetection bool
|
EnableRTPStreamRestartDetection bool
|
||||||
|
ForceBackupCodecPolicySimulcast bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type ParticipantImpl struct {
|
type ParticipantImpl struct {
|
||||||
@@ -3287,6 +3288,7 @@ func (p *ParticipantImpl) addMediaTrack(signalCid string, ti *livekit.TrackInfo)
|
|||||||
PreferVideoSizeFromMedia: p.params.PreferVideoSizeFromMedia,
|
PreferVideoSizeFromMedia: p.params.PreferVideoSizeFromMedia,
|
||||||
EnableRTPStreamRestartDetection: p.params.EnableRTPStreamRestartDetection,
|
EnableRTPStreamRestartDetection: p.params.EnableRTPStreamRestartDetection,
|
||||||
UpdateTrackInfoByVideoSizeChange: p.params.UseOneShotSignallingMode,
|
UpdateTrackInfoByVideoSizeChange: p.params.UseOneShotSignallingMode,
|
||||||
|
ForceBackupCodecPolicySimulcast: p.params.ForceBackupCodecPolicySimulcast,
|
||||||
}, ti)
|
}, ti)
|
||||||
|
|
||||||
mt.OnSubscribedMaxQualityChange(p.onSubscribedMaxQualityChange)
|
mt.OnSubscribedMaxQualityChange(p.onSubscribedMaxQualityChange)
|
||||||
|
|||||||
Reference in New Issue
Block a user