Interface VideoBackend
- All Superinterfaces:
AlgorithmProvider, Backend, ComputeBackend, VideoAlgorithmProvider
- All Known Implementing Classes:
JavaCVMediaBackend, MulticoreVideoBackend, NativeJavaCVMediaBackend, NativeVideoBackend, VLCJMediaBackend
Universal interface for video backends (playback, frame grabbing, analysis).
- Since:
- 2.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptiondefault ObjectCreates and returns the backend instance (or returns self if it is the backend).default ExecutionContextCreates an execution context for running operations.default HardwareAcceleratorReturns the type of hardware accelerator used by this backend.Returns the friendly name of this backend instance.default StringReturns a description of the backend.doubledefault StringgetId()Returns the unique identifier for this backend (e.g., "javafx", "jmol", "cuda").default StringgetName()Returns the display name for UI presentation.default intReturns the priority for auto-selection (higher = preferred).doublegetTime()default StringgetType()Returns the backend type category (e.g., "plotting", "molecular", "tensor", "math").<T> TGrabs the current frame as an image.default booleanChecks if this backend is currently available (libraries loaded, etc.).voidLoads a video resource.voidpause()voidplay()default voidshutdown()Called when the application is shutting down or the backend is being replaced.voidstop()Methods inherited from interface AlgorithmProvider
description, getMetadata, scoreMethods inherited from interface Backend
getAlgorithmProviders, getStatusMessage, isExplicitlyDisabledMethods inherited from interface ComputeBackend
supportsComplexNumbers, supportsFloatingPoint, supportsParallelOpsMethods inherited from interface VideoAlgorithmProvider
detectMotion, detectTransitions, getAlgorithmType
-
Method Details
-
getType
-
createContext
Description copied from interface:ComputeBackendCreates an execution context for running operations.The context should be used within a try-with-resources block to ensure proper cleanup of resources.
- Specified by:
createContextin interfaceComputeBackend- Returns:
- new execution context
-
getAcceleratorType
Description copied from interface:ComputeBackendReturns the type of hardware accelerator used by this backend.- Specified by:
getAcceleratorTypein interfaceComputeBackend- Returns:
- the accelerator type
-
getName
Description copied from interface:BackendReturns the display name for UI presentation.- Specified by:
getNamein interfaceAlgorithmProvider- Specified by:
getNamein interfaceBackend- Specified by:
getNamein interfaceVideoAlgorithmProvider
-
load
-
play
void play() -
pause
void pause() -
stop
void stop() -
getTime
double getTime() -
getDuration
double getDuration() -
grabFrame
<T> T grabFrame()Grabs the current frame as an image.- Type Parameters:
T- the image type- Returns:
- the current frame
-
getBackendName
String getBackendName()Returns the friendly name of this backend instance. -
getId
-
getDescription
Description copied from interface:BackendReturns a description of the backend.- Specified by:
getDescriptionin interfaceBackend- Specified by:
getDescriptionin interfaceComputeBackend
-
getPriority
default int getPriority()Description copied from interface:BackendReturns the priority for auto-selection (higher = preferred). Used when multiple backends are available.- Specified by:
getPriorityin interfaceAlgorithmProvider- Specified by:
getPriorityin interfaceBackend
-
isAvailable
default boolean isAvailable()Description copied from interface:BackendChecks if this backend is currently available (libraries loaded, etc.).Default implementation checks
Backend.isExplicitlyDisabled()and returns false if it is.- Specified by:
isAvailablein interfaceAlgorithmProvider- Specified by:
isAvailablein interfaceBackend
-
shutdown
default void shutdown()Description copied from interface:BackendCalled when the application is shutting down or the backend is being replaced. Use this to release hardware resources, close file handles, or stop background threads.- Specified by:
shutdownin interfaceAlgorithmProvider- Specified by:
shutdownin interfaceBackend
-
createBackend
Description copied from interface:BackendCreates and returns the backend instance (or returns self if it is the backend).- Specified by:
createBackendin interfaceBackend- Specified by:
createBackendin interfaceComputeBackend- Returns:
- The backend implementation object
-