PreviewingVideoGraph


@UnstableApi
interface PreviewingVideoGraph : VideoGraph

Known direct subclasses
PreviewingSingleInputVideoGraph

A Previewing specific implementation of .


A VideoGraph specific to previewing.

Summary

Nested types

A factory for creating a PreviewingVideoGraph.

Public functions

Unit
renderOutputFrame(renderTimeNs: Long)

Renders the oldest unrendered output frame that has become available for rendering at the given renderTimeNs.

Inherited functions

From androidx.media3.common.VideoGraph
VideoFrameProcessor!
getProcessor(inputIndex: Int)

Returns the VideoFrameProcessor that handles the processing for an input registered via registerInput.

Boolean

Returns whether the VideoGraph has produced a frame with zero presentation timestamp.

Unit

Initialize the VideoGraph.

Unit
registerInput(inputIndex: @IntRange(from = 0) Int)

Registers a new input to the VideoGraph.

Unit

Releases the associated resources.

Unit
setOutputSurfaceInfo(outputSurfaceInfo: SurfaceInfo?)

Sets the output surface and supporting information.

Public functions

renderOutputFrame

fun renderOutputFrame(renderTimeNs: Long): Unit

Renders the oldest unrendered output frame that has become available for rendering at the given renderTimeNs.

This will either render the output frame to the output surface, or drop the frame, per renderTimeNs.

The renderTimeNs may be passed to eglPresentationTimeANDROID depending on the implementation.

Parameters
renderTimeNs: Long

The render time to use for the frame, in nanoseconds. The render time can be before or after the current system time. Use DROP_OUTPUT_FRAME to drop the frame, or RENDER_OUTPUT_FRAME_IMMEDIATELY to render the frame immediately.