Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNegro committed Jun 24, 2024
1 parent b445c03 commit cff3ed6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
2 changes: 2 additions & 0 deletions worker/include/RTC/RtpPacket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,12 @@ namespace RTC
{
uint8_t extenLen;
uint8_t* extenValue = GetExtension(this->playoutDelayExtensionId, extenLen);

if (extenLen != 3)
{
return false;
}

uint32_t v = Utils::Byte::Get3Bytes(extenValue, 0);
minDelay = v >> 12u;
maxDelay = v & 0xFFFu;
Expand Down
10 changes: 5 additions & 5 deletions worker/src/RTC/Consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ namespace RTC
this->rtpHeaderExtensionIds.videoOrientation = exten.id;
}

if (this->rtpHeaderExtensionIds.playoutDelay == 0u && exten.type == RTC::RtpHeaderExtensionUri::Type::PLAYOUT_DELAY)
{
this->rtpHeaderExtensionIds.playoutDelay = exten.id;
}

if (this->rtpHeaderExtensionIds.absSendTime == 0u && exten.type == RTC::RtpHeaderExtensionUri::Type::ABS_SEND_TIME)
{
this->rtpHeaderExtensionIds.absSendTime = exten.id;
Expand All @@ -95,11 +100,6 @@ namespace RTC
this->rtpHeaderExtensionIds.transportWideCc01 = exten.id;
}

if (this->rtpHeaderExtensionIds.playoutDelay == 0u && exten.type == RTC::RtpHeaderExtensionUri::Type::PLAYOUT_DELAY)
{
this->rtpHeaderExtensionIds.playoutDelay = exten.id;
}

if (this->rtpHeaderExtensionIds.mid == 0u && exten.type == RTC::RtpHeaderExtensionUri::Type::MID)
{
this->rtpHeaderExtensionIds.mid = exten.id;
Expand Down
4 changes: 2 additions & 2 deletions worker/src/RTC/Producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1403,8 +1403,6 @@ namespace RTC
packet->SetMidExtensionId(static_cast<uint8_t>(RTC::RtpHeaderExtensionUri::Type::MID));
packet->SetAbsSendTimeExtensionId(
static_cast<uint8_t>(RTC::RtpHeaderExtensionUri::Type::ABS_SEND_TIME));
packet->SetPlayoutDelayExtensionId(
static_cast<uint8_t>(RTC::RtpHeaderExtensionUri::Type::PLAYOUT_DELAY));
packet->SetTransportWideCc01ExtensionId(
static_cast<uint8_t>(RTC::RtpHeaderExtensionUri::Type::TRANSPORT_WIDE_CC_01));
// NOTE: Remove this once framemarking draft becomes RFC.
Expand All @@ -1416,6 +1414,8 @@ namespace RTC
static_cast<uint8_t>(RTC::RtpHeaderExtensionUri::Type::SSRC_AUDIO_LEVEL));
packet->SetVideoOrientationExtensionId(
static_cast<uint8_t>(RTC::RtpHeaderExtensionUri::Type::VIDEO_ORIENTATION));
packet->SetPlayoutDelayExtensionId(
static_cast<uint8_t>(RTC::RtpHeaderExtensionUri::Type::PLAYOUT_DELAY));
}

return true;
Expand Down
20 changes: 10 additions & 10 deletions worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ namespace RTC
return RtpHeaderExtensionUri::Type::VIDEO_ORIENTATION;
}

case FBS::RtpParameters::RtpHeaderExtensionUri::PlayoutDelay:
{
return RtpHeaderExtensionUri::Type::PLAYOUT_DELAY;
}

case FBS::RtpParameters::RtpHeaderExtensionUri::TimeOffset:
{
return RtpHeaderExtensionUri::Type::TOFFSET;
Expand All @@ -67,11 +72,6 @@ namespace RTC
{
return RtpHeaderExtensionUri::Type::ABS_CAPTURE_TIME;
}

case FBS::RtpParameters::RtpHeaderExtensionUri::PlayoutDelay:
{
return RtpHeaderExtensionUri::Type::PLAYOUT_DELAY;
}
}
}

Expand Down Expand Up @@ -125,6 +125,11 @@ namespace RTC
return FBS::RtpParameters::RtpHeaderExtensionUri::VideoOrientation;
}

case RtpHeaderExtensionUri::Type::PLAYOUT_DELAY:
{
return FBS::RtpParameters::RtpHeaderExtensionUri::PlayoutDelay;
}

case RtpHeaderExtensionUri::Type::TOFFSET:
{
return FBS::RtpParameters::RtpHeaderExtensionUri::TimeOffset;
Expand All @@ -134,11 +139,6 @@ namespace RTC
{
return FBS::RtpParameters::RtpHeaderExtensionUri::AbsCaptureTime;
}

case RtpHeaderExtensionUri::Type::PLAYOUT_DELAY:
{
return FBS::RtpParameters::RtpHeaderExtensionUri::PlayoutDelay;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions worker/src/RTC/RtpPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ namespace RTC
{
uint16_t minDelay;
uint16_t maxDelay;

if (ReadPlayoutDelay(minDelay, maxDelay))
{
MS_DUMP(
Expand Down

0 comments on commit cff3ed6

Please sign in to comment.