Skip to content

Check for unsupported pixel format #218

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e7e86c1
meson: Add libpisp.wrap
naushir May 4, 2023
4c1dce9
pipeline: rpi: Add support for Raspberry Pi 5
naushir Jun 19, 2023
a31747d
ipa: rpi: Add support for Raspberry Pi 5
naushir May 4, 2023
eeb4626
ipa: rpi: Use r-value references in the set()/setLocked() functions
naushir Sep 9, 2024
c67e9c9
ipa: rpi: Add erase()/eraseLocked() to RPiController::Metadata
naushir Sep 9, 2024
f94e2c5
ipa: rpi: Add a HW property to determine if the data buffer is strided
naushir Sep 9, 2024
20ed8f1
controls: ipa: rpi: Add CNN controls
naushir Sep 9, 2024
28aa776
ipa: rpi: Handle the new CNN controls in the IPA
naushir Sep 9, 2024
6311abe
ipa: rpi: Provide the camera helper with the hardware configuration
naushir Sep 9, 2024
e73d51d
ipa: rpi: Add support for the Sony IMX500 camera sensor
naushir Sep 9, 2024
052de74
RASPBERRYPI ONLY: Add Sony IMX708 sensor properties
njhollinghurst Dec 8, 2022
4a52884
RASPBERRYPI ONLY: Handle mandatory stream flags
naushir May 23, 2023
e86d034
RASPBERRYPI ONLY: Add a Github workflow to generate release tarballs
XECDesign Nov 16, 2023
2fc9ce1
RASPBERRYPI ONLY: Update README to follow Raspberry Pi documentation
mtouzot Mar 30, 2024
2abd1f8
RASPBERRYPI ONLY: libcamera: v4l2_videodevice: Limit number of queued…
naushir Jun 28, 2024
75fe515
RASPBERRYPI ONLY: Use meson from pip when generating orig tarball
XECDesign Aug 29, 2024
1230f78
ipa: rpi: awb: Disable CT search bias for Grey World AWB
naushir Nov 19, 2024
b4da73c
Check for unsupported pixel format
Dec 8, 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 @@ -267,6 +268,8 @@ class V4L2VideoDevice : public V4L2Device
void bufferAvailable();
FrameBuffer *dequeueBuffer();

int queueToDevice(FrameBuffer *buffer);

void watchdogExpired();

template<typename T>
Expand All @@ -282,6 +285,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