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

Commit f19f85ed authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add missing IProducerListener callbacks to BLASTBufferQueue" into main am: 1050b6ce

parents efccb35e 1050b6ce
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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
+6 −0
Original line number Diff line number Diff line
@@ -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
+6 −0
Original line number Diff line number Diff line
@@ -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
@@ -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