Logging cleanup (#843)

* Logging cleanup

Changes log levels to better match significance

* fix lock
This commit is contained in:
David Zhao
2022-07-21 00:39:49 -07:00
committed by GitHub
parent f2e1e67e58
commit 53f51c8cb0
17 changed files with 45 additions and 55 deletions
+1 -1
View File
@@ -208,8 +208,8 @@ func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track *webrtc.Tra
} }
} }
t.params.Logger.Debugw("primary codec published, set potential codecs", "potential", potentialCodecs)
if len(potentialCodecs) > 0 { if len(potentialCodecs) > 0 {
t.params.Logger.Debugw("primary codec published, set potential codecs", "potential", potentialCodecs)
t.MediaTrackReceiver.SetPotentialCodecs(potentialCodecs, parameters.HeaderExtensions) t.MediaTrackReceiver.SetPotentialCodecs(potentialCodecs, parameters.HeaderExtensions)
} }
t.params.Telemetry.TrackPublished( t.params.Telemetry.TrackPublished(
+1 -1
View File
@@ -466,7 +466,7 @@ func (t *MediaTrackReceiver) removeSubscriber(subscriberID livekit.ParticipantID
} }
func (t *MediaTrackReceiver) RemoveAllSubscribers(willBeResumed bool) { func (t *MediaTrackReceiver) RemoveAllSubscribers(willBeResumed bool) {
t.params.Logger.Debugw("removing all subscribers") t.params.Logger.Infow("removing all subscribers")
for _, subscriberID := range t.MediaTrackSubscriptions.GetAllSubscribers() { for _, subscriberID := range t.MediaTrackSubscriptions.GetAllSubscribers() {
t.RemoveSubscriber(subscriberID, willBeResumed) t.RemoveSubscriber(subscriberID, willBeResumed)
} }
+2 -2
View File
@@ -754,7 +754,7 @@ func (t *MediaTrackSubscriptions) downTrackClosed(
if sender == nil { if sender == nil {
return return
} }
sub.GetLogger().Infow("removing peerconnection track", sub.GetLogger().Debugw("removing PeerConnection track",
"publisher", subTrack.PublisherIdentity(), "publisher", subTrack.PublisherIdentity(),
"publisherID", subTrack.PublisherID(), "publisherID", subTrack.PublisherID(),
"kind", t.params.MediaTrack.Kind(), "kind", t.params.MediaTrack.Kind(),
@@ -767,7 +767,7 @@ func (t *MediaTrackSubscriptions) downTrackClosed(
if _, ok := err.(*rtcerr.InvalidStateError); !ok { if _, ok := err.(*rtcerr.InvalidStateError); !ok {
// most of these are safe to ignore, since the track state might have already // most of these are safe to ignore, since the track state might have already
// been set to Inactive // been set to Inactive
sub.GetLogger().Infow("could not remove remoteTrack from forwarder", sub.GetLogger().Debugw("could not remove remoteTrack from forwarder",
"error", err, "error", err,
"publisher", subTrack.PublisherIdentity(), "publisher", subTrack.PublisherIdentity(),
"publisherID", subTrack.PublisherID(), "publisherID", subTrack.PublisherID(),
+7 -15
View File
@@ -714,7 +714,7 @@ func (p *ParticipantImpl) Close(sendLeave bool, reason types.ParticipantCloseRea
return nil return nil
} }
p.params.Logger.Infow("closing participant", "sendLeave", sendLeave, "reason", reason) p.params.Logger.Infow("closing participant", "sendLeave", sendLeave, "reason", reason.String())
// send leave message // send leave message
if sendLeave { if sendLeave {
_ = p.writeMessage(&livekit.SignalResponse{ _ = p.writeMessage(&livekit.SignalResponse{
@@ -884,15 +884,6 @@ func (p *ParticipantImpl) GetConnectionQuality() *livekit.ConnectionQualityInfo
} }
rating := connectionquality.Score2Rating(avgScore) rating := connectionquality.Score2Rating(avgScore)
if rating != livekit.ConnectionQuality_EXCELLENT {
p.params.Logger.Infow("connection quality not optimal",
"totalScore", totalScore,
"numTracks", numTracks,
"rating", rating,
"publisherScores", publisherScores,
"subscriberScores", subscriberScores,
)
}
return &livekit.ConnectionQualityInfo{ return &livekit.ConnectionQualityInfo{
ParticipantSid: string(p.ID()), ParticipantSid: string(p.ID()),
@@ -1314,7 +1305,7 @@ func (p *ParticipantImpl) handlePrimaryStateChange(state webrtc.PeerConnectionSt
} }
if primaryPC.ConnectionState() != webrtc.PeerConnectionStateConnected { if primaryPC.ConnectionState() != webrtc.PeerConnectionStateConnected {
p.params.Logger.Infow("closing disconnected participant") p.params.Logger.Infow("closing disconnected participant")
p.Close(true, types.ParticipantCloseReasonPeerConnectionDisconnected) _ = p.Close(true, types.ParticipantCloseReasonPeerConnectionDisconnected)
} }
}) })
p.lock.Unlock() p.lock.Unlock()
@@ -1580,7 +1571,7 @@ func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *l
if req.Sid != "" { if req.Sid != "" {
track := p.GetPublishedTrack(livekit.TrackID(req.Sid)) track := p.GetPublishedTrack(livekit.TrackID(req.Sid))
if track == nil { if track == nil {
p.params.Logger.Infow("track not found for new codec publish", "trackID", req.Sid) p.params.Logger.Infow("could not find existing track for multi-codec simulcast", "trackID", req.Sid)
return nil return nil
} }
@@ -2098,7 +2089,7 @@ func (p *ParticipantImpl) setDowntracksConnected() {
func (p *ParticipantImpl) CacheDownTrack(trackID livekit.TrackID, rtpTransceiver *webrtc.RTPTransceiver, forwarderState sfu.ForwarderState) { func (p *ParticipantImpl) CacheDownTrack(trackID livekit.TrackID, rtpTransceiver *webrtc.RTPTransceiver, forwarderState sfu.ForwarderState) {
p.lock.Lock() p.lock.Lock()
if existing := p.cachedDownTracks[trackID]; existing != nil && existing.transceiver != rtpTransceiver { if existing := p.cachedDownTracks[trackID]; existing != nil && existing.transceiver != rtpTransceiver {
p.params.Logger.Infow("cached transceiver change", "trackID", trackID) p.params.Logger.Infow("cached transceiver changed", "trackID", trackID)
} }
p.cachedDownTracks[trackID] = &downTrackState{transceiver: rtpTransceiver, forwarder: forwarderState} p.cachedDownTracks[trackID] = &downTrackState{transceiver: rtpTransceiver, forwarder: forwarderState}
p.lock.Unlock() p.lock.Unlock()
@@ -2128,7 +2119,7 @@ func (p *ParticipantImpl) GetCachedDownTrack(trackID livekit.TrackID) (*webrtc.R
} }
func (p *ParticipantImpl) handleNegotiationFailed() { func (p *ParticipantImpl) handleNegotiationFailed() {
p.params.Logger.Infow("negotiation failed, notify client do full reconnect") p.params.Logger.Infow("negotiation failed, starting full reconnect")
_ = p.writeMessage(&livekit.SignalResponse{ _ = p.writeMessage(&livekit.SignalResponse{
Message: &livekit.SignalResponse_Leave{ Message: &livekit.SignalResponse_Leave{
Leave: &livekit.LeaveRequest{ Leave: &livekit.LeaveRequest{
@@ -2202,7 +2193,8 @@ func (p *ParticipantImpl) ProcessSubscriptionRequestsQueue(trackID livekit.Track
} }
default: default:
p.params.Logger.Warnw("unknown request type", nil) p.params.Logger.Warnw("unknown request type", nil,
"requestType", request.requestType)
// let the queue move forward // let the queue move forward
p.ClearInProgressAndProcessSubscriptionRequestsQueue(trackID) p.ClearInProgressAndProcessSubscriptionRequestsQueue(trackID)
+2 -2
View File
@@ -32,7 +32,7 @@ func HandleParticipantSignal(room types.Room, participant types.LocalParticipant
return nil return nil
} }
if err := participant.AddICECandidate(candidateInit, msg.Trickle.Target); err != nil { if err := participant.AddICECandidate(candidateInit, msg.Trickle.Target); err != nil {
pLogger.Warnw("could not handle trickle", err) pLogger.Warnw("could not add ICE candidate", err)
} }
case *livekit.SignalRequest_Mute: case *livekit.SignalRequest_Mute:
participant.SetTrackMuted(livekit.TrackID(msg.Mute.Sid), msg.Mute.Muted, false) participant.SetTrackMuted(livekit.TrackID(msg.Mute.Sid), msg.Mute.Muted, false)
@@ -65,7 +65,7 @@ func HandleParticipantSignal(room types.Room, participant types.LocalParticipant
continue continue
} }
pLogger.Debugw("updated subscribed track settings", "trackID", sid, "settings", msg.TrackSetting) pLogger.Infow("updated subscribed track settings", "trackID", sid, "settings", msg.TrackSetting)
} }
case *livekit.SignalRequest_UpdateLayers: case *livekit.SignalRequest_UpdateLayers:
err := room.UpdateVideoLayers(participant, msg.UpdateLayers) err := room.UpdateVideoLayers(participant, msg.UpdateLayers)
+2 -3
View File
@@ -374,8 +374,8 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error {
// restart without current remote description, sent current local description again to try recover // restart without current remote description, sent current local description again to try recover
offer := t.pc.LocalDescription() offer := t.pc.LocalDescription()
if offer == nil { if offer == nil {
// it should not happend, check for safety // it should not happen, log just in case
t.params.Logger.Infow("ice restart without local offer") t.params.Logger.Warnw("ice restart without local offer", nil)
return ErrIceRestartWithoutLocalSDP return ErrIceRestartWithoutLocalSDP
} else { } else {
t.negotiationState = negotiationRetry t.negotiationState = negotiationRetry
@@ -449,7 +449,6 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error {
failed := t.negotiationState != negotiationStateNone failed := t.negotiationState != negotiationStateNone
t.lock.RUnlock() t.lock.RUnlock()
if t.negotiateCounter.Load() == negotiateVersion && failed { if t.negotiateCounter.Load() == negotiateVersion && failed {
t.params.Logger.Infow("negotiation timeout")
if t.onNegotiationFailed != nil { if t.onNegotiationFailed != nil {
t.onNegotiationFailed() t.onNegotiationFailed()
} }
+1 -1
View File
@@ -276,7 +276,7 @@ func (s *EgressService) updateWorker() {
if res.Error != "" { if res.Error != "" {
logger.Errorw("egress failed", errors.New(res.Error), "egressID", res.EgressId) logger.Errorw("egress failed", errors.New(res.Error), "egressID", res.EgressId)
} else { } else {
logger.Debugw("egress ended", "egressID", res.EgressId) logger.Infow("egress ended", "egressID", res.EgressId)
} }
s.telemetry.EgressEnded(context.Background(), res) s.telemetry.EgressEnded(context.Background(), res)
+7 -7
View File
@@ -200,7 +200,7 @@ func (r *RoomManager) StartSession(
// When reconnecting, it means WS has interrupted by underlying peer connection is still ok // When reconnecting, it means WS has interrupted by underlying peer connection is still ok
// in this mode, we'll keep the participant SID, and just swap the sink for the underlying connection // in this mode, we'll keep the participant SID, and just swap the sink for the underlying connection
if pi.Reconnect { if pi.Reconnect {
logger.Debugw("resuming RTC session", logger.Infow("resuming RTC session",
"room", roomName, "room", roomName,
"nodeID", r.currentNode.Id, "nodeID", r.currentNode.Id,
"participant", pi.Identity, "participant", pi.Identity,
@@ -225,7 +225,7 @@ func (r *RoomManager) StartSession(
return errors.New("could not restart participant") return errors.New("could not restart participant")
} }
logger.Debugw("starting RTC session", logger.Infow("starting RTC session",
"room", roomName, "room", roomName,
"nodeID", r.currentNode.Id, "nodeID", r.currentNode.Id,
"participant", pi.Identity, "participant", pi.Identity,
@@ -351,22 +351,22 @@ func (r *RoomManager) getOrCreateRoom(ctx context.Context, roomName livekit.Room
newRoom.OnClose(func() { newRoom.OnClose(func() {
r.telemetry.RoomEnded(ctx, newRoom.ToProto()) r.telemetry.RoomEnded(ctx, newRoom.ToProto())
if err := r.DeleteRoom(ctx, roomName); err != nil { if err := r.DeleteRoom(ctx, roomName); err != nil {
logger.Errorw("could not delete room", err) newRoom.Logger.Errorw("could not delete room", err)
} }
logger.Infow("room closed") newRoom.Logger.Infow("room closed")
}) })
newRoom.OnMetadataUpdate(func(metadata string) { newRoom.OnMetadataUpdate(func(metadata string) {
if err := r.roomStore.StoreRoom(ctx, newRoom.ToProto()); err != nil { if err := r.roomStore.StoreRoom(ctx, newRoom.ToProto()); err != nil {
logger.Errorw("could not handle metadata update", err) newRoom.Logger.Errorw("could not handle metadata update", err)
} }
}) })
newRoom.OnParticipantChanged(func(p types.LocalParticipant) { newRoom.OnParticipantChanged(func(p types.LocalParticipant) {
if p.State() != livekit.ParticipantInfo_DISCONNECTED { if p.State() != livekit.ParticipantInfo_DISCONNECTED {
if err := r.roomStore.StoreParticipant(ctx, roomName, p.ToProto()); err != nil { if err := r.roomStore.StoreParticipant(ctx, roomName, p.ToProto()); err != nil {
logger.Errorw("could not handle participant change", err) newRoom.Logger.Errorw("could not handle participant change", err)
} }
} }
}) })
@@ -388,7 +388,7 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.LocalPa
// give time for the participant to be closed with a proper reason. // give time for the participant to be closed with a proper reason.
// if participant is closed from here, we would be obscuring the real reason the participant is closed. // if participant is closed from here, we would be obscuring the real reason the participant is closed.
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
logger.Debugw("RTC session finishing", logger.Infow("RTC session finishing",
"participant", participant.Identity(), "participant", participant.Identity(),
"pID", participant.ID(), "pID", participant.ID(),
"room", room.Name(), "room", room.Name(),
+4 -11
View File
@@ -19,7 +19,6 @@ import (
"github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/routing"
"github.com/livekit/livekit-server/pkg/routing/selector" "github.com/livekit/livekit-server/pkg/routing/selector"
"github.com/livekit/livekit-server/pkg/rtc" "github.com/livekit/livekit-server/pkg/rtc"
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/livekit-server/pkg/telemetry/prometheus" "github.com/livekit/livekit-server/pkg/telemetry/prometheus"
) )
@@ -182,7 +181,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
} }
pLogger := rtc.LoggerWithParticipant( pLogger := rtc.LoggerWithParticipant(
rtc.LoggerWithRoom(logger.GetDefaultLogger(), roomName, ""), rtc.LoggerWithRoom(logger.GetDefaultLogger(), roomName, livekit.RoomID(rm.Sid)),
pi.Identity, pi.Identity,
"", "",
false, false,
@@ -190,7 +189,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
done := make(chan struct{}) done := make(chan struct{})
// function exits when websocket terminates, it'll close the event reading off of response sink as well // function exits when websocket terminates, it'll close the event reading off of response sink as well
defer func() { defer func() {
pLogger.Infow("server closing WS connection", "connID", connId) pLogger.Infow("finishing WS connection", "connID", connId)
resSource.Close() resSource.Close()
reqSink.Close() reqSink.Close()
close(done) close(done)
@@ -205,15 +204,9 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return return
} }
sigConn := NewWSSignalConnection(conn) sigConn := NewWSSignalConnection(conn)
if types.ProtocolVersion(pi.Client.Protocol).SupportsProtobuf() {
sigConn.useJSON = false
}
prometheus.ServiceOperationCounter.WithLabelValues("signal_ws", "success", "").Add(1) prometheus.ServiceOperationCounter.WithLabelValues("signal_ws", "success", "").Add(1)
pLogger.Infow("new client WS connected", pLogger.Infow("new client WS connected", "connID", connId)
"connID", connId,
"roomID", rm.Sid,
)
// handle responses // handle responses
go func() { go func() {
@@ -256,7 +249,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if err != nil { if err != nil {
if err == io.EOF || strings.HasSuffix(err.Error(), "use of closed network connection") || if err == io.EOF || strings.HasSuffix(err.Error(), "use of closed network connection") ||
websocket.IsCloseError(err, websocket.CloseAbnormalClosure, websocket.CloseGoingAway, websocket.CloseNormalClosure, websocket.CloseNoStatusReceived) { websocket.IsCloseError(err, websocket.CloseAbnormalClosure, websocket.CloseGoingAway, websocket.CloseNormalClosure, websocket.CloseNoStatusReceived) {
pLogger.Infow("exit ws read loop for closed connection", "connID", connId) pLogger.Debugw("exit ws read loop for closed connection", "connID", connId)
return return
} else { } else {
pLogger.Errorw("error reading from websocket", err) pLogger.Errorw("error reading from websocket", err)
+5 -2
View File
@@ -122,8 +122,10 @@ func createRedisClient(conf *config.Config) (*redis.Client, error) {
} }
} }
values := make([]interface{}, 0)
values = append(values, "sentinel", conf.UseSentinel())
if conf.UseSentinel() { if conf.UseSentinel() {
logger.Infow("using multi-node routing via redis", "sentinel", true, "addr", conf.Redis.SentinelAddresses, "masterName", conf.Redis.MasterName) values = append(values, "addr", conf.Redis.SentinelAddresses, "masterName", conf.Redis.MasterName)
rcOptions := &redis.FailoverOptions{ rcOptions := &redis.FailoverOptions{
SentinelAddrs: conf.Redis.SentinelAddresses, SentinelAddrs: conf.Redis.SentinelAddresses,
SentinelUsername: conf.Redis.SentinelUsername, SentinelUsername: conf.Redis.SentinelUsername,
@@ -136,7 +138,7 @@ func createRedisClient(conf *config.Config) (*redis.Client, error) {
} }
rc = redis.NewFailoverClient(rcOptions) rc = redis.NewFailoverClient(rcOptions)
} else { } else {
logger.Infow("using multi-node routing via redis", "sentinel", false, "addr", conf.Redis.Address) values = append(values, "addr", conf.Redis.Address)
rcOptions := &redis.Options{ rcOptions := &redis.Options{
Addr: conf.Redis.Address, Addr: conf.Redis.Address,
Username: conf.Redis.Username, Username: conf.Redis.Username,
@@ -146,6 +148,7 @@ func createRedisClient(conf *config.Config) (*redis.Client, error) {
} }
rc = redis.NewClient(rcOptions) rc = redis.NewClient(rcOptions)
} }
logger.Infow("using multi-node routing via redis", values...)
if err := rc.Ping(context.Background()).Err(); err != nil { if err := rc.Ping(context.Background()).Err(); err != nil {
err = errors.Wrap(err, "unable to connect to redis") err = errors.Wrap(err, "unable to connect to redis")
+5 -2
View File
@@ -148,8 +148,10 @@ func createRedisClient(conf *config.Config) (*redis.Client, error) {
} }
} }
values := make([]interface{}, 0)
values = append(values, "sentinel", conf.UseSentinel())
if conf.UseSentinel() { if conf.UseSentinel() {
logger.Infow("using multi-node routing via redis", "sentinel", true, "addr", conf.Redis.SentinelAddresses, "masterName", conf.Redis.MasterName) values = append(values, "addr", conf.Redis.SentinelAddresses, "masterName", conf.Redis.MasterName)
rcOptions := &redis.FailoverOptions{ rcOptions := &redis.FailoverOptions{
SentinelAddrs: conf.Redis.SentinelAddresses, SentinelAddrs: conf.Redis.SentinelAddresses,
SentinelUsername: conf.Redis.SentinelUsername, SentinelUsername: conf.Redis.SentinelUsername,
@@ -162,7 +164,7 @@ func createRedisClient(conf *config.Config) (*redis.Client, error) {
} }
rc = redis.NewFailoverClient(rcOptions) rc = redis.NewFailoverClient(rcOptions)
} else { } else {
logger.Infow("using multi-node routing via redis", "sentinel", false, "addr", conf.Redis.Address) values = append(values, "addr", conf.Redis.Address)
rcOptions := &redis.Options{ rcOptions := &redis.Options{
Addr: conf.Redis.Address, Addr: conf.Redis.Address,
Username: conf.Redis.Username, Username: conf.Redis.Username,
@@ -172,6 +174,7 @@ func createRedisClient(conf *config.Config) (*redis.Client, error) {
} }
rc = redis.NewClient(rcOptions) rc = redis.NewClient(rcOptions)
} }
logger.Infow("using multi-node routing via redis", values...)
if err := rc.Ping(context.Background()).Err(); err != nil { if err := rc.Ping(context.Background()).Err(); err != nil {
err = errors.Wrap(err, "unable to connect to redis") err = errors.Wrap(err, "unable to connect to redis")
+1 -1
View File
@@ -29,7 +29,7 @@ func NewWSSignalConnection(conn types.WebsocketClient) *WSSignalConnection {
wsc := &WSSignalConnection{ wsc := &WSSignalConnection{
conn: conn, conn: conn,
mu: sync.Mutex{}, mu: sync.Mutex{},
useJSON: true, useJSON: false,
} }
go wsc.pingWorker() go wsc.pingWorker()
return wsc return wsc
+1 -1
View File
@@ -288,7 +288,7 @@ func (b *Buffer) Close() error {
if b.rtpStats != nil { if b.rtpStats != nil {
b.rtpStats.Stop() b.rtpStats.Stop()
b.logger.Infow("rtp stats", "stats", b.rtpStats.ToString()) b.logger.Infow("rtp stats", "direction", "upstream", "stats", b.rtpStats.ToString())
} }
if b.onClose != nil { if b.onClose != nil {
+1 -1
View File
@@ -19,7 +19,7 @@ type DependencyDescriptorParser struct {
} }
func NewDependencyDescriptorParser(ddExt uint8, logger logger.Logger, onMaxLayerChanged func(int32, int32)) *DependencyDescriptorParser { func NewDependencyDescriptorParser(ddExt uint8, logger logger.Logger, onMaxLayerChanged func(int32, int32)) *DependencyDescriptorParser {
logger.Infow("creating dependency descriptor parse", "ddExt", ddExt) logger.Infow("creating dependency descriptor parser", "ddExt", ddExt)
return &DependencyDescriptorParser{ return &DependencyDescriptorParser{
ddExt: ddExt, ddExt: ddExt,
logger: logger, logger: logger,
+1 -1
View File
@@ -165,7 +165,7 @@ func (cs *ConnectionStats) updateScore(streams map[uint32]*buffer.StreamStatsWit
} }
if cs.score < 4.0 { if cs.score < 4.0 {
cs.params.Logger.Infow("low score", "score", cs.score, "params", params) cs.params.Logger.Debugw("low connection quality score", "score", cs.score, "params", params)
} }
return cs.score return cs.score
+3 -3
View File
@@ -308,7 +308,7 @@ func (d *DownTrack) Bind(t webrtc.TrackLocalContext) (webrtc.RTPCodecParameters,
d.connectionStats.SetTrackSource(d.receiver.TrackSource()) d.connectionStats.SetTrackSource(d.receiver.TrackSource())
d.connectionStats.Start() d.connectionStats.Start()
d.logger.Debugw("bound") d.logger.Debugw("downtrack bound")
return codec, nil return codec, nil
} }
@@ -685,7 +685,7 @@ func (d *DownTrack) CloseWithFlush(flush bool) {
d.bindLock.Unlock() d.bindLock.Unlock()
d.connectionStats.Close() d.connectionStats.Close()
d.rtpStats.Stop() d.rtpStats.Stop()
d.logger.Infow("rtp stats", "stats", d.rtpStats.ToString()) d.logger.Infow("rtp stats", "direction", "downstream", "stats", d.rtpStats.ToString())
if d.onMaxLayerChanged != nil && d.kind == webrtc.RTPCodecTypeVideo { if d.onMaxLayerChanged != nil && d.kind == webrtc.RTPCodecTypeVideo {
d.onMaxLayerChanged(d, InvalidLayerSpatial) d.onMaxLayerChanged(d, InvalidLayerSpatial)
@@ -1347,7 +1347,7 @@ func (d *DownTrack) getTranslatedRTPHeader(extPkt *buffer.ExtPacket, tp *Transla
if d.dependencyDescriptorID != 0 && tp.ddExtension != nil { if d.dependencyDescriptorID != 0 && tp.ddExtension != nil {
bytes, err := tp.ddExtension.Marshal() bytes, err := tp.ddExtension.Marshal()
if err != nil { if err != nil {
d.logger.Infow("marshalling dependency descriptor extension err", "err", err) d.logger.Warnw("error marshalling dependency descriptor extension", err)
} else { } else {
extension = append(extension, extensionData{ extension = append(extension, extensionData{
id: uint8(d.dependencyDescriptorID), id: uint8(d.dependencyDescriptorID),
+1 -1
View File
@@ -526,7 +526,7 @@ func (f *Forwarder) AllocateOptimal(brs Bitrates) VideoAllocation {
if bandwidthRequested == 0 && f.maxLayers.IsValid() { if bandwidthRequested == 0 && f.maxLayers.IsValid() {
// if we cannot allocate anything below max layer, // if we cannot allocate anything below max layer,
// look for a layer above. It is okay to overshoot // look for a layer above. It is okay to overshoot
// in optimal allocation (i. e. no bandwidth restricstions). // in optimal allocation (i.e. no bandwidth restrictions).
// It is possible that clients send only a higher layer. // It is possible that clients send only a higher layer.
// To accommodate cases like that, try finding a layer // To accommodate cases like that, try finding a layer
// above the requested maximum to ensure streaming // above the requested maximum to ensure streaming