Commit graph

5589 commits

Author SHA1 Message Date
Laurent Pinchart
432b14013c libcamera: camera: Log proposed configuration in streamConfiguration()
The IPU3 and RKISP1 pipeline handlers log the camera configuration they
propose in their streamConfiguration() methods. Other pipeline handlers
are expected to log similar information, move it to the Camera class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-04-28 13:42:53 +03:00
Niklas Söderlund
ff24be7022 libcamera: camera: Check requests before queueing them
Make sure all requests queued to a camera only contain streams which
have been configured and belong to the camera.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-04-28 11:29:33 +02:00
Laurent Pinchart
11fd9f171e test: signal: Exercise the signal delivery code paths for Object
Member slots for objects deriving from the Object class receive special
handling. Add one test to make sure we exercise the related code paths.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-27 17:50:25 +03:00
Laurent Pinchart
df587aa100 libcamera: Make libudev optional
libcamera depends on libudev for device enumeration. It is however
useful to allow building documentation without requiring the dependency
to be installed. Make the libudev dependency optional and compile the
udev-based device enumerator out when libudev is not present.

Note that while libcamera will compile without libudev, it will not be
able to enumerate devices. A sysfs-based device enumerator is planned as
a fallback but not implemented yet.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-27 17:11:13 +03:00
Kieran Bingham
c34e09d33a libcamera: v4l2_device: Prefix V4L2 direction in log messages
The V4L2Device will use the same deviceNode for two directions in the
case of an M2M device.

Add the direction to identify the queue direction on each instance.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-27 15:59:59 +02:00
Laurent Pinchart
2ab299a276 libcamera: Remove outdated \todo comments
Some \todo comments are outdated and refer to tasks that have been
completed. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-26 19:26:56 +03:00
Laurent Pinchart
4c8989cdf7 cam: options: Fix string concatenation
Adding an integer value to a char pointer doesn't concatenate strings,
it indexes in the pointed string. Fix it.

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>
2019-04-26 19:25:19 +03:00
Laurent Pinchart
5d987629d9 cam: options: Don't initialise variable-length arrays
According to clang, variable-length arrays can't be initialised. Don't
do so, and explicitly set the last element to 0 instead.

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>
2019-04-26 19:25:17 +03:00
Laurent Pinchart
d98ab6f2ae test: v4l2_subdevice: Remove std::move() that prevents copy elision
Moving a temporary value prevents copy elision. Remove it.

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>
2019-04-26 19:25:15 +03:00
Laurent Pinchart
4088ae7a20 libcamera: v4l2_device: Buffer is not a struct
Buffer is a class, not a struct. Fix a variable declaration accordingly.

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>
2019-04-26 19:25:13 +03:00
Laurent Pinchart
1ec73e9ad5 libcamera: Mark overridden functions with override
Several overridden virtual functions are not marked with override. Fix
it.

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>
2019-04-26 19:25:11 +03:00
Laurent Pinchart
af0d21ef81 libcamera: log: Add a LogInvalid entry to LogSeverity
enum LogSeverity values are assigned or compared to -1 to flag invalid
log severities. This generates compilation warnings with clang. Fix it
by adding an explicit LogInvalid entry to the enumeration.

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>
2019-04-26 19:25:05 +03:00
Laurent Pinchart
2eeb826f3f libcamera: event_dispatcher_poll: Fix bitwise test
Add missing parentheses to fix a bitwise test.

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>
2019-04-26 19:07:49 +03:00
Laurent Pinchart
152147c539 libcamera: Correct struct forward declarations
Several structures are forward-declarated as classes. Fix this by using
the struct keyword where appropriate, or removing the forward
declaration when not needed.

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>
2019-04-26 19:07:45 +03:00
Giulio Benetti
ab0188fc8b libcamera: utils: call secure_getenv() if it exists or workaround with issetugid()
When secure_getenv() is not available, need to have a workaround.

