Unverified 提交 4b3dd530 authored 作者: Nazar Mokrynskyi's avatar Nazar Mokrynskyi 提交者: GitHub

Merge pull request #709 from versatica/use-more-than-one-core

Use more than one core for compilation on Windows
......@@ -46,9 +46,10 @@ namespace RTC
bool HasReceiverReferenceTime()
{
return std::any_of(
this->xrPacket.Begin(), this->xrPacket.End(), [](const ExtendedReportBlock* report) {
return report->GetType() == ExtendedReportBlock::Type::RRT;
});
this->xrPacket.Begin(),
this->xrPacket.End(),
[](const ExtendedReportBlock* report)
{ return report->GetType() == ExtendedReportBlock::Type::RRT; });
}
void Serialize(uint8_t* data);
......
......@@ -82,8 +82,9 @@ namespace RTC
void SetTotalLost(int32_t totalLost)
{
// Get the limit value for possitive and negative totalLost.
int32_t clamp = (totalLost >= 0) ? totalLost > 0x07FFFFF ? 0x07FFFFF : totalLost
: -totalLost > 0x0800000 ? 0x0800000 : -totalLost;
int32_t clamp = (totalLost >= 0) ? totalLost > 0x07FFFFF ? 0x07FFFFF : totalLost
: -totalLost > 0x0800000 ? 0x0800000
: -totalLost;
uint32_t value = (totalLost >= 0) ? (clamp & 0x07FFFFF) : (clamp | 0x0800000);
......
......@@ -6,7 +6,7 @@ OS="$(uname -s)"
NUM_CORES=
case "${OS}" in
Linux*) NUM_CORES=$(nproc);;
Linux*|MINGW*) NUM_CORES=$(nproc);;
Darwin*|FreeBSD) NUM_CORES=$(sysctl -n hw.ncpu);;
*) NUM_CORES=1;;
esac
......
......@@ -17,10 +17,13 @@ void DepOpenSSL::ClassInit()
{
MS_TRACE();
std::call_once(globalInitOnce, [] {
MS_DEBUG_TAG(info, "openssl version: \"%s\"", OpenSSL_version(OPENSSL_VERSION));
std::call_once(
globalInitOnce,
[]
{
MS_DEBUG_TAG(info, "openssl version: \"%s\"", OpenSSL_version(OPENSSL_VERSION));
// Initialize some crypto stuff.
RAND_poll();
});
// Initialize some crypto stuff.
RAND_poll();
});
}
......@@ -463,7 +463,7 @@ namespace RTC
size_t levelIndex = this->nextLevelIndex >= (i + 1)
? this->nextLevelIndex - i - 1
: this->nextLevelIndex + LevelsBuffLen - i - 1;
uint8_t level = this->levels[levelIndex];
uint8_t level = this->levels[levelIndex];
if (level < minLevel)
{
......
......@@ -222,12 +222,15 @@ namespace RTC
return;
}
const auto* cb = new onQueuedCallback([&request](bool queued, bool sctpSendBufferFull) {
if (queued)
request->Accept();
else
request->Error(sctpSendBufferFull == true ? "sctpsendbufferfull" : "message send failed");
});
const auto* cb = new onQueuedCallback(
[&request](bool queued, bool sctpSendBufferFull)
{
if (queued)
request->Accept();
else
request->Error(
sctpSendBufferFull == true ? "sctpsendbufferfull" : "message send failed");
});
SendMessage(ppid, msg, len, cb);
......
......@@ -2596,23 +2596,27 @@ namespace RTC
sentInfo.size = packet->GetSize();
sentInfo.sendingAtMs = DepLibUV::GetTimeMs();
auto* cb = new onSendCallback([tccClient, &packetInfo, senderBwe, &sentInfo](bool sent) {
if (sent)
{
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
auto* cb = new onSendCallback(
[tccClient, &packetInfo, senderBwe, &sentInfo](bool sent)
{
if (sent)
{
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
sentInfo.sentAtMs = DepLibUV::GetTimeMs();
sentInfo.sentAtMs = DepLibUV::GetTimeMs();
senderBwe->RtpPacketSent(sentInfo);
}
});
senderBwe->RtpPacketSent(sentInfo);
}
});
SendRtpPacket(consumer, packet, cb);
#else
const auto* cb = new onSendCallback([tccClient, &packetInfo](bool sent) {
if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
});
const auto* cb = new onSendCallback(
[tccClient, &packetInfo](bool sent)
{
if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
});
SendRtpPacket(consumer, packet, cb);
#endif
......@@ -2664,23 +2668,27 @@ namespace RTC
sentInfo.size = packet->GetSize();
sentInfo.sendingAtMs = DepLibUV::GetTimeMs();
auto* cb = new onSendCallback([tccClient, &packetInfo, senderBwe, &sentInfo](bool sent) {
if (sent)
{
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
auto* cb = new onSendCallback(
[tccClient, &packetInfo, senderBwe, &sentInfo](bool sent)
{
if (sent)
{
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
sentInfo.sentAtMs = DepLibUV::GetTimeMs();
sentInfo.sentAtMs = DepLibUV::GetTimeMs();
senderBwe->RtpPacketSent(sentInfo);
}
});
senderBwe->RtpPacketSent(sentInfo);
}
});
SendRtpPacket(consumer, packet, cb);
#else
const auto* cb = new onSendCallback([tccClient, &packetInfo](bool sent) {
if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
});
const auto* cb = new onSendCallback(
[tccClient, &packetInfo](bool sent)
{
if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
});
SendRtpPacket(consumer, packet, cb);
#endif
......@@ -2999,23 +3007,27 @@ namespace RTC
sentInfo.isProbation = true;
sentInfo.sendingAtMs = DepLibUV::GetTimeMs();
auto* cb = new onSendCallback([tccClient, &packetInfo, senderBwe, &sentInfo](bool sent) {
if (sent)
{
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
auto* cb = new onSendCallback(
[tccClient, &packetInfo, senderBwe, &sentInfo](bool sent)
{
if (sent)
{
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
sentInfo.sentAtMs = DepLibUV::GetTimeMs();
sentInfo.sentAtMs = DepLibUV::GetTimeMs();
senderBwe->RtpPacketSent(sentInfo);
}
});
senderBwe->RtpPacketSent(sentInfo);
}
});
SendRtpPacket(nullptr, packet, cb);
#else
const auto* cb = new onSendCallback([tccClient, &packetInfo](bool sent) {
if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
});
const auto* cb = new onSendCallback(
[tccClient, &packetInfo](bool sent)
{
if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
});
SendRtpPacket(nullptr, packet, cb);
#endif
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论