surfaceflinger: move SurfaceFlingerConsumer::mContentsChangedListener
Move it and related methods to the base class, BufferLayerConsumer.
Test: boots
Change-Id: I8d92e3fa74681198457c61ad82546d7e5a8f18a6
diff --git a/services/surfaceflinger/BufferLayerConsumer.h b/services/surfaceflinger/BufferLayerConsumer.h
index f8da6bf..b8b3874 100644
--- a/services/surfaceflinger/BufferLayerConsumer.h
+++ b/services/surfaceflinger/BufferLayerConsumer.h
@@ -54,13 +54,19 @@
*/
class BufferLayerConsumer : public ConsumerBase {
public:
- typedef ConsumerBase::FrameAvailableListener FrameAvailableListener;
+ struct ContentsChangedListener : public FrameAvailableListener {
+ virtual void onSidebandStreamChanged() = 0;
+ };
// BufferLayerConsumer constructs a new BufferLayerConsumer object.
// The tex parameter indicates the name of the OpenGL ES
// texture to which images are to be streamed.
BufferLayerConsumer(const sp<IGraphicBufferConsumer>& bq, uint32_t tex, Layer* layer);
+ // Sets the contents changed listener. This should be used instead of
+ // ConsumerBase::setFrameAvailableListener().
+ void setContentsChangedListener(const wp<ContentsChangedListener>& listener);
+
// updateTexImage acquires the most recently queued buffer, and sets the
// image contents of the target texture to it.
//
@@ -257,6 +263,7 @@
// IConsumerListener interface
void onDisconnect() override;
+ void onSidebandStreamChanged() override;
void addAndGetFrameTimestamps(const NewFrameEventsEntry* newTimestamps,
FrameEventHistoryDelta* outDelta) override;
@@ -341,6 +348,8 @@
// The layer for this BufferLayerConsumer
const wp<Layer> mLayer;
+ wp<ContentsChangedListener> mContentsChangedListener;
+
// EGLSlot contains the information and object references that
// BufferLayerConsumer maintains about a BufferQueue buffer slot.
struct EglSlot {