Commit graph

4465 commits

Author SHA1 Message Date
Kieran Bingham
d5ca33f6c7 qcam: meson: Use pkg-config method for qt5 dependencies
Meson searches for qmake to determine if QT5 is available to support the
optional qcam component.

When cross compiling, meson can incorrectly identify the host qmake
which will cause incorrect linkage and usage of system headers.

Set the dependency method to specify pkg-config which resolves the
issue.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-03 18:03:56 +07:00
Kieran Bingham
78552c818b libcamera: ipu3: Catch return value when disabling links
Ensure that any error from the disableLinks() call during match() is
propogated to the caller.

Fixes: d698ed2749 ("libcamera: ipu3: Create ImgUDevice class")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-03 18:03:41 +07:00
Jacopo Mondi
a8cab93b18 libcamera: ipu3: Enable ImgU media links
As the lengthy comment reports, link enable/disable is not trivial, as
links in one ImgU instance interfere with capture operations in the
other one. As it is not yet clear if this behaviour is intended, as of
now reset the media graph during pipeline's match() and enable the
required links at streamConfiguration time.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
b95d12ac31 libcamera: ipu3: Limit resolution to 2560x1920
As the procedure to configure the intermediate sizes and the alignement
requirements of the ImgU device have not been clarified yet, return as
default configuration the (2560x1920) resolution that has been validated
for both cameras.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
9a1cdb7500 libcamera: ipu3: Set stream configuration
Use the cached sensor maximum resolution and the pixel format
generated by the ImgU output devices as default stream configuration.

While at it, replace the hardcoded numerical value for the number of
buffers with a named constexpr.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
4ce2f06a1b libcamera: ipu3: Connect CIO2 and ImgU bufferReady signals
Connect the CIO2 output bufferRead signal to a slot that simply
queue the received buffer to ImgU for processing, and connect the ImgU
main output bufferReady signal to the cameraData slot that notifies
to applications that a new image buffer is available.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
b7ddedaf42 libcamera: ipu3: Queue requests to ImgU
Implement queueRequest for the IPU3 pipeline manager. When a request is
queued, a new buffer is queued to the ImgU output for capture.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
88316d63f0 libcamera: ipu3: Implement camera start/stop
Start and stop video devices in the pipeline.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
4f370e1001 libcamera: ipu3: Implement memory handling
Implement buffer allocation and release in IPU3 pipeline handlers.

As the pipeline handler currently supports a single stream, provide two
internal buffer pools for 'viewfinder' and 'stat' video devices, and
export the 'output' video device buffers to the stream's pool. This
works around the fact that the ImgU requires buffers to be queued on all
its outputs, even when they are not in use.

Share buffers between the CIO2 output and the ImgU input video devices,
as the output of the former should immediately be provided to the
latter for further processing.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
83458e5712 libcamera: ipu3: Apply image format to the pipeline
Apply the requested stream configuration to the CIO2 device, and
propagate formats through the the ImgU subdevice and its input and
output video devices.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
d698ed2749 libcamera: ipu3: Create ImgUDevice class
Group ImgU components in a class associated with a camera at camera
registration time and provide an intialization method to create and open
all video devices and subdevices of the ImgU.

Statically assign imgu0 to the first camera and imgu1 to the second one
and limit support to two cameras. This will have to be revised in the
future.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
2be53dc605 libcamera: ipu3: Cache the sensor size and format
Cache the sensor maximum size and the media bus code used to produce
it.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
cfd2fff2cd libcamera: ipu3: Create CIO2Device class
Group CIO2 components (cio2, csi2 and image sensor) in a class
associated with the CameraData, to ease management and initialization of
CIO2 unit at camera registration time. A CIO2 unit will always be
associated with a single Camera only.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
289343a24a libcamera: geometry: Add Size structure
Add a simple Size structure that contains an image width and height.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Jacopo Mondi
05a8608f1f libcamera: geometry: Add 0-initialized SizeRange constructor
Add constructor to SizeRange which initialize all the size range fields
to 0.

While at there make the in-line constructor declarations respect the
coding style by moving braces to a new line.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-03 10:11:17 +02:00
Kieran Bingham
88646061e0 libcamera: utils: Use internal secure_getenv() implementation
The secure_getenv() call is not provided by all C libraries. Support
this feature by implementing our own version.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-03 13:56:31 +07:00
Kieran Bingham
0e1a809525 libcamera: utils: Use internal basename implementation.
Differing implementations of basename() exist, some of which may modify
the content of the string passed as an argument.

The implementation of basename() is trivial, thus to support different
C librariese, provide our own version which accepts and returns a const
char *.

Update the call sites to use the new implementation.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-03 13:56:10 +07:00
Laurent Pinchart
80e236e19b qcam: Add JPEG format support
When the camera provides MJPEG, use the QImage JPEG decompression code
to convert that to RGB.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-04-02 17:24:41 +03:00
Jacopo Mondi
c5ef6310fd libcamera: v4l2_subdevice: Create device from entity name
Add a static method to V4L2Subdevice class to create a V4L2Subdevice
instance from a media entity name.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-02 11:02:38 +02:00
Jacopo Mondi
69c97ec042 libcamera: v4l2_device: Create device from entity name
Add a static method to V4L2Device class to create a V4L2Device instance
from a media entity name.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-02 11:02:38 +02:00
Jacopo Mondi
5b9b3c38a1 libcamera: v4l2_subdevice: Rename deviceName() method
Rename the 'deviceName()' method to 'entityName()' as it actually
returns the name of the entity backing the v4l2 subdevice.

