Skip to content

Add a new OutputWindows control#346

Draft
davidplowman wants to merge 5 commits into
nextfrom
output-windows
Draft

Add a new OutputWindows control#346
davidplowman wants to merge 5 commits into
nextfrom
output-windows

Conversation

@davidplowman

Copy link
Copy Markdown
Collaborator

This control lets you direct the camera image at only a smaller "window" within the normal output image.

It is intended primarily for ML applications that might want to create a square image but where the camera output is "letterboxed" within it.

Ensure platform specific controls are advertised as still being
available after calling configure().

Additionally, provide the correct defaults for the platform specific
ScalerCrops control, even if there's only a single stream. This is
more convenient for applications which no longer have to perform
different actions depending on whether it's available.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
We sometimes need to know which stream (according to its index in the
camera configuration) corresponds to which ISP output branch (0 or
1). Previously this was stored within the cropParams_ (for use by the
ScalerCrops controls).

Here we remove the ISP index to its own array, making it easier for
other functions to refer to it in future.

Additionally, when implementing cropping, we rename the "index"
variable to "ispIndex" for future clarity.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
This control allows the camera images to occupy only a smaller
"window" within the overall output.

It is principally intended for machine learning applications that
might want to create letterboxed versions of the camera image directly
in a larger square output.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Add a small OutputInfo structure to store some extra useful
information about the output buffers, such as the pixel alignment
required for output format, and the minimum image width we can make
before having to resort to software downscaling.

This information will be used by future features.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
We add the OutputWindows control and apply it to the pipeline at the
same time as the ScalerCrops (the applyScalerCrops function is renamed
to applyScalerCropsAndWindows).

The platform specific implementation for the Pi5/PiSP checks the
validity (size and alignment) of the output windows using the extra
OutputInfo that is now available.

We only allow modification of the output window when no software
downscaling is required, as this limits the amount of pipeline
reconfiguration we might need to perform at runtime (though we could
revisit this at a later date).

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
@davidplowman davidplowman marked this pull request as draft June 19, 2026 13:05
@davidplowman

Copy link
Copy Markdown
Collaborator Author

@naushir Not a thing to merge, but would appreciate any feedback before I consider trying to upstream!

@pinchartl

Copy link
Copy Markdown
Collaborator

We already support offsets (in FrameBuffer::Plane) and stride, I'd rather use that than a new control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants