Commit Graph

45 Commits

Author SHA1 Message Date
Fabio Manganiello e58f5d2fa1
[Camera] The `wait_for_either` barrier should be enabled on streaming by default.
continuous-integration/drone/push Build is passing Details
`camera.pi*` plugins are an exception, as they handle the lifecycle of
the camera streaming process through the `picamera*` libraries.

Otherwise, the streaming thread should explicitly wait on either the
plugin stop or streaming stop events and exit accordingly, or the camera
thread may be streaming indefinitely.
2024-02-26 01:28:25 +01:00
Fabio Manganiello 1c14450781 FIX: Remove `wait_for_either` barrier from the streaming thread.
continuous-integration/drone/push Build is passing Details
The `_accept_client` logic will be executed anyway at the next
iteration, unless the server socket is closed - in that case, the thread
will fail and exit anyway.

The `wait_for_either` barrier in the streaming thread may instead
prevent other connections from being established after the first one is
closed.
2024-02-25 16:02:52 +01:00
Fabio Manganiello 4c92bdd11c
FIX: Handle `stop_streaming` exceptions in the main loop of the camera plugin.
continuous-integration/drone/push Build is passing Details
Otherwise camera process teardown errors may bubble up and prevent the
plugin from restarting the streaming.
2024-02-24 21:36:08 +01:00
Fabio Manganiello 8999a226b1
[WIP] Updated documentation for `camera.pi`.
continuous-integration/drone/push Build is passing Details
2024-02-24 21:16:43 +01:00
Fabio Manganiello e46704010b
[WIP] Rewritten `camera.pi.legacy` plugin.
continuous-integration/drone/push Build is passing Details
2024-02-24 14:07:07 +01:00
Fabio Manganiello 9ad9bd20e4
Added `stream_on_start` argument to `camera` plugins.
continuous-integration/drone/push Build is passing Details
It replaces the functionalities of the deprecated `camera` backends.
2024-02-24 01:31:05 +01:00
Fabio Manganiello 9cf95125a6 [WIP] Added streaming support to camera.pi using new picamera2 API
continuous-integration/drone/push Build is passing Details
2024-02-22 22:52:52 +01:00
Fabio Manganiello 659c33837e [WIP] Using new picamera2 module for camera.pi, and moved old picamera integration to camera.pi.legacy
continuous-integration/drone/push Build is passing Details
2024-02-19 00:07:29 +00:00
Fabio Manganiello c59446fdb1
Fixed setting of `output_file` on `FfmpegWriter`.
continuous-integration/drone/push Build is passing Details
Also, fixed parameters passed to camera
writer objects.
2024-02-17 00:01:47 +01:00
Fabio Manganiello c3337ccc6c
[#311] Docs deps autogen sphinx plugin.
continuous-integration/drone/push Build is passing Details
Added an `add_dependencies` plugin to the Sphinx build process that
parses the manifest files of the scanned backends and plugins and
automatically generates the documentation for the required dependencies
and triggered events.

This means that those dependencies are no longer required to be listed
in the docstring of the class itself.

Also in this commit:

- Black/LINT for some integrations that hadn't been touched in a long
  time.

- Deleted some leftovers from previous refactors (deprecated
  `backend.mqtt`, `backend.zwave.mqtt`, `backend.http.request.rss`).

- Deleted deprecated `inotify` backend - replaced by `file.monitor` (see
  #289).
2023-09-24 17:00:08 +02:00
Fabio Manganiello 2f4229d7b1
pylint fixes for the camera plugin. 2023-06-16 15:40:05 +02:00
Fabio Manganiello 4587b262b0
Stream camera frames over HTTP using a Redis pub/sub mechanism. 2023-06-05 20:40:12 +02:00
Fabio Manganiello 4bf9c01ac9
Moved camera routes.
Camera routes migrated from Flask blueprints to Tornado handlers.
2023-05-27 22:24:45 +02:00
Fabio Manganiello 1c40e5e843
Black'd the camera plugin and writer.
Also, proper fix for the multi-inheritance problem of
the ffmpeg writers.
2023-05-23 20:42:59 +02:00
Fabio Manganiello 94bb3e0541
Added TOC to readme and more LGTM fixes 2022-02-09 21:06:49 +01:00
Fabio Manganiello 29a7eff15a
Fixed/suppressed LGTM warnings 2022-02-08 21:51:37 +01:00
Fabio Manganiello 3bfc5b83ef Moved to manifest files for describing plugins and backends and their dependencies 2021-09-16 17:53:40 +02:00
Fabio Manganiello 2a78f81a7b Major LINT fixes 2021-04-05 00:58:44 +02:00
Fabio Manganiello e9d9ef252f Frames directory should be created in 0o755 mode 2020-09-28 02:33:27 +02:00
Fabio Manganiello df1e03f0af Added FFmpeg camera plugin [relates to #150] 2020-09-27 12:52:07 +02:00
Fabio Manganiello ac42f7eba4 Make sure that the PiCamera session is properly closed and re-opened on each stream request 2020-09-25 18:06:27 +02:00
Fabio Manganiello 09f9e974b1 Camera plugins refactor 2020-09-25 17:19:43 +02:00
Fabio Manganiello a130edb74f Made QR-code scan work also on picamera 2020-03-11 01:06:07 +01:00
Fabio Manganiello 141275ecdf Support for scanning QR-codes and barcodes through a camera plugin 2020-03-10 22:35:50 +01:00
Fabio Manganiello ba6c890a42 Refactored and improved camera plugin 2019-12-29 16:28:07 +01:00
Fabio Manganiello 416c9ceb93 Fixed picamera mjpeg stream 2019-12-17 22:44:15 +01:00
Fabio Manganiello 17af488b32 Using an io memory buffer to write the streamed images instead of a
physical file to improve streaming performance
2019-12-17 21:32:56 +01:00
Fabio Manganiello a43508a743 Do not import cv2 in camera.__init__ unless we specify a video_type that needs to be expanded. Otherwise we introduce the OpenCV dependency also for the camera.pi plugin 2019-09-10 00:21:11 +02:00
Fabio Manganiello 228e656da8 Only import cv2 in the methods that require it (prevents camera.pi
and other camera derived plugins from failing if OpenCV is not installed)
2019-08-07 09:43:40 +02:00
Fabio Manganiello 5c3d32d05d Fixed undefined reference 2019-07-19 13:50:01 +02:00
Fabio Manganiello cc61032bec Fixes for readthedocs build 2019-07-16 22:38:42 +02:00
Fabio Manganiello 95b5820783 Fixes for readthedocs build 2019-07-16 22:29:23 +02:00
Fabio Manganiello 0b05d7d8de pylint warnings fixed 2019-07-13 18:25:42 +02:00
Fabio Manganiello 20b0c09a0c Removed workaround that doesn't work 2019-03-20 18:37:49 +01:00
Fabio Manganiello cbe4d8cd78 Delete recording thread item from map only if the thread has actually stopped 2019-03-17 22:55:36 +01:00
Fabio Manganiello 81a200bd4e Make sure that device_id is in _is_recording and hasn't been removed by another thread before checking it 2019-03-17 02:16:43 +01:00
Fabio Manganiello f95f52df19 Few fixes in camera plugin 2019-03-17 02:06:47 +01:00
Fabio Manganiello 9ed4ad6d85 Set workaround environment variable before importing OpenCV 2019-03-17 01:56:05 +01:00
Fabio Manganiello 3af30075e3 Temporarily workaround for OpenCV >= 3.4.2 bug that doesn't properly release the video device 2019-03-17 01:26:06 +01:00
Fabio Manganiello 0596d77403 Support for camera snapshot and stream endpoints and for disabling logging on response and event messages 2019-03-06 02:01:17 +01:00
Fabio Manganiello 65d6e5a5f6 Support for video_type in camera plugin 2019-02-28 01:55:12 +01:00
Fabio Manganiello a9fb6a38dd New API for firing events and registering/unregistering event handlers
both for plugins and backends
2019-02-28 01:21:25 +01:00
Fabio Manganiello 29b8d0827b Added basic support for camera events in the camera plugin 2019-02-27 20:12:40 +01:00
Fabio Manganiello 17367f5b3e Added camera plugin over cv2 2019-02-26 23:50:48 +01:00
Fabio Manganiello 29a5cfa9c2 Refactored camera.pi backend. Support for start/stop recording control via plugin action. Introduced support for taking pictures too 2018-06-14 00:34:30 +02:00