|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Fixed PCM replay backend implementation. More...
#include "ra8_audio_source_memory.h"#include <stddef.h>#include <string.h>#include "ra8_audio_internal.h"Go to the source code of this file.
Functions | |
| static ra8_err_t | internal_memory_get_info (void *ctx, ra8_audio_source_info_t *out_info) |
| Report metadata for the fixed memory frame. | |
| static ra8_err_t | internal_memory_capture (void *ctx, const ra8_audio_buffer_t *buffer, ra8_audio_frame_t *out_frame) |
| Copy the fixed memory frame into a caller buffer. | |
| static ra8_err_t | internal_memory_stop (void *ctx) |
| Stop the memory replay backend. | |
| ra8_err_t | ra8_audio_source_memory_init (ra8_audio_source_t *source, ra8_audio_source_memory_state_t *state, const ra8_audio_frame_t *frame) |
| Bind one immutable PCM frame as a repeatable audio source. | |
Variables | |
| static const ra8_audio_source_iface_t | s_memory_source_iface |
Fixed PCM replay backend implementation.
Copies one immutable caller-owned fixture into each supplied output buffer and reports its validated PCM metadata without allocation.
Definition in file ra8_audio_source_memory.c.
|
static |
Copy the fixed memory frame into a caller buffer.
Replays the configured fixture without allocating or retaining the output buffer.
| [in] | ctx | Memory-source state supplied during initialization. |
| [in] | buffer | Caller-owned destination buffer descriptor. |
| [out] | out_frame | Descriptor for the copied frame. |
| k_ra8_ok | The fixture was copied successfully. |
| k_ra8_err_null_ptr | A required pointer is null. |
| k_ra8_err_invalid_size | The destination is too small. |
Definition at line 76 of file ra8_audio_source_memory.c.
References ra8_audio_frame_t::bytes, ra8_audio_buffer_t::capacity, ra8_audio_buffer_t::data, ra8_audio_frame_t::data, ra8_audio_source_memory_state_t::frame, k_ra8_err_invalid_size, k_ra8_err_null_ptr, k_ra8_ok, and memcpy().
|
static |
Report metadata for the fixed memory frame.
Copies the immutable fixture geometry into the generic source-info structure.
| [in] | ctx | Memory-source state supplied during initialization. |
| [out] | out_info | Destination for the frame metadata. |
| k_ra8_ok | Metadata was copied successfully. |
| k_ra8_err_null_ptr | A required pointer is null. |
Definition at line 38 of file ra8_audio_source_memory.c.
References ra8_audio_frame_t::bytes, ra8_audio_frame_t::channels, ra8_audio_frame_t::format, ra8_audio_source_memory_state_t::frame, k_ra8_err_null_ptr, k_ra8_ok, RA8_INTERNAL, ra8_audio_frame_t::sample_count, ra8_audio_frame_t::sample_rate_hz, and ra8_audio_frame_t::valid_bits.
|
static |
Stop the memory replay backend.
Acknowledges the stop request because the backend owns no active hardware.
| [in] | ctx | Memory-source state supplied during initialization. |
| k_ra8_ok | The no-op stop completed. |
| k_ra8_err_null_ptr | The state pointer is null. |
Definition at line 111 of file ra8_audio_source_memory.c.
References k_ra8_err_null_ptr, k_ra8_ok, and RA8_INTERNAL.
|
nodiscard |
Bind one immutable PCM frame as a repeatable audio source.
| [out] | source | Caller-owned source handle. |
| [out] | state | Caller-owned backend state. |
| [in] | frame | Valid immutable PCM frame retained by the caller. |
| k_ra8_ok | Source bound. |
| k_ra8_err_null_ptr | An argument was nullptr. |
| other | Propagated frame-validation error. |
Definition at line 126 of file ra8_audio_source_memory.c.
References ra8_audio_source_t::ctx, ra8_audio_source_memory_state_t::frame, ra8_audio_source_t::iface, k_ra8_err_null_ptr, k_ra8_ok, ra8_audio_frame_validate(), and s_memory_source_iface.
|
static |
Definition at line 119 of file ra8_audio_source_memory.c.
Referenced by ra8_audio_source_memory_init(), and ra8_camera_source_memory_init().