OSDN Git Service

ImageReader: Set BufferItem mGraphicBuffer to null when returning it
authorEino-Ville Talvala <etalvala@google.com>
Tue, 13 Jun 2017 19:43:19 +0000 (12:43 -0700)
committerEino-Ville Talvala <etalvala@google.com>
Thu, 15 Jun 2017 13:34:31 +0000 (06:34 -0700)
commit0af9435572aa4ef66c61a62605f6eb3f8d218d8b
treef999ef81b25e558a3e1dea887f0d6db566f32ee9
parent484fb951e005584aeb22c5c2598898bc00eae22a
ImageReader: Set BufferItem mGraphicBuffer to null when returning it

The ImageReader JNI layer needs to maintain a list of BufferItems that
back the Java Image objects. At start, we allocate maxImages of these
in a list, and acquire and release them from this list as the
application acquires and releases Images.

However, on release, the contents of the BufferItem are not adjusted,
so it can retain a reference to a GraphicBuffer until the BufferItem
is reused.

Test: Camera CTS passes, memory usage drops after camera bursts
Bug: 62652080
Change-Id: I9aade5e32cbe0af0c15a3886e16ada1a70392b74
media/jni/android_media_ImageReader.cpp