Start streamer on init and never time out
This commit is contained in:
parent
ae8e55fcda
commit
6e22376d9e
1 changed files with 3 additions and 12 deletions
|
|
@ -31,12 +31,14 @@ class BaseCamera(metaclass=ABCMeta):
|
|||
self.stop = False # Used to indicate that the stream loop should break
|
||||
|
||||
self.stream_timeout = 20
|
||||
self.stream_timeout_enabled = False
|
||||
|
||||
self.stream_active = False
|
||||
self.record_active = False
|
||||
self.preview_active = False
|
||||
|
||||
# Start the stream worker on init
|
||||
self.start_worker()
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def configuration(self):
|
||||
|
|
@ -154,17 +156,6 @@ class BaseCamera(metaclass=ABCMeta):
|
|||
self.frame = frame
|
||||
self.event.set() # send signal to clients
|
||||
|
||||
# Handle timeout
|
||||
if (
|
||||
self.stream_timeout_enabled
|
||||
and ( # If using timeout
|
||||
time.time() - self.last_access > self.stream_timeout
|
||||
)
|
||||
and not self.preview_active # And GPU preview is not active
|
||||
):
|
||||
self.frames_iterator.close()
|
||||
break
|
||||
|
||||
try:
|
||||
if self.stop is True:
|
||||
logging.debug("Worker thread flagged for stop.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue