Unverified 提交 c0e3a623 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo 提交者: GitHub

Avoid abseil containers with SeqManager compare functions (#1369)

上级 1a507ecc
......@@ -42,6 +42,7 @@ jobs:
env:
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true'
MEDIASOUP_LOCAL_DEV: 'true'
MEDIASOUP_BUILDTYPE: 'Release'
steps:
- name: Checkout repository
......
......@@ -29,12 +29,16 @@ jobs:
node: 20
- os: windows-2022
node: 20
build-type:
- Release
- Debug
runs-on: ${{ matrix.ci.os }}
env:
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true'
MEDIASOUP_LOCAL_DEV: 'true'
MEDIASOUP_BUILDTYPE: ${{ matrix.build-type }}
steps:
- name: Checkout
......
......@@ -49,8 +49,12 @@ jobs:
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
# NOTE: In Windows this will build and test libmediasoupworker in release
# mode twice since build.rs doesn't allow debug mode for Windows.
- name: cargo test
run: cargo test --verbose
run: |
cargo test --verbose
cargo test --release --verbose
- name: cargo doc
run: cargo doc --locked --all --no-deps --lib
......
......@@ -20,6 +20,9 @@ jobs:
cc: clang
cxx: clang++
arch: arm64
build-type:
- Release
- Debug
runs-on: ${{ matrix.build.os }}
......@@ -28,6 +31,7 @@ jobs:
CXX: ${{ matrix.build.cxx }}
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true'
MEDIASOUP_LOCAL_DEV: 'true'
MEDIASOUP_BUILDTYPE: ${{ matrix.build-type }}
steps:
- name: Checkout
......
......@@ -51,6 +51,7 @@ jobs:
CXX: ${{ matrix.build.cxx }}
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true'
MEDIASOUP_LOCAL_DEV: 'true'
MEDIASOUP_BUILDTYPE: 'Release'
steps:
- name: Checkout
......
......@@ -53,6 +53,9 @@ jobs:
# A single Node.js version should be fine for C++.
node:
- 20
build-type:
- Release
- Debug
runs-on: ${{ matrix.build.os }}
......@@ -61,6 +64,7 @@ jobs:
CXX: ${{ matrix.build.cxx }}
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true'
MEDIASOUP_LOCAL_DEV: 'true'
MEDIASOUP_BUILDTYPE: ${{ matrix.build-type }}
steps:
- name: Checkout
......
......@@ -5,8 +5,6 @@
#include "RTC/RtpPacket.hpp"
#include "RTC/SeqManager.hpp"
#include "handles/TimerHandle.hpp"
#include <absl/container/btree_map.h>
#include <absl/container/btree_set.h>
#include <map>
#include <set>
#include <vector>
......@@ -80,9 +78,9 @@ namespace RTC
// Allocated by this.
TimerHandle* timer{ nullptr };
// Others.
absl::btree_map<uint16_t, NackInfo, RTC::SeqManager<uint16_t>::SeqLowerThan> nackList;
absl::btree_set<uint16_t, RTC::SeqManager<uint16_t>::SeqLowerThan> keyFrameList;
absl::btree_set<uint16_t, RTC::SeqManager<uint16_t>::SeqLowerThan> recoveredList;
std::map<uint16_t, NackInfo, RTC::SeqManager<uint16_t>::SeqLowerThan> nackList;
std::set<uint16_t, RTC::SeqManager<uint16_t>::SeqLowerThan> keyFrameList;
std::set<uint16_t, RTC::SeqManager<uint16_t>::SeqLowerThan> recoveredList;
bool started{ false };
uint16_t lastSeq{ 0u }; // Seq number of last valid packet.
uint32_t rtt{ 0u }; // Round trip time (ms).
......
......@@ -6,7 +6,6 @@
#include "RTC/RateCalculator.hpp"
#include "RTC/SeqManager.hpp"
#include "RTC/TrendCalculator.hpp"
#include <absl/container/btree_map.h>
#include <map>
namespace RTC
......@@ -103,7 +102,7 @@ namespace RTC
uint32_t initialAvailableBitrate{ 0u };
uint32_t availableBitrate{ 0u };
uint64_t lastAvailableBitrateEventAtMs{ 0u };
absl::btree_map<uint16_t, SentInfo, RTC::SeqManager<uint16_t>::SeqLowerThan> sentInfos;
std::map<uint16_t, SentInfo, RTC::SeqManager<uint16_t>::SeqLowerThan> sentInfos;
float rtt{ 0 }; // Round trip time in ms.
CummulativeResult cummulativeResult;
CummulativeResult probationCummulativeResult;
......
......@@ -106,6 +106,8 @@ namespace RTC
absl::flat_hash_map<std::string, RTC::WebRtcTransport*> mapLocalIceUsernameFragmentWebRtcTransport;
// Map of WebRtcTransports indexed by TransportTuple.hash.
absl::flat_hash_map<uint64_t, RTC::WebRtcTransport*> mapTupleWebRtcTransport;
// Whether the destructor has been called.
bool closing{ false };
};
} // namespace RTC
......
......@@ -5,6 +5,7 @@
#include "Logger.hpp"
#include "MediaSoupErrors.hpp"
#include "RTC/RtpDictionaries.hpp"
#include <absl/container/btree_map.h>
#include <cmath> // std::lround()
namespace RTC
......
......@@ -232,6 +232,8 @@ namespace RTC
{
MS_TRACE();
this->closing = true;
this->shared->channelMessageRegistrator->UnregisterHandler(this->id);
for (auto& item : this->udpSocketOrTcpServers)
......@@ -497,7 +499,14 @@ namespace RTC
this->webRtcTransports.find(webRtcTransport) != this->webRtcTransports.end(),
"WebRtcTransport not handled");
this->webRtcTransports.erase(webRtcTransport);
// NOTE: If WebRtcServer is closing then do not remove the transport from
// the set since it would modify the set while the WebRtcServer destructor
// is iterating it.
// See: https://github.com/versatica/mediasoup/pull/1369#issuecomment-2044672247
if (!this->closing)
{
this->webRtcTransports.erase(webRtcTransport);
}
}
inline void WebRtcServer::OnWebRtcTransportLocalIceUsernameFragmentAdded(
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论