Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 728dba1f authored by Vishnu Nair's avatar Vishnu Nair
Browse files

BBQ: Remove BufferFreedListener

If BBQ is destroyed without calling abandon, its BufferItemConsumer
will call onBufferFreed. Since BBQ registers itself as the
BufferFreedListener we end up trying to promote and destroy the
BBQ again. The BufferFreedListener is not used so as a simple fix,
we remove the listener.

Test: presubmit
Bug: 200246498
Change-Id: I7b2be265b3c09d691cc0c41b80c73067f9a8b84d
parent 715b4413
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -159,7 +159,6 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, bool updateDestinati
    id++;
    mBufferItemConsumer->setName(String8(consumerName.c_str()));
    mBufferItemConsumer->setFrameAvailableListener(this);
    mBufferItemConsumer->setBufferFreedListener(this);

    ComposerServiceAIDL::getComposerService()->getMaxAcquiredBufferCount(&mMaxAcquiredBuffers);
    mBufferItemConsumer->setMaxAcquiredBufferCount(mMaxAcquiredBuffers);
@@ -1114,7 +1113,6 @@ void BLASTBufferQueue::abandon() {
    if (mBufferItemConsumer != nullptr) {
        mBufferItemConsumer->abandon();
        mBufferItemConsumer->setFrameAvailableListener(nullptr);
        mBufferItemConsumer->setBufferFreedListener(nullptr);
    }
    mBufferItemConsumer = nullptr;
    mConsumer = nullptr;
+1 −4
Original line number Diff line number Diff line
@@ -69,9 +69,7 @@ private:
    bool mPreviouslyConnected GUARDED_BY(mMutex);
};

class BLASTBufferQueue
    : public ConsumerBase::FrameAvailableListener, public BufferItemConsumer::BufferFreedListener
{
class BLASTBufferQueue : public ConsumerBase::FrameAvailableListener {
public:
    BLASTBufferQueue(const std::string& name, bool updateDestinationFrame = true);
    BLASTBufferQueue(const std::string& name, const sp<SurfaceControl>& surface, int width,
@@ -83,7 +81,6 @@ public:
    sp<Surface> getSurface(bool includeSurfaceControlHandle);
    bool isSameSurfaceControl(const sp<SurfaceControl>& surfaceControl) const;

    void onBufferFreed(const wp<GraphicBuffer>&/* graphicBuffer*/) override { /* TODO */ }
    void onFrameReplaced(const BufferItem& item) override;
    void onFrameAvailable(const BufferItem& item) override;
    void onFrameDequeued(const uint64_t) override;