From 76372f6b09400aebea1f4570c7ffdd19685fb6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?= Date: Tue, 7 Feb 2023 17:51:02 +0100 Subject: [PATCH] Add extra logs for VP8 forwarding Related to #989 --- worker/include/RTC/Codecs/VP8.hpp | 5 ++++ worker/src/RTC/Codecs/VP8.cpp | 41 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/worker/include/RTC/Codecs/VP8.hpp b/worker/include/RTC/Codecs/VP8.hpp index f8fe037e1a..1cbebe6fc5 100644 --- a/worker/include/RTC/Codecs/VP8.hpp +++ b/worker/include/RTC/Codecs/VP8.hpp @@ -41,6 +41,7 @@ namespace RTC ~PayloadDescriptor() = default; void Dump() const override; + void DumpOneLine(uint16_t currentTemporalLayer, uint16_t targetTemporalLayer) const; // Rewrite the buffer with the given pictureId and tl0PictureIndex values. void Encode(uint8_t* data, uint16_t pictureId, uint8_t tl0PictureIndex) const; void Restore(uint8_t* data) const; @@ -113,6 +114,10 @@ namespace RTC { this->payloadDescriptor->Dump(); } + void DumpOneLine(uint16_t currentTemporalLayer, uint16_t targetTemporalLayer) const + { + this->payloadDescriptor->DumpOneLine(currentTemporalLayer, targetTemporalLayer); + } bool Process(RTC::Codecs::EncodingContext* encodingContext, uint8_t* data, bool& marker) override; void Restore(uint8_t* data) override; uint8_t GetSpatialLayer() const override diff --git a/worker/src/RTC/Codecs/VP8.cpp b/worker/src/RTC/Codecs/VP8.cpp index bab206bd04..7330dd66f2 100644 --- a/worker/src/RTC/Codecs/VP8.cpp +++ b/worker/src/RTC/Codecs/VP8.cpp @@ -188,6 +188,44 @@ namespace RTC MS_DUMP(""); } + void VP8::PayloadDescriptor::DumpOneLine( + uint16_t currentTemporalLayer, uint16_t targetTemporalLayer) const + { + MS_TRACE(); + + MS_DUMP( + "i:%" PRIu8 "|l:%" PRIu8 "|t:%" PRIu8 "|k:%" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 + ", %" PRIu8 ", %" PRIu16 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 + ", %s" + ", %s" + ", %s" + ", %s" + ", %s" + ", %s" + ", %" PRIu16 ", %" PRIu16, + this->i, + this->l, + this->t, + this->k, + this->extended, + this->nonReference, + this->start, + this->partitionIndex, + this->pictureId, + this->tl0PictureIndex, + this->tlIndex, + this->y, + this->keyIndex, + this->isKeyFrame ? "true" : "false", + this->hasPictureId ? "true" : "false", + this->hasOneBytePictureId ? "true" : "false", + this->hasTwoBytesPictureId ? "true" : "false", + this->hasTl0PictureIndex ? "true" : "false", + this->hasTlIndex ? "true" : "false", + currentTemporalLayer, + targetTemporalLayer); + } + void VP8::PayloadDescriptor::Encode(uint8_t* data, uint16_t pictureId, uint8_t tl0PictureIndex) const { MS_TRACE(); @@ -361,6 +399,9 @@ namespace RTC context->SetCurrentTemporalLayer(context->GetTargetTemporalLayer()); } + this->payloadDescriptor->DumpOneLine( + context->GetCurrentTemporalLayer(), context->GetTargetTemporalLayer()); + // clang-format off if ( this->payloadDescriptor->hasPictureId &&