Commit graph

1736 commits

Author SHA1 Message Date
Niklas Söderlund
142a9ee3f8 android: camera_device: Use HAL_PIXEL_FORMAT_* defines for formats
The documentation says the HAL_PIXEL_FORMAT_* defines shall be used for
formats instead of ANDROID_SCALER_AVAILABLE_FORMATS_* for the
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS and
ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS tags.

This have worked in the past as the numerical value of the two sets are
the same for the formats supported.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Niklas Söderlund
3530614fbf android: camera_device: Remove ANDROID_SCALER_AVAILABLE_FORMATS
According to the documentation the tag
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS deprecates the
ANDROID_SCALER_AVAILABLE_FORMATS tag. As the HAL implements both tags
remove the deprecated one.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Laurent Pinchart
7145d15e04 libcamera: formats: Remove unnecessary explicit constructor calls
When initializing the PixelFormatInfo::format field with a PixelFormat,
there's no need to call the PixelFormat (copy) constructor explicitly.
Remove the unnecessary calls.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-24 14:23:03 +03:00
Niklas Söderlund
a8a2048ab0 libcamera: v4l2_videodevice: Add using statement for format map
Define a using statement for the format maps returned by
V4L2Device::formats() and use it in all call sites. There is no
functional change in this patch.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-23 16:31:41 +02:00
Niklas Söderlund
4a5b0df984 libcamera: formats: Remove ImageFormats
The ImageFormats helper class is not used anymore and can be removed.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-23 16:31:41 +02:00
Niklas Söderlund
dcda73ec14 libcamera: v4l2_subdevice: Replace ImageFormats with a map
Replace the V4L2Subdevice usage of the ImageFormats class with a
std::map and the utils::map_keys() helper.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-23 16:31:41 +02:00
Niklas Söderlund
d9295552b1 libcamera: Add support for RGB565 format
Add support for RGB565 format.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-21 14:19:09 +02:00
Niklas Söderlund
7855dc922f libcamera: Add support for planar YVU420 format
Add support for planar YVU420.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-21 14:19:09 +02:00
Naushir Patuck
3e7aa49344 libcamera: pipeline: ipa: raspberrypi: Use dma heap allocs for LS tables
Remove use of vcsm allocations and replace with dma heap allocations.
The pipeline handler now passes the fd of the allocation over to the IPA
instead of the raw pointer.

Also use libcamera::FileDescriptor for fd lifetime management.

This commit must be built alongside the accompanying BCM2835 ISP kernel
driver changes at https://github.com/raspberrypi/linux/pull/3715.
Otherwise a mismatch will cause undefined behavior.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-17 16:36:28 +03:00
Naushir Patuck
3c02a808e8 include: linux: Add dma-buf.h and dma-heap.h UAPI headers
This commit adds the dmabuf UAPI headers from the mainline Linux kernel
v5.6.19. They are required by the Raspberry Pi library for lens shading
table allocations.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-17 16:36:27 +03:00
Paul Elder
c3548a333f tests: v4l2_compat: Fix v4l2-compliance and v4l2-ctl version parsing
v4l2-compliance originally printed the SHA before the version, leading
to the indexing that was used previously. Now that the version is
printed before the SHA, the indexing is incorrect. Fix this.

