Adapt CHDKbridge capture and lens controls to USHER's backend contract. More...
#include "chdk_camera_backend.h"#include "chdk_pipe.h"#include "camera_control.h"#include "path_utils.h"#include <errno.h>#include <limits.h>#include <stdio.h>#include <sys/stat.h>#include <unistd.h>
Go to the source code of this file.
Macros | |
| #define | USHER_CHDK_PHOTO_DIR "~/Pictures/sensoraia" |
| #define | USHER_SODA "./bin/soda" |
Functions | |
| static void | chdk_backend_configure (const struct camera_backend_host *host) |
| Pass service cancellation to CHDKbridge supervision. | |
| void | chdk_camera_backend_set_photo_directory (const char *directory) |
| static int | chdk_backend_init (const char *source_image) |
| Prepare capture storage and initialize the CHDK controller path. | |
| static int | chdk_backend_shoot (char *filename, size_t capacity, int number) |
| Capture one CHDK JPEG at the path derived from its shot number. | |
| struct camera_backend | chdk_camera_backend_get (void) |
Variables | |
| static const char * | photo_directory = USHER_CHDK_PHOTO_DIR |
Detailed Description
Adapt CHDKbridge capture and lens controls to USHER's backend contract.
This layer resolves the configured photo directory and owns naming; the subprocess layer owns USB/camera transactions. It advertises only the controls for which CHDKbridge can return command-specific evidence.
Definition in file chdk_camera_backend.c.
Macro Definition Documentation
◆ USHER_CHDK_PHOTO_DIR
| #define USHER_CHDK_PHOTO_DIR "~/Pictures/sensoraia" |
Definition at line 36 of file chdk_camera_backend.c.
◆ USHER_SODA
| #define USHER_SODA "./bin/soda" |
Definition at line 39 of file chdk_camera_backend.c.
Function Documentation
◆ chdk_backend_configure()
|
static |
Pass service cancellation to CHDKbridge supervision.
- Parameters
-
host Nullable backend host whose running flag outlives capture work.
Retain only the flag; the backend does not need the host's other callbacks.
Definition at line 46 of file chdk_camera_backend.c.
◆ chdk_backend_init()
|
static |
Prepare capture storage and initialize the CHDK controller path.
- Parameters
-
source_image Unused fixture argument from the shared backend interface.
- Returns
- Zero for successful setup, or -1 on storage/controller setup failure.
Reject unusable output storage before advertising capture readiness.
Definition at line 60 of file chdk_camera_backend.c.
◆ chdk_backend_shoot()
|
static |
Capture one CHDK JPEG at the path derived from its shot number.
- Parameters
-
[out] filename Output path; cleared on failure when writable. capacity Path buffer size including the terminator. number Nonnegative photo number.
- Returns
- Zero for a completed capture, or -1 on invalid input or capture failure.
Pass the path to the controller only if it fits so truncated names cannot misassociate a saved image with another shot.
Definition at line 81 of file chdk_camera_backend.c.
◆ chdk_camera_backend_get()
| struct camera_backend chdk_camera_backend_get | ( | void | ) |
Return CHDK's descriptor without acquiring the camera.
Definition at line 96 of file chdk_camera_backend.c.
◆ chdk_camera_backend_set_photo_directory()
| void chdk_camera_backend_set_photo_directory | ( | const char * | directory | ) |
Configure a borrowed photo directory before capture; used by isolated speed tests.
Definition at line 51 of file chdk_camera_backend.c.
Variable Documentation
◆ photo_directory
|
static |
Definition at line 41 of file chdk_camera_backend.c.