#ifndef _PL_QUEUE_H_
|
#define _PL_QUEUE_H_
|
|
#include "PipeLine.h"
|
#include "MaterialBuffer.h"
|
|
typedef bool (*plq_cache_pm_func_t)(const PipeMaterial& inPm, PipeMaterial& outPm, std::vector<MB_Frame>& outMbf, uint8_t* cacheData, size_t& cacheMaxSize);
|
|
struct PL_Queue_Config
|
{
|
size_t maxBlockCount;
|
size_t maxBlockSize;
|
bool cacheEmptyBlock;//#todo not implement
|
|
bool syncQueueFull;
|
bool syncQueueEmpty;
|
bool queueFullDropFrontBlock;
|
bool copyData; //#todo not implement (copy ptr)
|
bool dropBlockOnlyNextPayOK;
|
|
plq_cache_pm_func_t cacheFrameListFunc;
|
|
PL_Queue_Config() :
|
maxBlockCount(32), maxBlockSize(1920*1080*2), cacheEmptyBlock(false),
|
syncQueueFull(true), syncQueueEmpty(true), queueFullDropFrontBlock(false), copyData(true), dropBlockOnlyNextPayOK(true),
|
cacheFrameListFunc(nullptr)
|
{
|
}
|
};
|
|
class PL_Queue : public PipeLineElem
|
{
|
public:
|
PL_Queue();
|
virtual ~PL_Queue();
|
|
virtual bool init(void* args);
|
virtual void finit();
|
|
virtual bool pay(const PipeMaterial& pm);
|
virtual bool gain(PipeMaterial& pm);
|
|
private:
|
static void pm_deleter_qb(PipeMaterial* pm, bool lastRet);
|
|
void* internal;
|
};
|
|
PipeLineElem* create_PL_Queue();
|
|
#endif
|