diff --git a/.gitignore b/.gitignore index 0f14273..213636a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ test/test core build/ +build-clang/ builddir/ subprojects/* !subprojects/*.wrap diff --git a/src/FtlStream.cpp b/src/FtlStream.cpp index d71095c..1e51a16 100644 --- a/src/FtlStream.cpp +++ b/src/FtlStream.cpp @@ -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); diff --git a/src/FtlStream.h b/src/FtlStream.h index 4f14af4..f76e66b 100644 --- a/src/FtlStream.h +++ b/src/FtlStream.h @@ -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 }; diff --git a/src/JanusFtl.cpp b/src/JanusFtl.cpp index 0b66577..30ff282 100644 --- a/src/JanusFtl.cpp +++ b/src/JanusFtl.cpp @@ -657,7 +657,7 @@ void JanusFtl::serviceReportThreadBody(std::promise&& 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); } @@ -987,12 +987,11 @@ ConnectionResult JanusFtl::onOrchestratorStreamRelay(ConnectionRelayPayload payl }; } - if (relayClients.count(payload.ChannelId) <= 0) - { - relayClients.insert_or_assign(payload.ChannelId, std::list()); - } - 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 { diff --git a/src/JanusFtl.h b/src/JanusFtl.h index b7ce95d..eabdae1 100644 --- a/src/JanusFtl.h +++ b/src/JanusFtl.h @@ -116,8 +116,6 @@ class JanusFtl std::unordered_map> 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 isStopping = false; std::thread serviceReportThread; std::future serviceReportThreadEndedFuture; diff --git a/src/PreviewGenerators/H264PreviewGenerator.cpp b/src/PreviewGenerators/H264PreviewGenerator.cpp index 1a706e0..abc6583 100644 --- a/src/PreviewGenerators/H264PreviewGenerator.cpp +++ b/src/PreviewGenerators/H264PreviewGenerator.cpp @@ -37,7 +37,7 @@ std::vector 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) { diff --git a/src/ServiceConnections/GlimeshServiceConnection.cpp b/src/ServiceConnections/GlimeshServiceConnection.cpp index f34bc98..b635770 100644 --- a/src/ServiceConnections/GlimeshServiceConnection.cpp +++ b/src/ServiceConnections/GlimeshServiceConnection.cpp @@ -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) { } diff --git a/src/ServiceConnections/GlimeshServiceConnection.h b/src/ServiceConnections/GlimeshServiceConnection.h index 70b8bba..8279535 100644 --- a/src/ServiceConnections/GlimeshServiceConnection.h +++ b/src/ServiceConnections/GlimeshServiceConnection.h @@ -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; diff --git a/src/ServiceConnections/RestServiceConnection.cpp b/src/ServiceConnections/RestServiceConnection.cpp index 558afac..c2ec4a1 100644 --- a/src/ServiceConnections/RestServiceConnection.cpp +++ b/src/ServiceConnections/RestServiceConnection.cpp @@ -26,8 +26,6 @@ RestServiceConnection::RestServiceConnection( : baseUri(fmt::format("{}://{}:{}", (useHttps ? "https" : "http"), hostname, port)), hostname(hostname), - port(port), - useHttps(useHttps), pathBase(pathBase), authToken(authToken) { diff --git a/src/ServiceConnections/RestServiceConnection.h b/src/ServiceConnections/RestServiceConnection.h index be65101..9ca20ca 100644 --- a/src/ServiceConnections/RestServiceConnection.h +++ b/src/ServiceConnections/RestServiceConnection.h @@ -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;