While at it, make the names getter methods return a const reference
instead of returning by copy.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-02 11:02:38 +02:00
Jacopo Mondi
a20182310d libcamera: geometry: Add toString to Rectangle
Add toString() helpers to pretty print out the sizes of a Rectangle.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-02 11:02:38 +02:00
Jacopo Mondi
8dcd871fec libcamera: formats: Define FormatEnum type
Add an internal format.h and format.cpp files to collect libcamera image
format related types, helpers and structures. Define and document the
FormatEnum type, used to enumerate pixel image formats and associated
image resolutions.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-02 11:02:38 +02:00
Jacopo Mondi
ee81275238 libcamera: formats: Add toString() methods
Add toString() helpers to pretty print out a V4L2Device or V4L2Subdevice
format.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-04-02 11:02:38 +02:00
Laurent Pinchart
97e8b3a2eb qcam: Add Qt-based GUI application
qcam is a sample camera GUI application based on Qt. It demonstrates
integration of the Qt event loop with libcamera.

The application lets the user select a camera through the GUI, and then
captures a single stream from the camera and displays it in a window.
Only streams in YUYV formats are supported for now.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-03-29 17:09:46 +02:00
Laurent Pinchart
f8386836df cam: Separate options valid() and empty()
An empty option list is not necessarily an error. Add a new empty()
function to test the option list for emptiness, and modify the valid()
function to only notify parsing errors. As a side effect this allows
accessing partially parsed options, which may be useful in the future.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-27 18:26:15 +02:00
Niklas Söderlund
3f906920e4 cam: options: Add support for repeatable options
Add a flag to indicate if an option can be repeatable. If an option is
repeatable it must be accessed thru the array interface, even if it's
only specified once by the user.

Also update the usage generator to indicate which options are
repeatable.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-03-27 15:06:14 +01:00
Niklas Söderlund
2a608965f8 cam: options: Add an array data type to OptionValue
To allow specifying the same argument option multiple times a new type
of OptionValue is needed. As parsing of options is an iterative process
there is a need to append options as they are parsed so instead of
setting values using the constructor a new addValue() method is used.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-03-27 15:06:02 +01:00
Niklas Söderlund
af45435014 cam: options: Create separate enum for OptionValue types
In preparation for support of multiple instances of the same option,
create a separate enum for the OptionValue types as it will diverge from
enum OptionType.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-03-25 21:56:30 +01:00
Kieran Bingham
651f6973a0 libcamera: v4l2_device: Fix trivial spelling errors
succcess -> success
  categorized -> categorised

Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-03-20 15:39:25 +00:00
Kieran Bingham
18647a5324 libcamera: media_device: Initialise local variable
The local variable ifaceId generates a compiler warning that it is used
without initialisation.

The loop, and check against the loop iterator, and the
topology.num_interfaces actually ensures that this isn't the case, and
that ifaceId can only be used when set to a valid ID.

The media_v2_interface.id field documents the ID as simply "Unique ID
for the interface" but does not specify if zero is a valid ID or not. As
such we don't further check the pre-initialised ID for validity and keep
the existing check on the iterator count to determine if the ID had been
discovered successfully.

