diff --git a/services/framecache/src/slot.c b/services/framecache/src/slot.c index 45972fd..e22cde8 100644 --- a/services/framecache/src/slot.c +++ b/services/framecache/src/slot.c @@ -17,17 +17,6 @@ #define SEM_PREFIX "/framecache-" #define SEM_SUFFIX "-write" -/* Internal handle used by both server (writer) and client (reader) */ -struct fc_slot { - int shm_fd; - void *base; - size_t shm_size; - sem_t *sem; - char slot_id[FC_MAX_SLOT_ID]; - char shm_path[128]; - char sem_name[128]; -}; - /* ── helpers ─────────────────────────────────────────────────────────── */ static void build_paths(const char *slot_id, @@ -172,12 +161,6 @@ void fc_slot_write_frame(struct fc_slot *s, sem_post(s->sem); } -/* Accessors used by HTTP API */ -fc_header_t *fc_slot_header(struct fc_slot *s) { return (fc_header_t *)s->base; } -const char *fc_slot_id(struct fc_slot *s) { return s->slot_id; } -const char *fc_slot_shm_path(struct fc_slot *s) { return s->shm_path; } -const char *fc_slot_sem_name(struct fc_slot *s) { return s->sem_name; } - /* ── client-side open / read / close (also used by capture-manager) ── */ /** diff --git a/services/framecache/src/slot.h b/services/framecache/src/slot.h index 03ca39f..27c3d27 100644 --- a/services/framecache/src/slot.h +++ b/services/framecache/src/slot.h @@ -21,6 +21,17 @@ #define FC_FRAME_HDR_SIZE 24u /* pts_us(8) + wall_us(8) + size(4) + pad(4) */ #define FC_MAX_SLOT_ID 64u +/* Internal handle used by both server (writer) and client (reader) */ +struct fc_slot { + int shm_fd; + void *base; + size_t shm_size; + sem_t *sem; + char slot_id[FC_MAX_SLOT_ID]; + char shm_path[128]; + char sem_name[128]; +}; + /* Pixel format codes */ #define FC_PIX_UYVY422 0u @@ -57,6 +68,12 @@ typedef struct { _Static_assert(sizeof(fc_frame_t) == FC_FRAME_HDR_SIZE, "fc_frame_t header must be exactly FC_FRAME_HDR_SIZE bytes"); +/* Accessor function declarations (implemented in slot.c) */ +fc_header_t *fc_slot_header(struct fc_slot *s); +const char *fc_slot_id(struct fc_slot *s); +const char *fc_slot_shm_path(struct fc_slot *s); +const char *fc_slot_sem_name(struct fc_slot *s); + /** * Compute total shm size for a slot given frame_size. * = FC_HEADER_SIZE + ring_depth * (FC_FRAME_HDR_SIZE + frame_size)