提交 64152f2e authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

- Router: use auto*

- Consumer: check IsEnabled() in methods
上级 2c0b4268
......@@ -191,6 +191,9 @@ namespace RTC
{
MS_TRACE();
if (!IsEnabled())
return;
// If paused don't forward RTP.
if (IsPaused())
return;
......@@ -260,6 +263,9 @@ namespace RTC
{
MS_TRACE();
if (!IsEnabled())
return;
for (auto it = nackPacket->Begin(); it != nackPacket->End(); ++it)
{
RTC::RTCP::FeedbackRtpNackItem* item = *it;
......@@ -284,6 +290,9 @@ namespace RTC
{
MS_TRACE();
if (!IsEnabled())
return;
this->rtpStream->ReceiveRtcpReceiverReport(report);
}
......@@ -291,6 +300,9 @@ namespace RTC
{
MS_TRACE();
if (!IsEnabled())
return;
if (this->kind == RTC::Media::Kind::AUDIO)
return;
......
......@@ -127,11 +127,11 @@ namespace RTC
// Add mapProducerConsumers.
for (auto& kv : this->mapProducerConsumers)
{
auto producer = kv.first;
auto* producer = kv.first;
auto& consumers = kv.second;
Json::Value jsonProducers(Json::arrayValue);
for (auto& consumer : consumers)
for (auto* consumer : consumers)
{
jsonProducers.append(std::to_string(consumer->consumerId));
}
......@@ -143,8 +143,8 @@ namespace RTC
// Add mapConsumerProducer.
for (auto& kv : this->mapConsumerProducer)
{
auto consumer = kv.first;
auto producer = kv.second;
auto* consumer = kv.first;
auto* producer = kv.second;
jsonMapConsumerProducer[std::to_string(consumer->consumerId)] =
std::to_string(producer->producerId);
......@@ -653,7 +653,6 @@ namespace RTC
break;
}
case Channel::Request::MethodId::CONSUMER_DUMP:
case Channel::Request::MethodId::CONSUMER_ENABLE:
{
static const Json::StaticString JsonStringRtpParameters{ "rtpParameters" };
......@@ -728,6 +727,7 @@ namespace RTC
break;
}
case Channel::Request::MethodId::CONSUMER_DUMP:
case Channel::Request::MethodId::CONSUMER_PAUSE:
case Channel::Request::MethodId::CONSUMER_RESUME:
{
......@@ -890,7 +890,7 @@ namespace RTC
auto& consumers = this->mapProducerConsumers[producer];
for (auto& consumer : consumers)
for (auto* consumer : consumers)
{
consumer->SetSourcePaused();
}
......@@ -906,7 +906,7 @@ namespace RTC
auto& consumers = this->mapProducerConsumers[producer];
for (auto& consumer : consumers)
for (auto* consumer : consumers)
{
consumer->SetSourceResumed();
}
......@@ -924,7 +924,7 @@ namespace RTC
// Send the RtpPacket to all the Consumers associated to the Producer
// from which it was received.
for (auto& consumer : consumers)
for (auto* consumer : consumers)
{
if (consumer->IsEnabled())
consumer->SendRtpPacket(packet);
......@@ -972,7 +972,7 @@ namespace RTC
this->mapConsumerProducer.find(consumer) != this->mapConsumerProducer.end(),
"Consumer not present in mapConsumerProducer");
auto& producer = this->mapConsumerProducer[consumer];
auto* producer = this->mapConsumerProducer[consumer];
producer->RequestFullFrame();
}
......@@ -992,7 +992,7 @@ namespace RTC
for (auto& kv : this->mapProducerAudioLevelContainer)
{
auto producer = kv.first;
auto* producer = kv.first;
auto& audioLevelContainer = kv.second;
auto numdBovs = audioLevelContainer.numdBovs;
auto sumdBovs = audioLevelContainer.sumdBovs;
......
......@@ -249,7 +249,7 @@ namespace RTC
}
// Disable all the handled Consumers.
for (auto& consumer : this->consumers)
for (auto* consumer : this->consumers)
{
consumer->Disable();
......@@ -798,7 +798,7 @@ namespace RTC
{
MS_TRACE();
for (auto consumer : this->consumers)
for (auto* consumer : this->consumers)
{
// Ignore if not enabled.
if (!consumer->IsEnabled())
......@@ -1254,7 +1254,7 @@ namespace RTC
this->notifier->Emit(this->transportId, "dtlsstatechange", eventData);
// Iterate all the Consumers and request full frame.
for (auto& consumer : this->consumers)
for (auto* consumer : this->consumers)
{
consumer->RequestFullFrame();
}
......@@ -1369,8 +1369,11 @@ namespace RTC
{
MS_WARN_TAG(rbe, "uplink effective max bitrate abruptly decrease, requesting full frames");
// TODO: No. Iterate producers and call RequestFullFrame() on them.
// this->listener->OnTransportFullFrameRequired(this);
// Request full frame for all the Producers.
for (auto* producer : this->producers)
{
producer->RequestFullFrame();
}
}
this->lastEffectiveMaxBitrateAt = now;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论