From e478305181bb8dc8706361bc702256fe73f958de Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 14 May 2015 15:55:11 -0700 Subject: [PATCH] Add ConsumerBase::isAbandoned Bug: 20105644 Change-Id: I21526b5397ea51a15500c44a99daa9d75fc4ea67 --- include/gui/ConsumerBase.h | 3 +++ libs/gui/ConsumerBase.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/gui/ConsumerBase.h b/include/gui/ConsumerBase.h index f46bf014f..46c603d91 100644 --- a/include/gui/ConsumerBase.h +++ b/include/gui/ConsumerBase.h @@ -56,6 +56,9 @@ public: // or by OpenGL ES as a texture) then those buffer will remain allocated. void abandon(); + // Returns true if the ConsumerBase is in the 'abandoned' state + bool isAbandoned(); + // set the name of the ConsumerBase that will be used to identify it in // log messages. void setName(const String8& name); diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp index 072ab44bc..0e42daf61 100644 --- a/libs/gui/ConsumerBase.cpp +++ b/libs/gui/ConsumerBase.cpp @@ -171,6 +171,11 @@ void ConsumerBase::abandonLocked() { mConsumer.clear(); } +bool ConsumerBase::isAbandoned() { + Mutex::Autolock _l(mMutex); + return mAbandoned; +} + void ConsumerBase::setFrameAvailableListener( const wp& listener) { CB_LOGV("setFrameAvailableListener");