52 Commits

Author SHA1 Message Date
Ruslan Sayfutdinov
6deb9c513c
libcamera: fix bytesperline calculation for libcamera0.2 (#140)
For libcamera0.2 configuraiton.stride is already set to some incorrect value and configurations->validate() doesn't update it if it's not 0.

For libcamera0.1 it was set to 0. So set it to 0 manually to make sure configurations->validate() computes the correct value.
2024-03-08 08:30:59 +01:00
Kamil Trzcinski
bc231917d8 libcamera: support transform to orientation rename 2023-11-27 22:21:18 +01:00
Kamil Trzcinski
e43e93c236 libcamera: disable SceneFlicker in bookworm 2023-10-14 20:34:44 +02:00
Kamil Trzcinski
67832e526c libcamera: ignore some controls 2023-06-12 22:38:35 +02:00
Kamil Trzcinski
899f2c5e62 status: extend to provide all camera options and properties in JSON payload
- control: add `device_option_is_equal`
- libcamera: provide human readable configurable options
- v4l2: include camera control values
- libcamera: store all applied controls
- libcamera: use `device_option_is_equal`
2023-06-12 22:38:08 +02:00
Kamil Trzcinski
f742c1a7fc Fix camera-vflip/hflip support on arm32v7
This adds `buffer_list_alloc_buffers` and `buffer_list_free_buffers`
to delay buffers allocation for `libcamera`.

Doing this allows to setup RAW stream afterwards.
2023-04-29 10:21:52 +02:00
Kamil Trzcinski
04dd8c926f debug: dump all buffers to path specified by CAMERA_DEBUG_CAPTURE 2023-03-08 19:37:28 +01:00
Kamil Trzcinski
9db8ba5fa5 device: fix compiler bugs 2023-03-03 00:28:48 +01:00
Kamil Trzcinski
27b93facc9 libcamera: add frame timeout 2023-02-24 19:59:54 +01:00
Kamil Trzcinski
f2ad561734 libcamera: find camera by partial match (if not found) 2023-02-24 19:59:53 +01:00
Kamil Trzcinski
23491cef49 libcamera: dynamically add new configurations
device: add `buffer_type_t`
2023-02-23 19:17:11 +01:00
Kamil Trzcinski
21ce78a277 camera: improve FPS handling 2023-02-23 19:17:07 +01:00
Kamil Trzcinski
529d72b105 libcamera: configure RAW to force correct resolution 2023-02-22 23:04:39 +01:00
Kamil Trzcinski
e2e5762b2b libcamera: improve configuration management 2023-02-22 23:04:39 +01:00
Kamil Trzcinski
aafd120af3 libcamera: support Rectangle and Size types
Fixes: https://github.com/ayufan/camera-streamer/issues/28
Replaces: https://github.com/ayufan/camera-streamer/pull/30
2023-02-22 18:07:27 +01:00
noahwilliamsson
d36c2d590c device/libcamera: fix libcamera::Span API breakage (#11)
After upgrading from the July, 2022 releases of Raspberry Pi's libcamera packages to the Aug, 2022 releases, compilation fails with:

```
g++ -std=c++17 -MMD -Werror -Wall -g -I/tmp/camera-streamer -D_GNU_SOURCE -DUSE_FFMPEG -DUSE_LIBCAMERA -I/usr/include/libcamera -DUSE_RTSP -I/usr/include/liveMedia -I/usr/include/groupsock -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment -DUSE_LIBDATACHANNEL -Ithird_party/libdatachannel/include -Ithird_party/libdatachannel/deps/json/include -c -o device/libcamera/device.o device/libcamera/device.cc
In file included from device/libcamera/libcamera.hh:22,
                 from device/libcamera/device.cc:2:
/usr/include/libcamera/libcamera/controls.h: In instantiation of 'void libcamera::ControlList::set(const libcamera::Control<T>&, const std::initializer_list<_Up>&) [with T = libcamera::Span<const long int, 2>; V = long int]':
device/libcamera/device.cc:126:100:   required from here
/usr/include/libcamera/libcamera/controls.h:403:14: error: no matching function for call to 'libcamera::ControlValue::set<libcamera::Span<const long int, 2> >(libcamera::Span<const long int, 18446744073709551615>)'
  403 |   val->set<T>(Span<const typename std::remove_cv_t<V>>{ value.begin(), value.size() });
      |   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/libcamera/libcamera/controls.h:178:7: note: candidate: 'template<class T, typename std::enable_if<((! libcamera::details::is_span<U>::value) && (! std::is_same<std::__cxx11::basic_string<char>, typename std::remove_cv< <template-parameter-1-1> >::type>::value)), std::nullptr_t>::type <anonymous> > void libcamera::ControlValue::set(const T&)'
  178 |  void set(const T &value)
      |       ^~~
/usr/include/libcamera/libcamera/controls.h:178:7: note:   template argument deduction/substitution failed:
/usr/include/libcamera/libcamera/controls.h:177:30: error: no type named 'type' in 'struct std::enable_if<false, std::nullptr_t>'
  177 |            std::nullptr_t> = nullptr>
      |                              ^~~~~~~
/usr/include/libcamera/libcamera/controls.h:190:7: note: candidate: 'template<class T, typename std::enable_if<(libcamera::details::is_span<U>::value || std::is_same<std::__cxx11::basic_string<char>, typename std::remove_cv< <template-parameter-1-1> >::type>::value), std::nullptr_t>::type <anonymous> > void libcamera::ControlValue::set(const T&)'
  190 |  void set(const T &value)
      |       ^~~
/usr/include/libcamera/libcamera/controls.h:190:7: note:   template argument deduction/substitution failed:
/usr/include/libcamera/libcamera/controls.h:403:14: note:   cannot convert 'libcamera::Span<const long int, 18446744073709551615>((& value)->std::initializer_list<long int>::begin(), (& value)->std::initializer_list<long int>::size())' (type 'libcamera::Span<const long int, 18446744073709551615>') to type 'const libcamera::Span<const long int, 2>&'
  403 |   val->set<T>(Span<const typename std::remove_cv_t<V>>{ value.begin(), value.size() });
      |   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

After introducing this change (see raspberrypi/libcamera-apps PR 342), it works with both versions mentioned below:

```
$ apt list --installed
libcamera-apps/now 0~git20220707+35266e8-1 arm64 [installed,upgradable to: 0~git20220830+1bf0cca-1]
libcamera-dev/now 0~git20220705+f30ad033-1 arm64 [installed,upgradable to: 0~git20220826+3fad116f-1]
libcamera-tools/now 0~git20220705+f30ad033-1 arm64 [installed,upgradable to: 0~git20220826+3fad116f-1]
libcamera0/now 0~git20220705+f30ad033-1 arm64 [installed,upgradable to: 0~git20220826+3fad116f-1]
```
2022-09-06 13:52:47 +02:00
Kamil Trzciński
878ad95598 Fix bug introduced by 3c818772d1 (diff-6eb6287b4cf8659acef0809a500f07e26feac08a34f12b17a8897127a5d84ab8) 2022-09-04 19:19:13 +00:00
Kamil Trzcinski
3c818772d1 Add scripts to create build env for other architectures 2022-09-04 20:27:42 +02:00
Kamil Trzcinski
f5726fc9b2 Move opts/ into util/opts/ 2022-09-02 22:00:01 +02:00
Kamil Trzcinski
a9c65fae0d Allow to set -camera-vflip and -camera-hflip 2022-08-24 17:48:55 +02:00
Kamil Trzcinski
8b1d066dfc Fix compilation of device/libcamera/fake_camera.c on 32bits 2022-07-20 12:21:33 +02:00
Kamil Trzcinski
6530e5f5b6 Implement FAKE_CAMERA_SENSOR to allow fake image sensor used
Example, make `arducam_64mp` to behave as `imx519` as `imx519`
does have auto exposure control:

```
FAKE_CAMERA_SENSOR=arducam_64mp=imx519
```
2022-07-14 14:19:02 +02:00
Kamil Trzcinski
4e641dea1e Open default camera of a given type 2022-07-12 21:59:02 +02:00
Kamil Trzcinski
b052e5eb04 Remove the controls::draft::AfTrigger since it is an exposed control now via controls::AfTrigger 2022-07-12 11:10:25 +02:00
Kamil Trzcinski
883a951cea Expose options for v4l2 2022-07-08 12:41:08 +02:00
Kamil Trzcinski
6460d1b902 Emit options of all devices 2022-07-08 12:20:09 +02:00
Kamil Trzcinski
b4668aa320 Output all properties and options 2022-07-08 12:12:30 +02:00
Kamil Trzcinski
9051518082 Better print available cameras 2022-07-08 10:54:18 +02:00
Kamil Trzcinski
f7e5b0bcbe Better output controls and properties from libcamera 2022-07-07 14:19:45 +02:00
Kamil Trzcinski
99dd89796d Dump libcamera metadata in verbose 2022-07-07 12:09:05 +02:00
Kamil Trzcinski
4e8e74c716 Fix dynamic setting of auto-focus 2022-07-07 11:37:36 +02:00
Kamil Trzcinski
07a46ee7cc Make libcamera to support some formats 2022-07-07 11:37:19 +02:00
Kamil Trzcinski
4eaa42f1ea Add Af-Trigger 2022-07-05 12:05:17 +02:00
Kamil Trzcinski
26d94709e3 Fix printf warnings 2022-07-05 11:25:20 +02:00
Kamil Trzcinski
9c7f5fed12 Enable -Wall 2022-04-14 10:13:44 +02:00
Kamil Trzcinski
8dd470cb49 Make device to support composite devices (single output, many captures) 2022-04-11 22:02:22 +02:00
Kamil Trzcinski
5a9e871484 Introduce buffer_format_t and use it for buffer_list_open 2022-04-11 20:48:09 +02:00
Kamil Trzcinski
a3e8ef1e24 Make buffer_list_open to accept const char *path 2022-04-11 19:14:06 +02:00
Kamil Trzcinski
e69f707ef0 Fix frame rate 2022-04-11 17:07:35 +02:00
Kamil Trzcinski
fb400f3139 Fix libcamera resolution handling 2022-04-11 16:49:21 +02:00
Kamil Trzcinski
b15d5b28af Improve supported formats 2022-04-11 16:15:06 +02:00
Kamil Trzcinski
ae12963c6e Update logs 2022-04-11 13:52:46 +02:00
Kamil Trzcinski
bce0303b8e Remove non-needed message 2022-04-11 13:11:23 +02:00
Kamil Trzcinski
7c56fa2813 Improve controls handling (preload) 2022-04-11 13:00:45 +02:00
Kamil Trzcinski
a586bad403 Allow to configure control 2022-04-11 12:45:01 +02:00
Kamil Trzcinski
8adcd67569 Allow to configure controls 2022-04-11 12:42:17 +02:00
Kamil Trzcinski
9eeee04560 Allow to disable libcamera 2022-04-11 10:55:54 +02:00
Kamil Trzcinski
aa0f7276bf Make libcamera to work? 2022-04-11 10:51:05 +02:00
Kamil Trzcinski
4783fe31a5 The libcamera starts 2022-04-11 10:01:18 +02:00
Kamil Trzcinski
95c7b06e1e Move int nbufs into buffer_list_open 2022-04-11 09:28:05 +02:00