HardwareBufferToGlTextureFrameProcessor


@ExperimentalApi
@RequiresApi(value = 26)
class HardwareBufferToGlTextureFrameProcessor : PacketProcessor


A PacketProcessor implementation that converts a HardwareBufferFrame to GlTextureFrame.

Summary

Public companion functions

FloatArray

Public constructors

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

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.

Unit
open Unit

Sets the output PacketConsumer that will receive the processed packets.

Public companion functions

constructTransformationMatrix

fun constructTransformationMatrix(hardwareBufferFrame: HardwareBufferFrame): FloatArray

Public constructors

HardwareBufferToGlTextureFrameProcessor

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

Public functions

queuePacket

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

The Packet to process.

release

open suspend fun release(): Unit

Releases all resources.

setErrorConsumer

fun setErrorConsumer(errorConsumer: Consumer<Exception>): Unit

setOutput

open fun setOutput(output: PacketConsumer<GlTextureFrame>): Unit

Sets the output PacketConsumer that will receive the processed packets.

Parameters
output: PacketConsumer<GlTextureFrame>

The PacketConsumer for the output packets.