Skip to content

Commit

Permalink
💨 Support compiling with clang (#105)
Browse files Browse the repository at this point in the history
No functional change, just handy because it compiles twice as fast and has better error messages.

test with `CC=clang CXX=clang++ meson build-clang && ninja -C build-clang`
  • Loading branch information
danstiner authored Mar 12, 2021
1 parent c8666a6 commit 1898e28
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
test/test
core
build/
build-clang/
builddir/
subprojects/*
!subprojects/*.wrap
Expand Down
3 changes: 1 addition & 2 deletions src/FtlStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ FtlStream::FtlStream(
mediaMetadata(mediaMetadata),
streamId(streamId),
onClosed(onClosed),
onRtpPacket(onRtpPacket),
nackLostPackets(nackLostPackets)
onRtpPacket(onRtpPacket)
{
// Prepare stream data stores to accept packets from SSRCs specified by control handshake
ssrcData.try_emplace(mediaMetadata.AudioSsrc);
Expand Down
2 changes: 0 additions & 2 deletions src/FtlStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ class FtlStream
const ftl_stream_id_t streamId;
const ClosedCallback onClosed;
const RtpPacketCallback onRtpPacket;
const bool nackLostPackets;
bool stopping = false;
// Stream data
std::shared_mutex dataMutex;
time_t startTime { 0 };
Expand Down
13 changes: 6 additions & 7 deletions src/JanusFtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ void JanusFtl::serviceReportThreadBody(std::promise<void>&& threadEndedPromise)
// wind up waiting forever on the connection thread due to it taking a lock in the
// JanusFtl::ftlServerRtpPacket callback
lock.lock();
for (const auto channelStreamPair : streamsStopped)
for (const auto& channelStreamPair : streamsStopped)
{
endStream(channelStreamPair.first, channelStreamPair.second, lock);
}
Expand Down Expand Up @@ -987,12 +987,11 @@ ConnectionResult JanusFtl::onOrchestratorStreamRelay(ConnectionRelayPayload payl
};
}

if (relayClients.count(payload.ChannelId) <= 0)
{
relayClients.insert_or_assign(payload.ChannelId, std::list<ActiveRelay>());
}
relayClients.at(payload.ChannelId).emplace_back(payload.ChannelId, payload.TargetHostname,
std::move(relayClient));
relayClients[payload.ChannelId].push_back(ActiveRelay {
.ChannelId = payload.ChannelId,
.TargetHostname = payload.TargetHostname,
.Client = std::move(relayClient),
});

return ConnectionResult
{
Expand Down
2 changes: 0 additions & 2 deletions src/JanusFtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ class JanusFtl
std::unordered_map<VideoCodecKind, std::unique_ptr<PreviewGenerator>> previewGenerators;
uint32_t maxAllowedBitsPerSecond = 0;
std::chrono::milliseconds metadataReportInterval = std::chrono::milliseconds::min();
uint16_t minMediaPort = 9000; // TODO: Migrate to Configuration
uint16_t maxMediaPort = 10000; // TODO: Migrate to Configuration
std::atomic<bool> isStopping = false;
std::thread serviceReportThread;
std::future<void> serviceReportThreadEndedFuture;
Expand Down
2 changes: 1 addition & 1 deletion src/PreviewGenerators/H264PreviewGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ std::vector<uint8_t> H264PreviewGenerator::GenerateJpegImage(

// For fragmented types, start bits are special, they have some extra data in the NAL header
// that we need to include.
if ((fragmentType == 28))
if (fragmentType == 28)
{
if (startBit)
{
Expand Down
2 changes: 0 additions & 2 deletions src/ServiceConnections/GlimeshServiceConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ GlimeshServiceConnection::GlimeshServiceConnection(
std::string clientSecret) :
baseUri(fmt::format("{}://{}:{}", (useHttps ? "https" : "http"), hostname, port)),
hostname(hostname),
port(port),
useHttps(useHttps),
clientId(clientId),
clientSecret(clientSecret)
{ }
Expand Down
2 changes: 0 additions & 2 deletions src/ServiceConnections/GlimeshServiceConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class GlimeshServiceConnection :
const int TIME_BETWEEN_RETRIES_MS = 3000;
std::string baseUri;
std::string hostname;
uint16_t port;
bool useHttps;
std::string clientId;
std::string clientSecret;
std::string accessToken;
Expand Down
2 changes: 0 additions & 2 deletions src/ServiceConnections/RestServiceConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ RestServiceConnection::RestServiceConnection(
:
baseUri(fmt::format("{}://{}:{}", (useHttps ? "https" : "http"), hostname, port)),
hostname(hostname),
port(port),
useHttps(useHttps),
pathBase(pathBase),
authToken(authToken)
{
Expand Down
2 changes: 0 additions & 2 deletions src/ServiceConnections/RestServiceConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class RestServiceConnection : public ServiceConnection
const int TIME_BETWEEN_RETRIES_MS = 3000;
std::string baseUri;
std::string hostname;
uint16_t port;
bool useHttps;
std::string pathBase;
std::string authToken;

Expand Down

0 comments on commit 1898e28

Please sign in to comment.