RecordingPacketConsumer


@ExperimentalApi
class RecordingPacketConsumer : PacketConsumer


A PacketConsumer implementation that holds a reference to all queued packets, and optionally releases the underlying frames.

Summary

Public constructors

RecordingPacketConsumer(releaseIncomingFrames: Boolean)

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.

open Boolean

Attempts to queue a Packet for processing without blocking.

Public constructors

RecordingPacketConsumer

RecordingPacketConsumer(releaseIncomingFrames: Boolean)

Public functions

queuePacket

open suspend fun queuePacket(packet: PacketConsumer.Packet<MutableList<GlTextureFrame>>): 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<MutableList<GlTextureFrame>>

The Packet to process.

release

open suspend fun release(): Unit

Releases all resources.

tryQueuePacket

open fun tryQueuePacket(
    packet: PacketConsumer.Packet<MutableList<GlTextureFrame>>
): Boolean

Attempts to queue a Packet for processing without blocking.

If this method returns true, the ownership of the packet is transferred to this PacketConsumer and the caller must not modify the packet.

Parameters
packet: PacketConsumer.Packet<MutableList<GlTextureFrame>>

The Packet to process.

Returns
Boolean

true if the packet was accepted and queued for processing. Returns false if the consumer is at capacity and cannot accept the packet at this time.

Public properties

queuedPackets

val queuedPacketsList<MutableList<GlTextureFrame>>