다음을 통해 공유


HardwareBuffer.Id Property

Definition

Returns the system-wide unique id for this buffer

public long Id { [Android.Runtime.Register("getId", "()J", "", ApiSince=34)] get; }
[<get: Android.Runtime.Register("getId", "()J", "", ApiSince=34)>]
member this.Id : int64

Property Value

Attributes

Remarks

Returns the system-wide unique id for this buffer

This can be useful as a cache key for associating additional objects with a given HardwareBuffer, such as associating an imported EGLImage with the target HardwareBuffer when processing a stream of buffers from ImageReader.

This can also be useful for doing cross-process buffer caching. As sending a HardwareBuffer over Binder is slower than sending a long, this can be used as reliable cache key after an initial handshake that passes the HardwareBuffers themselves to later be referred to using only the id.

Java documentation for android.hardware.HardwareBuffer.getId().

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