From 1f6ab6980565740d8b36ccebb33347cf7a9fe330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Sat, 30 Sep 2023 18:45:45 -0700 Subject: [PATCH] compressed_vipc: fix issues with VisionIpcServer in ZMQ mode (#30115) old-commit-hash: 0e5cfa3426a3cc2e270c239169a126cdd233865d --- tools/camerastream/compressed_vipc.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/camerastream/compressed_vipc.py b/tools/camerastream/compressed_vipc.py index ac7ca2520b..c6e05a0af8 100755 --- a/tools/camerastream/compressed_vipc.py +++ b/tools/camerastream/compressed_vipc.py @@ -19,7 +19,11 @@ ENCODE_SOCKETS = { VisionStreamType.VISION_STREAM_DRIVER: "driverEncodeData", } -def decoder(addr, vipc_server, vst, nvidia, debug=False): +def decoder(addr, vst, nvidia, debug=False): + vipc_server = VisionIpcServer("camerad") + vipc_server.create_buffers(vst, 4, False, W, H) + vipc_server.start_listener() + sock_name = ENCODE_SOCKETS[vst] if debug: print("start decoder for %s" % sock_name) @@ -101,14 +105,9 @@ def decoder(addr, vipc_server, vst, nvidia, debug=False): class CompressedVipc: def __init__(self, addr, vision_streams, nvidia=False, debug=False): - self.vipc_server = VisionIpcServer("camerad") - for vst in vision_streams: - self.vipc_server.create_buffers(vst, 4, False, W, H) - self.vipc_server.start_listener() - self.procs = [] for vst in vision_streams: - p = multiprocessing.Process(target=decoder, args=(addr, self.vipc_server, vst, nvidia, debug)) + p = multiprocessing.Process(target=decoder, args=(addr, vst, nvidia, debug)) p.start() self.procs.append(p)