Files
pide/script/test/test_stream_out.py
2022-08-11 16:24:40 +02:00

36 lines
1012 B
Python

#stop_event = multiprocessing.Event()
#parameter_queue = multiprocessing.Queue()
#manager = multiprocessing.Manager()
#statistics = manager.Namespace()
stop_event = threading.Event()
parameter_queue = queue.Queue()
statistics=Namespace()
OUTPUT_PORT = 12005
viewer.show_stream("tcp://localhost:" + str(OUTPUT_PORT))
pipeline_config = PipelineConfig("test_pipeline", parameters={"camera_name": "simulation", "function":"transparent"})
def send():
print ("Startint pipeline on port: ", OUTPUT_PORT)
try:
processing_pipeline(stop_event, statistics, parameter_queue, camera_client, pipeline_config, OUTPUT_PORT, MockBackgroundManager())
except:
traceback.print_exc()
thread = Thread(target=send)
thread.start()
with source(host="127.0.0.1", port=OUTPUT_PORT, mode=SUB, receive_timeout = 3000) as stream:
data = stream.receive()
if not data:
raise Exception("Received None message.")
print (data.data.data.keys())
stop_event.set()
thread.join(5.0)