Interface HMSVideoPlugin
-
- All Implemented Interfaces:
public interface HMSVideoPluginA plugin implementing this interface can be registered with HMSStreamFactory to transform, process or analyze the videoFrame. These can include applications like video filters, virtual background, live analysis of video etc. The below functions are required for the sdk to properly use the plugin, usually the plugin would also be exposing some public functions of its own for the UI to control its working.
-
-
Method Summary
Modifier and Type Method Description abstract StringgetName()The name is meant to uniquely specify a plugin instance. abstract BooleanisSupported()This function will be called before the call to init, it is used to check whether the plugin supports current OS and device or not. abstract Unitinit()This function will be called in the beginning for initialization which may include tasks like setting up variables, loading ML models etc. abstract HMSVideoPluginTypegetPluginType()abstract UnitprocessVideoFrame(VideoFrame input, HMSPluginResultListener outputListener, Boolean skipProcessing)This function will be called by the SDK for every video frame which the plugin needs to process. abstract Unitstop()the plugin can use this function to dispose off its resources. UnitsetKey(String key)-
-
Method Detail
-
getName
abstract String getName()
The name is meant to uniquely specify a plugin instance. This will be used to track number of plugins added, and same name won't be allowed twice.
-
isSupported
abstract Boolean isSupported()
This function will be called before the call to init, it is used to check whether the plugin supports current OS and device or not. An error will be thrown back to the user if they try to use an unsupported plugin.
-
init
abstract Unit init()
This function will be called in the beginning for initialization which may include tasks like setting up variables, loading ML models etc. This can be used by a plugin to ensure it's prepared at the time processVideoFrame is called.
-
getPluginType
abstract HMSVideoPluginType getPluginType()
-
processVideoFrame
abstract Unit processVideoFrame(VideoFrame input, HMSPluginResultListener outputListener, Boolean skipProcessing)
This function will be called by the SDK for every video frame which the plugin needs to process.
- Parameters:
input- input videoFrame containing the input frameoutputListener-HMSActionResultListenerwhich is a callback object needed to inform about output VideoFrame and time Taken to receive itskipProcessing- use results from previous run if true
-
stop
abstract Unit stop()
the plugin can use this function to dispose off its resources. It'll be called when the processor instance is no longer needed at the end.
-
-
-
-