Attention: This MediaPipe Solutions Preview is an early release. Learn more.

OutputHandler

Stay organized with collections Save and categorize content based on your preferences.
public class OutputHandler

Base class for handling MediaPipe task graph outputs.

Nested Classes

interface OutputHandler.OutputPacketConverter<OutputT extends TaskResult, InputT> Interface for converting MediaPipe graph output ERROR(/Packet)s to task result object and task input object. 
interface OutputHandler.PureResultListener<OutputT extends TaskResult> Interface for the customizable MediaPipe task result listener that can only reteive task result objects. 
interface OutputHandler.ResultListener<OutputT extends TaskResult, InputT> Interface for the customizable MediaPipe task result listener that can reteive both task result objects and the correpsonding input data. 

Public Constructors

Public Methods

long
OutputT
void
setErrorListener(ErrorListener listener)
Sets a callback to be invoked when exceptions are thrown from the task graph.
void
setHandleTimestampBoundChanges(boolean handleTimestampBoundChanges)
Sets whether the output handler should react to the timestamp bound changes that are reprsented as empty output ERROR(/Packet)s.
void
setOutputPacketConverter(OutputPacketConverter<OutputT, InputT> converter)
Sets a callback to be invoked to convert a ERROR(/Packet) list to a task result object and a task input object.
void
setResultListener(ResultListener<OutputT, InputT> listener)
Sets a callback to be invoked when task result objects become available.

Inherited Methods

Public Constructors

public OutputHandler ()

Public Methods

public long getLatestOutputTimestamp ()

public OutputT retrieveCachedTaskResult ()

public void setErrorListener (ErrorListener listener)

Sets a callback to be invoked when exceptions are thrown from the task graph.

Parameters
listener The user-defined ErrorListener callback.

public void setHandleTimestampBoundChanges (boolean handleTimestampBoundChanges)

Sets whether the output handler should react to the timestamp bound changes that are reprsented as empty output ERROR(/Packet)s.

Parameters
handleTimestampBoundChanges A boolean value.

public void setOutputPacketConverter (OutputPacketConverter<OutputT, InputT> converter)

Sets a callback to be invoked to convert a ERROR(/Packet) list to a task result object and a task input object.

Parameters
converter the task-specific OutputHandler.OutputPacketConverter callback.

public void setResultListener (ResultListener<OutputT, InputT> listener)

Sets a callback to be invoked when task result objects become available.

Parameters
listener the user-defined OutputHandler.ResultListener callback.