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