fix(stream): isolate audio and video UDP receive endpoints

Signed-off-by: ugfuglio <se7en.brc@gmail.com>
This commit is contained in:
ugfuglio authored and Dave Lane committed 2026-11-01 21:35:00 -05:00
1 parent 4dadc7d40c
commit dfc2f1f8cb
2 files changed
+75 -3

No files matched your search

+13
View File
@@ -22,8 +22,21 @@
namespace stream {
std::vector<uint8_t> concat_and_insert(uint64_t insert_size, uint64_t slice_size, const std::string_view &data1, const std::string_view &data2);
std::optional<std::pair<std::uint16_t, std::string_view>> parse_control_packet(const ENetPacket &packet);
bool test_receive_ping_endpoints(bool session_id_pings);
} // namespace stream
TEST(StreamPingTests, KeepsLegacyAudioAndVideoSenderEndpointsSeparate) {
for (int attempt = 0; attempt < 20; ++attempt) {
ASSERT_TRUE(stream::test_receive_ping_endpoints(false)) << "Attempt " << attempt;
}
}
TEST(StreamPingTests, KeepsSessionIdAudioAndVideoSenderEndpointsSeparate) {
for (int attempt = 0; attempt < 20; ++attempt) {
ASSERT_TRUE(stream::test_receive_ping_endpoints(true)) << "Attempt " << attempt;
}
}
TEST(ConcatAndInsertTests, ConcatNoInsertionTest) {
std::array<char, 2> b1 = {'a', 'b'};
std::array<char, 3> b2 = {'c', 'd', 'e'};