summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-10-30android: Replace ThreadRPC with blocking method callJacopo Mondi
Use the newly introduced InvocationTypeBlocking message type to replace the blocking message delivery implemented with the ThreadRPC class in the Android camera HAL. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29test: object-invoke: Invoke method in blocking modeJacopo Mondi
Change the object-invoke test to perform the second method invocation operation in blocking mode. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29libcamera: object: Add connection type parameter to invokeMethod()Jacopo Mondi
Allow specifying a different connection type than ConnectionTypeQueued for Object::invokeMethod(). Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29libcamera: object: Use bound method activePack() for invokeMethod()Laurent Pinchart
The BoundMethodBase::activatePack() and the internal Object::invokeMethod() are duplicate implementation of the same mechanism. Use the former to replace the latter. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29libcamera: signal: Specify connection type for signalsLaurent Pinchart
Add a connection type parameter to the Signal::connect() method to control signal delivery. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29libcamera: bound_method: Support connection typesLaurent Pinchart
Support all connection types in the BoundMethodBase::activePack() method. To support this, add a semaphore to the InvokeMessage to signal delivery. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29libcamera: bound_method: Store connection type in BoundMethodBaseLaurent Pinchart
Store the connection type in the base BoundMethodBase class to make it accessible to all bound methods. The default type is ConnectionTypeAuto. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29libcamera: bound_method: Define connection type for method invocationJacopo Mondi
Define an enumeration of connection types to describe the delivery method of signals and method invocation. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-28libcamera: Add Semaphore classLaurent Pinchart
Add a general-purpose counting semaphore class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-28libcamera: Switch PixelFormat to DRM FourCC valuesJacopo Mondi
Use DRM FourCC values for the newly defined PixelFormat. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-28libcamera: v4l2_videodevice: Add PixelFormat conversionJacopo Mondi
In preparation for switching PixelFormat to DRM pixel formats, add helper methods to the V4L2VideoDevice class to translate between DRM pixel formats and V4L2 pixel formats. More work is needed to properly support the V4L2 multi-planar (NV[0-9]*M) formats. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-28libcamera: stream: Use the newly defined PixelFormatJacopo Mondi
Use the newly defined PixelFormat type to define the image format contained in the StreamFormats and StreamConfiguration classes. Update the classes documentation accordingly. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-28libcamera: Define a PixelFormat type for application-facing formatsJacopo Mondi
Define a PixelFormat type as a simple typedef to an uint32_t. The usage of a dedicated type creates a cleaner and more self-described API. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-28include: drm_fourcc: Add Motion-JPEG FourCCJacopo Mondi
Add a FourCC for Motion-JPEG compressed format. This is a temporary addition until the format gets merged in the upstream kernel. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-28include: linux: Import DRM/KMS headers from Linux v5.2Jacopo Mondi
Import DRM/KMS header files from Linux kernel v5.2. The DRM headers are used to prepare to use the DRM-defined pixel formats (DRM_FORMAT_*) in place of the currently used V4L2 pixel formats (V4L2_PIX_FMT_*). Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-28include: linux: Update headers to Linux v5.2Jacopo Mondi
Update headers to Linux v5.2. The Rockchip ISP1 formats that were added manually in commit 97dce7a13fa3 ("include: linux: Add rkisp1 kernel header and format definitions") are kept. Otherwise the headers come straight from the upstream kernel. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-28libcamera: formats: Write libcamera in lowercaseLaurent Pinchart
The libcamera name should never be capitalized. Fix the two incorrect occurrences. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-27libcamera: bound_method: Fix compiler warning due to unused argumentsLaurent Pinchart
The BoundStaticMethod::invoke() method is never used, but must still be implemented as the base class defines it as pure virtual. As it doesn't use its arguments, the compiler generates a warning. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-26include: libcamera: Install control_ids.hJacopo Mondi
Make the auto-generated control_ids.h file as part of the libcamera installation. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-26cam: capture: remove unused local variablePaul Elder
Remove unused local map variable. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-25libcamera: pipeline: vimc: Support format enumerationLaurent Pinchart
Fill the StreamConfiguration with all supported formats. The list of supported formats is currently hardcoded based on the limits of the vimc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-25qcam: Don't ask for a camera when only one existsKieran Bingham
If there is only one camera exposed by libcamera, there is little value in asking the user to choose it. Automatically select it, and remove the need to ask the user to select 'ok' from a Dialog box. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-24Documentation: Add git clone information to Getting StartedLaurent Pinchart
As the Getting Started section is displayed on the website, it should contain commands related to cloning the repository. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-23Documentation: theme: css: Really hide toc treesLaurent Pinchart
The toc trees are rendered as hidden but still take space due to their margin and padding. Really hide them. While at it, don't handle overflow with scrollbars in the content area, the whole page should be scrollable. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-23Documentation: theme: css: Make text darkerLaurent Pinchart
The text is currently rendered as a 50% gray, which is a bit painful to read in low light conditions. Make it darker. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-23Documentation: Hide the Getting Started informationLaurent Pinchart
The Getting Started information makes little sense on the generated documentation, as a developer with documentation compiled from a local libcamera source tree has already got started. We however want to keep the information in the top-level README.rst as it is useful there. In order to hide the Getting Started information from the front page while keeping it in README.rst, add comments to delimitate sections of README.rst, and include only a subset of the file in the front page. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-23Documentation: Set the index TOC max depth to 1Laurent Pinchart
We don't need more than one level in the main TOC tree, set the max depth to 1. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-23Documentation: Generate local TOC on demandLaurent Pinchart
All pages are generated with a local TOC, which is pointless on simple pages such as the front page, or other pages containing little content. Use the .. contents:: :local: directive instead to generate the local TOC on demand, and remove the automatic local TOC generation. Only the Docs page uses a local TOC. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-23Documentation: Link to API section in DocsLaurent Pinchart
The API belongs to the docs section. Link to it from docs.rst, and remove the shortcut in the navigation bar as links to a placeholder only. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-23Documentation: contributing: Remove Sphinx + Doxygen integrationLaurent Pinchart
Sphinx integration with Doxygen didn't produce the expected results, we will not go that way. Don't mention it on the contributing page. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-23Documentation: Move coding style under contributingLaurent Pinchart
The coding style isn't so important that it has to be displayed on the top contents bar. Move it to the contributing section. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-23libcamera: Standardise on C compatibility headersLaurent Pinchart
Now that our usage of C compatibility header is documented, use them consistently through the source code. While at it, group the C and C++ include statements as defined in the coding style, and fix a handful of #include ordering issues. 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>
2019-10-23utils: checkstyle.py: Add include checkerLaurent Pinchart
Add an include checker to verify usage of the C compatibility headers. 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>
2019-10-23Documentation: coding-style: Document order of includesLaurent Pinchart
We follow the Google C++ Style Guide rule on include ordering with a few tweaks. Document our rule explicitly. 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>
2019-10-23Documentation: coding-style: Document usage of C compatibility headersLaurent Pinchart
The C++ standard defines a set of C++ standard library headers, and for some of them, defines C compatibility headers. The former have a name of the form <cxxx> while the later are named <xxx.h>. The C++ headers declare names in the std namespace, and may declare the same names in the global namespace. The C compatibility headers declare names in the global namespace, and may declare the same names in the std namespace. We want to standardise on one set of headers through libcamera, and don't want to rely on optional behaviour. We can thus either use the C++ headers with an explicit std:: namespace qualifier through the code, or the C headers without the qualifier. Both set of headers are defined by the C++ standard, and are thus valid choices. After weighing pros and cons, we have decided to use the C compatibility headers, as nobody wanted to write std::uint32_t. Document this decision. 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>
2019-10-23libcamera: controls: Remove rogue ';'Jacopo Mondi
The ';' at the end of an inline method declaration is not required. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-22libcamera: pipeline_handler: Fix trivial spellingKieran Bingham
Signaled is an American spelling. s/signaled/signalled/ Fixes: b2c06cf40975 ("libcamera: Handle request completion explicitly in pipeline handlers") Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-17qcam: Support Qt versions earlier than 5.9Laurent Pinchart
The QtEventDispatcher timers implementation depends on Qt 5.9 or newer due to the use of QObject::startTimer(std::chrono::milliseconds). Support earlier Qt versions by using the QObject::startTimer(int) version instead. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-15libcamera: v4l2_controls: Remove V4L2ControlList classLaurent Pinchart
The V4L2ControlList class only provides a convenience constructor for the ControlList, which can easily be moved to the ControlList class and may benefit it later (to construct a ControlList from controls supported by a camera). Move the constructor and remove V4L2ControlList. 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-10-15libcamera: controls: Merge ControlInfoMap and V4L2ControlInfoMapLaurent Pinchart
The ControlInfoMap and V4L2ControlInfoMap classes are very similar, with the latter adding convenience accessors based on numerical IDs for the former, as well as a cached idmap. Both features can be useful for ControlInfoMap in the context of serialisation, and merging the two classes will further simplify the IPA API. Import all the features of V4L2ControlInfoMap into ControlInfoMap, turning the latter into a real class. A few new constructors and assignment operators are added for completeness. 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-10-15libcamera: v4l2_controls: Derive V4L2ControlInfoMap from ControlInfoMapLaurent Pinchart
Replace the std::map<> used as the base type for V4L2ControlInfoMap by ControlInfoMap, which is an alias for an std::unsorted_map<> with the same key and value types. This shortens the code. 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-10-15libcamera: v4l2_controls: Store a ControlRange in V4L2ControlInfoMapLaurent Pinchart
V4L2ControlRange only offers a convenience constructor for a ControlRange. Store the ControlRange instead of V4L2ControlRange in V4L2ControlInfoMap to make the map less dependent on V4L2 types. 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-10-15libcamera: v4l2_controls: Replace V4L2ControlInfo with V4L2ControlRangeLaurent Pinchart
The V4L2ControlInfo class only stores a ControlRange. Make it inherit from ControlRange to provide a convenience constructor from a struct v4l2_query_ext_ctrl and rename it to V4L2ControlRange. 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-10-15test: v4l2_videodevice: controls: Use correct control range in checkLaurent Pinchart
A value check on the V4L2_CID_CONTRAST control is using the brightness control range. 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>
2019-10-15libcamera: v4l2_controls: Index V4L2ControlInfoMap by ControlId *Laurent Pinchart
To bring the libcamera and V4L2 control info maps closer, index the latter by ControlId * like the former. As V4L2ControlInfoMap is widely indexed by V4L2 numerical IDs, add accessors based on numerical IDs. This allows complete removal of the ControId pointer from the V4L2ControlInfo, as the ControId is accessible as the key when iterating over the map. A handful of users have to be modified to adapt to the change. The controlInfo argument from V4L2Device::updateControls() can also be removed as it itsn't used 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>
2019-10-15libcamera: controls: Prevent copies of ControlId classLaurent Pinchart
Now that the V4L2ControlId embedded in V4L2ControlInfo has been moved out and doesn't require to be copied anymore, the base ControlId class doesn't need to be copyable either. Delete the ControlId copy constructor and copy assignment operator. 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-10-15libcamera: v4l2_controls: Move V4L2ControlId out of V4L2ControlInfoJacopo Mondi
In order to reconcile the libcamera and V4L2 control info maps, we need to move the V4L2ControlId embedded in V4L2ControlInfo map out of the class. Store the V4L2ControlId instances in the V4L2Device that creates them, and only reference them from V4L2ControlInfo. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> 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-10-15libcamera: v4l2_controls: Remove V4L2ControlInfo::size()Laurent Pinchart
We don't support V4L2 compound controls, the size field is thus unused. Remove it to ease merging of the libcamera and V4L2 control info classes. Support for array controls can then be added later on top, and would be useful for libcamera controls too. 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-10-15libcamera: v4l2_device: Print control ID in unknown type log messaggeLaurent Pinchart
When the type of a control enumerated from a V4L2 device is not supported, we log a debug message that mentions the control type. This makes it hard to figure out which control is faulty. Print the control ID instead. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-15libcamera: utils: Add hex stream output helperLaurent Pinchart
Add a utils::hex() function that simplifies writing hexadecimal values to an ostream. The function handles the '0x' prefix, the field width and the fill character automatically. Use it through the libcamera code base, and add a test. 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>