basic_bot.commons.base_camera
This was originally pilfered from https://github.com/adeept/Adeept_RaspTank/blob/a6c45e8cc7df620ad8977845eda2b839647d5a83/server/base_camera.py
Which looks like it was in turn pilfered from https://blog.miguelgrinberg.com/post/flask-video-streaming-revisited
Thank you, @adeept and @miguelgrinberg!
CameraEvent Objects
An Event-like class that signals all active clients when a new frame is available.
wait
Invoked from each client's thread to wait for the next frame.
set
Invoked by the camera thread when a new frame is available.
clear
Invoked from each client's thread after a frame was processed.
BaseCamera Objects
BaseCamera is an abstract base class that for camera implementations. It creates a background thread that reads frames from the camera and signals when a new frame is available.
__init__
Start the background camera thread if it isn't running yet.
get_frame
Return the current camera frame.
frames
"Generator that returns frames from the camera.
stats
Return the fps stats dictionary.