Skip to content

Commit

Permalink
cam.py: Fix handling of drm buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
tomba committed Nov 1, 2024
1 parent af195e4 commit 946590e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,12 @@ def readvid(ctx: Context, stream: Stream):
cap = stream['cap']
vbuf = cap.dequeue()

fb = None

if ctx.buf_type == 'drm':
fb = next((fb for fb in stream['fbs'] if fb.fd(0) == vbuf.fd), None)
assert fb is not None

fb = None
if ctx.save:
save_fb_to_file(stream, ctx.buf_type == 'drm', fb if ctx.buf_type == 'drm' else vbuf)

Expand Down

0 comments on commit 946590e

Please sign in to comment.