Loading libs/gui/BLASTBufferQueue.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -1096,6 +1096,17 @@ public: AsyncWorker::getInstance().post( [listener = mListener, slots = slots]() { listener->onBuffersDiscarded(slots); }); } void onBufferDetached(int slot) override { AsyncWorker::getInstance().post( [listener = mListener, slot = slot]() { listener->onBufferDetached(slot); }); } #if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_CONSUMER_ATTACH_CALLBACK) void onBufferAttached() override { AsyncWorker::getInstance().post([listener = mListener]() { listener->onBufferAttached(); }); } #endif }; // Extends the BufferQueueProducer to create a wrapper around the listener so the listener calls Loading libs/gui/IProducerListener.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -184,4 +184,10 @@ bool BnProducerListener::needsReleaseNotify() { void BnProducerListener::onBuffersDiscarded(const std::vector<int32_t>& /*discardedSlots*/) { } #if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_CONSUMER_ATTACH_CALLBACK) bool BnProducerListener::needsAttachNotify() { return true; } #endif } // namespace android libs/gui/include/gui/IProducerListener.h +6 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,9 @@ public: Parcel* reply, uint32_t flags = 0); virtual bool needsReleaseNotify(); virtual void onBuffersDiscarded(const std::vector<int32_t>& slots); #if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_CONSUMER_ATTACH_CALLBACK) virtual bool needsAttachNotify(); #endif }; #else Loading @@ -103,6 +106,9 @@ public: virtual ~StubProducerListener(); virtual void onBufferReleased() {} virtual bool needsReleaseNotify() { return false; } #if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_CONSUMER_ATTACH_CALLBACK) virtual bool needsAttachNotify() { return false; } #endif }; } // namespace android Loading Loading
libs/gui/BLASTBufferQueue.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -1096,6 +1096,17 @@ public: AsyncWorker::getInstance().post( [listener = mListener, slots = slots]() { listener->onBuffersDiscarded(slots); }); } void onBufferDetached(int slot) override { AsyncWorker::getInstance().post( [listener = mListener, slot = slot]() { listener->onBufferDetached(slot); }); } #if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_CONSUMER_ATTACH_CALLBACK) void onBufferAttached() override { AsyncWorker::getInstance().post([listener = mListener]() { listener->onBufferAttached(); }); } #endif }; // Extends the BufferQueueProducer to create a wrapper around the listener so the listener calls Loading
libs/gui/IProducerListener.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -184,4 +184,10 @@ bool BnProducerListener::needsReleaseNotify() { void BnProducerListener::onBuffersDiscarded(const std::vector<int32_t>& /*discardedSlots*/) { } #if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_CONSUMER_ATTACH_CALLBACK) bool BnProducerListener::needsAttachNotify() { return true; } #endif } // namespace android
libs/gui/include/gui/IProducerListener.h +6 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,9 @@ public: Parcel* reply, uint32_t flags = 0); virtual bool needsReleaseNotify(); virtual void onBuffersDiscarded(const std::vector<int32_t>& slots); #if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_CONSUMER_ATTACH_CALLBACK) virtual bool needsAttachNotify(); #endif }; #else Loading @@ -103,6 +106,9 @@ public: virtual ~StubProducerListener(); virtual void onBufferReleased() {} virtual bool needsReleaseNotify() { return false; } #if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_CONSUMER_ATTACH_CALLBACK) virtual bool needsAttachNotify() { return false; } #endif }; } // namespace android Loading