DefaultHardwareBufferEffectsPipeline
@RequiresApi(value = 26)
@ExperimentalApi
public final class DefaultHardwareBufferEffectsPipeline implements RenderingPacketConsumer
A PacketProcessor that composites the HardwareBufferFrames from the input packet onto the output HardwareBufferFrame using OpenGL.
Summary
Public methods |
|
|---|---|
static final @NonNull DefaultHardwareBufferEffectsPipeline |
create(Creates a new |
static final @NonNull DefaultHardwareBufferEffectsPipeline |
create(Creates a new |
void |
queuePacket(Queues a |
void |
release()Releases all resources. |
void |
setErrorConsumer(@NonNull Consumer<@NonNull Exception> errorConsumer)Sets a |
void |
Sets the target for where input frames are rendered to. |
Public methods
create
public static final @NonNull DefaultHardwareBufferEffectsPipeline create(
@NonNull Context context,
@NonNull HardwareBufferJniWrapper hardwareBufferJniWrapper
)
Creates a new DefaultHardwareBufferEffectsPipeline, that uses a default StaticOverlaySettings to composite each sequence..
create
public static final @NonNull DefaultHardwareBufferEffectsPipeline create(
@NonNull Context context,
@NonNull HardwareBufferJniWrapper hardwareBufferJniWrapper,
@NonNull Function1<@NonNull HardwareBufferFrame, @NonNull OverlaySettings> overlaySettingsProvider
)
Creates a new DefaultHardwareBufferEffectsPipeline that calls the given overlaySettingsProvider for each frame when compositing.
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.
| Parameters | |
|---|---|
@NonNull PacketConsumer.Packet<@NonNull ImmutableList<@NonNull HardwareBufferFrame>> packet |
The |
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.