add packet trailer stripping support (#4361)

* bump protocol version to 17 to enable packet trailer stripping functionality
* check subscriber protocol version for trailer stripping
This commit is contained in:
David Chen
2026-03-23 13:33:42 -07:00
committed by GitHub
parent 0e3d765d03
commit a5333a86bb
10 changed files with 407 additions and 26 deletions
+14 -11
View File
@@ -129,18 +129,21 @@ func NewSubscribedTrack(params SubscribedTrackParams) (*SubscribedTrack, error)
if isEncrypted {
trailer = params.Subscriber.GetTrailer()
}
stripPacketTrailer := params.MediaTrack.HasPacketTrailer() &&
!params.Subscriber.ProtocolVersion().SupportsPacketTrailer()
downTrack, err := sfu.NewDownTrack(sfu.DownTrackParams{
Codecs: codecs,
IsEncrypted: isEncrypted,
Source: params.MediaTrack.Source(),
Receiver: params.WrappedReceiver,
BufferFactory: params.Subscriber.GetBufferFactory(),
SubID: params.Subscriber.ID(),
StreamID: streamID,
MaxTrack: maxTrack,
PlayoutDelayLimit: params.Subscriber.GetPlayoutDelayConfig(),
Pacer: params.Subscriber.GetPacer(),
Trailer: trailer,
Codecs: codecs,
IsEncrypted: isEncrypted,
Source: params.MediaTrack.Source(),
Receiver: params.WrappedReceiver,
BufferFactory: params.Subscriber.GetBufferFactory(),
SubID: params.Subscriber.ID(),
StreamID: streamID,
MaxTrack: maxTrack,
PlayoutDelayLimit: params.Subscriber.GetPlayoutDelayConfig(),
Pacer: params.Subscriber.GetPacer(),
Trailer: trailer,
StripPacketTrailer: stripPacketTrailer,
Logger: LoggerWithTrack(
params.Subscriber.GetLogger().WithComponent(sutils.ComponentSub),
params.MediaTrack.ID(),