Skip to content

Commit

Permalink
Improve debug output of VP9 and AV1 quality filters.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanLennox committed Feb 12, 2024
1 parent a015be9 commit 17f60d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ internal class Av1DDQualityFilter(
internal fun addDiagnosticContext(pt: DiagnosticContext.TimeSeriesPoint) {
pt.addField("qf.currentIndex", Av1DDRtpLayerDesc.indexString(currentIndex))
.addField("qf.internalTargetEncoding", internalTargetEncoding)
.addField("qf.internalTargetDt", internalTargetDt)
.addField("qf.needsKeyframe", needsKeyframe)
.addField(
"qf.mostRecentKeyframeGroupArrivalTimeMs",
Expand All @@ -439,6 +440,7 @@ internal class Av1DDQualityFilter(
mostRecentKeyframeGroupArrivalTime?.toEpochMilli() ?: -1
debugState["needsKeyframe"] = needsKeyframe
debugState["internalTargetEncoding"] = internalTargetEncoding
debugState["internalTargetDt"] = internalTargetDt
debugState["currentIndex"] = Av1DDRtpLayerDesc.indexString(currentIndex)
return debugState
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal class Vp9QualityFilter(parentLogger: Logger) {
/**
* Which spatial layers are currently being forwarded.
*/
private val layers: Array<Boolean> = Array(MAX_VP9_LAYERS) { false }
private val layers = BooleanArray(MAX_VP9_LAYERS)

/**
* Determines whether to accept or drop a VP9 frame.
Expand Down Expand Up @@ -428,6 +428,7 @@ internal class Vp9QualityFilter(parentLogger: Logger) {
internal fun addDiagnosticContext(pt: DiagnosticContext.TimeSeriesPoint) {
pt.addField("qf.currentIndex", indexString(currentIndex))
.addField("qf.internalTargetEncoding", internalTargetEncoding)
.addField("qf.internalTargetSpatialId", internalTargetSpatialId)
.addField("qf.needsKeyframe", needsKeyframe)
.addField(
"qf.mostRecentKeyframeGroupArrivalTimeMs",
Expand All @@ -452,8 +453,10 @@ internal class Vp9QualityFilter(parentLogger: Logger) {
debugState["mostRecentKeyframeGroupArrivalTimeMs"] =
mostRecentKeyframeGroupArrivalTime?.toEpochMilli() ?: -1
debugState["needsKeyframe"] = needsKeyframe
debugState["internalTargetIndex"] = internalTargetEncoding
debugState["internalTargetEncoding"] = internalTargetEncoding
debugState["internalTargetSpatialId"] = internalTargetSpatialId
debugState["currentIndex"] = indexString(currentIndex)
debugState["layersForwarded"] = layers.map { toString().first() }.joinToString(separator = "")
return debugState
}

Expand Down

0 comments on commit 17f60d9

Please sign in to comment.