ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_camera_source_memory.h File Reference

Fixed in-memory frame source backend for ra8_camera. More...

#include "ra8_camera.h"
#include "ra8_err.h"
Include dependency graph for ra8_camera_source_memory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ra8_camera_source_memory_state_t
 Caller-owned state for a fixed-frame memory source. More...

Functions

ra8_err_t ra8_camera_source_memory_init (ra8_camera_source_t *source, ra8_camera_source_memory_state_t *state, const ra8_camera_frame_t *frame)
 Bind a repeatable source backed by one immutable frame.

Detailed Description

Fixed in-memory frame source backend for ra8_camera.

Tag
[Ring 4 / Service] {World: NS}

Binds one immutable frame as a repeatable camera source. Each capture copies the fixed frame into the caller's capture buffer. Besides host tests, this is useful for replaying a recorded RGB, UYVY, or JPEG frame through the same source/codec pipeline as live hardware.

Since
0.1.0

Definition in file ra8_camera_source_memory.h.

Function Documentation

◆ ra8_camera_source_memory_init()

ra8_err_t ra8_camera_source_memory_init ( ra8_camera_source_t * source,
ra8_camera_source_memory_state_t * state,
const ra8_camera_frame_t * frame )
nodiscard

Bind a repeatable source backed by one immutable frame.

Parameters
[out]sourceCaller-owned source handle to bind.
[out]stateCaller-owned backend state to populate.
[in]frameValid immutable frame to replay.
Returns
ra8_err_t Error code.
Return values
k_ra8_okSource bound.
k_ra8_err_null_ptrAn argument or frame->data was NULL.
otherPropagated from ra8_camera_frame_validate.
Precondition
source and state out-live every source operation.
frame->data remains readable for the source lifetime.
Postcondition
On success captures copy the fixed bytes into caller storage.
On error source and state are unchanged.
Note
Not thread-safe with respect to the same source state.
Since
0.1.0

Definition at line 108 of file ra8_camera_source_memory.c.

References ra8_camera_source_t::ctx, ra8_camera_source_memory_state_t::frame, ra8_camera_source_t::iface, k_ra8_err_null_ptr, k_ra8_ok, ra8_camera_frame_validate(), and s_memory_source_iface.