Although v4l2-ctl doesn't suffer the same issue, it is more correct to
use the zeroth index like the v4l2-compliance version check now does, so
fix that as well.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-17 18:50:10 +09:00
Laurent Pinchart
49771c6dcc libcamera: ipa_proxy: Allow stop() on a stopped IPA
To make error handling easier in callers, allow the stop() function to
be called when the proxy is already stopped, or not started yet.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-17 02:13:53 +03:00
Laurent Pinchart
2c0fad508c libcamera: pipeline: raspberrypi: Start IPA when starting camera
The IPA is meant to be started when starting the camera, and stopped
when stopping it. It was so far started early in order to handle the
IPAInterface::processEvent() call related to lens shading table
allocation before IPAInterface::configure() to pass the table to the
IPA. Now that the lens shading table is passed through configure(),
starting the IPA early isn't needed anymore.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:50 +03:00
Laurent Pinchart
89682ea1c4 ipa: raspberrypi: Pass sensor config back from configure()
The Raspberry Pi IPA uses the custom RPI_IPA_ACTION_SET_SENSOR_CONFIG
frame action to send the sensor staggered write configuration to the
pipeline handler when the IPA is configured. Replace this ad-hoc
mechanism by passing the corresponding data back from the IPA to the
pipeline handler through the configure() response. This allows
synchronous handling of the response on the pipeline handler side.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:45 +03:00
Laurent Pinchart
40ed8b3b75 ipa: raspberrypi: Pass lens shading table through configure() function
The IPAInterface::configure() function now accepts custom configuration
data. Use it to pass the lens shading table instead of using a custom
IPA event. This will allow starting the IPA when starting the camera,
instead of pre-starting it early in order to process the lens shading
table allocation event.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:41 +03:00
Laurent Pinchart
c0b0b7205c ipa: raspberrypi: Drop CameraHelper::GetOrientation()
The camera sensor orientation is now handled by the pipeline handler.
Drop hardcoded per-sensor orientations from the IPA.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:40 +03:00
Laurent Pinchart
44aa793056 libcamera: pipeline: raspberrypi: Set sensor flip based on rotation
Instead of receiving sensor orientation configuration from the IPA,
retrieve it from the CameraSensor Rotation property, and configure the
HFLIP and VFLIP controls accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:38 +03:00
Laurent Pinchart
c567ca70d0 libcamera: pipeline: raspberrypi: Move configureIPA() to RPiCameraData
The PipelineHandlerRPi::configureIPA() function accesses plenty of
member data from the RPiCameraData class and no member from the
PipelineHandlerRPi class. Move it to RPiCameraData where it logically
belongs.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-17 02:13:37 +03:00
Laurent Pinchart
44c4be5dba libcamera: pipeline: raspberrypi: Constify parameter to StaggeredCtrl::set()
The controls parameter of StaggeredCtrl::set(), passed by reference, is
not modified by the function. Make it const.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-17 02:13:36 +03:00
Laurent Pinchart
44a9b13f88 libcamera: pipeline: raspberrypi: Drop unused local variable
The controls variable in PipelineHandlerRPi::start() is unused. Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:34 +03:00
Laurent Pinchart
72263c5203 libcamera: ipa_interface: Add support for custom IPA data to configure()
Add two new parameters, ipaConfig and result, to the
IPAInterface::configure() function to allow pipeline handlers to pass
custom data to their IPA, and receive data back. Wire this through the
code base. The C API interface will be addressed separately, likely
through automation of the C <-> C++ translation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-17 02:13:29 +03:00
Laurent Pinchart
f1a48f96af libcamera: ipa_context_wrapper: Fix bad copy&paste in comment
A comment copied from the IPAInterfaceWrapper incorrectly mentions the
IPAInterfaceWrapper class instead of the IPAContextWrapper class. Fix
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-17 02:13:28 +03:00
Laurent Pinchart
89ca91e6b8 libcamera: ipa: Document the parameters of the IPA C configure function
The parameters to the configure() function part of the ipa_context_ops
are not documented. Fix that.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-17 02:13:26 +03:00
Laurent Pinchart
c1bbba36d3 libcamera: file: Create the file on open() if it doesn't exist
When a file is opened in WriteOnly or ReadWrite mode, create it if it
doesn't exist.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 19:06:47 +03:00
Laurent Pinchart
aca22bc73a test: file: Add file creation test
Add a test to verify file creation with File::open(). The test is
expected to fail as the File::open() implementation is not correct.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 19:06:47 +03:00
Laurent Pinchart
7e1c153c22 test: file: Add read/write tests
Add tests for the File::read() and File::write() functions.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 19:06:47 +03:00
Laurent Pinchart
25288281d1 libcamera: file: Add read/write support
Add basic support to read and write data from/to a file, along with
retrieving and setting the current read/write position.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-15 19:06:43 +03:00
Laurent Pinchart
d5446e9f32 libcamera: geometry: Provide in-place versions of the Size helpers
Add alignDownTo(), alignUpTo(), boundTo() and expandTo() helper
functions to the Size class. These are in-place versions of the existing
alignedDownTo(), alignedUpTo(), boundedTo() and expandedTo() functions.

