livoxGen1: Implement StimBuff add/del from StimProducers
There seems to be a bug where two or more stimProducers or stimBuffs get initialized at once but we can deal with that tomorrow.
This commit is contained in:
@@ -100,6 +100,28 @@ void produceStimFrameAck(void)
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<StimulusBuffer>
|
||||
PcloudStimulusProducer::getOrCreateAttachedStimulusBuffer(
|
||||
const std::shared_ptr<device::DeviceAttachmentSpec>& deviceAttachmentSpec,
|
||||
int histbuffMs
|
||||
)
|
||||
{
|
||||
// Check if buffer already exists (idempotent)
|
||||
auto existingBuffer = getAttachedStimulusBuffer(deviceAttachmentSpec);
|
||||
if (existingBuffer)
|
||||
{ return existingBuffer; }
|
||||
|
||||
// Create new PcloudXyzStimulusBuffer (for now, always use XYZ type)
|
||||
auto buffer = std::make_shared<PcloudXyzStimulusBuffer>(
|
||||
*this, deviceAttachmentSpec, histbuffMs, openClInputConstraints);
|
||||
|
||||
// Add to collection
|
||||
attachedStimulusBuffers.push_back(buffer);
|
||||
// Update specialized member
|
||||
xyzStimulusBuffer = buffer;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void PcloudStimulusProducer::stimFrameProductionTimesliceInd()
|
||||
{
|
||||
produceFrameReq({nullptr, nullptr});
|
||||
|
||||
Reference in New Issue
Block a user