Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetMaxOutgoingBitrate does not work if set before first consumer created #831

Closed
penguinol opened this issue Jun 13, 2022 · 1 comment · Fixed by #833
Closed

SetMaxOutgoingBitrate does not work if set before first consumer created #831

penguinol opened this issue Jun 13, 2022 · 1 comment · Fixed by #833
Labels

Comments

@penguinol
Copy link
Contributor

penguinol commented Jun 13, 2022

if (this->tccClient)
{
uint32_t bitrate = jsonBitrateIt->get<uint32_t>();
// NOTE: This may throw if given bitrate is less than current
// initialAvailableOutgoingBitrate, so don't update things before
// calling this method.
this->tccClient->SetMaxOutgoingBitrate(bitrate);
this->maxOutgoingBitrate = bitrate;
MS_DEBUG_TAG(bwe, "maximum outgoing bitrate set to %" PRIu32, this->maxOutgoingBitrate);
ComputeOutgoingDesiredBitrate();
}

According to current code, the max outgoing bitrate will be set only when tccClient is created.
And set max incoming bitrate has not this limitation
case Channel::ChannelRequest::MethodId::TRANSPORT_SET_MAX_INCOMING_BITRATE:
{
auto jsonBitrateIt = request->data.find("bitrate");
// clang-format off
if (
jsonBitrateIt == request->data.end() ||
!Utils::Json::IsPositiveInteger(*jsonBitrateIt)
)
// clang-format on
{
MS_THROW_TYPE_ERROR("missing bitrate");
}
this->maxIncomingBitrate = jsonBitrateIt->get<uint32_t>();
MS_DEBUG_TAG(bwe, "maximum incoming bitrate set to %" PRIu32, this->maxIncomingBitrate);
request->Accept();
if (this->tccServer)
this->tccServer->SetMaxIncomingBitrate(this->maxIncomingBitrate);
break;
}

I think it's because we want to validate the max bitrate in tccClient->SetMaxOutgoingBitrate.

@penguinol penguinol added the bug label Jun 13, 2022
@penguinol penguinol changed the title SetMaxOutgoingBitrate does not work if setted before first conusmer creating SetMaxOutgoingBitrate does not work if set before first conusmer creating Jun 13, 2022
@penguinol penguinol changed the title SetMaxOutgoingBitrate does not work if set before first conusmer creating SetMaxOutgoingBitrate does not work if set before first conusmer created Jun 13, 2022
ibc added a commit that referenced this issue Jun 13, 2022
…fore created

- Fixes #831
- Remove no longer used `RtpBufferSize` in `RtpPacket.hpp`.
@ibc
Copy link
Member

ibc commented Jun 13, 2022

@penguinol see PR #833

@ibc ibc closed this as completed in #833 Jun 14, 2022
ibc added a commit that referenced this issue Jun 14, 2022
…fore created (#833)

- Fixes #831
- Remove no longer used `RtpBufferSize` in `RtpPacket.hpp`.
@ibc ibc changed the title SetMaxOutgoingBitrate does not work if set before first conusmer created SetMaxOutgoingBitrate does not work if set before first consumer created Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants