aaudio

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionIAAudioServiceRegisterClient        = binder.FirstCallTransaction + 0
	TransactionIAAudioServiceOpenStream            = binder.FirstCallTransaction + 1
	TransactionIAAudioServiceCloseStream           = binder.FirstCallTransaction + 2
	TransactionIAAudioServiceGetStreamDescription  = binder.FirstCallTransaction + 3
	TransactionIAAudioServiceStartStream           = binder.FirstCallTransaction + 4
	TransactionIAAudioServicePauseStream           = binder.FirstCallTransaction + 5
	TransactionIAAudioServiceStopStream            = binder.FirstCallTransaction + 6
	TransactionIAAudioServiceFlushStream           = binder.FirstCallTransaction + 7
	TransactionIAAudioServiceRegisterAudioThread   = binder.FirstCallTransaction + 8
	TransactionIAAudioServiceUnregisterAudioThread = binder.FirstCallTransaction + 9
	TransactionIAAudioServiceExitStandby           = binder.FirstCallTransaction + 10
)
View Source
const (
	MethodIAAudioServiceRegisterClient        = "registerClient"
	MethodIAAudioServiceOpenStream            = "openStream"
	MethodIAAudioServiceCloseStream           = "closeStream"
	MethodIAAudioServiceGetStreamDescription  = "getStreamDescription"
	MethodIAAudioServiceStartStream           = "startStream"
	MethodIAAudioServicePauseStream           = "pauseStream"
	MethodIAAudioServiceStopStream            = "stopStream"
	MethodIAAudioServiceFlushStream           = "flushStream"
	MethodIAAudioServiceRegisterAudioThread   = "registerAudioThread"
	MethodIAAudioServiceUnregisterAudioThread = "unregisterAudioThread"
	MethodIAAudioServiceExitStandby           = "exitStandby"
)
View Source
const DescriptorIAAudioClient = "aaudio.IAAudioClient"
View Source
const DescriptorIAAudioService = "aaudio.IAAudioService"
View Source
const (
	MethodIAAudioClientOnStreamChange = "onStreamChange"
)
View Source
const (
	TransactionIAAudioClientOnStreamChange = binder.FirstCallTransaction + 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AAudioClientProxy

type AAudioClientProxy struct {
	Remote binder.IBinder
}

func NewAAudioClientProxy

func NewAAudioClientProxy(
	remote binder.IBinder,
) *AAudioClientProxy

func (*AAudioClientProxy) AsBinder

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

func (*AAudioClientProxy) OnStreamChange

func (p *AAudioClientProxy) OnStreamChange(
	ctx context.Context,
	handle int32,
	opcode int32,
	value int32,
) error

type AAudioClientStub

type AAudioClientStub struct {
	Impl      IAAudioClient
	Transport binder.VersionAwareTransport
}

AAudioClientStub dispatches incoming binder transactions to a typed IAAudioClient implementation.

func (*AAudioClientStub) Descriptor

func (s *AAudioClientStub) Descriptor() string

func (*AAudioClientStub) OnTransaction

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

type AAudioServiceProxy

type AAudioServiceProxy struct {
	Remote binder.IBinder
}

func NewAAudioServiceProxy

func NewAAudioServiceProxy(
	remote binder.IBinder,
) *AAudioServiceProxy

func (*AAudioServiceProxy) AsBinder

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

func (*AAudioServiceProxy) CloseStream

func (p *AAudioServiceProxy) CloseStream(
	ctx context.Context,
	streamHandle int32,
) (int32, error)

func (*AAudioServiceProxy) ExitStandby

func (p *AAudioServiceProxy) ExitStandby(
	ctx context.Context,
	streamHandle int32,
	endpoint Endpoint,
) (int32, error)

func (*AAudioServiceProxy) FlushStream

func (p *AAudioServiceProxy) FlushStream(
	ctx context.Context,
	streamHandle int32,
) (int32, error)

func (*AAudioServiceProxy) GetStreamDescription

func (p *AAudioServiceProxy) GetStreamDescription(
	ctx context.Context,
	streamHandle int32,
	endpoint Endpoint,
) (int32, error)

func (*AAudioServiceProxy) OpenStream

func (p *AAudioServiceProxy) OpenStream(
	ctx context.Context,
	request StreamRequest,
	paramsOut StreamParameters,
) (int32, error)

func (*AAudioServiceProxy) PauseStream

func (p *AAudioServiceProxy) PauseStream(
	ctx context.Context,
	streamHandle int32,
) (int32, error)

func (*AAudioServiceProxy) RegisterAudioThread

func (p *AAudioServiceProxy) RegisterAudioThread(
	ctx context.Context,
	streamHandle int32,
	clientThreadId int32,
	periodNanoseconds int64,
) (int32, error)

func (*AAudioServiceProxy) RegisterClient

func (p *AAudioServiceProxy) RegisterClient(
	ctx context.Context,
	client IAAudioClient,
) error

func (*AAudioServiceProxy) StartStream

func (p *AAudioServiceProxy) StartStream(
	ctx context.Context,
	streamHandle int32,
) (int32, error)

func (*AAudioServiceProxy) StopStream

func (p *AAudioServiceProxy) StopStream(
	ctx context.Context,
	streamHandle int32,
) (int32, error)

func (*AAudioServiceProxy) UnregisterAudioThread

func (p *AAudioServiceProxy) UnregisterAudioThread(
	ctx context.Context,
	streamHandle int32,
	clientThreadId int32,
) (int32, error)

type AAudioServiceStub

type AAudioServiceStub struct {
	Impl      IAAudioService
	Transport binder.VersionAwareTransport
}

AAudioServiceStub dispatches incoming binder transactions to a typed IAAudioService implementation.

func (*AAudioServiceStub) Descriptor

func (s *AAudioServiceStub) Descriptor() string

func (*AAudioServiceStub) OnTransaction

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

type Endpoint

type Endpoint struct {
	UpMessageQueueParcelable   RingBuffer
	DownMessageQueueParcelable RingBuffer
	UpDataQueueParcelable      RingBuffer
	DownDataQueueParcelable    RingBuffer
	SharedMemories             []media.SharedFileRegion
}

func (*Endpoint) MarshalParcel

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

func (*Endpoint) UnmarshalParcel

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

type IAAudioClient

type IAAudioClient interface {
	AsBinder() binder.IBinder
	OnStreamChange(ctx context.Context, handle int32, opcode int32, value int32) error
}

func NewAAudioClientStub

func NewAAudioClientStub(
	impl IAAudioClientServer,
) IAAudioClient

NewAAudioClientStub creates a server-side IAAudioClient wrapping the given server implementation. The returned value satisfies IAAudioClient 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 IAAudioClientServer

type IAAudioClientServer interface {
	OnStreamChange(ctx context.Context, handle int32, opcode int32, value int32) error
}

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

type IAAudioService

type IAAudioService interface {
	AsBinder() binder.IBinder
	RegisterClient(ctx context.Context, client IAAudioClient) error
	OpenStream(ctx context.Context, request StreamRequest, paramsOut StreamParameters) (int32, error)
	CloseStream(ctx context.Context, streamHandle int32) (int32, error)
	GetStreamDescription(ctx context.Context, streamHandle int32, endpoint Endpoint) (int32, error)
	StartStream(ctx context.Context, streamHandle int32) (int32, error)
	PauseStream(ctx context.Context, streamHandle int32) (int32, error)
	StopStream(ctx context.Context, streamHandle int32) (int32, error)
	FlushStream(ctx context.Context, streamHandle int32) (int32, error)
	RegisterAudioThread(ctx context.Context, streamHandle int32, clientThreadId int32, periodNanoseconds int64) (int32, error)
	UnregisterAudioThread(ctx context.Context, streamHandle int32, clientThreadId int32) (int32, error)
	ExitStandby(ctx context.Context, streamHandle int32, endpoint Endpoint) (int32, error)
}

func NewAAudioServiceStub

func NewAAudioServiceStub(
	impl IAAudioServiceServer,
) IAAudioService

NewAAudioServiceStub creates a server-side IAAudioService wrapping the given server implementation. The returned value satisfies IAAudioService 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 IAAudioServiceServer

type IAAudioServiceServer interface {
	RegisterClient(ctx context.Context, client IAAudioClient) error
	OpenStream(ctx context.Context, request StreamRequest, paramsOut StreamParameters) (int32, error)
	CloseStream(ctx context.Context, streamHandle int32) (int32, error)
	GetStreamDescription(ctx context.Context, streamHandle int32, endpoint Endpoint) (int32, error)
	StartStream(ctx context.Context, streamHandle int32) (int32, error)
	PauseStream(ctx context.Context, streamHandle int32) (int32, error)
	StopStream(ctx context.Context, streamHandle int32) (int32, error)
	FlushStream(ctx context.Context, streamHandle int32) (int32, error)
	RegisterAudioThread(ctx context.Context, streamHandle int32, clientThreadId int32, periodNanoseconds int64) (int32, error)
	UnregisterAudioThread(ctx context.Context, streamHandle int32, clientThreadId int32) (int32, error)
	ExitStandby(ctx context.Context, streamHandle int32, endpoint Endpoint) (int32, error)
}

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

type RingBuffer

type RingBuffer struct {
	ReadCounterParcelable  SharedRegion
	WriteCounterParcelable SharedRegion
	DataParcelable         SharedRegion
	BytesPerFrame          int32
	FramesPerBurst         int32
	CapacityInFrames       int32
	Flags                  int32
}

func (*RingBuffer) MarshalParcel

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

func (*RingBuffer) UnmarshalParcel

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

type SharedRegion

type SharedRegion struct {
	SharedMemoryIndex int32
	OffsetInBytes     int32
	SizeInBytes       int32
}

func (*SharedRegion) MarshalParcel

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

func (*SharedRegion) UnmarshalParcel

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

type StreamParameters

type StreamParameters struct {
	ChannelMask             int32
	SampleRate              int32
	DeviceId                int32
	SharingMode             int32
	AudioFormat             common.AudioFormatDescription
	Direction               int32
	Usage                   int32
	ContentType             int32
	SpatializationBehavior  int32
	IsContentSpatialized    bool
	InputPreset             int32
	BufferCapacity          int32
	AllowedCapturePolicy    int32
	SessionId               int32
	IsPrivacySensitive      bool
	HardwareSamplesPerFrame int32
	HardwareSampleRate      int32
	HardwareAudioFormat     common.AudioFormatDescription
}

func (*StreamParameters) MarshalParcel

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

func (*StreamParameters) UnmarshalParcel

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

type StreamRequest

type StreamRequest struct {
	Params                   StreamParameters
	AttributionSource        content.AttributionSourceState
	SharingModeMatchRequired bool
	InService                bool
}

func (*StreamRequest) MarshalParcel

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

func (*StreamRequest) UnmarshalParcel

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

Jump to

Keyboard shortcuts

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