Skip to content

Commit

Permalink
Add extra logs for VP8 forwarding
Browse files Browse the repository at this point in the history
Related to #989
  • Loading branch information
jmillan committed Feb 7, 2023
1 parent a19058d commit 76372f6
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
5 changes: 5 additions & 0 deletions worker/include/RTC/Codecs/VP8.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
41 changes: 41 additions & 0 deletions worker/src/RTC/Codecs/VP8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,44 @@ namespace RTC
MS_DUMP("</PayloadDescriptor>");
}

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();
Expand Down Expand Up @@ -361,6 +399,9 @@ namespace RTC
context->SetCurrentTemporalLayer(context->GetTargetTemporalLayer());
}

this->payloadDescriptor->DumpOneLine(
context->GetCurrentTemporalLayer(), context->GetTargetTemporalLayer());

// clang-format off
if (
this->payloadDescriptor->hasPictureId &&
Expand Down

0 comments on commit 76372f6

Please sign in to comment.