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

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

Merge "Add missing IProducerListener callbacks to BLASTBufferQueue" into main...

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

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3269729



Change-Id: I35995cb23d3c094ef157b17d256a38cd316a46f8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ed11598d f19f85ed
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1135,6 +1135,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