|
|
bool | begin () |
| | Create the mutex and allocate all slot buffers in PSRAM. False if any allocation fails.
|
| |
|
std::optional< size_t > | begin_write () |
| |
|
uint8_t * | write_buffer (size_t slot) |
| |
|
void | publish (size_t slot, const frames::FrameMeta &meta) |
| |
|
void | abort_write (size_t slot, frames::AbortReason reason) |
| |
|
std::optional< frames::FrameLease > | acquire_latest () |
| |
|
const uint8_t * | data (const frames::FrameLease &lease) const |
| |
| bool | add_subscriber (TaskHandle_t task) |
| | Register a task to wake (xTaskNotifyGive) on every publish.
|
| |
|
void | remove_subscriber (TaskHandle_t task) |
| | Unregister a task. Unknown or null handles are ignored. Remove before deleting the task.
|
| |
| TaskHandle_t | start_subscriber_task (TaskFunction_t entry, const char *name, uint32_t stack_bytes, UBaseType_t priority, BaseType_t core, void *arg) |
| | Creates a task pinned to core and registers it as a subscriber, so it is woken on every publish.
|
| |
|
FrameStoreStats | stats () |
| |
|
bool | ready () const |
| | True only after a fully successful begin(). Every other call is a safe no-op before that.
|
| |
| void | release_slot (size_t slot) override |
| |
|
|
static constexpr size_t | kSlotBytes = 32 * 1024 |
| |
|
static constexpr size_t | kMaxSubscribers = 2 |
| | Maximum number of tasks woken on each publish (stream task + detection task).
|
| |
◆ add_subscriber()
| bool FrameStore::add_subscriber |
( |
TaskHandle_t | task | ) |
|
Register a task to wake (xTaskNotifyGive) on every publish.
- Returns
- false when all kMaxSubscribers slots are taken; adding a handle already registered is a no-op that returns true. Safe from any task; no heap.
◆ release_slot()
| void FrameStore::release_slot |
( |
size_t | slot | ) |
|
|
overridevirtual |
◆ start_subscriber_task()
| TaskHandle_t FrameStore::start_subscriber_task |
( |
TaskFunction_t | entry, |
|
|
const char * | name, |
|
|
uint32_t | stack_bytes, |
|
|
UBaseType_t | priority, |
|
|
BaseType_t | core, |
|
|
void * | arg ) |
Creates a task pinned to core and registers it as a subscriber, so it is woken on every publish.
Shared by the stream and detection tasks. If the subscriber slots are full the new task is deleted again, so the caller never owns a task that is not subscribed.
- Returns
- The task handle, or nullptr if creation or registration failed (already logged).
The documentation for this class was generated from the following files:
- lib/frame_store/include/frame_store.h
- lib/frame_store/src/frame_store.cpp