summaryrefslogtreecommitdiffstats
path: root/libs/gui/ConsumerBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/ConsumerBase.cpp')
-rw-r--r--libs/gui/ConsumerBase.cpp40
1 files changed, 38 insertions, 2 deletions
diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp
index e576018..04ab06b 100644
--- a/libs/gui/ConsumerBase.cpp
+++ b/libs/gui/ConsumerBase.cpp
@@ -114,6 +114,21 @@ void ConsumerBase::onFrameAvailable(const BufferItem& item) {
}
}
+void ConsumerBase::onFrameReplaced(const BufferItem &item) {
+ CB_LOGV("onFrameReplaced");
+
+ sp<FrameAvailableListener> listener;
+ {
+ Mutex::Autolock lock(mMutex);
+ listener = mFrameAvailableListener.promote();
+ }
+
+ if (listener != NULL) {
+ CB_LOGV("actually calling onFrameReplaced");
+ listener->onFrameReplaced(item);
+ }
+}
+
void ConsumerBase::onBuffersReleased() {
Mutex::Autolock lock(mMutex);
@@ -156,6 +171,11 @@ void ConsumerBase::abandonLocked() {
mConsumer.clear();
}
+bool ConsumerBase::isAbandoned() {
+ Mutex::Autolock _l(mMutex);
+ return mAbandoned;
+}
+
void ConsumerBase::setFrameAvailableListener(
const wp<FrameAvailableListener>& listener) {
CB_LOGV("setFrameAvailableListener");
@@ -178,6 +198,22 @@ status_t ConsumerBase::detachBuffer(int slot) {
return result;
}
+status_t ConsumerBase::setDefaultBufferSize(uint32_t width, uint32_t height) {
+ Mutex::Autolock _l(mMutex);
+ return mConsumer->setDefaultBufferSize(width, height);
+}
+
+status_t ConsumerBase::setDefaultBufferFormat(PixelFormat defaultFormat) {
+ Mutex::Autolock _l(mMutex);
+ return mConsumer->setDefaultBufferFormat(defaultFormat);
+}
+
+status_t ConsumerBase::setDefaultBufferDataSpace(
+ android_dataspace defaultDataSpace) {
+ Mutex::Autolock _l(mMutex);
+ return mConsumer->setDefaultBufferDataSpace(defaultDataSpace);
+}
+
void ConsumerBase::dump(String8& result) const {
dump(result, "");
}
@@ -196,8 +232,8 @@ void ConsumerBase::dumpLocked(String8& result, const char* prefix) const {
}
status_t ConsumerBase::acquireBufferLocked(BufferItem *item,
- nsecs_t presentWhen) {
- status_t err = mConsumer->acquireBuffer(item, presentWhen);
+ nsecs_t presentWhen, uint64_t maxFrameNumber) {
+ status_t err = mConsumer->acquireBuffer(item, presentWhen, maxFrameNumber);
if (err != NO_ERROR) {
return err;
}