Sdílet prostřednictvím


ImageReader.DiscardFreeBuffers Method

Definition

Discard any free buffers owned by this ImageReader.

[Android.Runtime.Register("discardFreeBuffers", "()V", "GetDiscardFreeBuffersHandler", ApiSince=28)]
public virtual void DiscardFreeBuffers ();
[<Android.Runtime.Register("discardFreeBuffers", "()V", "GetDiscardFreeBuffersHandler", ApiSince=28)>]
abstract member DiscardFreeBuffers : unit -> unit
override this.DiscardFreeBuffers : unit -> unit
Attributes

Remarks

Discard any free buffers owned by this ImageReader.

Generally, the ImageReader caches buffers for reuse once they have been allocated, for best performance. However, sometimes it may be important to release all the cached, unused buffers to save on memory.

Calling this method will discard all free cached buffers. This does not include any buffers associated with Images acquired from the ImageReader, any filled buffers waiting to be acquired, and any buffers currently in use by the source rendering buffers into the ImageReader's Surface.

The ImageReader continues to be usable after this call, but may need to reallocate buffers when more buffers are needed for rendering.

Java documentation for android.media.ImageReader.discardFreeBuffers().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to