From 9d61a28d72d85ac0460fb7fba9f85f8a955354c7 Mon Sep 17 00:00:00 2001 From: Daniel Lam Date: Mon, 26 Mar 2012 20:37:15 -0700 Subject: [PATCH] Refactored DummyConsumer DummyConsumer no longer uses a ProxyConsumerListener Change-Id: I0a99428b3f9dae82cb47d5da3589de77653f3d7c --- include/gui/DummyConsumer.h | 9 +++------ libs/gui/DummyConsumer.cpp | 13 ++----------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/include/gui/DummyConsumer.h b/include/gui/DummyConsumer.h index 6fc8da77e..7fe4d40bd 100644 --- a/include/gui/DummyConsumer.h +++ b/include/gui/DummyConsumer.h @@ -25,14 +25,11 @@ namespace android { // The DummyConsumer does not keep a reference to BufferQueue // unlike SurfaceTexture. This prevents a circular reference from -// forming. The BufferQueue indirectly keeps a DummyConsumer alive -// through the proxy ConsumerListener. -class DummyConsumer : public virtual RefBase, - protected BufferQueue::ConsumerListener { +// forming without having to use a ProxyConsumerListener +class DummyConsumer : public BufferQueue::ConsumerListener { public: - DummyConsumer(sp bufferQueue); + DummyConsumer(); virtual ~DummyConsumer(); - protected: // Implementation of the BufferQueue::ConsumerListener interface. These diff --git a/libs/gui/DummyConsumer.cpp b/libs/gui/DummyConsumer.cpp index e42aa05b9..be47e0edf 100644 --- a/libs/gui/DummyConsumer.cpp +++ b/libs/gui/DummyConsumer.cpp @@ -24,17 +24,8 @@ namespace android { -DummyConsumer::DummyConsumer(sp bufferQueue) { - wp listener; - sp proxy; - listener = static_cast(this); - proxy = new BufferQueue::ProxyConsumerListener(listener); - - status_t err = bufferQueue->consumerConnect(proxy); - if (err != NO_ERROR) { - ALOGE("DummyConsumer: error connecting to BufferQueue: %s (%d)", - strerror(-err), err); - } +DummyConsumer::DummyConsumer() { + ALOGV("DummyConsumer"); } DummyConsumer::~DummyConsumer() {