summaryrefslogtreecommitdiff
path: root/src/audio/include/audio_element.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2022-12-02 13:39:00 +1100
committerjacqueline <me@jacqueline.id.au>2022-12-02 13:39:00 +1100
commit222c810b07ffc635fc7908d121e97e4d65ccc5c8 (patch)
tree91c7b5c72a11770ebf3695bf0c234597b2bc419d /src/audio/include/audio_element.hpp
parent71a4f5166f5491dc0982a18d62c63e28b3a52faa (diff)
downloadtangara-fw-222c810b07ffc635fc7908d121e97e4d65ccc5c8.tar.gz
fix build errors
Diffstat (limited to 'src/audio/include/audio_element.hpp')
-rw-r--r--src/audio/include/audio_element.hpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/audio/include/audio_element.hpp b/src/audio/include/audio_element.hpp
index 2a2f0727..13a48590 100644
--- a/src/audio/include/audio_element.hpp
+++ b/src/audio/include/audio_element.hpp
@@ -1,13 +1,28 @@
#pragma once
#include <stdint.h>
+
#include <cstdint>
+
+#include "freertos/FreeRTOS.h"
+
+#include "freertos/message_buffer.h"
#include "freertos/portmacro.h"
#include "result.hpp"
+
+#include "stream_info.hpp"
#include "types.hpp"
namespace audio {
+/* Errors that may be returned by any of the Process* methods. */
+enum StreamError {
+ // Indicates that this element is unable to handle the upcoming chunks.
+ UNSUPPORTED_STREAM,
+ // Indicates an error with reading or writing stream data.
+ IO_ERROR,
+};
+
/*
* One indepedentent part of an audio pipeline. Each element has an input and
* output message stream, and is responsible for taking data from the input
@@ -46,14 +61,6 @@ class IAudioElement {
/* Returns this element's output buffer. */
auto OutputBuffer() -> MessageBufferHandle_t* { return output_buffer_; }
- /* Errors that may be returned by any of the Process* methods. */
- enum StreamError {
- // Indicates that this element is unable to handle the upcoming chunks.
- UNSUPPORTED_STREAM,
- // Indicates an error with reading or writing stream data.
- IO_ERROR,
- };
-
/*
* Called when a StreamInfo message is received. Used to configure this
* element in preperation for incoming chunks.
@@ -78,8 +85,8 @@ class IAudioElement {
virtual auto ProcessIdle() -> cpp::result<void, StreamError> = 0;
protected:
- StreamBufferHandle_t* input_buffer_;
- StreamBufferHandle_t* output_buffer_;
+ MessageBufferHandle_t* input_buffer_;
+ MessageBufferHandle_t* output_buffer_;
};
} // namespace audio