You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.2 KiB
62 lines
1.2 KiB
4 months ago
|
/*
|
||
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2021-2023. All rights reserved.
|
||
|
* Description: Buffer manager
|
||
|
* Author: Hisilicon
|
||
|
* Created: 2021.04.16
|
||
|
*/
|
||
|
|
||
|
#ifndef IMAGEKIT_IMAGE_BUF_H
|
||
|
#define IMAGEKIT_IMAGE_BUF_H
|
||
|
|
||
|
#include <cstdint>
|
||
|
#include <memory>
|
||
|
#include <mutex>
|
||
|
#include <vector>
|
||
|
#include <set>
|
||
|
#include <list>
|
||
|
|
||
|
#include "ImageDefs.h"
|
||
|
|
||
|
namespace PhoenixImage {
|
||
|
class BufHolderImpl;
|
||
|
class BufSlotCore;
|
||
|
|
||
|
class BufHolder {
|
||
|
public:
|
||
|
/**
|
||
|
* @brief BufHolder constructor.
|
||
|
*/
|
||
|
BufHolder();
|
||
|
|
||
|
/**
|
||
|
* @brief BufHolder destructor.
|
||
|
*/
|
||
|
~BufHolder();
|
||
|
|
||
|
/**
|
||
|
* @brief PutBuf will send the colorBuf to proper slot.
|
||
|
*/
|
||
|
int32_t PutBuf(const ImageColorBuffer &colorBuf, int32_t fenceFd);
|
||
|
|
||
|
/**
|
||
|
* @brief GetBuf returns the next buffer slot index for produccer to use.
|
||
|
*/
|
||
|
int32_t GetBuf(ImageColorBuffer *colorBuf, int32_t *outFenceFd, uint64_t *outBufferAge);
|
||
|
|
||
|
/**
|
||
|
* @brief ClearFreedBuf will free out of use buffer.
|
||
|
*/
|
||
|
int32_t ClearFreedBuf();
|
||
|
|
||
|
/**
|
||
|
* @brief get bufSlotCore pointer.
|
||
|
*/
|
||
|
std::shared_ptr<BufSlotCore> &GetBufSlotCore();
|
||
|
|
||
|
private:
|
||
|
std::unique_ptr<BufHolderImpl> pImpl_;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
#endif
|