Commit graph

5587 commits

Author SHA1 Message Date
Kieran Bingham
cebe684c19 git: Add .gitignore file
Provide an initial starting point for our ignore file.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-14 13:23:07 +00:00
Laurent Pinchart
8274fed13d Documentation: contributing: Mark command line as shell code-block
The git clone command line is a (single line) block of shell code, mark
it appropriately.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-14 10:43:01 +02:00
Laurent Pinchart
6f739290ec Documentation: coding-style: Fix list indentation
The various lists in the document are not quoted blocks. Don't indent
them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-14 10:43:00 +02:00
Laurent Pinchart
58a31afc0c Documentation: Add architecture documentation
The documentation is copied mostly verbatim from the website, with small
modifications to the ascii art diagrams to make them compile.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-14 10:42:58 +02:00
Laurent Pinchart
73fec989ae Documentation: contributing: Add links to libcamera git and linuxtv.org
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-14 10:42:56 +02:00
Laurent Pinchart
24038c2c44 Documentation: Remove _static and _templates directory
sphinx only requires those directories to be present because they're
referenced in the configuration file. Remove the references and the
directories.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-14 10:42:33 +02:00
Jacopo Mondi
ee56622401 Documentation: Add coding style document
Add document to summarize the coding style adopted by libcamera.

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>
2018-12-13 09:00:07 +01:00
Jacopo Mondi
3b56ddaa96 build: Add 'std=c++11' cpp compiler flag
Building the current master branch with g++ 5.4.0-6 fails with:
./src/libcamera/include/log.h:25:34:
   error: defaulted and deleted functions only available with -std=c++11 \
   or -std=gnu++11 [-Werror]
   LogMessage(const LogMessage&) = delete;

Fix this by adding the 'std=c++11' compiler argument for to the list of
cpp build flags.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2018-12-13 08:51:05 +01:00
Laurent Pinchart
6ab3ff4501 libcamera: log: Document the LogMessage class
Fix Doxygen build warnings by adding the missing documentation for the
LogMessage class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-12 20:45:39 +02:00
Laurent Pinchart
b4351e1a6b libcamera: log: Fix Doxygen documentation
Now that the documentation can be compiled, Doxygen throws a few
warnings due to incorrect enum field naming. Fix it.

The \file block needs to be named after the header file in order for
Doxygen to document any global function, variable, typedef or enum
defined in the header (as documented in the Doxygen manual under the
\file command). We thus need to use log.h as the file name. No \file
block is needed for the .cpp file, as we don't want to generate
documentation for internal private globals.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-12 20:45:39 +02:00
Laurent Pinchart
53c4d4c34f Documentation: Generate source code documentation using Doxygen
Extend the documentation build system to automatically generate
documentation from source code using Doxygen. This is currently separate
from the sphinx documentation, and should be integrated using the
breathe (and possibly exhale) extensions.

As the Documentation/meson.build file needs to reference the variables
holding the source files, move the Documentation directory to the end of
the subdirs() in the top-level meson.build.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-12 20:45:24 +02:00
Laurent Pinchart
652b1c8679 Documentation: Don't hardcode install directory
Use the datadir option to select the directory in which to install
documentation. This defaults to $prefix/share so this doesn't introduce
any change in the default case.

While at it use join_paths() to join patch components instead of
hardcoding the / separator.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-12 20:18:41 +02:00
Laurent Pinchart
66bb4d388d Documentation: Set install_dir in custom_target()
The custom_target() function accepts an install_dir parameter. Along
with setting install to true, this can be used to replace the
install_subdir() function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-11 20:28:34 +02:00
Laurent Pinchart
830031892b build: Clean up file names variables
The build system defines two variables, public_api and sources, that
store the names of the public headers and the source files respectively.
These files will need to be referenced when generating documentation
from source code, so let's make the variable names more descriptive:

- Rename public_api to libcamera_api and use the files() function
- Rename sources to libcamera_sources
- Add a libcamera_headers variable to hold the internal headers

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-11 20:28:34 +02:00
Laurent Pinchart
0763b8a80e utils: ipu3: process: Configure formats on ImgU subdev pads
Set format and selection rectangles on the ImgU subdev as required by
the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-11 15:58:19 +02:00
Laurent Pinchart
1ebd2c09f5 utils: ipu3: process: Fix typo in output files path
A typo in the output files path causes the script to attempt to write
all captured frames to /. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-11 15:48:26 +02:00
Laurent Pinchart
0d96f3e232 utils: ipu3: Abort when sensor or media device isn't found
Calling exit from a function only exits from the function, it doesn't
abort the whole script. Propagate the errors to stop operation when the
sensor or media device can't be found.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-11 00:31:24 +02:00
Laurent Pinchart
ad8934db5b libcamera: log: Fix miscellaneous coding style issues
Those issues were pointed out during review.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-11 00:02:04 +02:00
Laurent Pinchart
cc7d204b2c libcamera: Use the logger instead of cout
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-06 16:43:45 +02:00
Laurent Pinchart
edbd2059d8 libcamera: Add initial logger
The logger is based on the ostream API, allowing code to log messages in
a native way. It automatically logs the time stamp, severity level, file
name and line number.

Many important features are missing, such as logging to file, logging
classes, and log filtering based on the severity level, file name and
class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-06 16:43:04 +02:00
Laurent Pinchart
913b3ee817 Overhaul the directory structure
In order to match the directory structure of traditional projects,
rename the top-level lib/ directory to src/libcamera/. Other libraries
developed as part of the project will later find a home in src/.

Split the libcamera header files in three categories: public headers
describing the public API in include/libcamera/, internal headers
describing the internal API in src/libcamera/include/, and private
headers local to one or a small number of compilation units along the
corresponding .cpp files. As no internal header exists yet the
src/libcamera/include/ directory is created empty as the build system
would fail otherwise.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-06 16:34:01 +02:00
Laurent Pinchart
0713202dc0 Add boilerplate headers comments and include guards
The initial main.cpp and libcamera.h files are missing boilerplate
header comments. libcamera.h is further missing include guards. Add
them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-06 16:33:36 +02:00
Kieran Bingham
b99da21657 lib: Fix class and namespace usage
The (dummy) init_lib function was linking correctly only due to a
namespace 'collision' adding the init_lib to libcamera namespace, which
is 'shared' by class libcamera.

The init function was designed to be a class member function of the
libcamera object - and is used as such in the existing test function.

Instead of relying on the namespace collision - update the lib/main.cpp
example file to correctly utilise the class header - and specify the
function declaration, so that further implementations do not fall into
the same bad habits.

Reported-by: Jacopo Mondi <jacopo@mondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-12-03 09:21:23 +00:00
Laurent Pinchart
b4935e9a4d utils: ipu3: Add test process script
The script processes raw frames through the Intel IPU3 IMGU.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-12-02 19:23:07 +02:00
Kieran Bingham
b15e378851 meson: Describe minimum meson version requirements
We utilise 'add_project_arguments' which is only available in version
0.36 and 'build_by_default' which is only available in version 0.40 of
meson.

Add this dependancy to the project requirements.

Reported-by: Jacopo Mondi <jacopo@mondi.org>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-30 11:28:14 +00:00
Laurent Pinchart
9cb17c2743 utils: ipu3: Add test capture script
The script captures raw frames from cameras based on the Intel IPU3. It
takes the sensor name as an argument and isn't meant to depend on a
particular platform.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-29 14:45:12 +02:00
Kieran Bingham
c60069241f Documentation: Introduce sphinx documentation
Utilise sphinx-build to generate documentation in HTML form, and
populate with some initial content.

An initial conf.py is generated from sphinx-quickstart and answering
initial questions.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-28 11:10:11 +00:00
Kieran Bingham
ce1c86c10c licenses: Add licenses subdirectory
Code licensing will be specified with SPDX license headers.
Documentation will be licensed under CC-by-SA.

Include the common license text files to reference with the headers.

Licenses are extracted from the following locations:
  https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
  https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
  https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-28 11:10:11 +00:00
Kieran Bingham
df77f99386 meson: Replace tabs for spaces
Tabs are disliked within the meson build system.
Replace indentation by spaces, in all existing locations.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-28 11:08:35 +00:00
Kieran Bingham
a66fe04c19 build: Add project arguments
Add language specific project arguments and ensure that -Werror is
enabled, enforcing code to be as clean as possible.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-27 12:11:48 +00:00
Kieran Bingham
66051636c5 include: Install include files
The include directory was defined but not installed.

Add it to the meson build structure to incorporate it as part of the
library install.

To facilitate the same include paths in our internal includes, update
the structure for headers to match the install structure.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-27 12:10:57 +00:00
Kieran Bingham
88c35c9084 lib: Include library in the install target
The shared library build target does not install the library when 'ninja
install' is executed.

Flag it as an installable item.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-27 12:10:26 +00:00
Kieran Bingham
72ca485dd4 README: Update build instructions
README is currently a bit too sparse, and there is no guidance on how to
use our build system.

Add some initial instructions.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-26 15:52:21 +00:00
Kieran Bingham
cc4de52524 test: Register the initialisation test with meson
Register the test so that it can integrate with the meson test
framework.

To execute the test suite, use 'ninja test'.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-11-22 15:24:56 +00:00
Laurent Pinchart
23ac77dc4a utils: ipu3: Add IPU3 raw capture unpack utility
The IPU3 captures Bayer data in a 25-pixels-in-32-bytes packed format,
which no standard tool can process. Add a quick implementation of data
unpacking to turn raw binary files into 16 bits per pixel unpacked Bayer
data.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2018-11-20 03:06:41 +02:00
Kieran Bingham
708d3c9fc0 build: Provide initial meson infrastructure
Define the starting points for the libcamera build using
meson and ninja build components.

An initial 'dummy' library class is created, and a test binary links
against the shared library calling it's init_lib() function.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-10-24 12:22:19 +01:00
Kieran Bingham
87ba17ba41 libcamera: Supporting complex camera pipelines
Cameras are complex devices that need heavy hardware image processing
operations. Control of the processing is based on advanced algorithms
that must run on a programmable processor. This has traditionally been
implemented in a dedicated MCU in the camera, but in embedded devices
algorithms have been moved to the main CPU to save cost. Blurring the
boundary between camera devices and Linux often left the user with no
other option than a vendor-specific closed-source solution.

To address this problem the Linux media community has very recently
started collaboration with the industry to develop a camera stack that
will be open-source-friendly while still protecting vendor core IP.
libcamera was born out of that collaboration and will offer modern
camera support to Linux-based systems, including traditional Linux
distributions, ChromeOS and Android.
2018-10-24 12:00:06 +01:00