ProcessAndRenderToSurfaceConsumer


@RequiresApi(value = 34)
@ExperimentalApi
class ProcessAndRenderToSurfaceConsumer : PacketConsumer


A PacketConsumer that renders a Packet of HardwareBufferFrames to a android.view.SurfaceHolder.

Summary

Public functions

open suspend Unit

Queues a Packet for processing, suspending the caller if the consumer is at capacity.

open suspend Unit

Releases all resources.

Public functions

queuePacket

open suspend fun queuePacket(
    packet: PacketConsumer.Packet<ImmutableList<HardwareBufferFrame>>
): Unit

Queues a Packet for processing, suspending the caller if the consumer is at capacity.

Once this method returns, the ownership of the packet is transferred to this PacketConsumer, and the caller should not modify the packet.

Parameters
packet: PacketConsumer.Packet<ImmutableList<HardwareBufferFrame>>

The Packet to process.

release

open suspend fun release(): Unit

Releases all resources.