Check if secure_getenv() is present, otherwise call issetugid() on its
place.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[Kieran: include stdlib.h]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-26 14:31:59 +02:00
Giulio Benetti
46bfc32157 meson: check if secure_getenv() is present
Not all libc make secure_getenv() available, this could lead to build
failure on certain build systems.

Check if secure_getenv() is available and emit #define
HAVE_SECURE_GETENV to config.h Include config.h to every c/c++ file
during building by adding `-include config.h` to project arguments for
both c and c++.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[Kieran: Drop unnessecary meson message
         Update commit message]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-26 14:31:09 +02:00
Jacopo Mondi
a10fbfcaaa libcamera: ipu3: Connect viewfinder's BufferReady signal
The viewfinder and main output require identical logic for buffer and
request completion. Connect the viewfinder bufferReady signal to the slot
and handle requests for both main output and viewfinder there.

Update the slot logic to complete the request only when the last buffer
has completed, and make sure to complete requests in the same order they
have been queued to the pipeline handler.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 16:00:03 +02:00
Jacopo Mondi
9f2bf7ba1e libcamera: ipu3: Queue requests for multiple streams
Add support for queueing requests for multiple streams in the IPU3
pipeline handler class.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 16:00:03 +02:00
Jacopo Mondi
57c84b4f3f libcamera: ipu3: Add multiple stream memory management
Perform allocation and setup of memory sharing between the CIO2 output
and the ImgU input and allocate memory for each active stream.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 16:00:03 +02:00
Jacopo Mondi
2aa2bbaae9 libcamera: ipu3: Use roles in stream configuration
Use and inspect the stream roles provided by the application to
streamConfiguration() to assign streams to their intended roles and
return a default configuration associated with them.

Support a limited number of usages, with the viewfinder stream able to
capture both continuous video streams and still images, and the main
output stream supporting still images only. This is an artificial
limitation until we figure out the exact capabilities of the hardware.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 15:59:56 +02:00
Jacopo Mondi
a7f4a98110 libcamera: ipu3: Create camera with 2 streams
Sub-class the Stream class with an IPU3-specific implementation and
create each IPU3 camera with two streams: 'output' and 'viewfinder'
which represent the video streams from main and secondary ImgU output
respectively.

Rework stream configuration to handle the two video streams 'output'
and 'viewfinder' separately.

As the IPU3 driver requires viewfinder and stat video nodes to be
started not to stall ImgU processing, configure 'output', 'viewfinder'
and 'stat' regardless of the user-requested active streams.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 15:56:15 +02:00
Jacopo Mondi
6647db6f42 libcamera: camera: Reset basefield to decimal
When logging the camera configuration, the same ostringstream instance
is used to assemble a message describing configuration of all the
configured streams.

After the first stream configuration has been assembled, the use of
std::hex modifies the ostringstream basefield, causing all successive
integers values inserted in the stream to be expressed as hexadecimals.

Fix that by resetting the stream's basefield to decimal, before
assembling a stream configuration description.

Before this patch:
INFO Camera camera.cpp:615  (0) 640x480-0x3231564e (1) 140xa0-0x3231564e
After this patch:
INFO Camera camera.cpp:616  (0) 640x480-0x3231564e (1) 320x160-0x3231564e

Fixes: 9c90781332 ("libcamera: camera: Log requested configuration in configureStreams()")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 14:11:09 +02:00
Jacopo Mondi
323f21b56b libcamera: stream: Document protected members
Since commit: 4e1dc9004f ("libcamera: stream: Make Stream inheritable")
the private members of the Stream class have been turned into protected,
to allows subclasses to access them.

As Doxygen generates documentation for protected members (but not for
private memebers), add documentation to the stream class for the
'bufferMap_' and 'configuration_' members.

Fixes: 4e1dc9004f ("libcamera: stream: Make Stream inheritable")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 14:10:15 +02:00
Laurent Pinchart
1ba441cae6 libcamera: Include header related to source file first
Include the header file corresponding to the source file in the very
first position. This complies with the Google C++ coding style
guideliens, and helps ensuring that the headers are self-contained.

