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 ¶
WriteEmptyFrameEventHistoryDelta writes an empty FrameEventHistoryDelta as a Flattenable: compositorTiming (3 * int64) + int32(0 deltas) = 28 bytes.
func WriteGrallocGraphicBuffer ¶
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 ¶
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.