mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-12 23:09:45 +03:00
py: Switch to non-blocking eventfd
Blocking wait can be easily implemented on top in Python, so rather than supporting only blocking reads, or supporting both non-blocking and blocking reads, let's support only non-blocking reads. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
de7f1aa591
commit
bf3dbaece9
6 changed files with 41 additions and 12 deletions
|
@ -207,9 +207,16 @@ class SimpleCaptureMethods(CameraTesterBase):
|
|||
reqs = None
|
||||
gc.collect()
|
||||
|
||||
sel = selectors.DefaultSelector()
|
||||
sel.register(cm.event_fd, selectors.EVENT_READ)
|
||||
|
||||
reqs = []
|
||||
|
||||
while True:
|
||||
events = sel.select()
|
||||
if not events:
|
||||
continue
|
||||
|
||||
ready_reqs = cm.get_ready_requests()
|
||||
|
||||
reqs += ready_reqs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue