mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-21 03:15:06 +03:00
py: cam.py: Fix duplicate metadata output if more than one stream
Currently, if there are multiple streams, the --metadata flag will print the metadata for each request multiple times. Moving the metadata print logic outside the stream for loop this will no longer occur. Signed-off-by: Daniel Oakley <daniel.oakley@ideasonboard.com> Reviewed-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
3666290f5f
commit
20e33bc0df
1 changed files with 5 additions and 5 deletions
|
@ -266,6 +266,11 @@ class CaptureState:
|
||||||
ctx.last = ts
|
ctx.last = ts
|
||||||
ctx.fps = fps
|
ctx.fps = fps
|
||||||
|
|
||||||
|
if ctx.opt_metadata:
|
||||||
|
reqmeta = req.metadata
|
||||||
|
for ctrl, val in reqmeta.items():
|
||||||
|
print(f'\t{ctrl} = {val}')
|
||||||
|
|
||||||
for stream, fb in buffers.items():
|
for stream, fb in buffers.items():
|
||||||
stream_name = ctx.stream_names[stream]
|
stream_name = ctx.stream_names[stream]
|
||||||
|
|
||||||
|
@ -284,11 +289,6 @@ class CaptureState:
|
||||||
'/'.join([str(p.bytes_used) for p in meta.planes]),
|
'/'.join([str(p.bytes_used) for p in meta.planes]),
|
||||||
crcs))
|
crcs))
|
||||||
|
|
||||||
if ctx.opt_metadata:
|
|
||||||
reqmeta = req.metadata
|
|
||||||
for ctrl, val in reqmeta.items():
|
|
||||||
print(f'\t{ctrl} = {val}')
|
|
||||||
|
|
||||||
if ctx.opt_save_frames:
|
if ctx.opt_save_frames:
|
||||||
with libcamera.utils.MappedFrameBuffer(fb) as mfb:
|
with libcamera.utils.MappedFrameBuffer(fb) as mfb:
|
||||||
filename = 'frame-{}-{}-{}.data'.format(ctx.id, stream_name, ctx.reqs_completed)
|
filename = 'frame-{}-{}-{}.data'.format(ctx.id, stream_name, ctx.reqs_completed)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue