Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support files for OV7251 #191

Open
wants to merge 27 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
50350c5
controls: rpi: Add a vendor rpi::ScalerCrops control
naushir Jul 25, 2024
7b6faf5
pipeline: rpi: Remove CameraData::scalerCrop_
naushir Aug 6, 2024
3fb451a
pipeline: rpi: Pass crop rectangle as a parameter to platformSetIspCr…
naushir Aug 8, 2024
e56433f
pipeline: rpi: Introduce CameraData::CropParams
naushir Aug 6, 2024
8849e49
pipeline: rpi: Track which ISP output is configured for a stream
naushir Aug 2, 2024
be60c00
pipeline: rpi: Pass ISP output index into platformSetIspCrop()
naushir Aug 1, 2024
fb5774c
pipeline: rpi: Handler controls::rpi::ScalerCrops
naushir Aug 2, 2024
2da4fb4
pipeline: rpi: Fix invalid access to CameraData::sensorInfo_
naushir Sep 6, 2024
471c190
pipeline: rpi: Fix for multiple reported scaler crops
naushir Sep 13, 2024
bb52ecb
meson: Add libpisp.wrap
naushir May 4, 2023
c28fca8
pipeline: rpi: Add support for Raspberry Pi 5
naushir Jun 19, 2023
62fb6f5
ipa: rpi: Add support for Raspberry Pi 5
naushir May 4, 2023
f08b6df
RASPBERRYPI ONLY: Add Sony IMX708 sensor properties
njhollinghurst Dec 8, 2022
62b433e
RASPBERRYPI ONLY: Handle mandatory stream flags
naushir May 23, 2023
0c1bf0b
RASPBERRYPI ONLY: Add a Github workflow to generate release tarballs
XECDesign Nov 16, 2023
114c35d
RASPBERRYPI ONLY: Update README to follow Raspberry Pi documentation
mtouzot Mar 30, 2024
4cb83d3
RASPBERRYPI ONLY: libcamera: v4l2_videodevice: Limit number of queued…
naushir Jun 28, 2024
26a20d6
RASPBERRYPI ONLY: Use meson from pip when generating orig tarball
XECDesign Aug 29, 2024
02928ef
ipa: rpi: Use r-value references in the set()/setLocked() functions
naushir Sep 9, 2024
31dc985
ipa: rpi: Add erase()/eraseLocked() to RPiController::Metadata
naushir Sep 9, 2024
e21d0a9
ipa: rpi: Add a HW property to determine if the data buffer is strided
naushir Sep 9, 2024
a401e82
controls: ipa: rpi: Add CNN controls
naushir Sep 9, 2024
dc7c297
ipa: rpi: Handle the new CNN controls in the IPA
naushir Sep 9, 2024
549f80a
ipa: rpi: Provide the camera helper with the hardware configuration
naushir Sep 9, 2024
7330f29
ipa: rpi: Add support for the Sony IMX500 camera sensor
naushir Sep 9, 2024
1086b70
ipa: rpi: Add tuning files for OV7251
6by9 Oct 9, 2024
0d201a1
ipa: rpi: Add pisp tuning files for OV7251
6by9 Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/gen_orig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Generate source release tarball
run-name: Generating source release tarball
on:
push:
tags: # vX.Y.Z+rptYYYMMDD
- 'v[0-9]+.[0-9]+.[0-9]+\+rpt[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
workflow_dispatch:
jobs:
publish_tarball:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: | # Local cmake needs to be removed for pybind11 to be detected
sudo rm -rf /usr/local/bin/cmake
pip3 install --user meson
sudo apt-get update
sudo apt-get install -y ninja-build pkgconf cmake libgtest-dev libyaml-dev python3 python3-dev pybind11-dev python3-jinja2 python3-ply python3-yaml
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for 'git describe' to work
- name: Generate tarball
run: |
meson setup build -Dpycamera=enabled
meson dist --no-tests --include-subprojects -C build
mv build/meson-dist/*.tar.xz "build/meson-dist/libcamera-${GITHUB_REF_NAME:1}.tar.xz"
- name: Release tarball
uses: softprops/action-gh-release@v1
with:
files: build/meson-dist/*.tar.xz
- if: failure()
run: cat build/meson-logs/meson-log.txt
2 changes: 1 addition & 1 deletion Documentation/guides/pipeline-handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ to the libcamera build options in the top level ``meson_options.txt``.

option('pipelines',
type : 'array',
choices : ['ipu3', 'rkisp1', 'rpi/vc4', 'simple', 'uvcvideo', 'vimc', 'vivid'],
choices : ['ipu3', 'rkisp1', 'rpi/pisp', 'rpi/vc4', 'simple', 'uvcvideo', 'vimc', 'vivid'],
description : 'Select which pipeline handlers to include')


Expand Down
38 changes: 35 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,47 @@ systems, including traditional Linux distributions, ChromeOS and Android.
Getting Started
---------------

To fetch the sources, build and install:
Only build ``libcamera`` from scratch if you need custom behaviour or the latest features that have not yet reached ``apt`` repositories.

If you run ``Raspberry Pi OS Lite``, begin by installing the following packages:

.. code::

git clone https://git.libcamera.org/libcamera/libcamera.git
sudo apt install -y python-pip git python3-jinja2

First, install the following ``libcamera`` dependencies:
.. code::

sudo apt install -y libboost-dev
sudo apt install -y libgnutls28-dev openssl libtiff-dev pybind11-dev
sudo apt install -y qtbase5-dev libqt5core5a libqt5widgets
sudo apt install -y meson cmake
sudo apt install -y python3-yaml python3-ply
sudo apt install -y libglib2.0-dev libgstreamer-plugins-base1.0-dev

Now we're ready to build ``libcamera`` itself.

Download a local copy of Raspberry Pi's fork of ``libcamera`` from GitHub, before building and installing freshly-build binary:

.. code::

git clone https://github.com/raspberrypi/libcamera.git
cd libcamera
meson setup build
meson setup build --buildtype=release -Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dv4l2=true -Dgstreamer=enabled -Dtest=false -Dlc-compliance=disabled -Dcam=disabled -Dqcam=disabled -Ddocumentation=disabled -Dpycamera=enabled
ninja -C build install

You can disable the ``gstreamer`` plugin by replacing ``-Dgstreamer=enabled`` with ``-Dgstreamer=disabled`` during the ``meson`` build configuration.
If you disable ``gstreamer``, there is no need to install the ``libglib2.0-dev`` and ``libgstreamer-plugins-base1.0-dev`` dependencies.

On devices with 1GB of memory or less, the build may exceed available memory. Append the ``-j 1`` flag to ``ninja`` commands to limit the build to a single process.
This should prevent the build from exceeding available memory on devices like the Raspberry Pi Zero and the Raspberry Pi 3.

``libcamera`` does not yet have a stable binary interface. Always build ``rpicam-apps`` after you build ``libcamera``.

You can find more informations at `Raspberry Pi libcamera documentation`_ pages.

.. _Raspberry Pi libcamera documentation: https://www.raspberrypi.com/documentation/computers/camera_software.html

Dependencies
~~~~~~~~~~~~

Expand Down
4 changes: 4 additions & 0 deletions include/libcamera/internal/v4l2_videodevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <memory>
#include <optional>
#include <ostream>
#include <queue>
#include <stdint.h>
#include <string>
#include <unordered_set>
Expand Down Expand Up @@ -266,6 +267,8 @@ class V4L2VideoDevice : public V4L2Device
void bufferAvailable();
FrameBuffer *dequeueBuffer();

int queueToDevice(FrameBuffer *buffer);

void watchdogExpired();

template<typename T>
Expand All @@ -281,6 +284,7 @@ class V4L2VideoDevice : public V4L2Device

V4L2BufferCache *cache_;
std::map<unsigned int, FrameBuffer *> queuedBuffers_;
std::queue<FrameBuffer *> pendingBuffersToQueue_;

EventNotifier *fdBufferNotifier_;

Expand Down
1 change: 1 addition & 0 deletions include/libcamera/ipa/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ libcamera_ipa_headers += custom_target('core_ipa_serializer_h',
pipeline_ipa_mojom_mapping = {
'ipu3': 'ipu3.mojom',
'rkisp1': 'rkisp1.mojom',
'rpi/pisp': 'raspberrypi.mojom',
'rpi/vc4': 'raspberrypi.mojom',
'simple': 'soft.mojom',
'vimc': 'vimc.mojom',
Expand Down
1 change: 1 addition & 0 deletions include/libcamera/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ controls_map = {
'controls': {
'draft': 'control_ids_draft.yaml',
'core': 'control_ids_core.yaml',
'rpi/pisp': 'control_ids_rpi.yaml',
'rpi/vc4': 'control_ids_rpi.yaml',
},

Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ pipelines_support = {
'ipu3': arch_x86,
'mali-c55': arch_arm,
'rkisp1': arch_arm,
'rpi/pisp': arch_arm,
'rpi/vc4': arch_arm,
'simple': ['any'],
'uvcvideo': ['any'],
Expand Down
3 changes: 2 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ option('gstreamer',

option('ipas',
type : 'array',
choices : ['ipu3', 'rkisp1', 'rpi/vc4', 'simple', 'vimc'],
choices : ['ipu3', 'rkisp1', 'rpi/pisp', 'rpi/vc4', 'simple', 'vimc'],
description : 'Select which IPA modules to build')

option('lc-compliance',
Expand All @@ -50,6 +50,7 @@ option('pipelines',
'ipu3',
'mali-c55',
'rkisp1',
'rpi/pisp',
'rpi/vc4',
'simple',
'uvcvideo',
Expand Down
5 changes: 5 additions & 0 deletions src/ipa/rpi/cam_helper/cam_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ void CamHelper::setCameraMode(const CameraMode &mode)
}
}

void CamHelper::setHwConfig(const Controller::HardwareConfig &hwConfig)
{
hwConfig_ = hwConfig;
}

void CamHelper::getDelays(int &exposureDelay, int &gainDelay,
int &vblankDelay, int &hblankDelay) const
{
Expand Down
2 changes: 2 additions & 0 deletions src/ipa/rpi/cam_helper/cam_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class CamHelper
CamHelper(std::unique_ptr<MdParser> parser, unsigned int frameIntegrationDiff);
virtual ~CamHelper();
void setCameraMode(const CameraMode &mode);
void setHwConfig(const Controller::HardwareConfig &hwConfig);
virtual void prepare(libcamera::Span<const uint8_t> buffer,
Metadata &metadata);
virtual void process(StatisticsPtr &stats, Metadata &metadata);
Expand Down Expand Up @@ -108,6 +109,7 @@ class CamHelper

std::unique_ptr<MdParser> parser_;
CameraMode mode_;
Controller::HardwareConfig hwConfig_;

private:
/*
Expand Down
Loading