MCPcopy Create free account
hub / github.com/ARM-software/AVH / init

Function init

interface/video/python/vsi_video.py:164–191  ·  view source on GitHub ↗
(address, authkey)

Source from the content-addressed store, hash-verified

162
163# Client connection to VSI Video Server
164def init(address, authkey):
165 global FILENAME_VALID
166
167 base_dir = path.dirname(__file__)
168 server_path = path.join(base_dir, 'vsi_video_server.py')
169
170 logger.info("Start video server")
171 if path.isfile(server_path):
172 # Start Video Server
173 if os_name == 'nt':
174 py_cmd = 'python'
175 else:
176 py_cmd = 'python3.9'
177 cmd = f"{py_cmd} {server_path} "\
178 f"--ip {address[0]} "\
179 f"--port {address[1]} "\
180 f"--authkey {authkey}"
181 subprocess.Popen(cmd, shell=True)
182 # Connect to Video Server
183 Video.connectToServer(address, authkey)
184 if Video.conn == None:
185 logger.error("Server not connected")
186
187 else:
188 logger.error(f"Server script not found: {server_path}")
189
190 # Register clean-up function
191 atexit.register(cleanup)
192
193
194## Flush Stream buffer

Callers

nothing calls this directly

Calls 1

connectToServerMethod · 0.45

Tested by

no test coverage detected