Module vcr4j.core
Package org.mbari.vcr4j
Class SimpleVideoIO<S extends VideoState,E extends VideoError>
java.lang.Object
org.mbari.vcr4j.SimpleVideoIO<S,E>
- All Implemented Interfaces:
Closeable,AutoCloseable,VideoIO<S,E>
public class SimpleVideoIO<S extends VideoState,E extends VideoError>
extends Object
implements VideoIO<S,E>
Sometimes you need a VideoIO object that is an amalgam of observables from different sources.
This class provides a way assemble a VideoIO object using disparate observables
- Since:
- 2016-04-04T16:07:00
- Author:
- Brian Schlining
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleVideoIO(String connectionID, io.reactivex.rxjava3.subjects.Subject<VideoCommand<?>> commandSubject, io.reactivex.rxjava3.core.Observable<S> stateObservable, io.reactivex.rxjava3.core.Observable<E> errorObservable, io.reactivex.rxjava3.core.Observable<VideoIndex> indexObservable) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the video io and free it's resources.io.reactivex.rxjava3.subjects.Subject<VideoCommand<?>>We foresee needing to chain several VideoIO services together.io.reactivex.rxjava3.core.Observable<E>All errors that occur will be sent to this observableio.reactivex.rxjava3.core.Observable<VideoIndex>io.reactivex.rxjava3.core.Observable<S>Listen to this observable for responses to status requests<A extends VideoCommand<?>>
voidsend(A videoCommand) Send a command to the video player
-
Constructor Details
-
SimpleVideoIO
public SimpleVideoIO(String connectionID, io.reactivex.rxjava3.subjects.Subject<VideoCommand<?>> commandSubject, io.reactivex.rxjava3.core.Observable<S> stateObservable, io.reactivex.rxjava3.core.Observable<E> errorObservable, io.reactivex.rxjava3.core.Observable<VideoIndex> indexObservable)
-
-
Method Details
-
getCommandSubject
Description copied from interface:VideoIOWe foresee needing to chain several VideoIO services together. The current plan is to use RX to monitor commands sent between different services so that one may augment anothers capabilities. For example, we may talk to a video player, but also need to fetch information from a Media Asset Manager simultaneously to get recorded dates for each frame.- Specified by:
getCommandSubjectin interfaceVideoIO<S extends VideoState,E extends VideoError> - Returns:
- A Subject that is the pipeline for all commands sent to the VideoIO provider
-
getErrorObservable
Description copied from interface:VideoIOAll errors that occur will be sent to this observable- Specified by:
getErrorObservablein interfaceVideoIO<S extends VideoState,E extends VideoError> - Returns:
- stream of errors
-
getIndexObservable
- Specified by:
getIndexObservablein interfaceVideoIO<S extends VideoState,E extends VideoError> - Returns:
- THis observable streams timecode/elapsedtime/timestamp responses.
-
getStateObservable
Description copied from interface:VideoIOListen to this observable for responses to status requests- Specified by:
getStateObservablein interfaceVideoIO<S extends VideoState,E extends VideoError> - Returns:
- Status stream
-
close
public void close()Description copied from interface:VideoIOClose the video io and free it's resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceVideoIO<S extends VideoState,E extends VideoError>
-
send
Description copied from interface:VideoIOSend a command to the video player- Specified by:
sendin interfaceVideoIO<S extends VideoState,E extends VideoError> - Type Parameters:
A- The type of the video Command- Parameters:
videoCommand- The command to send
-
getConnectionID
- Specified by:
getConnectionIDin interfaceVideoIO<S extends VideoState,E extends VideoError> - Returns:
- A string unique to the particular video io connection
-