42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
#include <config.h>
|
|
#include <opts.h>
|
|
#include <algorithm>
|
|
#include <unistd.h>
|
|
#include <user/spMcRingBuffer.h>
|
|
#include <componentThread.h>
|
|
#include "pcloudStimulusBuffer.h"
|
|
|
|
namespace smo {
|
|
namespace stim_buff {
|
|
|
|
// OpenCL kernels are used to collate and produce our StimFrames.
|
|
static SpMcRingBuffer::InputEngineConstraints openClInputConstraints(
|
|
static_cast<size_t>(sysconf(_SC_PAGE_SIZE)), sizeof(void *));
|
|
|
|
PcloudStimulusBuffer::PcloudStimulusBuffer(
|
|
const device::DeviceAttachmentSpec& deviceAttachmentSpec,
|
|
std::shared_ptr<livoxProto1::Device> &device,
|
|
const PcloudFormatDesc& formatDesc,
|
|
int histbuffMs,
|
|
size_t nDgramsPerStagingBufferFrame)
|
|
: StimulusBuffer(
|
|
deviceAttachmentSpec,
|
|
static_cast<size_t>(histbuffMs / CONFIG_STIMBUFF_FRAME_PERIOD_MS),
|
|
openClInputConstraints,
|
|
device->componentThread->getIoService()),
|
|
deviceAttachmentSpec(deviceAttachmentSpec), device(device),
|
|
formatDesc(formatDesc), stagingBuffer(
|
|
StagingBuffer::InputEngineConstraints::ioUringConstraints,
|
|
OpenClConstraints(), nDgramsPerStagingBufferFrame)
|
|
{
|
|
}
|
|
|
|
void PcloudStimulusBuffer::stimFrameProductionTimesliceInd()
|
|
{
|
|
// Release the spinlock for now
|
|
frameAssemblyRateLimiter.release();
|
|
}
|
|
|
|
} // namespace stim_buff
|
|
} // namespace smo
|