summaryrefslogtreecommitdiff
path: root/commons.h
diff options
context:
space:
mode:
Diffstat (limited to 'commons.h')
-rw-r--r--commons.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/commons.h b/commons.h
index 30ddafe1..e4cdf7f4 100644
--- a/commons.h
+++ b/commons.h
@@ -6,10 +6,10 @@
#define RX_SAMPLE_RATE 12000
#include "DecoderIpcProtocol.h"
+#include "lib/decoder_ipc_layout.h"
#ifdef __cplusplus
#include <cstddef>
-#include <QString>
#else
#include <stdbool.h>
#endif
@@ -114,7 +114,9 @@ typedef struct dec_data {
typedef struct shared_dec_data {
decoder_ipc_control_t control;
+ decoder_ipc_layout_t layout;
dec_data_t payload;
+ decoder_input_metadata_t metadata;
} shared_dec_data_t;
#ifdef __cplusplus
@@ -123,10 +125,18 @@ static_assert (sizeof (decoder_ipc_control_t) == 16,
"decoder IPC control header must remain 16 bytes");
static_assert (offsetof (decoder_ipc_control_t, state) == 4,
"decoder IPC state must remain at the legacy shutdown offset");
-static_assert (offsetof (shared_dec_data_t, payload) == 16,
- "decoder payload must immediately follow the control header");
+static_assert (offsetof (shared_dec_data_t, layout) == sizeof (decoder_ipc_control_t),
+ "decoder layout descriptor must immediately follow the control header");
+static_assert (offsetof (shared_dec_data_t, payload) ==
+ sizeof (decoder_ipc_control_t) + sizeof (decoder_ipc_layout_t),
+ "decoder payload must immediately follow the layout descriptor");
+static_assert (sizeof (decoder_input_metadata_t) == 24,
+ "decoder input metadata layout must remain stable");
+static_assert (offsetof (shared_dec_data_t, metadata) >=
+ offsetof (shared_dec_data_t, payload) + sizeof (dec_data_t),
+ "decoder input metadata must follow the payload");
static_assert (sizeof (shared_dec_data_t) ==
- sizeof (decoder_ipc_control_t) + sizeof (dec_data_t),
+ offsetof (shared_dec_data_t, metadata) + sizeof (decoder_input_metadata_t),
"decoder shared-memory layout must not contain trailing padding");
#endif