Skip to content

Most visited

Recently visited


AImageReader_BufferRemovedListener Struct Reference

AImageReader_BufferRemovedListener Struct Reference

#include <NdkImageReader.h>

Data Fields

void * context
 optional application context. More...
AImageReader_BufferRemovedCallback onBufferRemoved

Field Documentation

◆ context

void* context

optional application context.

◆ onBufferRemoved

This callback is called when an old AHardwareBuffer is about to be removed from the image reader.

Note that registering this callback is optional unless the user holds on extra reference to AHardwareBuffer returned from AImage_getHardwareBuffer by calling AHardwareBuffer_acquire or creating external graphic objects, such as EglImage, from it.

If the callback is registered, the AImageReader will hold on the last of its references to the AHardwareBuffer until this callback returns. User can use the callback to get notified that it becomes the last owner of the buffer. It is up to the user to decide to either 1) immediately release all of its references to the buffer; or 2) keep using the buffer and release it in future. Note that, if option 2 if used, user of this API is responsible to deallocate the buffer properly by calling AHardwareBuffer_release.

See also

The documentation for this struct was generated from the following file:
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)