Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
joy_demo: Don't start preview if alpha is 0.
Browse files Browse the repository at this point in the history
Running the preview pipeline and having DispmanX compose with
alpha blending adds to the total workload, potentially increasing
thermal output. If it's not gonna be visible, don't do it.

Change-Id: Icd10989f217eadddaa3fefe1c1d01ccfe409e436
  • Loading branch information
Jonas Larsson committed Apr 13, 2018
1 parent fca6998 commit 35d8d12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/examples/vision/joy/joy_detection_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ def take_photo():
photographer.shoot(camera)

# Blend the preview layer with the alpha value from the flags.
camera.start_preview(alpha=preview_alpha)
if preview_alpha > 0:
logger.info('Starting preview with alpha %d', preview_alpha)
camera.start_preview(alpha=preview_alpha)
else:
logger.info('Not starting preview, alpha 0')

button = Button(23)
button.when_pressed = take_photo
Expand Down

0 comments on commit 35d8d12

Please sign in to comment.