Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Use controls::ScalerCrop on VC4 platforms #746

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/rpicam_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,10 @@ void RPiCamApp::StartCamera()
LOG(2, "Using crop (lores) " << crops.back().toString());
}

controls_.set(controls::rpi::ScalerCrops, libcamera::Span<const Rectangle>(crops.data(), crops.size()));
if (options_->GetPlatform() == Platform::VC4)
controls_.set(controls::ScalerCrop, crops[0]);
else
controls_.set(controls::rpi::ScalerCrops, libcamera::Span<const Rectangle>(crops.data(), crops.size()));
}

if (!controls_.get(controls::AfWindows) && !controls_.get(controls::AfMetering) && options_->afWindow_width != 0 &&
Expand Down
8 changes: 8 additions & 0 deletions utils/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ def test_hello(exe_dir, output_dir):
check_retcode(retcode, "test_hello: roi test")
check_time(time_taken, 1, 6, "test_hello: roi test")

# "crops test". Specify an image crop with lores output and see if it blows up.
print(" crop test")
retcode, time_taken = run_executable(
[executable, '-t', '2000', '--roi', '0.25,0.25,0.5,0.5',
'--lores-width', '640', '--lores-height', '640'], logfile)
check_retcode(retcode, "test_hello: crop test")
check_time(time_taken, 1, 6, "test_hello: crop test")

# "controls test". Specify some image controls and see if it blows up.
print(" controls test")
retcode, time_taken = run_executable(
Expand Down