From b65f2d964ee64c0cfdacd049f36c4aa6b8bcc9db Mon Sep 17 00:00:00 2001 From: Jonathan Lennox Date: Tue, 20 Feb 2024 15:51:28 -0500 Subject: [PATCH] More improvements to Vp9 rewrite debugging. --- .../vp9/Vp9AdaptiveSourceProjectionContext.kt | 19 +++++++++++++++++-- .../videobridge/cc/vp9/Vp9FrameProjection.kt | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/jvb/src/main/kotlin/org/jitsi/videobridge/cc/vp9/Vp9AdaptiveSourceProjectionContext.kt b/jvb/src/main/kotlin/org/jitsi/videobridge/cc/vp9/Vp9AdaptiveSourceProjectionContext.kt index 1417f82c34..e5b39c9232 100644 --- a/jvb/src/main/kotlin/org/jitsi/videobridge/cc/vp9/Vp9AdaptiveSourceProjectionContext.kt +++ b/jvb/src/main/kotlin/org/jitsi/videobridge/cc/vp9/Vp9AdaptiveSourceProjectionContext.kt @@ -131,7 +131,21 @@ class Vp9AdaptiveSourceProjectionContext( } } - val accept = frame.isAccepted && frame.projection?.accept(packet) == true + val accept = frame.isAccepted && + if (frame.projection?.accept(packet) == true) { + true + } else { + if (frame.projection != null && frame.projection?.closedSeq != -1) { + logger.debug( + "Not accepting $packet: frame projection is closed at ${frame.projection?.closedSeq}" + ) + } else if (frame.projection == null) { + logger.warn("Not accepting $packet: frame has no projection, even though QF accepted it") + } else { + logger.warn("Not accepting $packet, even though frame projection is not closed") + } + false + } if (timeSeriesLogger.isTraceEnabled) { val pt = diagnosticContext.makeTimeSeriesPoint("rtp_vp9") @@ -139,6 +153,7 @@ class Vp9AdaptiveSourceProjectionContext( .addField("timestamp", packet.timestamp) .addField("seq", packet.sequenceNumber) .addField("pictureId", packet.pictureId) + .addField("pictureIdIndex", frame.index) .addField("encoding", incomingEncoding) .addField("spatialLayer", packet.spatialLayerIndex) .addField("temporalLayer", packet.temporalLayerIndex) @@ -252,7 +267,7 @@ class Vp9AdaptiveSourceProjectionContext( } /** - * Create an projection for the first frame after an encoding switch. + * Create a projection for the first frame after an encoding switch. */ private fun createEncodingSwitchProjection( frame: Vp9Frame, diff --git a/jvb/src/main/kotlin/org/jitsi/videobridge/cc/vp9/Vp9FrameProjection.kt b/jvb/src/main/kotlin/org/jitsi/videobridge/cc/vp9/Vp9FrameProjection.kt index 87598ee961..f9d08fb49f 100644 --- a/jvb/src/main/kotlin/org/jitsi/videobridge/cc/vp9/Vp9FrameProjection.kt +++ b/jvb/src/main/kotlin/org/jitsi/videobridge/cc/vp9/Vp9FrameProjection.kt @@ -89,7 +89,8 @@ internal constructor( * -1 if this projection is still "open" for new, later packets. * Projections can be closed when we switch away from their encodings. */ - private var closedSeq = -1 + var closedSeq = -1 + private set /** * Ctor.