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. Cherry pick of I5ea5229bf3a329bf02c6bd20e7247039c75d136b Change-Id: I6f8f52c72654e4cee649721383819bafe378f964
This commit is contained in:
parent
2632350ac8
commit
966b98bd86
@ -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);
|
||||
|
@ -547,9 +547,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);
|
||||
|
Loading…
Reference in New Issue
Block a user