The new helpers return a reference to the size, to allow chaining the
functions. One can thus write

	size.alignDownTo(16, 16).alignUpTo(32, 32)
	    .boundTo({ 40, 80 }).expandTo({ 16, 80 });

instead of

	size.alignDownTo(16, 16);
	size.alignUpTo(32, 32);
	size.boundTo({ 40, 80 });
	size.expandTo({ 16, 80 });

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-15 17:33:54 +03:00
Laurent Pinchart
b5f3b9915c libcamera: geometry: Make Size and Rectangle usable as constexpr
There are use cases for declaring constexpr Size and Rectangle
instances. Make it possible.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 17:29:59 +03:00
Laurent Pinchart
945eedaf2f libcamera: geometry: Turn Size and Rectangle into classes
SizeRange is defined as a class while Size and Rectangle are defined as
struct. This is confusing for users in forward declarations. Simplify it
by turning both structures into classes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 17:29:59 +03:00
Laurent Pinchart
4f509caa8e libcamera: geometry: Give constructors to Rectangle
Rectangle, unlike Size, has no constructor, requiring the users to
explicitly initialize the instances. This is error-prone, add
constructors.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 17:29:59 +03:00
Laurent Pinchart
935aec66ae libcamera: geometry: Define Rectangle after Size
A subsequent change to the Rectangle will require the definition of the
Size to be available. Define Rectangle after Size to ease review of that
change. No code change is included.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 17:29:59 +03:00
Laurent Pinchart
120cbd8024 libcamera: geometry: Don't default-initialize Size unnecessarily
Size has a default constructor, there's no need to default-initialize
instances explicitly. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 17:29:59 +03:00
Laurent Pinchart
ed1b290aab libcamera: pipeline: simple: Use std::make_tuple()
Prior to N4387 ([1]), the std::tuple::tuple(const Types&...) constructor
was unconditionally explicit. gcc 5 doesn't implement N4387, leading to
a compilation error in the simple pipeline handler. Use
std::make_tuple() to fix it.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4387.html

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 17:29:59 +03:00
Laurent Pinchart
6c0afb8b33 libcamera: geometry: Add helper functions to the Size class
Pipeline handlers commonly have to calculate the minimum or maximum of
multiple sizes, or align a size's width and height. Add helper functions
to the Size class to perform those tasks.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-15 00:27:26 +03:00
Paul Elder
74c8b50833 tests: v4l2_compat: Check v4l2-compliance and v4l2-ctl versions
v4l2-compliance and v4l2-ctl with version 1.20 and before will fail with
v4l2-compat. Check the versions of v4l2-compliance and v4l2-ctl before
continuing.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-13 19:46:24 +09:00
Paul Elder
ce32ca4918 tests: v4l2_compat: Prettify failure output
When a test is being run on a video device, there is output like so:

Testing /dev/video0 with uvcvideo driver...

and when it succeeds, "success" is appended:

Testing /dev/video0 with uvcvideo driver... success

On failure, however, the output of v4l2-compliance is printed before
"failure" is printed, resulting in the first line of the v4l2-compliance
output to be printed on the same line as the message:

Testing /dev/video2 with uvcvideo driver... v4l2-compliance SHA: not available, 64 bits
<v4l2-compliance output>
failure

Refactor the code to make "failure" print before the output of the test,
to prettify the output upon failure.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-13 19:46:11 +09:00
Naushir Patuck
d76acac30d libcamera: pipeline: raspberrypi: Fix initial value for scoring routine
Use std::numerical_limits to initialise the best score instead of an
arbitrary value. This fixes a failure in v4l2-conformance when using
the Raspberry Pi pipeline handler and v4l2-compatibility libcamera
layer.

