提交 e3224ea5 authored 作者: José Luis Millán's avatar José Luis Millán

VP8: gracefully upgrade and downgrade temporal layers

上级 a3b00570
...@@ -89,6 +89,7 @@ namespace RTC ...@@ -89,6 +89,7 @@ namespace RTC
RTC::SeqManager<uint16_t> pictureIdManager; RTC::SeqManager<uint16_t> pictureIdManager;
RTC::SeqManager<uint8_t> tl0PictureIndexManager; RTC::SeqManager<uint8_t> tl0PictureIndexManager;
bool syncRequired{ false }; bool syncRequired{ false };
uint8_t currentTemporalLayer{ std::numeric_limits<uint8_t>::max() };
}; };
class PayloadDescriptorHandler : public RTC::Codecs::PayloadDescriptorHandler class PayloadDescriptorHandler : public RTC::Codecs::PayloadDescriptorHandler
......
...@@ -200,6 +200,27 @@ namespace RTC ...@@ -200,6 +200,27 @@ namespace RTC
return false; return false;
} }
else if (context->currentTemporalLayer != context->preferences.temporalLayer)
{
// Payload descriptor contains the target temporal layer.
if (this->payloadDescriptor->tlIndex == context->preferences.temporalLayer)
{
// Upgrade required.
if (context->currentTemporalLayer < this->payloadDescriptor->tlIndex)
{
// Drop current packet if sync flag is not set.
if (this->payloadDescriptor->y != 1u)
{
context->pictureIdManager.Drop(this->payloadDescriptor->pictureId);
context->tl0PictureIndexManager.Drop(this->payloadDescriptor->tl0PictureIndex);
return false;
}
}
context->currentTemporalLayer = this->payloadDescriptor->tlIndex;
}
}
} }
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论