RecordingHardwareBufferEffectsPipeline


@ExperimentalApi
public final class RecordingHardwareBufferEffectsPipeline implements RenderingPacketConsumer


Wraps a DefaultHardwareBufferEffectsPipeline and triggers a callback on every queuePacket call.

Summary

Public methods

static final @NonNull RecordingHardwareBufferEffectsPipeline
@RequiresApi(value = 26)
create(
    @NonNull Context context,
    @NonNull HardwareBufferJniWrapper hardwareBufferJniWrapper,
    @NonNull Function1<@NonNull ImmutableList<@NonNull HardwareBufferFrame>, ImmutableList<@NonNull HardwareBufferFrame>> onQueue
)

Create a RecordingHardwareBufferEffectsPipeline with a DefaultHardwareBufferEffectsPipeline.

void

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

void

Releases all resources.

void

Sets a Consumer to handle any Exceptions that occur during rendering.

void

Sets the target for where input frames are rendered to.

Public methods

queuePacket

public void queuePacket(
    @NonNull PacketConsumer.Packet<@NonNull ImmutableList<@NonNull HardwareBufferFrame>> packet
)

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.

release

public void release()

Releases all resources.

setErrorConsumer

public void setErrorConsumer(@NonNull Consumer<@NonNull Exception> errorConsumer)

Sets a Consumer to handle any Exceptions that occur during rendering.

setRenderOutput

public void setRenderOutput(HardwareBufferFrameQueue output)

Sets the target for where input frames are rendered to.