summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2015-05-13 17:15:45 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-05-13 17:15:45 +0000
commit119a03c5a2faee9c40efd53c7d198d9173aba493 (patch)
tree2ecb67f04eab279198bbde5595289330646f63e4 /include
parentc53bc80b624e63f0c65fa3137465c984c8cc8e5f (diff)
parent09d561dbee9a28db9632ff3d51f633c18aefe023 (diff)
downloadframeworks_native-119a03c5a2faee9c40efd53c7d198d9173aba493.zip
frameworks_native-119a03c5a2faee9c40efd53c7d198d9173aba493.tar.gz
frameworks_native-119a03c5a2faee9c40efd53c7d198d9173aba493.tar.bz2
am 09d561db: Merge "Fix PTS handling for buffer replacement" into mnc-dev
* commit '09d561dbee9a28db9632ff3d51f633c18aefe023': Fix PTS handling for buffer replacement
Diffstat (limited to 'include')
-rw-r--r--include/gui/BufferQueueConsumer.h5
-rw-r--r--include/gui/BufferQueueCore.h6
-rw-r--r--include/gui/ConsumerBase.h3
-rw-r--r--include/gui/GLConsumer.h3
-rw-r--r--include/gui/IGraphicBufferConsumer.h14
5 files changed, 13 insertions, 18 deletions
diff --git a/include/gui/BufferQueueConsumer.h b/include/gui/BufferQueueConsumer.h
index 0f42613..cde302f 100644
--- a/include/gui/BufferQueueConsumer.h
+++ b/include/gui/BufferQueueConsumer.h
@@ -47,7 +47,7 @@ public:
// returned. The presentation time is in nanoseconds, and the time base
// is CLOCK_MONOTONIC.
virtual status_t acquireBuffer(BufferItem* outBuffer,
- nsecs_t expectedPresent);
+ nsecs_t expectedPresent, uint64_t maxFrameNumber = 0) override;
// See IGraphicBufferConsumer::detachBuffer
virtual status_t detachBuffer(int slot);
@@ -148,9 +148,6 @@ public:
// Retrieve the sideband buffer stream, if any.
virtual sp<NativeHandle> getSidebandStream() const;
- // See IGraphicBufferConsumer::setShadowQueueSize
- virtual void setShadowQueueSize(size_t size);
-
// dump our state in a String
virtual void dump(String8& result, const char* prefix) const;
diff --git a/include/gui/BufferQueueCore.h b/include/gui/BufferQueueCore.h
index a22015c..d7686ec 100644
--- a/include/gui/BufferQueueCore.h
+++ b/include/gui/BufferQueueCore.h
@@ -275,12 +275,6 @@ private:
// buffer as the number of frames that have elapsed since it was last queued
uint64_t mBufferAge;
- // mConsumerHasShadowQueue determines if acquireBuffer should be more
- // cautious about dropping buffers so that it always returns a buffer that
- // is represented in the consumer's shadow queue.
- bool mConsumerHasShadowQueue;
- size_t mConsumerShadowQueueSize;
-
}; // class BufferQueueCore
} // namespace android
diff --git a/include/gui/ConsumerBase.h b/include/gui/ConsumerBase.h
index 5be3ffb..f46bf01 100644
--- a/include/gui/ConsumerBase.h
+++ b/include/gui/ConsumerBase.h
@@ -152,7 +152,8 @@ protected:
// initialization that must take place the first time a buffer is assigned
// to a slot. If it is overridden the derived class's implementation must
// call ConsumerBase::acquireBufferLocked.
- virtual status_t acquireBufferLocked(BufferItem *item, nsecs_t presentWhen);
+ virtual status_t acquireBufferLocked(BufferItem *item, nsecs_t presentWhen,
+ uint64_t maxFrameNumber = 0);
// releaseBufferLocked relinquishes control over a buffer, returning that
// control to the BufferQueue.
diff --git a/include/gui/GLConsumer.h b/include/gui/GLConsumer.h
index 4912580..c35c7be 100644
--- a/include/gui/GLConsumer.h
+++ b/include/gui/GLConsumer.h
@@ -241,7 +241,8 @@ protected:
// acquireBufferLocked overrides the ConsumerBase method to update the
// mEglSlots array in addition to the ConsumerBase behavior.
- virtual status_t acquireBufferLocked(BufferItem *item, nsecs_t presentWhen);
+ virtual status_t acquireBufferLocked(BufferItem *item, nsecs_t presentWhen,
+ uint64_t maxFrameNumber = 0) override;
// releaseBufferLocked overrides the ConsumerBase method to update the
// mEglSlots array in addition to the ConsumerBase.
diff --git a/include/gui/IGraphicBufferConsumer.h b/include/gui/IGraphicBufferConsumer.h
index 0be09a2..6363a3a 100644
--- a/include/gui/IGraphicBufferConsumer.h
+++ b/include/gui/IGraphicBufferConsumer.h
@@ -69,6 +69,12 @@ public:
// returned. The presentation time is in nanoseconds, and the time base
// is CLOCK_MONOTONIC.
//
+ // If maxFrameNumber is non-zero, it indicates that acquireBuffer should
+ // only return a buffer with a frame number less than or equal to
+ // maxFrameNumber. If no such frame is available (such as when a buffer has
+ // been replaced but the consumer has not received the onFrameReplaced
+ // callback), then PRESENT_LATER will be returned.
+ //
// Return of NO_ERROR means the operation completed as normal.
//
// Return of a positive value means the operation could not be completed
@@ -78,7 +84,8 @@ public:
//
// Return of a negative value means an error has occurred:
// * INVALID_OPERATION - too many buffers have been acquired
- virtual status_t acquireBuffer(BufferItem* buffer, nsecs_t presentWhen) = 0;
+ virtual status_t acquireBuffer(BufferItem* buffer, nsecs_t presentWhen,
+ uint64_t maxFrameNumber = 0) = 0;
// detachBuffer attempts to remove all ownership of the buffer in the given
// slot from the buffer queue. If this call succeeds, the slot will be
@@ -248,11 +255,6 @@ public:
// Retrieve the sideband buffer stream, if any.
virtual sp<NativeHandle> getSidebandStream() const = 0;
- // setShadowQueueSize notifies the BufferQueue that the consumer is
- // shadowing its queue and allows it to limit the number of buffers it is
- // permitted to drop during acquire so as to not get out of sync.
- virtual void setShadowQueueSize(size_t size) = 0;
-
// dump state into a string
virtual void dump(String8& result, const char* prefix) const = 0;