Stay organized with collections
Save and categorize content based on your preferences.
OnImageReleasedListener
interface OnImageReleasedListener
ImageWriter callback interface, used to to asynchronously notify the application of various ImageWriter events.
Summary
Public methods |
abstract Unit |
Callback that is called when an input Image is released back to ImageWriter after the data consumption.
|
Public methods
onImageReleased
abstract fun onImageReleased(writer: ImageWriter!): Unit
Callback that is called when an input Image is released back to ImageWriter after the data consumption.
The client can use this callback to be notified that an input Image has been consumed and released by the downstream consumer. More specifically, this callback will be fired for below cases:
The application dequeues an input Image via the dequeueInputImage()
method, uses it, and then queues it back to this ImageWriter via the queueInputImage()
method. After the downstream consumer uses and releases this image to this ImageWriter, this callback will be fired. This image will be available to be dequeued after this callback.
The application obtains an Image from some other component (e.g. an ImageReader
), uses it, and then queues it to this ImageWriter via queueInputImage()
. After the downstream consumer uses and releases this image to this ImageWriter, this callback will be fired.
Parameters |
writer |
ImageWriter!: the ImageWriter the callback is associated with. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ImageWriter.OnImageReleasedListener\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnImageReleasedListener\n=======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/ImageWriter.OnImageReleasedListener \"View this page in Java\") \n\n```\ninterface OnImageReleasedListener\n```\n\n|--------------------------------------------------------|\n| [android.media.ImageWriter.OnImageReleasedListener](#) |\n\nImageWriter callback interface, used to to asynchronously notify the application of various ImageWriter events.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onImageReleased](#onImageReleased(android.media.ImageWriter))`(`writer:` `[ImageWriter](/reference/kotlin/android/media/ImageWriter)!`)` Callback that is called when an input Image is released back to ImageWriter after the data consumption. |\n\nPublic methods\n--------------\n\n### onImageReleased\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onImageReleased(writer: ImageWriter!): Unit\n```\n\nCallback that is called when an input Image is released back to ImageWriter after the data consumption.\n\nThe client can use this callback to be notified that an input Image has been consumed and released by the downstream consumer. More specifically, this callback will be fired for below cases:\n- The application dequeues an input Image via the [dequeueInputImage()](/reference/kotlin/android/media/ImageWriter#dequeueInputImage()) method, uses it, and then queues it back to this ImageWriter via the [queueInputImage()](/reference/kotlin/android/media/ImageWriter#queueInputImage(android.media.Image)) method. After the downstream consumer uses and releases this image to this ImageWriter, this callback will be fired. This image will be available to be dequeued after this callback.\n- The application obtains an Image from some other component (e.g. an [ImageReader](/reference/kotlin/android/media/ImageReader)), uses it, and then queues it to this ImageWriter via [queueInputImage()](/reference/kotlin/android/media/ImageWriter#queueInputImage(android.media.Image)). After the downstream consumer uses and releases this image to this ImageWriter, this callback will be fired.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------------------------------|\n| `writer` | [ImageWriter](/reference/kotlin/android/media/ImageWriter)!: the ImageWriter the callback is associated with. |\n\n**See Also**\n\n- [android.media.ImageWriter](/reference/kotlin/android/media/ImageWriter)\n- [android.media.Image](/reference/kotlin/android/media/Image)"]]