Module vcr4j.core

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 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

      public io.reactivex.rxjava3.subjects.Subject<VideoCommand<?>> getCommandSubject()
      Description copied from interface: VideoIO
      We 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:
      getCommandSubject in interface VideoIO<S extends VideoState,E extends VideoError>
      Returns:
      A Subject that is the pipeline for all commands sent to the VideoIO provider
    • getErrorObservable

      public io.reactivex.rxjava3.core.Observable<E> getErrorObservable()
      Description copied from interface: VideoIO
      All errors that occur will be sent to this observable
      Specified by:
      getErrorObservable in interface VideoIO<S extends VideoState,E extends VideoError>
      Returns:
      stream of errors
    • getIndexObservable

      public io.reactivex.rxjava3.core.Observable<VideoIndex> getIndexObservable()
      Specified by:
      getIndexObservable in interface VideoIO<S extends VideoState,E extends VideoError>
      Returns:
      THis observable streams timecode/elapsedtime/timestamp responses.
    • getStateObservable

      public io.reactivex.rxjava3.core.Observable<S> getStateObservable()
      Description copied from interface: VideoIO
      Listen to this observable for responses to status requests
      Specified by:
      getStateObservable in interface VideoIO<S extends VideoState,E extends VideoError>
      Returns:
      Status stream
    • close

      public void close()
      Description copied from interface: VideoIO
      Close the video io and free it's resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface VideoIO<S extends VideoState,E extends VideoError>
    • send

      public <A extends VideoCommand<?>> void send(A videoCommand)
      Description copied from interface: VideoIO
      Send a command to the video player
      Specified by:
      send in interface VideoIO<S extends VideoState,E extends VideoError>
      Type Parameters:
      A - The type of the video Command
      Parameters:
      videoCommand - The command to send
    • getConnectionID

      public String getConnectionID()
      Specified by:
      getConnectionID in interface VideoIO<S extends VideoState,E extends VideoError>
      Returns:
      A string unique to the particular video io connection