Reported-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
2020-07-10 23:17:17 +09:00
Paul Elder
e37e72c61c tests: v4l2_compat: Add test for v4l2_compat
Test the V4L2 compatibility layer by running v4l2-compliance -s on every
/dev/video* device.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-10 16:11:53 +09:00
Paul Elder
323a53c232 v4l2: v4l2_camera_proxy: Use stream config in tryFormat
For handling try_fmt, the values should be filled in by validating the
stream configuration, and not by recalculating them or manually checking
against the cached list of formats and sizes. Add a new
V4L2Camera::validateConfiguration() function to validate a configuration
and use it to obtain size, format, stride, and frameSize values.

If the format negotiation fails, return error from try_fmt and s_fmt.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-10 16:11:50 +09:00
Paul Elder
a3b5ee998e v4l2: v4l2_camera_proxy: Get stride and frameSize from stream config
The stride and frameSize should be obtained through StreamConfiguration
rather than PixelFormatInfo, as pipeline handlers might have different
values (eg. for alignment). Get the stride and frameSize values from
StreamConfiguration instead of from PixelFormatInfo.

This removes the need for V4L2CameraProxy's calculation helper functions
(bplMultiplier, imageSize, v4l2ToDrm, drmToV4L2, calculateSizeImage) and
formats, so remove them.

This also removes the need for V4L2CameraProxy::calculateSizeImage, so
remove it,.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-10 16:11:47 +09:00
Paul Elder
ae50922879 v4l2: v4l2_camera: Fix stream selection for buffer operations
The buffer operations in V4L2Camera were getting the stream from the
wrong place. Fix it.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-10 16:11:44 +09:00
Paul Elder
e52cc8c916 libcamera: StreamConfiguration: Update stride documentation
Now that all the pipeline handlers fill in the stride information at
validation time, update the documentation accordingly.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-10 16:11:41 +09:00
Paul Elder
7c3831d2d1 libcamera: vimc: Fill stride and frameSize at config validation
Fill the stride and frameSize fields of the StreamConfiguration at
configuration validation time instead of at camera configuration time.
This allows applications to get the stride when trying a configuration
without modifying the active configuration of the camera.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-10 16:11:38 +09:00
Paul Elder
d0395efd3a libcamera: uvcvideo: Fill stride and frameSize at config validation
Fill the stride and frameSize fields of the StreamConfiguration at
configuration validation time instead of at camera configuration time.
This allows applications to get the stride when trying a configuration
without modifying the active configuration of the camera.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-10 16:11:35 +09:00
Paul Elder
89fb1efac2 libcamera: simple: Fill stride and frameSize at config validation
Fill the stride and frameSize fields of the StreamConfiguration at
configuration validation time instead of at camera configuration time.
This allows applications to get the stride when trying a configuration
without modifying the active configuration of the camera.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-10 16:11:32 +09:00
Paul Elder
99b926bd12 libcamera: rkisp1: Fill stride and frameSize at config validation
Fill the stride and frameSize fields of the StreamConfiguration at
configuration validation time instead of at camera configuration time.
This allows applications to get the stride when trying a configuration
without modifying the active configuration of the camera.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-10 16:11:29 +09:00
Paul Elder
7ed827e0a0 libcamera: raspberrypi: Fill stride and frameSize at config validation
Fill the stride and frameSize fields of the StreamConfiguration at
configuration validation time instead of at camera configuration time.
This allows applications to get the stride when trying a configuration
without modifying the active configuration of the camera.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-10 16:11:26 +09:00
Paul Elder
3a9c574ed9 libcamera: ipu3: Fill stride and frameSize at config validation
Fill the stride and frameSize fields of the StreamConfiguration at
configuration validation time instead of at camera configuration time.
This allows applications to get the stride when trying a configuration
without modifying the active configuration of the camera.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-10 16:11:24 +09:00
Paul Elder
bded08db18 libcamera: pipeline: uvcvideo: Filter out unsupported formats
Unsupported formats should not be added to the configuration when
generating the configuration. Filter them out.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-10 16:11:21 +09:00