diff options
| author | 2015-03-02 22:12:37 -0800 | |
|---|---|---|
| committer | 2015-03-23 19:59:56 -0700 | |
| commit | 28dbde32c2fa4a19a8bf3875e1756fb2a787695c (patch) | |
| tree | db54857301bde7de62165710953669ab66b52709 /libs | |
| parent | bd6f5b27386b666f66ebb209e9235db9bb7f7db5 (diff) | |
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
Change-Id: I5ea5229bf3a329bf02c6bd20e7247039c75d136b
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/gui/Surface.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 0e2baa28fd..9bd0d0dd55 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -546,9 +546,13 @@ int Surface::dispatchSetSidebandStream(va_list args) { } int Surface::connect(int api) { + static sp<IProducerListener> listener = new DummyProducerListener(); + return connect(api, listener); +} + +int Surface::connect(int api, const sp<IProducerListener>& listener) { ATRACE_CALL(); ALOGV("Surface::connect"); - static sp<IProducerListener> listener = new DummyProducerListener(); Mutex::Autolock lock(mMutex); IGraphicBufferProducer::QueueBufferOutput output; int err = mGraphicBufferProducer->connect(listener, api, mProducerControlledByApp, &output); |