Module vcr4j.core
Package org.mbari.vcr4j.decorators
Class SchedulerVideoIO<S extends VideoState,E extends VideoError>
java.lang.Object
org.mbari.vcr4j.decorators.SchedulerVideoIO<S,E>
- All Implemented Interfaces:
Closeable,AutoCloseable,Decorator,VideoIO<S,E>
public class SchedulerVideoIO<S extends VideoState,E extends VideoError>
extends Object
implements VideoIO<S,E>, Decorator
Decorator that moves the IO off of the currently executing thread. All commands are sent from a single
independent thread (not managed by any scheduler or executor). All other observables have their state
dealt with on the Executor or Scheduler that you provide.
- Since:
- 2016-02-11T14:38:00
- Author:
- Brian Schlining
-
Constructor Summary
ConstructorsConstructorDescriptionSchedulerVideoIO(VideoIO<S, E> io, io.reactivex.rxjava3.core.Scheduler scheduler) SchedulerVideoIO(VideoIO<S, E> io, Executor executor) -
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 requestsvoidsend(VideoCommand videoCommand) Send a command to the video playervoidTells the decorator to unsubscribe from all Observables that it is watching.
-
Constructor Details
-
SchedulerVideoIO
-
SchedulerVideoIO
-
-
Method Details
-
unsubscribe
public void unsubscribe()Description copied from interface:DecoratorTells the decorator to unsubscribe from all Observables that it is watching.- Specified by:
unsubscribein interfaceDecorator
-
send
Description copied from interface:VideoIOSend a command to the video player- Specified by:
sendin interfaceVideoIO<S extends VideoState,E extends VideoError> - Parameters:
videoCommand- The command to send
-
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
-
getConnectionID
- Specified by:
getConnectionIDin interfaceVideoIO<S extends VideoState,E extends VideoError> - Returns:
- A string unique to the particular video io connection
-
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>
-
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
-
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
-
getIndexObservable
- Specified by:
getIndexObservablein interfaceVideoIO<S extends VideoState,E extends VideoError> - Returns:
- THis observable streams timecode/elapsedtime/timestamp responses.
-