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

Commit 28dbde32 authored by Dan Stoza's avatar Dan Stoza Committed by Zhijun He
Browse files

Surface: Permit an IProducerListener on connect

This change allows clients of Surface to provide an IProducerListener
callback object to Surface::connect, which will be passed down to the
underlying IGraphicBufferProducer

Change-Id: I5ea5229bf3a329bf02c6bd20e7247039c75d136b
parent bd6f5b27
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ protected:

    virtual int lockBuffer_DEPRECATED(ANativeWindowBuffer* buffer);

    virtual int connect(int api, const sp<IProducerListener>& listener);
    virtual int connect(int api);
    virtual int disconnect(int api);
    virtual int setBufferCount(int bufferCount);
+5 −1
Original line number Diff line number Diff line
@@ -546,9 +546,13 @@ int Surface::dispatchSetSidebandStream(va_list args) {
}

int Surface::connect(int api) {
    static sp<IProducerListener> listener = new DummyProducerListener();
    return connect(api, listener);
}

int Surface::connect(int api, const sp<IProducerListener>& listener) {
    ATRACE_CALL();
    ALOGV("Surface::connect");
    static sp<IProducerListener> listener = new DummyProducerListener();
    Mutex::Autolock lock(mMutex);
    IGraphicBufferProducer::QueueBufferOutput output;
    int err = mGraphicBufferProducer->connect(listener, api, mProducerControlledByApp, &output);