virtualcamera

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

Documentation

Index

Constants

View Source
const (
	TransactionIVirtualCameraCallbackOnStreamConfigured      = binder.FirstCallTransaction + 0
	TransactionIVirtualCameraCallbackOnProcessCaptureRequest = binder.FirstCallTransaction + 1
	TransactionIVirtualCameraCallbackOnStreamClosed          = binder.FirstCallTransaction + 2
)
View Source
const (
	MethodIVirtualCameraCallbackOnStreamConfigured      = "onStreamConfigured"
	MethodIVirtualCameraCallbackOnProcessCaptureRequest = "onProcessCaptureRequest"
	MethodIVirtualCameraCallbackOnStreamClosed          = "onStreamClosed"
)
View Source
const (
	TransactionIVirtualCameraServiceRegisterCamera   = binder.FirstCallTransaction + 0
	TransactionIVirtualCameraServiceUnregisterCamera = binder.FirstCallTransaction + 1
	TransactionIVirtualCameraServiceGetCameraId      = binder.FirstCallTransaction + 2
)
View Source
const (
	MethodIVirtualCameraServiceRegisterCamera   = "registerCamera"
	MethodIVirtualCameraServiceUnregisterCamera = "unregisterCamera"
	MethodIVirtualCameraServiceGetCameraId      = "getCameraId"
)
View Source
const DescriptorIVirtualCameraCallback = "android.companion.virtualcamera.IVirtualCameraCallback"
View Source
const DescriptorIVirtualCameraService = "android.companion.virtualcamera.IVirtualCameraService"

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format int32
const (
	FormatUNKNOWN   Format = 0
	FormatRgba8888  Format = 1
	FormatYuv420888 Format = 35
)

type IVirtualCameraCallback

type IVirtualCameraCallback interface {
	AsBinder() binder.IBinder
	OnStreamConfigured(ctx context.Context, streamId int32, surface view.Surface, width int32, height int32, pixelFormat Format) error
	OnProcessCaptureRequest(ctx context.Context, streamId int32, frameId int32) error
	OnStreamClosed(ctx context.Context, streamId int32) error
}

func NewVirtualCameraCallbackStub

func NewVirtualCameraCallbackStub(
	impl IVirtualCameraCallbackServer,
) IVirtualCameraCallback

NewVirtualCameraCallbackStub creates a server-side IVirtualCameraCallback wrapping the given server implementation. The returned value satisfies IVirtualCameraCallback 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 IVirtualCameraCallbackServer

type IVirtualCameraCallbackServer interface {
	OnStreamConfigured(ctx context.Context, streamId int32, surface view.Surface, width int32, height int32, pixelFormat Format) error
	OnProcessCaptureRequest(ctx context.Context, streamId int32, frameId int32) error
	OnStreamClosed(ctx context.Context, streamId int32) error
}

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

type IVirtualCameraService

type IVirtualCameraService interface {
	AsBinder() binder.IBinder
	RegisterCamera(ctx context.Context, token binder.IBinder, configuration VirtualCameraConfiguration) (bool, error)
	UnregisterCamera(ctx context.Context, token binder.IBinder) error
	GetCameraId(ctx context.Context, token binder.IBinder) (int32, error)
}

func NewVirtualCameraServiceStub

func NewVirtualCameraServiceStub(
	impl IVirtualCameraServiceServer,
) IVirtualCameraService

NewVirtualCameraServiceStub creates a server-side IVirtualCameraService wrapping the given server implementation. The returned value satisfies IVirtualCameraService 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 IVirtualCameraServiceServer

type IVirtualCameraServiceServer interface {
	RegisterCamera(ctx context.Context, token binder.IBinder, configuration VirtualCameraConfiguration) (bool, error)
	UnregisterCamera(ctx context.Context, token binder.IBinder) error
	GetCameraId(ctx context.Context, token binder.IBinder) (int32, error)
}

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

type LensFacing

type LensFacing int32
const (
	LensFacingFRONT    LensFacing = 0
	LensFacingBACK     LensFacing = 1
	LensFacingEXTERNAL LensFacing = 2
)