Three bugs are already caught by this change (missing includes or
forward declarations) in device_enumerator.h, event_dispatcher_poll.h
and pipeline_handler.h. Fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 13:38:14 +03:00
Laurent Pinchart
0af0fb9ca9 libcamera: stream: Add and use toString() method to StreamConfiguration
Add a toString() method to the StreamConfiguration class, and replace
all manually coded implementations through the source code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 13:38:14 +03:00
Laurent Pinchart
8cf52e378d libcamera: pipeline: rkisp1: Don't hardcode NV12 in configureStreams()
Use the pixel format requested by the application in the
RkISP1PipelineHandler::configureStreams() method instead of hardcoding
NV12. The streamsConfiguration() method still proposes NV12 by default.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 13:38:11 +03:00
Laurent Pinchart
8bc88758d2 libcamera: Document documentation style and update the code accordingly
The documentation style for the Doxygen comment blocks is inconsistent
in the library. Document the expectations and update all existing
comment blocks to match.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-19 13:20:46 +03:00
Laurent Pinchart
0d1b60adaf libcamera: pipeline: Add RKISP1 pipeline
The pipeline handler for the Rockchip ISP creates one camera instance
per detected raw Bayer CSI-2 sensor. Parallel sensors and YUV sensors
are not supported yet.

As the ISP has a single CSI-2 receiver, only one camera can be used at a
time. Mutual exclusion isn't implemented yet.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-18 18:13:28 +03:00
Laurent Pinchart
2619480146 libcamera: pipeline: ipu3: Use the new CameraSensor class
Replace the manual handling of sensor formats with usage of the new
CameraSensor class.

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>
2019-04-18 18:13:22 +03:00
Laurent Pinchart
7645083c72 libcamera: camera_sensor: Add a new class to model a camera sensor
The CameraSensor class abstracts camera sensors and provides helper
functions to ease interactions with them. It is currently limited to
sensors that expose a single subdev, and offer the same frame sizes for
all media bus codes, but will be extended to support more complex
sensors as the needs arise.

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>
2019-04-18 18:13:17 +03:00
Laurent Pinchart
05b0e5ed53 libcamera: v4l2_subdevice: Add method to retrieve the media entity
Add a method to retrieve the media entity associated with a subdevice.
The entityName() and deviceNode() methods are not needed anymore as they
can be accessed through the media entity, remove them.

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>
2019-04-18 18:13:16 +03:00
Laurent Pinchart
d97cafdf3c libcamera: v4l2_subdevice: Close subdevice when destroyed
Make sure the subdevice file descriptor isn't leaked by closing it when
the V4L2Subdevice instance is destroyed.

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>
2019-04-18 18:13:15 +03:00
Laurent Pinchart
889b70d62d libcamera: utils: Add set_overlap() function
The new set_overlap() function counts the number of overlapping elements
in the intersection of two sorted ranges defined by their beginning and
ending iterators.

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>
2019-04-18 18:13:14 +03:00
Laurent Pinchart
2059b857e1 test: geometry: Add tests for Size class comparison operators
Add a test that exercises all the comparison operators for the Size
class.

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>
2019-04-18 18:13:10 +03:00
Laurent Pinchart
66337b96b1 libcamera: geometry: Add comparison operators to geometry classes
Add equality and inequality comparison operators for the Rectangle, Size
and SizeRange classes.

For the Size class, also add ordering operators. Sizes are first
compared on combined width and height, then on area, and finally on
width only to achieve a stable ordering.

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>
2019-04-18 18:13:07 +03:00
Laurent Pinchart
72afcbb087 libcamera: geometry: Use Size to store min and max in SizeRange
Instead of storing four integers for the minimum and maximum width and
height in the SizeRange class, use two instance of the Size class for
the minimum and maximum sizes.

While it at replace the mention of image size with size in the SizeRange
documentation, as the Size class isn't limited to image sizes.

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>
2019-04-18 18:13:06 +03:00
Laurent Pinchart
e7f446e1ed libcamera: geometry: Sort classes alphabetically
Move the Size class before the SizeRange class. No functional change.

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>
2019-04-18 18:13:05 +03:00
Laurent Pinchart
9c90781332 libcamera: camera: Log requested configuration in configureStreams()
The IPU3 pipeline handler logs the requested configuration in its
configureStreams() handler. This is useful for other pipeline handlers
as well, move it to the Camera class.

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>
2019-04-18 18:13:00 +03:00
Laurent Pinchart
8f6f63a208 libcamera: log: Mark Loggable::_log() methods as const
The methods don't modify the object instance, mark them as const. This
allows using the LOG() macro from a const method of a Loggable object.

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>
2019-04-18 18:12:59 +03:00
Laurent Pinchart
9e3f9c5261 Install the cam and qcam utilities
The cam and qcam utilities are meant to be shipped with libcamera,
install them by default.

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>
2019-04-18 18:12:58 +03:00
Jacopo Mondi
ee027781b4 libcamera: buffer: Store Request reference in Buffer
Add to the Buffer class methods to set and retrieve a reference to the
Request instance the buffer is part of.

As buffers outlive the Request they are associated with, the reference
is only temporary valid during the buffer completion interval (from when
the buffer gets queued to Camera for processing, until it gets marked as
completed).

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-18 15:37:59 +02:00
Jacopo Mondi
0527ba92ad libcamera: request: Expose the Stream to Buffers map
Add to the Request class a method to access the map of Stream to Buffer.

With the introduction of multiple stream support, pipeline handler
should be able to access the map of streams at request queueing time.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-18 15:36:48 +02:00
Jacopo Mondi
e671485989 libcamera: camera: Validate Request before queueing it
Extend the Request::prepare() operation to validate the request before
preparing it. Return an error if the request is invalid, which for now
is limited to ensuring that the request contains at least one buffer.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-18 15:36:37 +02:00
Jacopo Mondi
571d16b539 libcamera: request: Add hasPendingBuffers() method
Add method to verify if a request has pending buffers yet to be
completed.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-18 15:35:34 +02:00
Jacopo Mondi
7b7c8f06a0 libcamera: v4l2_device: Propagate releaseBuffers() error
The error code returned by requestBuffers(0) was not propagated to the
caller. Fix it.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-18 15:35:18 +02:00
Jacopo Mondi
da341a4dd1 libcamera: camera: Don't call freeBuffer() on allocateBuffer() error
Do not assume the freeBuffer() function can handle allocateBuffer()
method failures, as error handling and clean up should be performed
by allocateBuffer() method itself.

Perform clean-up on allocations failures in the IPU3 pipeline handler,
now that freeBuffers() is not called anymore.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-18 15:34:54 +02:00
Jacopo Mondi
911bc4aa41 libcamera: camera: Pass the stream set to allocate/freeBuffers()
Pipeline handlers might need to perform allocation of internal buffers,
setup operations, or simple sanity check before going into the
per-stream buffer allocation.

As of now, PipelineHandler::allocateBuffers() is called once for each
active stream, leaving no space for stream-independent configuration.

Change this by providing to the pipeline handlers the full set of active
streams, and ask them to loop over them to perform per-streams
memory allocations and freeing.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-17 15:42:24 +02:00
Jacopo Mondi
4e1dc9004f libcamera: stream: Make Stream inheritable
In preparation for multiple streams support prepare to allow sub-classing
the Stream class by removing the 'final' specifier from the class
definition and make its private members protected.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-16 14:55:58 +02:00
Niklas Söderlund
7726cba16f libcamera: pipeline_handler: Add missing forward declaration of StreamUsage
When switching to stream usages in the PipelineHandler StreamUsage was
was not forward declared as it should and was hid by other include
files, fix this.

Fixes: 20a6455e0b ("libcamera: camera: Add support for stream usages")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-14 13:55:18 +02:00
Niklas Söderlund
8b26fec690 libcamera: Add missing header files to meson.build
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-04-09 17:36:30 +02:00