From 966b98bd86abc6473167bc98ddf8ddb1f8dd2ed5 Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Mon, 2 Mar 2015 22:12:37 -0800 Subject: Surface: Permit an IProducerListener on connect This change allows clients of Surface to provide an IProducerListener callback object to Surface::connect, which will be passed down to the underlying IGraphicBufferProducer. Cherry pick of I5ea5229bf3a329bf02c6bd20e7247039c75d136b Change-Id: I6f8f52c72654e4cee649721383819bafe378f964 --- libs/gui/Surface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libs/gui') diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index aa4aee4..98489b1 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -547,9 +547,13 @@ int Surface::dispatchSetSidebandStream(va_list args) { } int Surface::connect(int api) { + static sp listener = new DummyProducerListener(); + return connect(api, listener); +} + +int Surface::connect(int api, const sp& listener) { ATRACE_CALL(); ALOGV("Surface::connect"); - static sp listener = new DummyProducerListener(); Mutex::Autolock lock(mMutex); IGraphicBufferProducer::QueueBufferOutput output; int err = mGraphicBufferProducer->connect(listener, api, mProducerControlledByApp, &output); -- cgit v1.1