HardwareBufferToGlTextureFrameProcessor


@ExperimentalApi
@RequiresApi(value = 26)
public final class HardwareBufferToGlTextureFrameProcessor implements PacketProcessor


A PacketProcessor implementation that converts a HardwareBufferFrame to GlTextureFrame.

Summary

Nested types

Public constructors

HardwareBufferToGlTextureFrameProcessor(
    @NonNull Context context,
    @NonNull ExecutorService glExecutorService,
    @NonNull GlObjectsProvider glObjectsProvider,
    @NonNull HardwareBufferJniWrapper hardwareBufferJniWrapper,
    @NonNull Consumer<@NonNull Exception> errorConsumer
)

Public methods

void

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

void

Releases all resources.

final void
void

Sets the output PacketConsumer that will receive the processed packets.

Public constructors

HardwareBufferToGlTextureFrameProcessor

public HardwareBufferToGlTextureFrameProcessor(
    @NonNull Context context,
    @NonNull ExecutorService glExecutorService,
    @NonNull GlObjectsProvider glObjectsProvider,
    @NonNull HardwareBufferJniWrapper hardwareBufferJniWrapper,
    @NonNull Consumer<@NonNull Exception> errorConsumer
)

Public methods

queuePacket

public void queuePacket(
    @NonNull PacketConsumer.Packet<@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.

Parameters
@NonNull PacketConsumer.Packet<@NonNull HardwareBufferFrame> packet

The Packet to process.

release

public void release()

Releases all resources.

setErrorConsumer

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

setOutput

public void setOutput(@NonNull PacketConsumer<@NonNull GlTextureFrame> output)

Sets the output PacketConsumer that will receive the processed packets.

Parameters
@NonNull PacketConsumer<@NonNull GlTextureFrame> output

The PacketConsumer for the output packets.