HardwareBuffer Class

Definition

HardwareBuffer wraps a native AHardwareBuffer object, which is a low-level object representing a memory buffer accessible by various hardware units.

[Android.Runtime.Register("android/hardware/HardwareBuffer", ApiSince=26, DoNotGenerateAcw=true)]
public sealed class HardwareBuffer : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.IAutoCloseable
[<Android.Runtime.Register("android/hardware/HardwareBuffer", ApiSince=26, DoNotGenerateAcw=true)>]
type HardwareBuffer = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface IAutoCloseable
Inheritance
HardwareBuffer
Attributes
Implements

Remarks

HardwareBuffer wraps a native AHardwareBuffer object, which is a low-level object representing a memory buffer accessible by various hardware units. HardwareBuffer allows sharing buffers across different application processes. In particular, HardwareBuffers may be mappable to memory accessibly to various hardware systems, such as the GPU, a sensor or context hub, or other auxiliary processing units.

For more information, see the NDK documentation for AHardwareBuffer.

Java documentation for android.hardware.HardwareBuffer.

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.

Fields

UsageComposerOverlay

The buffer will be used as a hardware composer overlay layer.

UsageCpuReadOften

Usage: The buffer will often be read by the CPU

UsageCpuReadRarely

Usage: The buffer will sometimes be read by the CPU

UsageCpuWriteOften

Usage: The buffer will often be written to by the CPU

UsageCpuWriteRarely

Usage: The buffer will sometimes be written to by the CPU

UsageFrontBuffer

Usage: The buffer is used for front-buffer rendering.

UsageGpuColorOutput

Usage: The buffer will be written to by the GPU

UsageGpuCubeMap

Usage: The buffer will be used as a cube map texture

UsageGpuDataBuffer

Usage: The buffer will be used as a shader storage or uniform buffer object

UsageGpuMipmapComplete

Usage: The buffer contains a complete mipmap hierarchy

UsageGpuSampledImage

Usage: The buffer will be read from by the GPU

UsageProtectedContent

Usage: The buffer must not be used outside of a protected hardware path

UsageSensorDirectData

Usage: The buffer will be used for sensor direct data

UsageVideoEncode

Usage: The buffer will be read by a hardware video encoder

Ycbcr420888
Obsolete.

Format: Planar YCbCr 420; must have an even width and height

YcbcrP010
Obsolete.

Android YUV P010 format.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Creator
Format

Returns the

Handle

The handle to the underlying Android instance.

(Inherited from Object)
Height

Returns the height of this buffer in pixels.

Id

Returns the system-wide unique id for this buffer

IsClosed

Indicates whether this buffer has been closed.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Layers

Returns the number of layers in this buffer.

PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
Width

Returns the width of this buffer in pixels.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Destroys this buffer immediately.

DescribeContents()
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags)

Flatten this object in to a Parcel.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to