323 Commits

Author SHA1 Message Date
Kamil Trzcinski
86e89a6291 device: add helpers for count enqueued 2023-02-24 00:07:19 +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
a24e100983 camera: fix output matches to find close-by resolutions 2023-02-23 19:16:11 +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
10545b6b7a camera: match resolutions close to 32x32 blocks (when re-using) 2023-02-22 21:49:06 +01:00
Kamil Trzcinski
aef3a7300a tests: fix dummy.sh script 2023-02-22 21:41:46 +01:00
Kamil Trzcinski
b2dfba5577 cmd: add /status.json to describe what and how it works 2023-02-22 21:40:17 +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
Kamil Trzcinski
d963fdd16d service: update raspi 12MP config 2023-02-22 17:34:54 +01:00
Kamil Trzcinski
72dfc2e731 camera: limit max rescaller size to 1920 (default for Raspi) 2023-02-22 17:32:47 +01:00
Kamil Trzcinski
3bc447c772 camera: add support for V4L2_PIX_FMT_SBGGR10P 2023-02-22 17:32:47 +01:00
Kamil Trzcinski
c9600d1253 device: allow to use dummy as a way to test streamer
This adds loopback tests via `tests/`
2023-02-22 17:32:47 +01:00
Kamil Trzcinski
2e9718fea7 device: make device_open_buffer_list_capture to use buffer_format_t 2023-02-22 17:32:46 +01:00
Kamil Trzcinski
71a88f3fc2 util/opts: print help as a command line 2023-02-22 17:32:46 +01:00
Kamil Trzcinski
168181afa5 camera: find device handling the format by format order 2023-02-22 17:32:46 +01:00
Kamil Trzcinski
0c244a61c8 Pass sizeimage to ensure that allocated buffers are of a correct size 2023-02-22 17:32:46 +01:00
Kamil Trzciński
ca08adb62f Add -snapshot.height, -stream.height and -video.height 2023-02-22 17:32:46 +01:00
Kamil Trzcinski
c18561c9f8 service: add support for Raspi Camera Module 3 12MP 2023-02-22 17:13:30 +01:00
Kamil Trzcinski
a5bfeffc2b tools: update csi_camera.sh and libcamera_camera.sh scripts 2023-02-21 23:50:35 +01:00
Kamil Trzcinski
4d58a383bf util: improve error message of ioctl_retried 2023-02-21 23:50:35 +01:00
Kamil Trzcinski
38c1811fdf tools: usb_camera.sh accepts CAMERA_INDEX=0..n 2023-02-21 23:39:38 +01:00
Kamil Trzcinski
4ff6bee511 device: some random fixes 2023-02-21 23:39:38 +01:00
Kamil Trzcinski
fc8255ed90 device: ensure that sink has capture that can process output - otherwise skip
It appears that if output is enqueued, but there's no capture for longer period
this results EPIPE from mmal.
2023-02-21 23:39:38 +01:00
Kamil Trzcinski
45c4d69332 tools: add tools/rpi_mem_usage.sh script 2023-02-21 23:20:18 +01:00
Kamil Trzcinski
ba369ce597 Log how much memory was used 2023-02-21 15:28:03 +01:00
Kamil Trzcinski
764f94ba44 Add various tools 2022-11-05 15:41:25 +01:00
Stefan Dej
d143f3019e
fix: use current url to connect to server (#22)
instead of using absolute path `/webrtc`

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2022-10-30 17:16:06 +01:00
Kamil Trzciński
5ff64f2caf Use value_uint for value_mapping 2022-10-29 12:23:18 +02:00
Kamil Trzciński
3839f051af Refactor buffer_lock_capture method 2022-10-29 11:46:25 +02:00
Kamil Trzciński
79e9bca11f Discover H264 keyframes on dequeue 2022-10-29 11:36:58 +02:00
MK3S+ Printer
ec2ed5e392 Fix top bar for H264 stream 2022-10-29 11:10:49 +02:00
MK3S+ Printer
f0d16f491c Add CAMERA_DECODER_DEBUG to capture debug output of capture into /tmp 2022-10-29 11:10:36 +02:00
MK3S+ Printer
8359362204 Improve decoder selected formats to choose ones with best quality first 2022-10-29 11:10:16 +02:00
MK3S+ Printer
4b2f51ba2e Fix /option support 2022-10-29 10:00:17 +02:00
Kamil Trzcinski
57fc761986 Active high/low res only when needed 2022-10-25 16:56:32 +02:00
Kamil Trzcinski
6bdb33ff3a Fix buffer leakage on camera reconnect 2022-10-25 16:37:30 +02:00
Kamil Trzcinski
caafd0da44 Add Access-Control-Allow-Origin: * everywhere 2022-10-24 00:22:48 +02:00
Kamil Trzcinski
cb7795ad2e Fix typo 2022-10-24 00:22:48 +02:00
MK3S+ Printer
e509c328f1 Disable usage of STUN server (it should not be needed for local) 2022-10-10 20:27:22 +02:00
Kamil Trzcinski
57fb09fbf1 Improve index.html to provide better description of all options 2022-10-03 01:25:51 +02:00
Kamil Trzcinski
771f61449b Fix Unexpected error 9 on netlink descriptor <fd>
The problem is double close of `fd` since the `fdopen`
takes ownership of fd passed.
2022-09-24 10:59:08 +02:00
Kamil Trzcinski
f08421a796 Improve HTTP support (to better handle params) and redirect /video params 2022-09-24 10:41:09 +02:00
Kamil Trzcinski
5801152b03 Add /video to automatically give HLS to supported browser 2022-09-24 10:40:52 +02:00
Kamil Trzcinski
5ee0bee59f Add WebRTC support using libdatachannel
The WebRTC is exposed via `/video.html` endpoint
and enabled by default as long as h264 stream
is available.
2022-09-24 10:38:37 +02:00
Kamil Trzcinski
ff81088824 Build action workflow 2022-09-06 14:11:27 +00: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 Trzciński
fbf4e30f71 Fix build-env script 2022-09-04 18:48:12 +00:00