/* * 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 #include #include #include #include #include #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 &GetBufSlotCore(); private: std::unique_ptr pImpl_; }; } #endif