Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self._log = log
self._streams = []
self._vis_pack = None
# Construct UDP streams and associated item groups.
stream_config = spead2.send.StreamConfig(
spead_config['stream_config']['max_packet_size'],
spead_config['stream_config']['rate'],
spead_config['stream_config']['burst_size'],
spead_config['stream_config']['max_heaps'])
for stream in spead_config['streams']:
threads = stream['threads'] if 'threads' in stream else 1
thread_pool = spead2.ThreadPool(threads=threads)
log.info("Creating SPEAD stream for host {} on port {} ..."
.format(stream['host'], stream['port']))
udp_stream = spead2.send.UdpStream(thread_pool, stream['host'],
stream['port'], stream_config)
item_group = spead2.send.ItemGroup(
flavour=spead2.Flavour(4, 64, 40, 0))
# Append udp_stream and item_group to the stream list as a tuple.
self._streams.append((udp_stream, item_group))