Changes Surface::detachNextBuffer to return an sp<GraphicBuffer>
instead of an ANativeWindowBuffer* to ensure that reference counting
works correctly.
Bug:
20092217
Change-Id: I3979ea6121aaf14845f0554477b778770413581e
virtual int unlockAndPost();
virtual int connect(int api, const sp<IProducerListener>& listener);
- virtual int detachNextBuffer(ANativeWindowBuffer** outBuffer,
+ virtual int detachNextBuffer(sp<GraphicBuffer>* outBuffer,
sp<Fence>* outFence);
virtual int attachBuffer(ANativeWindowBuffer*);
return err;
}
-int Surface::detachNextBuffer(ANativeWindowBuffer** outBuffer,
+int Surface::detachNextBuffer(sp<GraphicBuffer>* outBuffer,
sp<Fence>* outFence) {
ATRACE_CALL();
ALOGV("Surface::detachNextBuffer");
return result;
}
- *outBuffer = buffer.get();
+ *outBuffer = buffer;
if (fence != NULL && fence->isValid()) {
*outFence = fence;
} else {