DefaultHardwareBufferEffectsPipeline


@RequiresApi(value = 26)
@ExperimentalApi
class DefaultHardwareBufferEffectsPipeline : RenderingPacketConsumer


A PacketProcessor that composites the HardwareBufferFrames from the input packet onto the output HardwareBufferFrame using OpenGL.

Summary

Public companion functions

DefaultHardwareBufferEffectsPipeline
create(
    context: Context,
    hardwareBufferJniWrapper: HardwareBufferJniWrapper
)

Creates a new DefaultHardwareBufferEffectsPipeline, that uses a default StaticOverlaySettings to composite each sequence..

DefaultHardwareBufferEffectsPipeline
create(
    context: Context,
    hardwareBufferJniWrapper: HardwareBufferJniWrapper,
    overlaySettingsProvider: (HardwareBufferFrame) -> OverlaySettings
)

Creates a new DefaultHardwareBufferEffectsPipeline that calls the given overlaySettingsProvider for each frame when compositing.

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 Unit

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

open Unit

Sets the target for where input frames are rendered to.

Public companion functions

create

fun create(
    context: Context,
    hardwareBufferJniWrapper: HardwareBufferJniWrapper
): DefaultHardwareBufferEffectsPipeline

Creates a new DefaultHardwareBufferEffectsPipeline, that uses a default StaticOverlaySettings to composite each sequence..

create

fun create(
    context: Context,
    hardwareBufferJniWrapper: HardwareBufferJniWrapper,
    overlaySettingsProvider: (HardwareBufferFrame) -> OverlaySettings
): DefaultHardwareBufferEffectsPipeline

Creates a new DefaultHardwareBufferEffectsPipeline that calls the given overlaySettingsProvider for each frame when compositing.

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.

setErrorConsumer

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

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

setRenderOutput

open fun setRenderOutput(output: HardwareBufferFrameQueue?): Unit

Sets the target for where input frames are rendered to.