igbp

package
v0.0.5 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: 8 Imported by: 0

Documentation

Overview

Package igbp provides a minimal IGraphicBufferProducer stub backed by gralloc-allocated buffers, suitable for receiving camera frames.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteEmptyFrameEventHistoryDelta

func WriteEmptyFrameEventHistoryDelta(reply *parcel.Parcel)

WriteEmptyFrameEventHistoryDelta writes an empty FrameEventHistoryDelta as a Flattenable: compositorTiming (3 * int64) + int32(0 deltas) = 28 bytes.

func WriteGrallocGraphicBuffer

func WriteGrallocGraphicBuffer(
	p *parcel.Parcel,
	buf *gralloc.Buffer,
	bufID uint64,
)

WriteGrallocGraphicBuffer writes a flattened GraphicBuffer backed by a gralloc NativeHandle. The wire format follows GraphicBuffer::flatten():

int32(flattenedSize) + int32(fdCount) + raw[flattenedSize] + fd objects

func WriteQueueBufferOutput

func WriteQueueBufferOutput(reply *parcel.Parcel)

WriteQueueBufferOutput writes a minimal QueueBufferOutput Flattenable.

Types

type ProducerStub

type ProducerStub struct {
	// contains filtered or unexported fields
}

ProducerStub implements a minimal IGraphicBufferProducer that provides gralloc-allocated buffers to the camera HAL. Queued frames are delivered via QueuedFrames().

func NewProducerStub

func NewProducerStub(
	width uint32,
	height uint32,
	grallocBufs [4]*gralloc.Buffer,
) *ProducerStub

NewProducerStub creates a new IGraphicBufferProducer stub backed by the given pre-allocated gralloc buffers.

func (*ProducerStub) Descriptor

func (g *ProducerStub) Descriptor() string

Descriptor implements binder.NativeTransactionHandler.

func (*ProducerStub) OnTransaction

func (g *ProducerStub) OnTransaction(
	_ context.Context,
	code binder.TransactionCode,
	data *parcel.Parcel,
) (*parcel.Parcel, error)

OnTransaction implements binder.NativeTransactionHandler.

func (*ProducerStub) QueuedFrames

func (g *ProducerStub) QueuedFrames() <-chan int

QueuedFrames returns a channel that receives the slot index each time the camera queues a buffer back.

func (*ProducerStub) SlotBuffer

func (g *ProducerStub) SlotBuffer(slot int) *gralloc.Buffer

SlotBuffer returns the gralloc buffer for the given slot, or nil if the slot has not been assigned yet.

Jump to

Keyboard shortcuts

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