window buffer share

Signed-off-by: huyanchao@huawei.com <huyanchao@huawei.com>
This commit is contained in:
huyanchao@huawei.com 2024-03-15 10:41:15 +08:00
parent 0b3faab181
commit 45a01bce97
2 changed files with 30 additions and 0 deletions

View File

@ -33,6 +33,7 @@ public:
GSError QueueBuffer(int32_t slot, int32_t acquireFence);
GSError ReleaseBuffer(const sptr<SurfaceBuffer> &buffer, const sptr<SyncFence> &fence);
GSError ClearBufferSlot(int32_t slot);
GSError ClearAllBuffers();
GSError CancelBuffer(int32_t slot, int32_t fenceFd);
GSError DetachBuffer(int32_t slot);
int OnDequeueBuffer(MessageParcel &data, MessageParcel &reply);
@ -43,6 +44,10 @@ private:
std::vector<sptr<SurfaceBuffer>> pendingReleaseBuffer_;
std::mutex mapMutex_;
std::mutex mstate_;
void AddBufferLocked(const sptr<SurfaceBuffer>& buffer, int32_t slot);
sptr<SurfaceBuffer> GetBufferLocked(int32_t slot);
int32_t GetSlotLocked(const sptr<SurfaceBuffer>& buffer);
};
} // namespace OHOS
#endif // PRODUCER_SURFACE_DELEGATOR_H

View File

@ -39,6 +39,31 @@ GSError ProducerSurfaceDelegator::ClearBufferSlot(int32_t slot)
return GSERROR_OK;
}
GSError ClearBufferSlot(int32_t slot)
{
(void)slot;
return GSERROR_OK;
}
void AddBufferLocked(const sptr<SurfaceBuffer>& buffer, int32_t slot)
{
(void)buffer;
(void)slot;
return;
}
sptr<SurfaceBuffer> GetBufferLocked(int32_t slot)
{
(void)slot;
return nullptr;
}
int32_t GetSlotLocked(const sptr<SurfaceBuffer>& buffer)
{
(void)buffer;
return 0;
}
GSError ProducerSurfaceDelegator::CancelBuffer(int32_t slot, int32_t fenceFd)
{
return GSERROR_OK;