Skip to content

Commit

Permalink
rpicam_still: Fix immediate capture breakage
Browse files Browse the repository at this point in the history
This feature was broken when adding the zsl option, fix it.
Add a regression test for the immediate option as well.

Signed-off-by: Naushir Patuck <[email protected]>
  • Loading branch information
naushir committed Nov 21, 2023
1 parent dd744cb commit d756abe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/rpicam_still.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static void event_loop(RPiCamStillApp &app)
} af_wait_state = AF_WAIT_NONE;
int af_wait_timeout = 0;

bool want_capture = false;
bool want_capture = options->immediate;
for (unsigned int count = 0;; count++)
{
RPiCamApp::Msg msg = app.Wait();
Expand Down
10 changes: 9 additions & 1 deletion utils/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def test_still(exe_dir, output_dir):
check_size(output_jpg, 1024, "test_still: jpg test")

# "no-raw test". As above but without a raw stream.
print(" jpg test")
print(" no-raw test")
retcode, time_taken = run_executable([executable, '-t', '1000', '-o', output_jpg, '--no-raw'], logfile)
check_retcode(retcode, "test_still: no-raw test")
check_time(time_taken, 1.2, 8, "test_still: no-raw test")
Expand All @@ -232,6 +232,14 @@ def test_still(exe_dir, output_dir):
check_time(time_taken, 1.2, 8, "test_still: zsl test")
check_size(output_jpg, 1024, "test_still: zsl test")

# "immediate test". Immediate capture test
print(" immediate test")
retcode, time_taken = run_executable([executable, '-o', output_jpg, '--immediate', '--shutter', '20000',
'--gain', '1.0', '--awbgains', '1.5,1.2'], logfile)
check_retcode(retcode, "test_still: immediate test")
check_time(time_taken, 0.2, 5, "test_still: immediate test")
check_size(output_jpg, 1024, "test_still: immediate test")

# "png test". As above, but write a png.
print(" png test")
retcode, time_taken = run_executable(
Expand Down

0 comments on commit d756abe

Please sign in to comment.