Merge "Refactored DummyConsumer"
This commit is contained in:
commit
9285a16450
@ -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
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user