type SensorOrientation

type SensorOrientation int32
const (
	SensorOrientationOrientation0   SensorOrientation = 0
	SensorOrientationOrientation90  SensorOrientation = 90
	SensorOrientationOrientation180 SensorOrientation = 180
	SensorOrientationOrientation270 SensorOrientation = 270
)

type SupportedStreamConfiguration

type SupportedStreamConfiguration struct {
	Width       int32
	Height      int32
	PixelFormat Format
	MaxFps      int32
}

func (*SupportedStreamConfiguration) MarshalParcel

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

func (*SupportedStreamConfiguration) UnmarshalParcel

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

type VirtualCameraCallbackProxy

type VirtualCameraCallbackProxy struct {
	Remote binder.IBinder
}

func NewVirtualCameraCallbackProxy

func NewVirtualCameraCallbackProxy(
	remote binder.IBinder,
) *VirtualCameraCallbackProxy

func (*VirtualCameraCallbackProxy) AsBinder

func (*VirtualCameraCallbackProxy) OnProcessCaptureRequest

func (p *VirtualCameraCallbackProxy) OnProcessCaptureRequest(
	ctx context.Context,
	streamId int32,
	frameId int32,
) error

func (*VirtualCameraCallbackProxy) OnStreamClosed

func (p *VirtualCameraCallbackProxy) OnStreamClosed(
	ctx context.Context,
	streamId int32,
) error

func (*VirtualCameraCallbackProxy) OnStreamConfigured

func (p *VirtualCameraCallbackProxy) OnStreamConfigured(
	ctx context.Context,
	streamId int32,
	surface view.Surface,
	width int32,
	height int32,
	pixelFormat Format,
) error

type VirtualCameraCallbackStub

type VirtualCameraCallbackStub struct {
	Impl      IVirtualCameraCallback
	Transport binder.VersionAwareTransport
}

VirtualCameraCallbackStub dispatches incoming binder transactions to a typed IVirtualCameraCallback implementation.

func (*VirtualCameraCallbackStub) Descriptor

func (s *VirtualCameraCallbackStub) Descriptor() string

func (*VirtualCameraCallbackStub) OnTransaction

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

type VirtualCameraConfiguration

type VirtualCameraConfiguration struct {
	SupportedStreamConfigs []SupportedStreamConfiguration
	VirtualCameraCallback  IVirtualCameraCallback
	SensorOrientation      SensorOrientation
	LensFacing             LensFacing
}

func (*VirtualCameraConfiguration) MarshalParcel

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

func (*VirtualCameraConfiguration) UnmarshalParcel

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

type VirtualCameraServiceProxy

type VirtualCameraServiceProxy struct {
	Remote binder.IBinder
}

func NewVirtualCameraServiceProxy

func NewVirtualCameraServiceProxy(
	remote binder.IBinder,
) *VirtualCameraServiceProxy

func (*VirtualCameraServiceProxy) AsBinder

func (*VirtualCameraServiceProxy) GetCameraId

func (p *VirtualCameraServiceProxy) GetCameraId(
	ctx context.Context,
	token binder.IBinder,
) (int32, error)

func (*VirtualCameraServiceProxy) RegisterCamera

func (p *VirtualCameraServiceProxy) RegisterCamera(
	ctx context.Context,
	token binder.IBinder,
	configuration VirtualCameraConfiguration,
) (bool, error)

func (*VirtualCameraServiceProxy) UnregisterCamera

func (p *VirtualCameraServiceProxy) UnregisterCamera(
	ctx context.Context,
	token binder.IBinder,
) error

type VirtualCameraServiceStub

type VirtualCameraServiceStub struct {
	Impl      IVirtualCameraService
	Transport binder.VersionAwareTransport
}

VirtualCameraServiceStub dispatches incoming binder transactions to a typed IVirtualCameraService implementation.

func (*VirtualCameraServiceStub) Descriptor

func (s *VirtualCameraServiceStub) Descriptor() string

func (*VirtualCameraServiceStub) OnTransaction

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

Jump to

Keyboard shortcuts

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