allocator

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionIAllocatorAllocate                = binder.FirstCallTransaction + 0
	TransactionIAllocatorAllocate2               = binder.FirstCallTransaction + 1
	TransactionIAllocatorIsSupported             = binder.FirstCallTransaction + 2
	TransactionIAllocatorGetIMapperLibrarySuffix = binder.FirstCallTransaction + 3
)
View Source
const (
	MethodIAllocatorAllocate                = "allocate"
	MethodIAllocatorAllocate2               = "allocate2"
	MethodIAllocatorIsSupported             = "isSupported"
	MethodIAllocatorGetIMapperLibrarySuffix = "getIMapperLibrarySuffix"
)
View Source
const DescriptorIAllocator = "android.hardware.graphics.allocator.IAllocator"

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocationError

type AllocationError int32
const (
	AllocationErrorBadDescriptor AllocationError = 0
	AllocationErrorNoResources   AllocationError = 1
	AllocationErrorUNSUPPORTED   AllocationError = 2
)

type AllocationResult

type AllocationResult struct {
	Stride  int32
	Buffers []common.NativeHandle
}

func (*AllocationResult) MarshalParcel

func (s *AllocationResult) MarshalParcel(
	p *parcel.Parcel,
) error

func (*AllocationResult) UnmarshalParcel

func (s *AllocationResult) UnmarshalParcel(
	p *parcel.Parcel,
) error

type AllocatorProxy

type AllocatorProxy struct {
	Remote binder.IBinder
}

func NewAllocatorProxy

func NewAllocatorProxy(
	remote binder.IBinder,
) *AllocatorProxy

func (*AllocatorProxy) Allocate

func (p *AllocatorProxy) Allocate(
	ctx context.Context,
	descriptor []byte,
	count int32,
) (AllocationResult, error)

func (*AllocatorProxy) Allocate2

func (p *AllocatorProxy) Allocate2(
	ctx context.Context,
	descriptor BufferDescriptorInfo,
	count int32,
) (AllocationResult, error)

func (*AllocatorProxy) AsBinder

func (p *AllocatorProxy) AsBinder() binder.IBinder

func (*AllocatorProxy) GetIMapperLibrarySuffix

func (p *AllocatorProxy) GetIMapperLibrarySuffix(
	ctx context.Context,
) (string, error)

func (*AllocatorProxy) IsSupported

func (p *AllocatorProxy) IsSupported(
	ctx context.Context,
	descriptor BufferDescriptorInfo,
) (bool, error)

type AllocatorStub

type AllocatorStub struct {
	Impl      IAllocator
	Transport binder.VersionAwareTransport
}

AllocatorStub dispatches incoming binder transactions to a typed IAllocator implementation.

func (*AllocatorStub) Descriptor

func (s *AllocatorStub) Descriptor() string

func (*AllocatorStub) OnTransaction

func (s *AllocatorStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

type BufferDescriptorInfo

type BufferDescriptorInfo struct {
	Name              []byte
	Width             int32
	Height            int32
	LayerCount        int32
	Format            common.PixelFormat
	Usage             common.BufferUsage
	ReservedSize      int64
	AdditionalOptions []common.ExtendableType
}

func (*BufferDescriptorInfo) MarshalParcel

func (s *BufferDescriptorInfo) MarshalParcel(
	p *parcel.Parcel,
) error

func (*BufferDescriptorInfo) UnmarshalParcel

func (s *BufferDescriptorInfo) UnmarshalParcel(
	p *parcel.Parcel,
) error

type IAllocator

type IAllocator interface {
	AsBinder() binder.IBinder
	Allocate(ctx context.Context, descriptor []byte, count int32) (AllocationResult, error)
	Allocate2(ctx context.Context, descriptor BufferDescriptorInfo, count int32) (AllocationResult, error)
	IsSupported(ctx context.Context, descriptor BufferDescriptorInfo) (bool, error)
	GetIMapperLibrarySuffix(ctx context.Context) (string, error)
}

func NewAllocatorStub

func NewAllocatorStub(
	impl IAllocatorServer,
) IAllocator

NewAllocatorStub creates a server-side IAllocator wrapping the given server implementation. The returned value satisfies IAllocator and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type IAllocatorServer

type IAllocatorServer interface {
	Allocate(ctx context.Context, descriptor []byte, count int32) (AllocationResult, error)
	Allocate2(ctx context.Context, descriptor BufferDescriptorInfo, count int32) (AllocationResult, error)
	IsSupported(ctx context.Context, descriptor BufferDescriptorInfo) (bool, error)
	GetIMapperLibrarySuffix(ctx context.Context) (string, error)
}

IAllocatorServer is the server-side interface that user implementations provide to NewAllocatorStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL