Skip to content

Commit

Permalink
Pass the appropriate log context to the adaptive source projection co…
Browse files Browse the repository at this point in the history
…ntexts.

This will then include the source epId and target ssrc.
  • Loading branch information
JonathanLennox committed Feb 14, 2024
1 parent a015be9 commit ab43a8b
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ public class AdaptiveSourceProjection
* and its instances for logging output.
*/
private final Logger logger;
/**
* The parent logger, so that we can pass it to the next created context
* TODO(brian): maybe we should allow a child logger to retrieve its
* parent?
*/
private final Logger parentLogger;

/**
* The main SSRC of the source (if simulcast is used, this is the SSRC
Expand Down Expand Up @@ -110,7 +104,6 @@ public AdaptiveSourceProjection(
{
targetSsrc = source.getPrimarySSRC();
this.diagnosticContext = diagnosticContext;
this.parentLogger = parentLogger;
this.logger = parentLogger.createChildLogger(AdaptiveSourceProjection.class.getName(),
Map.of("targetSsrc", Long.toString(targetSsrc),
"srcEpId", Objects.toString(source.getOwner(), "")));
Expand Down Expand Up @@ -218,7 +211,7 @@ private AdaptiveSourceProjectionContext getContext(@NotNull VideoRtpPacket rtpPa
(context == null ? "creating new" : "changing to") +
" VP8 context for source packet ssrc " + rtpPacket.getSsrc());
context = new VP8AdaptiveSourceProjectionContext(
diagnosticContext, rtpState, parentLogger);
diagnosticContext, rtpState, logger);
}
else if (!projectable
&& (!(context instanceof GenericAdaptiveSourceProjectionContext) ||
Expand All @@ -236,7 +229,7 @@ else if (!projectable
", ssrc " + rtpPacket.getSsrc() +
", hasTL=" + hasTemporalLayer + ", hasPID=" + hasPictureId + ")";
});
context = new GenericAdaptiveSourceProjectionContext(payloadType, rtpState, parentLogger);
context = new GenericAdaptiveSourceProjectionContext(payloadType, rtpState, logger);
}

// no context switch
Expand All @@ -252,7 +245,7 @@ else if (rtpPacket instanceof Vp9Packet)
(context == null ? "creating new" : "changing to") +
" VP9 context for source packet ssrc " + rtpPacket.getSsrc());
context = new Vp9AdaptiveSourceProjectionContext(
diagnosticContext, rtpState, parentLogger);
diagnosticContext, rtpState, logger);
}

return context;
Expand All @@ -267,7 +260,7 @@ else if (rtpPacket instanceof Av1DDPacket)
(context == null ? "creating new" : "changing to") +
" AV1 DD context for source packet ssrc " + rtpPacket.getSsrc());
context = new Av1DDAdaptiveSourceProjectionContext(
diagnosticContext, rtpState, parentLogger);
diagnosticContext, rtpState, logger);
}

return context;
Expand All @@ -281,7 +274,7 @@ else if (rtpPacket instanceof Av1DDPacket)
logger.debug(() -> "adaptive source projection " +
(context == null ? "creating new" : "changing to") +
" generic context for payload type " + rtpPacket.getPayloadType());
context = new GenericAdaptiveSourceProjectionContext(payloadType, rtpState, parentLogger);
context = new GenericAdaptiveSourceProjectionContext(payloadType, rtpState, logger);
}
return context;
}
Expand Down

0 comments on commit ab43a8b

Please sign in to comment.