StimBuff: Add skeleton common impl with rate limiting
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
#ifndef _LIVOX_GEN1_PCLOUD_STIMULUS_BUFFER_H
|
||||
#define _LIVOX_GEN1_PCLOUD_STIMULUS_BUFFER_H
|
||||
|
||||
#include <config.h>
|
||||
#include <atomic>
|
||||
#include <boost/asio/deadline_timer.hpp>
|
||||
#include <spinLock.h>
|
||||
#include <user/stimulusBuffer.h>
|
||||
#include <user/stimFrame.h>
|
||||
#include <livoxProto1/device.h>
|
||||
@@ -40,25 +36,12 @@ public:
|
||||
PcloudStimulusBuffer(PcloudStimulusBuffer&&) = default;
|
||||
PcloudStimulusBuffer& operator=(PcloudStimulusBuffer&&) = default;
|
||||
|
||||
// Control methods
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
public:
|
||||
device::DeviceAttachmentSpec deviceAttachmentSpec;
|
||||
std::shared_ptr<livoxProto1::Device> device;
|
||||
PcloudFormatDesc formatDesc;
|
||||
StagingBuffer stagingBuffer;
|
||||
IoUringAssemblyEngine ioUringAssemblyEngine;
|
||||
|
||||
private:
|
||||
std::atomic<bool> shouldContinue;
|
||||
boost::asio::deadline_timer timer;
|
||||
SpinLock frameAssemblyRateLimiter;
|
||||
|
||||
private:
|
||||
void scheduleNextTimeout(int delayMs = CONFIG_STIMBUFF_FRAME_PERIOD_MS);
|
||||
void onTimeout(const boost::system::error_code& error);
|
||||
};
|
||||
|
||||
} // namespace stim_buff
|
||||
|
||||
Reference in New Issue
Block a user