Own LOOM's AIcam specialization outside the universal USHER service. More...
#include "loom_camera_backend.h"#include "loom_cam.h"#include "imx500_pipe.h"#include <stdio.h>#include <string.h>
Go to the source code of this file.
Macros | |
| #define | USHER_AI_CAM_PHOTO_DIR "~/Pictures/sensoraia" |
| Capture destination default; backend naming remains LOOM-owned. | |
| #define | USHER_SODA "./bin/soda" |
| Existing post-capture analysis executable, not the LOOM matcher. | |
Functions | |
| static void | loom_capture_configure (const struct camera_backend_host *host) |
| Pass the service cancellation flag to the native capture owner. | |
| int | loom_camera_backend_set_settings (const char *settings) |
| Choose one LOOM assignment before acquiring either worker. | |
| void | loom_camera_backend_configure (const char *references, const char *model) |
| Configure the LOOM plugin before selecting or initializing its owner. | |
| static int | loom_capture_init (const char *source) |
| Select the native capture protocol only when this owner is acquired. | |
| static int | loom_capture_shoot (char *filename, size_t capacity, int number) |
| Request pixels through the neutral supervisor without detection parsing. | |
| static void | loom_capture_deinit (void) |
| Stop only LOOM's capture child; the saved-photo stream drains separately. | |
| static int | loom_stream_init (void) |
| Start optional saved-photo processing without acquiring another sensor. | |
| struct camera_backend | loom_camera_backend_get (bool mock) |
| Return LOOM's descriptor without opening a sensor or starting a thread. | |
Variables | |
| static const char * | reference_directory = USHER_LOOMCAM_REFERENCE_DIR |
| static const char * | network_model = USHER_LOOMCAM_MODEL |
| static struct imx500_pipe | capture_owner = IMX500_PIPE_INITIALIZER |
| static const char * | inference_settings_path |
Detailed Description
Own LOOM's AIcam specialization outside the universal USHER service.
The capture owner and saved-photo worker have separate lifecycles: optional matching starts without acquiring IMX500, while physical capture is lazy. A failed matcher never disables ordinary photograph capture.
Definition in file loom_camera_backend.c.
Macro Definition Documentation
◆ USHER_AI_CAM_PHOTO_DIR
| #define USHER_AI_CAM_PHOTO_DIR "~/Pictures/sensoraia" |
Capture destination default; backend naming remains LOOM-owned.
Definition at line 34 of file loom_camera_backend.c.
◆ USHER_SODA
| #define USHER_SODA "./bin/soda" |
Existing post-capture analysis executable, not the LOOM matcher.
Definition at line 38 of file loom_camera_backend.c.
Function Documentation
◆ loom_camera_backend_configure()
| void loom_camera_backend_configure | ( | const char * | references, |
| const char * | model ) |
Configure the LOOM plugin before selecting or initializing its owner.
- Parameters
-
references Borrowed reference-directory path, valid until initialization. model Borrowed RPK path, valid for the capture backend lifetime.
- Precondition
- No LOOM owner is active while configuration changes.
Saved-photo worker initialization copies its paths; native capture continues borrowing the model until shutdown. Do not shorten that lifetime merely because the matcher has already started.
Definition at line 62 of file loom_camera_backend.c.
◆ loom_camera_backend_get()
| struct camera_backend loom_camera_backend_get | ( | bool | mock | ) |
Return LOOM's descriptor without opening a sensor or starting a thread.
- Parameters
-
mock True for saved/mock pixels rather than the native capture owner.
- Returns
- Immutable hook lifetimes with LOOM-owned naming and point semantics.
Native LOOM advertises image capture and finish ownership, never object detection. Frame timing remains on the common capture path; matching has its own saved-photo stream lifecycle and cannot acquire the sensor again.
Definition at line 111 of file loom_camera_backend.c.
◆ loom_camera_backend_set_settings()
| int loom_camera_backend_set_settings | ( | const char * | settings | ) |
Choose one LOOM assignment before acquiring either worker.
- Parameters
-
settings Borrowed nonempty settings path, alive until capture and analysis have stopped.
- Returns
- Zero if accepted; minus one when invalid or workers already own configuration.
Definition at line 54 of file loom_camera_backend.c.
◆ loom_capture_configure()
|
static |
Pass the service cancellation flag to the native capture owner.
- Parameters
-
host Nullable backend host with a running flag valid through capture.
Borrow only the flag; the host object itself need not persist.
Definition at line 49 of file loom_camera_backend.c.
◆ loom_capture_deinit()
|
static |
Stop only LOOM's capture child; the saved-photo stream drains separately.
Definition at line 96 of file loom_camera_backend.c.
◆ loom_capture_init()
|
static |
Select the native capture protocol only when this owner is acquired.
- Parameters
-
source Reserved common-backend input; native capture uses the configured RPK.
- Returns
- Zero after the camera child reports READY, otherwise -1.
Stream startup may happen earlier without camera acquisition. Delaying physical ownership until capture keeps saved-photo processing independent.
Definition at line 73 of file loom_camera_backend.c.
◆ loom_capture_shoot()
|
static |
Request pixels through the neutral supervisor without detection parsing.
- Parameters
-
filename Caller-owned destination buffer. capacity Writable path bytes including the terminator. number FC photo number used only for the output filename.
- Returns
- Zero for a qualified saved image, otherwise -1.
Definition at line 90 of file loom_camera_backend.c.
◆ loom_stream_init()
|
static |
Start optional saved-photo processing without acquiring another sensor.
- Returns
- Zero for worker startup, otherwise -1; photograph capture remains a separate capability.
Definition at line 103 of file loom_camera_backend.c.
Variable Documentation
◆ capture_owner
|
static |
LOOM's own neutral native worker, not detector state.
Definition at line 43 of file loom_camera_backend.c.
◆ inference_settings_path
|
static |
Definition at line 44 of file loom_camera_backend.c.
◆ network_model
|
static |
Borrowed RPK configuration for native capture lifetime.
Definition at line 42 of file loom_camera_backend.c.
◆ reference_directory
|
static |
Borrowed until worker init copies it.
Definition at line 41 of file loom_camera_backend.c.