summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2015-05-11 15:33:01 -0700
committerDan Stoza <stoza@google.com>2015-05-12 09:35:29 -0700
commita3b66932727503943b1c59e1846af60e0d95afa6 (patch)
treea18e916de08b9640321a93a2ca8f1c8843f87a5c /include
parent364ed9545382539ab9875555947bc18ec94bb82b (diff)
downloadframeworks_native-a3b66932727503943b1c59e1846af60e0d95afa6.zip
frameworks_native-a3b66932727503943b1c59e1846af60e0d95afa6.tar.gz
frameworks_native-a3b66932727503943b1c59e1846af60e0d95afa6.tar.bz2
libgui: Hook up onFrameReplaced
This completes the plumbing from ConsumerListener::onFrameReplaced into SurfaceFlinger (and other consumers that may care). Change-Id: I376e78ace95d6748e8662e6b4d47c0dfa697a300 (cherry picked from commit dc13c5b85b099050c73297a19f1ef89308f7620b)
Diffstat (limited to 'include')
-rw-r--r--include/gui/BufferQueue.h7
-rw-r--r--include/gui/ConsumerBase.h28
2 files changed, 16 insertions, 19 deletions
diff --git a/include/gui/BufferQueue.h b/include/gui/BufferQueue.h
index 721b218..09300a2 100644
--- a/include/gui/BufferQueue.h
+++ b/include/gui/BufferQueue.h
@@ -62,9 +62,10 @@ public:
public:
ProxyConsumerListener(const wp<ConsumerListener>& consumerListener);
virtual ~ProxyConsumerListener();
- virtual void onFrameAvailable(const BufferItem& item);
- virtual void onBuffersReleased();
- virtual void onSidebandStreamChanged();
+ virtual void onFrameAvailable(const BufferItem& item) override;
+ virtual void onFrameReplaced(const BufferItem& item) override;
+ virtual void onBuffersReleased() override;
+ virtual void onSidebandStreamChanged() override;
private:
// mConsumerListener is a weak reference to the IConsumerListener. This is
// the raison d'etre of ProxyConsumerListener.
diff --git a/include/gui/ConsumerBase.h b/include/gui/ConsumerBase.h
index d56fa89..5be3ffb 100644
--- a/include/gui/ConsumerBase.h
+++ b/include/gui/ConsumerBase.h
@@ -38,15 +38,9 @@ class ConsumerBase : public virtual RefBase,
protected ConsumerListener {
public:
struct FrameAvailableListener : public virtual RefBase {
- // onFrameAvailable() is called each time an additional frame becomes
- // available for consumption. This means that frames that are queued
- // while in asynchronous mode only trigger the callback if no previous
- // frames are pending. Frames queued while in synchronous mode always
- // trigger the callback.
- //
- // This is called without any lock held and can be called concurrently
- // by multiple threads.
+ // See IConsumerListener::onFrame{Available,Replaced}
virtual void onFrameAvailable(const BufferItem& item) = 0;
+ virtual void onFrameReplaced(const BufferItem& /* item */) {}
};
virtual ~ConsumerBase();
@@ -104,14 +98,16 @@ protected:
// Implementation of the IConsumerListener interface. These
// calls are used to notify the ConsumerBase of asynchronous events in the
- // BufferQueue. The onFrameAvailable and onBuffersReleased methods should
- // not need to be overridden by derived classes, but if they are overridden
- // the ConsumerBase implementation must be called from the derived class.
- // The ConsumerBase version of onSidebandStreamChanged does nothing and can
- // be overriden by derived classes if they want the notification.
- virtual void onFrameAvailable(const BufferItem& item);
- virtual void onBuffersReleased();
- virtual void onSidebandStreamChanged();
+ // BufferQueue. The onFrameAvailable, onFrameReplaced, and
+ // onBuffersReleased methods should not need to be overridden by derived
+ // classes, but if they are overridden the ConsumerBase implementation must
+ // be called from the derived class. The ConsumerBase version of
+ // onSidebandStreamChanged does nothing and can be overriden by derived
+ // classes if they want the notification.
+ virtual void onFrameAvailable(const BufferItem& item) override;
+ virtual void onFrameReplaced(const BufferItem& item) override;
+ virtual void onBuffersReleased() override;
+ virtual void onSidebandStreamChanged() override;
// freeBufferLocked frees up the given buffer slot. If the slot has been
// initialized this will release the reference to the GraphicBuffer in that