Merge "Refactored DummyConsumer"

This commit is contained in:
Jamie Gennis 2012-03-29 13:57:10 -07:00 committed by Android (Google) Code Review
commit 9285a16450
2 changed files with 5 additions and 17 deletions

View File

@ -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> bufferQueue);
DummyConsumer();
virtual ~DummyConsumer();
protected:
// Implementation of the BufferQueue::ConsumerListener interface. These

View File

@ -24,17 +24,8 @@
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() {