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