diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-01-27 13:28:22 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-01-27 13:28:22 +1100 |
| commit | 2cc0a38a1ac7fc54d7333dafa8b99479a7f5dc86 (patch) | |
| tree | 491921af1c26c2712d91030068ac29c4cb2d6d51 /src/audio/include/stream_event.hpp | |
| parent | 7b60f5f864997e94895305f23ed2716ad7d9acaa (diff) | |
| download | tangara-fw-2cc0a38a1ac7fc54d7333dafa8b99479a7f5dc86.tar.gz | |
pipeline memory management fixes + logging
Diffstat (limited to 'src/audio/include/stream_event.hpp')
| -rw-r--r-- | src/audio/include/stream_event.hpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/audio/include/stream_event.hpp b/src/audio/include/stream_event.hpp index 4dfdab41..4f441fa5 100644 --- a/src/audio/include/stream_event.hpp +++ b/src/audio/include/stream_event.hpp @@ -11,13 +11,11 @@ namespace audio { struct StreamEvent { - static auto CreateStreamInfo(QueueHandle_t source, - std::unique_ptr<StreamInfo> payload) - -> std::unique_ptr<StreamEvent>; + static auto CreateStreamInfo(QueueHandle_t source, const StreamInfo& payload) + -> StreamEvent*; static auto CreateChunkData(QueueHandle_t source, std::size_t chunk_size) - -> std::unique_ptr<StreamEvent>; - static auto CreateChunkNotification(QueueHandle_t source) - -> std::unique_ptr<StreamEvent>; + -> StreamEvent*; + static auto CreateChunkNotification(QueueHandle_t source) -> StreamEvent*; StreamEvent(); ~StreamEvent(); @@ -33,16 +31,10 @@ struct StreamEvent { } tag; union { - std::unique_ptr<StreamInfo> stream_info; - - // Scott Meyers says: - // `About the only situation I can conceive of when a std::unique_ptr<T[]> - // would make sense would be when you’re using a C-like API that returns a - // raw pointer to a heap array that you assume ownership of.` - // :-) + StreamInfo* stream_info; struct { - std::unique_ptr<std::byte*> raw_bytes; + std::byte* raw_bytes; cpp::span<std::byte> bytes; } chunk_data; |
