def thread_entry(self):
"""Entry point for consumption happening in the thread"""
try:
# Keep beffering for some time
self._buffer_start = time.time()
while self._q.qsize() < self._video_buffer_sz and not self._stop_thread:
logging.info('Buffering. Q: %s', self._q.qsize())
time.sleep(0.25)
# Set the start time
self._start_time = time.time()
# Run until requested to stop
while not self._stop_thread:
self.__consume()
time.sleep(1 / self._fps)
# When stopped - indicate stop time
self._stop_time = time.time()
return
except KeyboardInterrupt:
logging.warn('Except in consume thread!')
pass
评论列表
文章目录