Add SpMcRingBuffer to base class StimulusBuffer

This will hopefully genericise the interface for Stimbuffs.
This commit is contained in:
2025-11-01 00:06:42 -04:00
parent 5af7e531b6
commit cdade17905
4 changed files with 29 additions and 5 deletions
@@ -1,5 +1,8 @@
#include <config.h>
#include <opts.h>
#include <algorithm>
#include <unistd.h>
#include <user/spMcRingBuffer.h>
#include <componentThread.h>
#include "pcloudStimulusBuffer.h"
@@ -11,7 +14,12 @@ PcloudStimulusBuffer::PcloudStimulusBuffer(
std::shared_ptr<livoxProto1::Device> &device,
const PcloudFormatDesc& formatDesc,
size_t nDgramsPerStagingBufferFrame)
: StimulusBuffer(deviceAttachmentSpec, device->componentThread->getIoService()),
: StimulusBuffer(
deviceAttachmentSpec,
static_cast<size_t>((1000 * 30) / CONFIG_STIMBUFF_FRAME_PERIOD_MS),
SpMcRingBuffer::InputEngineConstraints(
static_cast<size_t>(sysconf(_SC_PAGE_SIZE)), 4),
device->componentThread->getIoService()),
deviceAttachmentSpec(deviceAttachmentSpec), device(device),
formatDesc(formatDesc), stagingBuffer(
StagingBuffer::InputEngineConstraints::ioUringConstraints,