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

Worker format: avoid large conditional blocks

上级 d42d6f1f
......@@ -110,32 +110,38 @@ namespace RTC
Json::Value json(Json::arrayValue);
if (this->rtpStream != nullptr)
if (this->rtpStream == nullptr)
{
auto jsonRtpStream = this->rtpStream->GetStats();
return json;
}
if (this->transport != nullptr)
{
jsonRtpStream[JsonStringTransportId] = this->transport->transportId;
}
auto jsonRtpStream = this->rtpStream->GetStats();
if (this->effectiveProfile != RTC::RtpEncodingParameters::Profile::NONE)
{
auto it = this->mapProfileRtpStream.find(this->effectiveProfile);
if (this->transport != nullptr)
{
jsonRtpStream[JsonStringTransportId] = this->transport->transportId;
}
MS_ASSERT(
it != this->mapProfileRtpStream.end(), "effective profile does not map to a rtp stream");
if (this->effectiveProfile == RTC::RtpEncodingParameters::Profile::NONE)
{
json.append(jsonRtpStream);
auto inboundRtpStream = const_cast<RTC::RtpStream*>(it->second);
auto jsonInboundRtpStream = inboundRtpStream->GetStats();
return json;
}
jsonRtpStream[JsonStringInboundRtpId] = inboundRtpStream->GetId();
auto it = this->mapProfileRtpStream.find(this->effectiveProfile);
json.append(jsonInboundRtpStream);
}
MS_ASSERT(
it != this->mapProfileRtpStream.end(), "effective profile does not map to a rtp stream");
json.append(jsonRtpStream);
}
auto inboundRtpStream = const_cast<RTC::RtpStream*>(it->second);
auto jsonInboundRtpStream = inboundRtpStream->GetStats();
jsonRtpStream[JsonStringInboundRtpId] = inboundRtpStream->GetId();
json.append(jsonInboundRtpStream);
json.append(jsonRtpStream);
return json;
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论