Parent-side contract for stock and native Raspberry Pi camera capture. More...
#include <stddef.h>#include <stdbool.h>

Go to the source code of this file.
Functions | |
| int | ai_cam_pipe_set_native (bool enabled) |
| Select native or system-camera capture before startup. | |
| bool | ai_cam_pipe_native (void) |
| Report whether the selected AIcam mode uses native photo-only capture. | |
| void | ai_cam_pipe_configure (const struct camera_backend_host *host) |
| Pass the shutdown flag to native worker supervision. | |
| int | ai_cam_pipe_init (const char *unused) |
| Validate storage and start the selected camera owner. | |
| void | ai_cam_pipe_set_photo_directory (const char *directory) |
| Select a borrowed directory before initialization. | |
| int | ai_cam_pipe_shoot (char *filename, size_t filename_size, int image_number) |
| Capture one ordinary JPEG into private staging for metadata completion. | |
| void | ai_cam_pipe_deinit (void) |
| Stop the native and system-camera subprocesses. | |
Detailed Description
Parent-side contract for stock and native Raspberry Pi camera capture.
Both modes publish private JPEGs and preserve no-replay behavior; only the native worker provides USHER sensor timing evidence.
Definition in file ai_cam_pipe.h.
Function Documentation
◆ ai_cam_pipe_configure()
| void ai_cam_pipe_configure | ( | const struct camera_backend_host * | host | ) |
Pass the shutdown flag to native worker supervision.
- Parameters
-
host Nullable backend host; its running flag must outlive the worker.
Retain only the borrowed flag, not the host structure. A null host clears the flag.
Definition at line 393 of file ai_cam_pipe.c.
◆ ai_cam_pipe_deinit()
| void ai_cam_pipe_deinit | ( | void | ) |
Stop the native and system-camera subprocesses.
Attempt bounded shutdown; an unreaped system-camera child retains ownership rather than allowing a second process to open the camera.
Definition at line 470 of file ai_cam_pipe.c.
◆ ai_cam_pipe_init()
| int ai_cam_pipe_init | ( | const char * | unused | ) |
Validate storage and start the selected camera owner.
- Parameters
-
[in] unused Reserved backend argument.
- Returns
- Zero for usable storage, otherwise -1.
All operations require the owning backend's serialization. Native startup waits for a valid frame; the system-camera path checks its child per shot.
Definition at line 398 of file ai_cam_pipe.c.
◆ ai_cam_pipe_native()
| bool ai_cam_pipe_native | ( | void | ) |
Report whether the selected AIcam mode uses native photo-only capture.
- Returns
- True for native mode.
Reports configuration, not whether the camera has started.
Definition at line 388 of file ai_cam_pipe.c.
◆ ai_cam_pipe_set_native()
| int ai_cam_pipe_set_native | ( | bool | enabled | ) |
Select native or system-camera capture before startup.
- Parameters
-
enabled True for native photo-only capture.
- Returns
- Zero on success, or -1 while either mode has an owned child.
Refuse to switch modes without releasing the previous owner.
Definition at line 381 of file ai_cam_pipe.c.
◆ ai_cam_pipe_set_photo_directory()
| void ai_cam_pipe_set_photo_directory | ( | const char * | directory | ) |
Select a borrowed directory before initialization.
- Parameters
-
[in] directory Caller-owned path, or NULL for the compiled default.
Retain the pointer, not a copy; keep the path valid through capture.
Definition at line 376 of file ai_cam_pipe.c.
◆ ai_cam_pipe_shoot()
| int ai_cam_pipe_shoot | ( | char * | filename, |
| size_t | filename_size, | ||
| int | image_number ) |
Capture one ordinary JPEG into private staging for metadata completion.
- Parameters
-
[out] filename Receives the .pending path, empty on failure. [in] filename_size Buffer capacity including NUL. [in] image_number USHER shot number.
- Returns
- Zero for a nonempty regular image, otherwise -1.
A failure after triggering never replays the exposure. The system camera path does not supply Sensoraia's sensor evidence. The caller completes metadata before exposing the final filename.
Definition at line 430 of file ai_cam_pipe.c.