// 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> bufferQueue);
+ DummyConsumer();
virtual ~DummyConsumer();
-
protected:
// Implementation of the BufferQueue::ConsumerListener interface. These
namespace android {
-DummyConsumer::DummyConsumer(sp<BufferQueue> bufferQueue) {
- wp<BufferQueue::ConsumerListener> listener;
- sp<BufferQueue::ConsumerListener> proxy;
- listener = static_cast<BufferQueue::ConsumerListener*>(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() {