From 6a8d2e8f06f7864976d148f3cf423e8b3a418e8a Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 21 Jul 2026 22:11:40 -0700 Subject: [PATCH 1/4] remove catch2, 3x faster builds (#695) --- SConscript | 2 +- SConstruct | 2 - lefthook.yml | 4 +- msgq/msgq_tests.cc | 172 +++++++++++++++++++++----------------------- msgq/test_runner.cc | 2 - msgq/test_runner.h | 106 +++++++++++++++++++++++++++ pyproject.toml | 1 - 7 files changed, 192 insertions(+), 97 deletions(-) delete mode 100644 msgq/test_runner.cc create mode 100644 msgq/test_runner.h diff --git a/SConscript b/SConscript index 23cbcc6ab..cde36529e 100644 --- a/SConscript +++ b/SConscript @@ -31,6 +31,6 @@ envCython.Program(f'{visionipc_dir.abspath}/visionipc_pyx.so', f'{visionipc_dir. LIBS=vipc_libs) if GetOption('extras'): - env.Program('msgq/test_runner', ['msgq/test_runner.cc', 'msgq/msgq_tests.cc'], LIBS=[msgq]+common) + env.Program('msgq/test_runner', ['msgq/msgq_tests.cc'], LIBS=[msgq]+common) Export('visionipc', 'msgq', 'msgq_python') diff --git a/SConstruct b/SConstruct index 5bf6df07b..0ee7a1dba 100644 --- a/SConstruct +++ b/SConstruct @@ -2,7 +2,6 @@ import os import platform import subprocess import sysconfig -import catch2 arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() if platform.system() == "Darwin": @@ -11,7 +10,6 @@ if platform.system() == "Darwin": common = [] cpppath = [ - catch2.INCLUDE_DIR, "#/", '#msgq/', '/usr/lib/include', diff --git a/lefthook.yml b/lefthook.yml index 449d1eb1b..91b18aa52 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -18,12 +18,12 @@ test: ty: run: ty check . codespell: - run: codespell {files} -L ned,stdio,master --builtin clear,rare,informal,usage,code,names,en-GB_to_en-US -S uv.lock,*_pyx.cpp,catch2* + run: codespell {files} -L ned,stdio,master --builtin clear,rare,informal,usage,code,names,en-GB_to_en-US -S uv.lock,*_pyx.cpp files: git ls-tree -r HEAD --name-only cppcheck: run: cppcheck --error-exitcode=1 --inline-suppr --language=c++ --force --quiet -j4 --check-level=exhaustive $(git ls-files '*.cc' | grep -v -E '(msgq_tests|test_runner)\.cc') cpplint: - run: cpplint --exclude=msgq/catch2/ --exclude=msgq/ipc_pyx.cpp --exclude=msgq/visionipc/visionipc_pyx.cpp --recursive --quiet --counting=detailed --linelength=240 --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces msgq/ + run: cpplint --exclude=msgq/ipc_pyx.cpp --exclude=msgq/visionipc/visionipc_pyx.cpp --recursive --quiet --counting=detailed --linelength=240 --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces msgq/ # *** tests *** test_runner: diff --git a/msgq/msgq_tests.cc b/msgq/msgq_tests.cc index cdb41220a..b8d6824da 100644 --- a/msgq/msgq_tests.cc +++ b/msgq/msgq_tests.cc @@ -1,4 +1,4 @@ -#include +#include "msgq/test_runner.h" #include "msgq/msgq.h" static void cleanup_test_queue() { @@ -71,39 +71,32 @@ TEST_CASE("msgq_init_subscriber") TEST_CASE("msgq_msg_send first message") { - cleanup_test_queue(); - msgq_queue_t q; - msgq_new_queue(&q, "test_queue", 1024); - msgq_init_publisher(&q); - - REQUIRE(*q.write_pointer == 0); - - size_t msg_size = 128; - - SECTION("Aligned message size") + const size_t msg_sizes[] = {128, 127}; + for (size_t msg_size : msg_sizes) { - } - SECTION("Unaligned message size") - { - msg_size--; - } - char *data = new char[msg_size]; - - for (size_t i = 0; i < msg_size; i++) - { - data[i] = i; - } + cleanup_test_queue(); + msgq_queue_t q; + msgq_new_queue(&q, "test_queue", 1024); + msgq_init_publisher(&q); + + REQUIRE(*q.write_pointer == 0); + char *data = new char[msg_size]; + for (size_t i = 0; i < msg_size; i++) + { + data[i] = i; + } - msgq_msg_t msg; - msgq_msg_init_data(&msg, data, msg_size); + msgq_msg_t msg; + msgq_msg_init_data(&msg, data, msg_size); - msgq_msg_send(&msg, &q); - REQUIRE(*(int64_t *)q.data == msg_size); // Check size tag - REQUIRE(*q.write_pointer == 128 + sizeof(int64_t)); - REQUIRE(memcmp(q.data + sizeof(int64_t), data, msg_size) == 0); + msgq_msg_send(&msg, &q); + REQUIRE(*(int64_t *)q.data == msg_size); // Check size tag + REQUIRE(*q.write_pointer == 128 + sizeof(int64_t)); + REQUIRE(memcmp(q.data + sizeof(int64_t), data, msg_size) == 0); - delete[] data; - msgq_msg_close(&msg); + delete[] data; + msgq_msg_close(&msg); + } } TEST_CASE("msgq_msg_send test wraparound") @@ -140,84 +133,85 @@ TEST_CASE("msgq_msg_send test wraparound") TEST_CASE("msgq_msg_recv test wraparound") { - cleanup_test_queue(); - msgq_queue_t q_pub, q_sub; - msgq_new_queue(&q_pub, "test_queue", 1024); - msgq_new_queue(&q_sub, "test_queue", 1024); + const bool keep_up_cases[] = {false, true}; + for (bool keep_up_with_writer : keep_up_cases) + { + cleanup_test_queue(); + msgq_queue_t q_pub, q_sub; + msgq_new_queue(&q_pub, "test_queue", 1024); + msgq_new_queue(&q_sub, "test_queue", 1024); - msgq_init_publisher(&q_pub); - msgq_init_subscriber(&q_sub); + msgq_init_publisher(&q_pub); + msgq_init_subscriber(&q_sub); - REQUIRE((*q_pub.write_pointer >> 32) == 0); - REQUIRE((*q_sub.read_pointers[0] >> 32) == 0); + REQUIRE((*q_pub.write_pointer >> 32) == 0); + REQUIRE((*q_sub.read_pointers[0] >> 32) == 0); - const size_t msg_size = 120; - msgq_msg_t msg1; - msgq_msg_init_size(&msg1, msg_size); + const size_t msg_size = 120; + msgq_msg_t msg1; + msgq_msg_init_size(&msg1, msg_size); - SECTION("Check cycle counter after reset") - { for (int i = 0; i < 8; i++) { msgq_msg_send(&msg1, &q_pub); + if (keep_up_with_writer) + { + msgq_msg_t msg2; + msgq_msg_recv(&msg2, &q_sub); + REQUIRE(msg2.size > 0); + msgq_msg_close(&msg2); + } } - msgq_msg_t msg2; - msgq_msg_recv(&msg2, &q_sub); - REQUIRE(msg2.size == 0); // Reader had to reset - msgq_msg_close(&msg2); - } - SECTION("Check cycle counter while keeping up with writer") - { - for (int i = 0; i < 8; i++) + if (!keep_up_with_writer) { - msgq_msg_send(&msg1, &q_pub); - msgq_msg_t msg2; msgq_msg_recv(&msg2, &q_sub); - REQUIRE(msg2.size > 0); + REQUIRE(msg2.size == 0); // Reader had to reset msgq_msg_close(&msg2); } - } - REQUIRE((*q_sub.read_pointers[0] >> 32) == 1); - msgq_msg_close(&msg1); + REQUIRE((*q_sub.read_pointers[0] >> 32) == 1); + msgq_msg_close(&msg1); + } } TEST_CASE("msgq_msg_send test invalidation") { - cleanup_test_queue(); - msgq_queue_t q_pub, q_sub; - msgq_new_queue(&q_pub, "test_queue", 1024); - msgq_new_queue(&q_sub, "test_queue", 1024); - - msgq_init_publisher(&q_pub); - msgq_init_subscriber(&q_sub); - *q_sub.write_pointer = (uint64_t)1 << 32; + for (int read_pointer_location = 0; read_pointer_location < 3; read_pointer_location++) + { + cleanup_test_queue(); + msgq_queue_t q_pub, q_sub; + msgq_new_queue(&q_pub, "test_queue", 1024); + msgq_new_queue(&q_sub, "test_queue", 1024); - REQUIRE(*q_sub.read_valids[0] == true); + msgq_init_publisher(&q_pub); + msgq_init_subscriber(&q_sub); + *q_sub.write_pointer = (uint64_t)1 << 32; - SECTION("read pointer in tag") - { - *q_sub.read_pointers[0] = 0; - } - SECTION("read pointer in data section") - { - *q_sub.read_pointers[0] = 64; - } - SECTION("read pointer in wraparound section") - { - *q_pub.write_pointer = ((uint64_t)1 << 32) | 1000; // Writer is one cycle ahead - *q_sub.read_pointers[0] = 1020; - } + REQUIRE(*q_sub.read_valids[0] == true); + if (read_pointer_location == 0) + { + *q_sub.read_pointers[0] = 0; + } + else if (read_pointer_location == 1) + { + *q_sub.read_pointers[0] = 64; + } + else + { + *q_pub.write_pointer = ((uint64_t)1 << 32) | 1000; // Writer is one cycle ahead + *q_sub.read_pointers[0] = 1020; + } - msgq_msg_t msg; - msgq_msg_init_size(&msg, 128); - msgq_msg_send(&msg, &q_pub); + msgq_msg_t msg; + msgq_msg_init_size(&msg, 128); + msgq_msg_send(&msg, &q_pub); - REQUIRE(*q_sub.read_valids[0] == false); + REQUIRE(*q_sub.read_valids[0] == false); - msgq_msg_close(&msg); + msgq_msg_close(&msg); + } } TEST_CASE("msgq_init_subscriber init 2 subscribers") @@ -243,7 +237,7 @@ TEST_CASE("msgq_init_subscriber init 2 subscribers") REQUIRE(q2.reader_id == 1); } -TEST_CASE("Write 1 msg, read 1 msg", "[integration]") +TEST_CASE("Write 1 msg, read 1 msg") { cleanup_test_queue(); const size_t msg_size = 128; @@ -279,7 +273,7 @@ TEST_CASE("Write 1 msg, read 1 msg", "[integration]") msgq_msg_close(&incoming_msg2); } -TEST_CASE("Write 2 msg, read 2 msg - conflate = false", "[integration]") +TEST_CASE("Write 2 msg, read 2 msg - conflate = false") { cleanup_test_queue(); const size_t msg_size = 128; @@ -316,7 +310,7 @@ TEST_CASE("Write 2 msg, read 2 msg - conflate = false", "[integration]") msgq_msg_close(&incoming_msg2); } -TEST_CASE("Write 2 msg, read 2 msg - conflate = true", "[integration]") +TEST_CASE("Write 2 msg, read 2 msg - conflate = true") { cleanup_test_queue(); const size_t msg_size = 128; @@ -354,7 +348,7 @@ TEST_CASE("Write 2 msg, read 2 msg - conflate = true", "[integration]") msgq_msg_close(&incoming_msg2); } -TEST_CASE("1 publisher, 1 slow subscriber", "[integration]") +TEST_CASE("1 publisher, 1 slow subscriber") { cleanup_test_queue(); msgq_queue_t writer, reader; @@ -397,7 +391,7 @@ TEST_CASE("1 publisher, 1 slow subscriber", "[integration]") REQUIRE(n_skipped == 1428); } -TEST_CASE("1 publisher, 2 subscribers", "[integration]") +TEST_CASE("1 publisher, 2 subscribers") { cleanup_test_queue(); msgq_queue_t writer, reader1, reader2; diff --git a/msgq/test_runner.cc b/msgq/test_runner.cc deleted file mode 100644 index 4ed06df1f..000000000 --- a/msgq/test_runner.cc +++ /dev/null @@ -1,2 +0,0 @@ -#define CATCH_CONFIG_MAIN -#include diff --git a/msgq/test_runner.h b/msgq/test_runner.h new file mode 100644 index 000000000..7ebfeb6a0 --- /dev/null +++ b/msgq/test_runner.h @@ -0,0 +1,106 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace test_runner { + +struct TestCase { + const char *name; + void (*function)(); +}; + +inline std::vector &tests() { + static std::vector registered_tests; + return registered_tests; +} + +struct Registrar { + Registrar(const char *name, void (*function)()) { + tests().push_back({name, function}); + } +}; + +struct TestState { + std::size_t assertion_count = 0; + bool failed = false; + std::string failure_message; +}; + +inline TestState &state() { + static TestState test_state; + return test_state; +} + +inline bool require(bool result, const char *expression, const char *file, int line) { + state().assertion_count++; + if (!result) { + state().failed = true; + state().failure_message = std::string(file) + ":" + std::to_string(line) + + ": REQUIRE(" + expression + ") failed"; + } + return result; +} + +inline int run_all() { + if (tests().empty()) { + std::cerr << "[FAIL] no tests registered\n"; + return 1; + } + std::size_t passed = 0; + + for (const TestCase &test : tests()) { + state() = {}; + bool threw = false; + try { + test.function(); + } catch (const std::exception &error) { + threw = true; + std::cerr << "[FAIL] " << test.name << "\n " << error.what() << '\n'; + } catch (...) { + threw = true; + std::cerr << "[FAIL] " << test.name << "\n unknown exception\n"; + } + + if (threw) { + continue; + } else if (state().failed) { + std::cerr << "[FAIL] " << test.name << "\n " << state().failure_message << '\n'; + } else if (state().assertion_count == 0) { + std::cerr << "[FAIL] " << test.name << "\n no assertions executed\n"; + } else { + ++passed; + std::cout << "[PASS] " << test.name << '\n'; + } + } + + std::cout << '\n' << passed << "/" << tests().size() << " tests passed\n"; + return passed == tests().size() ? 0 : 1; +} + +} // namespace test_runner + +#define TEST_RUNNER_JOIN_IMPL(left, right) left##right +#define TEST_RUNNER_JOIN(left, right) TEST_RUNNER_JOIN_IMPL(left, right) + +#define TEST_CASE(name) \ + static void TEST_RUNNER_JOIN(test_case_, __LINE__)(); \ + static const test_runner::Registrar TEST_RUNNER_JOIN(test_registrar_, \ + __LINE__)( \ + name, TEST_RUNNER_JOIN(test_case_, __LINE__)); \ + static void TEST_RUNNER_JOIN(test_case_, __LINE__)() + +#define REQUIRE(expression) \ + do { \ + if (!test_runner::require(static_cast(expression), #expression, \ + __FILE__, __LINE__)) { \ + return; \ + } \ + } while (false) + +int main() { + return test_runner::run_all(); +} diff --git a/pyproject.toml b/pyproject.toml index e7fc6410d..b52248d90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,6 @@ dev = [ "setuptools", # for distutils "Cython", "scons", - "catch2 @ git+https://github.com/commaai/dependencies.git@release-catch2#subdirectory=catch2", "ruff", "parameterized", "cppcheck", From 425b61a60358895b894e9a6920b1d3e06903132e Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 21 Jul 2026 22:25:43 -0700 Subject: [PATCH 2/4] rm parameterized --- msgq/tests/test_fake.py | 18 +++++++++++------- pyproject.toml | 1 - 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/msgq/tests/test_fake.py b/msgq/tests/test_fake.py index 2fa3a205f..799c3dba2 100644 --- a/msgq/tests/test_fake.py +++ b/msgq/tests/test_fake.py @@ -1,7 +1,6 @@ import multiprocessing import unittest import msgq -from parameterized import parameterized_class from typing import Optional WAIT_TIMEOUT = 5 @@ -92,12 +91,10 @@ def test_wait_for_one(self): assert msgq.wait_for_one_event([h.recv_called_event for h in handles], WAIT_TIMEOUT) == 1 -@parameterized_class([{"prefix": None}, {"prefix": "test"}]) -class TestFakeSockets(unittest.TestCase): +class FakeSocketsTestBase: prefix: Optional[str] = None def setUp(self): - super().setUp() msgq.toggle_fake_events(True) if self.prefix is not None: msgq.set_fake_prefix(self.prefix) @@ -107,7 +104,6 @@ def setUp(self): def tearDown(self): msgq.toggle_fake_events(False) msgq.delete_fake_prefix() - super().tearDown() def test_event_handle_init(self): handle = msgq.fake_event_handle("controlsState", override=True) @@ -163,7 +159,7 @@ def test_sockets_enable_disable(self): _ = sub_sock.receive() assert not recv_called.peek() except RuntimeError: - self.fail("event.wait() timed out") + raise AssertionError("event.wait() timed out") def test_synced_pub_sub(self): carState_handle = msgq.fake_event_handle("carState", enable=True) @@ -198,7 +194,15 @@ def test_synced_pub_sub(self): frame = int.from_bytes(msg, 'little') assert frame == i except RuntimeError: - self.fail("event.wait() timed out") + raise AssertionError("event.wait() timed out") finally: p.kill() p.join() + + +class TestFakeSockets(FakeSocketsTestBase, unittest.TestCase): + pass + + +class TestFakeSocketsWithPrefix(FakeSocketsTestBase, unittest.TestCase): + prefix = "test" diff --git a/pyproject.toml b/pyproject.toml index b52248d90..df5aac13f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,6 @@ dev = [ "Cython", "scons", "ruff", - "parameterized", "cppcheck", "cpplint", "codespell", From deecc5d246e79d91b62874d08b43be0cc023b241 Mon Sep 17 00:00:00 2001 From: YassineYousfi Date: Wed, 5 Aug 2026 15:28:40 -0700 Subject: [PATCH 3/4] package shared object files (#699) --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index df5aac13f..8bb946933 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,9 @@ dev = [ "lefthook", ] +[tool.setuptools.package-data] +"*" = ["*.so"] + # https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml [tool.ruff] lint.select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF100", "A"] From 0e266c1dbcf7328beee3e57b4a8688555387c877 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 8 Aug 2026 09:27:04 -0700 Subject: [PATCH 4/4] Remove camera knowledge from visionipc (#701) --- msgq/visionipc/__init__.py | 3 +-- msgq/visionipc/tests/test_visionipc.py | 26 +++++++++++++------------- msgq/visionipc/visionbuf.h | 14 ++++++-------- msgq/visionipc/visionipc.pxd | 3 +-- msgq/visionipc/visionipc_client.cc | 6 +++--- msgq/visionipc/visionipc_pyx.pyx | 9 +-------- msgq/visionipc/visionipc_server.cc | 4 ++-- 7 files changed, 27 insertions(+), 38 deletions(-) diff --git a/msgq/visionipc/__init__.py b/msgq/visionipc/__init__.py index fb31238e8..f93bafcc4 100644 --- a/msgq/visionipc/__init__.py +++ b/msgq/visionipc/__init__.py @@ -1,9 +1,8 @@ -from msgq.visionipc.visionipc_pyx import VisionBuf, VisionIpcClient, VisionIpcServer, VisionStreamType, get_endpoint_name +from msgq.visionipc.visionipc_pyx import VisionBuf, VisionIpcClient, VisionIpcServer, get_endpoint_name __all__ = [ "VisionBuf", "VisionIpcClient", "VisionIpcServer", - "VisionStreamType", "get_endpoint_name", ] diff --git a/msgq/visionipc/tests/test_visionipc.py b/msgq/visionipc/tests/test_visionipc.py index ed7c17c5c..b938df447 100644 --- a/msgq/visionipc/tests/test_visionipc.py +++ b/msgq/visionipc/tests/test_visionipc.py @@ -1,7 +1,7 @@ import struct import unittest from typing import Optional -from msgq.visionipc import VisionIpcServer, VisionIpcClient, VisionStreamType +from msgq.visionipc import VisionIpcServer, VisionIpcClient class TestVisionIpc(unittest.TestCase): @@ -31,19 +31,19 @@ def setup_vipc(self, name, *stream_types, num_buffers=1, width=100, height=100, return self.server, self.client def test_connect(self): - self.setup_vipc("camerad", VisionStreamType.VISION_STREAM_ROAD) + self.setup_vipc("camerad", 0) assert self.client is not None assert self.client.is_connected() def test_available_streams(self): - stream_types = (VisionStreamType.VISION_STREAM_ROAD, VisionStreamType.VISION_STREAM_WIDE_ROAD) + stream_types = (0, 2) self.setup_vipc("camerad", *stream_types) available_streams = VisionIpcClient.available_streams("camerad", True) - assert available_streams == {stream.value for stream in stream_types} + assert available_streams == set(stream_types) def test_buffers(self): width, height, num_buffers = 100, 200, 5 - self.setup_vipc("camerad", VisionStreamType.VISION_STREAM_ROAD, num_buffers=num_buffers, width=width, height=height) + self.setup_vipc("camerad", 0, num_buffers=num_buffers, width=width, height=height) assert self.client is not None assert self.client.width == width assert self.client.height == height @@ -51,13 +51,13 @@ def test_buffers(self): assert self.client.num_buffers == num_buffers def test_send_single_buffer(self): - self.setup_vipc("camerad", VisionStreamType.VISION_STREAM_ROAD) + self.setup_vipc("camerad", 0) assert self.server is not None assert self.client is not None assert self.client.buffer_len is not None buf = bytearray(self.client.buffer_len) struct.pack_into(" VisionIpcClient::getAvailableStreams(const std::strin if (socket_fd < 0) { return {}; } - // Send VISION_STREAM_MAX to server to request available streams - int request = VISION_STREAM_MAX; + // Send VISION_STREAM_LIST to server to request available streams + VisionStreamType request = VISION_STREAM_LIST; int r = ipc_sendrecv_with_fds(true, socket_fd, &request, sizeof(request), nullptr, 0, nullptr); assert(r == sizeof(request)); - VisionStreamType available_streams[VISION_STREAM_MAX] = {}; + VisionStreamType available_streams[VISIONIPC_MAX_STREAMS] = {}; r = ipc_sendrecv_with_fds(false, socket_fd, &available_streams, sizeof(available_streams), nullptr, 0, nullptr); if (r < 0) { // only expected error is server shutting down diff --git a/msgq/visionipc/visionipc_pyx.pyx b/msgq/visionipc/visionipc_pyx.pyx index 533762bb7..a274d4f7a 100644 --- a/msgq/visionipc/visionipc_pyx.pyx +++ b/msgq/visionipc/visionipc_pyx.pyx @@ -9,7 +9,7 @@ from libcpp.string cimport string from .visionipc cimport VisionIpcServer as cppVisionIpcServer from .visionipc cimport VisionIpcClient as cppVisionIpcClient from .visionipc cimport VisionBuf as cppVisionBuf -from .visionipc cimport VisionIpcBufExtra +from .visionipc cimport VisionIpcBufExtra, VisionStreamType from .visionipc cimport get_endpoint_name as cpp_get_endpoint_name @@ -17,13 +17,6 @@ def get_endpoint_name(string name, VisionStreamType stream): return cpp_get_endpoint_name(name, stream).decode('utf-8') -cpdef enum VisionStreamType: - VISION_STREAM_ROAD - VISION_STREAM_DRIVER - VISION_STREAM_WIDE_ROAD - VISION_STREAM_MAP - - cdef class VisionBuf: @staticmethod cdef create(cppVisionBuf * cbuf): diff --git a/msgq/visionipc/visionipc_server.cc b/msgq/visionipc/visionipc_server.cc index b7c1f8beb..a59ea6169 100644 --- a/msgq/visionipc/visionipc_server.cc +++ b/msgq/visionipc/visionipc_server.cc @@ -99,7 +99,7 @@ void VisionIpcServer::listener(){ int fd = accept(sock, NULL, NULL); assert(fd >= 0); - VisionStreamType type = VisionStreamType::VISION_STREAM_MAX; + VisionStreamType type = VISION_STREAM_LIST; int r = ipc_sendrecv_with_fds(false, fd, &type, sizeof(type), nullptr, 0, nullptr); if (r != sizeof(type)) { close(fd); @@ -108,7 +108,7 @@ void VisionIpcServer::listener(){ } // send available stream types - if (type == VisionStreamType::VISION_STREAM_MAX) { + if (type == VISION_STREAM_LIST) { std::vector available_stream_types; for (auto& [stream_type, _] : buffers) { available_stream_types.push_back(stream_type);