Merge "Surface: Permit an IProducerListener on connect"

This commit is contained in:
Dan Stoza 2015-03-06 20:50:08 +00:00 committed by Android (Google) Code Review
commit d8bf6e0baf
2 changed files with 6 additions and 1 deletions

View File

@ -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);

View File

@ -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);