File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,26 @@ status_t ConsumerBase::detachBuffer(const sp<GraphicBuffer>& buffer) {
385385}
386386#endif // COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_PLATFORM_API_IMPROVEMENTS)
387387
388+ status_t ConsumerBase::addReleaseFence (const sp<GraphicBuffer> buffer, const sp<Fence>& fence) {
389+ CB_LOGV (" addReleaseFence" );
390+ Mutex::Autolock lock (mMutex );
391+
392+ if (mAbandoned ) {
393+ CB_LOGE (" addReleaseFence: ConsumerBase is abandoned!" );
394+ return NO_INIT;
395+ }
396+ if (buffer == nullptr ) {
397+ return BAD_VALUE;
398+ }
399+
400+ int slotIndex = getSlotForBufferLocked (buffer);
401+ if (slotIndex == BufferQueue::INVALID_BUFFER_SLOT) {
402+ return BAD_VALUE;
403+ }
404+
405+ return addReleaseFenceLocked (slotIndex, buffer, fence);
406+ }
407+
388408status_t ConsumerBase::setDefaultBufferSize (uint32_t width, uint32_t height) {
389409 Mutex::Autolock _l (mMutex );
390410 if (mAbandoned ) {
Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ class ConsumerBase : public virtual RefBase,
9898 status_t detachBuffer (const sp<GraphicBuffer>& buffer);
9999#endif // COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_PLATFORM_API_IMPROVEMENTS)
100100
101+ status_t addReleaseFence (const sp<GraphicBuffer> buffer, const sp<Fence>& fence);
102+
101103 // See IGraphicBufferConsumer::setDefaultBufferSize
102104 status_t setDefaultBufferSize (uint32_t width, uint32_t height);
103105
You can’t perform that action at this time.
0 commit comments