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.ProgressListener<OutputT> | Interface for the customizable MediaPipe task result listener that receives partial task
updates until it is invoked with `done` set to true . |
|
interface | OutputHandler.PureResultListener<OutputT extends TaskResult> | Interface for the customizable MediaPipe task result listener that can only retrieve task result objects. | |
interface | OutputHandler.ResultListener<OutputT extends TaskResult, InputT> | Interface for the customizable MediaPipe task result listener that can retrieve both task result objects and the corresponding input data. | |
interface | OutputHandler.ValueListener<OutputT> | Interface for the customizable MediaPipe task result listener that only receives a task's output value. |
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
represented 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
represented 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.
|
---|