Fixes: d4af90d729 ("libcamera: media_device: Create entities with
major and minor numbers")

Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-03-20 10:25:30 +00:00
Niklas Söderlund
823fc8e25b libcamera: camera: Fix access bug in configureStreams()
It is not permitted to configure streams before a camera is acquired.

Fixes: 77100a7578 ("libcamera: camera: add state machine to control access from applications")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-03-10 23:21:09 +01:00
Niklas Söderlund
a3b8083f54 libcamera: camera: ensure streams belong to camera
Before calling into the pipeline handler make sure the streams provided
by the application actually belongs to the camera.

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>
2019-03-05 22:32:41 +01:00
Kieran Bingham
7401f5002e libcamera: camera: Unmap buffers before release
Buffers must have all mappings destroyed before buffers can be freed by the
V4L2 device that has allocated them.

Swap the ordering of freeBuffers() and destroyBuffers() to correct this.

Fixes: bd38112b77 ("libcamera: camera: Extend the interface to support capture")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-03-05 15:20:50 +00:00
Kieran Bingham
cbdc4b9ad3 libcamera: v4l2_device: Close Plane dmabuf fd
When constructing a Plane, the exported buffer provides a dmabuf handle which
is set to the Plane object.

This action duplicates the handle for internal storage, and the original fd is
not used and needs to be closed.

Close the handle, ensuring that the resources can be correctly managed.

Fixes: 771befc6dc ("libcamera: v4l2_device: Request buffers from the device")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-03-05 15:06:29 +00:00
Jacopo Mondi
ba90504cac libcamera: v4l2_device: Cosmetic update
Cosmetic update of V4L2Device class: remove the return type from Doxygen
documentation of inline functions.

Cosmetic update, no functional changes intended.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-02 18:32:09 +01:00
Jacopo Mondi
3e94f9d7a2 libcamera: v4l2_device: Add support for META_CAPTURE devices
Add support for devices that provide video meta-data to v4l2_device.cpp
and re-arrange bufferType handling in open() method.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-02 18:32:00 +01:00
Jacopo Mondi
0088979683 libcamera: v4l2_subdevice: Cosmetic update
Cosmetic updated of V4L2Subdevice class: re-sort methods and comments to
reflect the declaration order in the class definition.

Cosmetic update, no functional changes intended.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-02 18:31:40 +01:00
Jacopo Mondi
0559c740f2 libcamera: v4l2_subdevice: Implement ENUM_FRAME_SIZES
Implement format and size enumeration methods to list all the available
subdevice image resolutions and formats.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-02 18:31:02 +01:00
Laurent Pinchart
54e6a3eb1f cam: Don't requeue requests when stopping stream
When stopping the stream all pending requests are cancelled, resulting
in the request completion signal being emitted with the request status
set appropriately. Check the request status in the request completion
slot and skip requeuing the request if it has been cancelled.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 20:46:43 +02:00
Laurent Pinchart
b2c06cf409 libcamera: Handle request completion explicitly in pipeline handlers
Request complete by themselves when all the buffers they contain have
completed, connecting the buffer's completed signal to be notified of
buffer completion. While this works for now, it prevents pipelines from
delaying request completion until all metadata is available, and makes
it impossible to ensure that requests complete in the order they are
queued.

To fix this, make request completion handling explicit in pipeline
handlers. The base PipelineHandler class is extended with
implementations of the queueRequest() and stop() methods and gets new
completeBuffer() and completeRequest() methods to help pipeline handlers
tracking requests and buffers.

The three existing pipeline handlers connect the bufferReady signal of
their capture video node to a slot of their respective camera data
instance, where they use the PipelineHandler helpers to notify buffer
and request completion. Request completion is handled synchronously with
buffer completion as the pipeline handlers don't need to support more
advanced use cases, but this paves the road for future work.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 20:46:40 +02:00
Laurent Pinchart
1accc258cc libcamera: request: Add request completion status
Add a new field to the Request class to report its completion status,
and a new complete() method to update the status.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:45:09 +02:00
Laurent Pinchart
fca7602c3c libcamera: buffer: Add buffer completion status
Add a new field to the Buffer class to report its completion status,
with a new cancel() method to mark the buffer as cancelled.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:45:09 +02:00
Laurent Pinchart
b581b9576a libcamera: pipeline_handler: Make pipeline-specific data mandatory
Mandate creationg of pipeline-specific data by pipeline handlers. This
allows simplifying the API by passing the pipeline-specific data to the
registerCamera() method and removing the separate setCameraData()
method.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:45:09 +02:00
Laurent Pinchart
61a62ddbd8 libcamera: pipeline_handler: Store pipe and camera in CameraData
Extend the CameraData class with two member variables pipe_ and camera_
that store pointers to the pipeline handler and camera that the
CameraData instance is related to. This will be used by pipeline
handlers to access the camera and the pipeline in member methods of
their CameraData derived classes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:45:07 +02:00
Laurent Pinchart
40439a933f libcamera: pipeline_handler: Pass a non-const Camera to methods
The start(), stop() and queueRequest() methods receive a const pointer
to the related Camera object. The stop() request will need to modify the
state of the camera, in order to report completion of pending requests.
Un-constify the Camera pointer to that method, and update the start()
and queueRequest() methods similarly for coherency.

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-03-01 15:44:35 +02:00
Laurent Pinchart
fedad60b76 libcamera: pipeline: vimc: Create VimcCameraData
Subclassing CameraData will become mandatory for pipeline handlers.
Create a new VimcCameraData class and instantiate it when creating
cameras to prepare for that change. The video_ and stream_ fields of the
VIMC pipeline handler belong to the camera data, move them there.

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-03-01 15:44:35 +02:00
Laurent Pinchart
19dfe91e17 libcamera: pipeline: uvcvideo: Create UVCCameraData
Subclassing CameraData will become mandatory for pipeline handlers.
Create a new UVCCameraData class and instantiate it when creating
cameras to prepare for that change. The video_ and stream_ fields of the
UVC pipeline handler belong to the camera data, move them there.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:44:33 +02:00
Laurent Pinchart
e6eff721d7 libcamera: pipeline: Fix double release of media devices
Media devices are acquired in the match() function of pipeline handlers,
and explicitly released if no match is found. The pipeline handler is
then deleted, which causes a second release of the media device in the
destructor. Fix this by removing the explicit release in the match()
function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 15:26:03 +02:00
Jacopo Mondi
3ab7f65d6f libcamera: v4l2_device: Expose the device node path
Provide a getter method to access the device node path. For video
devices it is usually the most informative description.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 12:34:41 +01:00