From 941bafca17b13547a88668b787ce4c8e064ef7ff Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 21 Feb 2023 13:16:58 +1100 Subject: Add a memory arena for the audio pipeline --- src/audio/include/stream_event.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/audio/include/stream_event.hpp') diff --git a/src/audio/include/stream_event.hpp b/src/audio/include/stream_event.hpp index d42de411..6d270e9d 100644 --- a/src/audio/include/stream_event.hpp +++ b/src/audio/include/stream_event.hpp @@ -2,6 +2,7 @@ #include +#include "arena.hpp" #include "freertos/FreeRTOS.h" #include "freertos/queue.h" @@ -13,7 +14,7 @@ namespace audio { struct StreamEvent { static auto CreateStreamInfo(QueueHandle_t source, const StreamInfo& payload) -> StreamEvent*; - static auto CreateChunkData(QueueHandle_t source, std::size_t chunk_size) + static auto CreateArenaChunk(QueueHandle_t source, memory::ArenaPtr ptr) -> StreamEvent*; static auto CreateChunkNotification(QueueHandle_t source) -> StreamEvent*; static auto CreateEndOfStream(QueueHandle_t source) -> StreamEvent*; @@ -28,7 +29,7 @@ struct StreamEvent { enum { UNINITIALISED, STREAM_INFO, - CHUNK_DATA, + ARENA_CHUNK, CHUNK_NOTIFICATION, END_OF_STREAM, LOG_STATUS, @@ -37,10 +38,7 @@ struct StreamEvent { union { StreamInfo* stream_info; - struct { - std::byte* raw_bytes; - cpp::span bytes; - } chunk_data; + memory::ArenaPtr arena_chunk; // FIXME: It would be nice to also support a pointer to himem data here, to // save a little ordinary heap space. -- cgit v1.2.3