Interface IStreamRecorder


public interface IStreamRecorder
This interface provides access to into a StreamRecorder.
The StreamRecorder is responsible for performing the actual recording functionality of a live stream, as directed by the LiveStreamRecordManager.
  • Method Summary

    Modifier and Type
    Method
    Description
    Called to add a listener for IStreamRecorderActionNotify events generated by the recorder.
    Multiple listeners can be added.
    void
    Called to tell the recorder to initalize itself after it has been created.
    Called to get the application Instance the recorder is associated with
    Called to get the full path and filename used by the recorder as the PRIOR to any changes made due to the selected segmentationType and versioningOption.
    long
    Called to get the current segment duration regardless of segmentationType.
    This value is updated continuously while the recorder state is RECORDER_STATE_RECORDING.
    Called to get the current segments fully qualified file name regardless of segmentationType.
    This value is updated continuously while the recorder state is RECORDER_STATE_RECORDING.
    long
    Called to get the current segment size regardless of segmentationType
    This value is updated continuously while the recorder state is RECORDER_STATE_RECORDING.
    org.joda.time.DateTime
    Called to get the end time of the recording regardless of segmentationType.
    When the recording is still active, the returned value is null.
    When the recording has been stopped, the returned value is for the time when the recording stopped.
    Called to get an error string describing the error, when the recorder state is is RECORDER_STATE_ERROR.
    Called to get output file format being used by the recorder.
    Called to get the full path and filename used by the recorder AFTER changes made due to the selected segmentationType and versioningOption.
    NOTE: When the recorder is not in RECORDER_STATE_RECORDING state, the returned value will be the basefilePath value.
    Called to get the IStreamRecorderFileVersionDelegate being used by the recorder.
    Called to get the StreamRecorderParameters for the recorder
    This is typically used to check or set the StreamRecorderParameters used to configure a recorder.
    int
    Called to get the current state of the recorder
    Called to get the current state of the recorder as a text string.
    Called to get the SegmentationType being used by the recorder.
    long
    Called to get the segment duration used by the recorder when segmentationType is set to SEGMENT_BY_DURATION.
    int
    Called to get the current segment number regardless of segmentationType.
    This value is updated continuously while the recorder state is RECORDER_STATE_RECORDING.
    Called to get the segment schedule crontab string used by the recorder when segmentationType is set to SEGMENT_BY_SCHEDULE.
    long
    Called to get the segment size used by the recorder when segmentationType is set to SEGMENT_BY_SIZE.
    org.joda.time.DateTime
    Called to get the start time of the current recording regardless of segmentationType.
    Called to get the IMediaStream object being used by the recorder
    Called to get the stream name being used by the recorder
    Called to get the method used by the recorder to version a file when a file exists of the same name.
    boolean
    Called to check the value of MoveFirstVideoFrameToZero being used by the recorder.
    boolean
    Called to check the value of RecordData being used by the recorder.
    boolean
    Called to check the value of splitOnTcDiscontinuity being used by the recorder.
    boolean
    Called to check the value of StartOnKeyFrame being used by the recorder.
    boolean
    Called to remove a listener from the the recorder.
    void
    Called to set the IMediaStream object the recorder will use
    NOTE: This method is used by LiveStreamRecordManager to manage recorders and associated IMediaStream objects and should NOT be used directly when a StreamRecorder is under the control of LiveStreamRecordManager
    void
    Called to tell the recorder to stop writing to the current file, create a new file and write begin writing data to the new file.
    The recorder should start writing data to the new file beginning with a video key frame.
    void
    Called to tell the recorder to start recording.
    void
    Called to tell the recorder to stop recording.
    void
    Called to tell the recorder to switch over to the data from a new IMediaStream.
    This occurs when an existing stream is replaced with a stream of the same name.
  • Method Details

    • createRecorder

      void createRecorder()
      Called to tell the recorder to initalize itself after it has been created. This API should be called prior to calling the startRecorder() method.
    • startRecorder

      void startRecorder()
      Called to tell the recorder to start recording. This API should be called after createRecorder() method has been called to ensure the recorder has been properly initialized
    • switchRecorder

      void switchRecorder(IMediaStream newStream)
      Called to tell the recorder to switch over to the data from a new IMediaStream.
      This occurs when an existing stream is replaced with a stream of the same name.

      For example: When a stream is published from an encoder, and then a different encoder publishes a stream using the same stream name. Called before LiveStreamRecordManager calls the recorders own switchRecorder method.

      Parameters:
      newStream - The new IMediaStream the recorder should switch to.
    • stopRecorder

      void stopRecorder()
      Called to tell the recorder to stop recording.
    • splitRecorder

      void splitRecorder()
      Called to tell the recorder to stop writing to the current file, create a new file and write begin writing data to the new file.
      The recorder should start writing data to the new file beginning with a video key frame.
    • getRecorderParams

      StreamRecorderParameters getRecorderParams()
      Called to get the StreamRecorderParameters for the recorder
      This is typically used to check or set the StreamRecorderParameters used to configure a recorder. To get the actual value used by the recorder, use the appropriate get method found below.

      See Also:
    • getAppInstance

      IApplicationInstance getAppInstance()
      Called to get the application Instance the recorder is associated with

      Returns:
      IApplicationInstance
    • getStreamName

      String getStreamName()
      Called to get the stream name being used by the recorder

      Returns:
      String Stream name
    • getStream

      IMediaStream getStream()
      Called to get the IMediaStream object being used by the recorder

      Returns:
      IMediaStream Stream object
    • setStream

      void setStream(IMediaStream stream)
      Called to set the IMediaStream object the recorder will use
      NOTE: This method is used by LiveStreamRecordManager to manage recorders and associated IMediaStream objects and should NOT be used directly when a StreamRecorder is under the control of LiveStreamRecordManager

      Parameters:
      stream - IMediaStream The new Stream object
    • getRecorderState

      int getRecorderState()
      Called to get the current state of the recorder

      Returns:
      int Current state

      See Also:
    • getRecorderStateString

      String getRecorderStateString()
      Called to get the current state of the recorder as a text string.

      Returns:
      String Current state as a string

      See Also:
    • getFileFormat

      String getFileFormat()
      Called to get output file format being used by the recorder.

      Returns:
      String Output file format

      See Also:
    • isStartOnKeyFrame

      boolean isStartOnKeyFrame()
      Called to check the value of StartOnKeyFrame being used by the recorder.

      Returns:
      boolean true, false

      See Also:
    • isRecordData

      boolean isRecordData()
      Called to check the value of RecordData being used by the recorder.

      Returns:
      boolean true, false

      See Also:
    • isSplitOnTcDiscontinuity

      boolean isSplitOnTcDiscontinuity()
      Called to check the value of splitOnTcDiscontinuity being used by the recorder.

      Returns:
      boolean true, false

      See Also:
    • isMoveFirstVideoFrameToZero

      boolean isMoveFirstVideoFrameToZero()
      Called to check the value of MoveFirstVideoFrameToZero being used by the recorder.

      Returns:
      boolean true, false

      See Also:
    • getSegmentationType

      String getSegmentationType()
      Called to get the SegmentationType being used by the recorder.

      Returns:
      String Segmentation type

      See Also:
    • getVersioningOption

      String getVersioningOption()
      Called to get the method used by the recorder to version a file when a file exists of the same name.

      Returns:
      String Versioning option

      See Also:
    • getSegmentSize

      long getSegmentSize()
      Called to get the segment size used by the recorder when segmentationType is set to SEGMENT_BY_SIZE.

      Returns:
      long Segment size in bytes

      See Also:
    • getSegmentDuration

      long getSegmentDuration()
      Called to get the segment duration used by the recorder when segmentationType is set to SEGMENT_BY_DURATION.

      Returns:
      long Segment duration in milliseconds

      See Also:
    • getSegmentScheduleString

      String getSegmentScheduleString()
      Called to get the segment schedule crontab string used by the recorder when segmentationType is set to SEGMENT_BY_SCHEDULE.

      Returns:
      String Segment schedule

      See Also:
    • getFilePath

      String getFilePath()
      Called to get the full path and filename used by the recorder AFTER changes made due to the selected segmentationType and versioningOption.
      NOTE: When the recorder is not in RECORDER_STATE_RECORDING state, the returned value will be the basefilePath value.

      Returns:
      String Full path and filename

      See Also:
    • getBaseFilePath

      String getBaseFilePath()
      Called to get the full path and filename used by the recorder as the PRIOR to any changes made due to the selected segmentationType and versioningOption.

      Returns:
      String Full path and filename

      See Also:
    • getCurrentSize

      long getCurrentSize()
      Called to get the current segment size regardless of segmentationType
      This value is updated continuously while the recorder state is RECORDER_STATE_RECORDING.

      Returns:
      long Segment size in bytes
    • getCurrentDuration

      long getCurrentDuration()
      Called to get the current segment duration regardless of segmentationType.
      This value is updated continuously while the recorder state is RECORDER_STATE_RECORDING.

      Returns:
      long Segment duration in milliseconds
    • getCurrentFile

      String getCurrentFile()
      Called to get the current segments fully qualified file name regardless of segmentationType.
      This value is updated continuously while the recorder state is RECORDER_STATE_RECORDING.

      Returns:
      String The current fully qualified file name, packets are being written to.
    • getSegmentNumber

      int getSegmentNumber()
      Called to get the current segment number regardless of segmentationType.
      This value is updated continuously while the recorder state is RECORDER_STATE_RECORDING.

      Returns:
      int Current segment number.
    • getStartTime

      org.joda.time.DateTime getStartTime()
      Called to get the start time of the current recording regardless of segmentationType.

      Returns:
      DateTime Current segment's start time.
    • getEndTime

      org.joda.time.DateTime getEndTime()
      Called to get the end time of the recording regardless of segmentationType.
      When the recording is still active, the returned value is null.
      When the recording has been stopped, the returned value is for the time when the recording stopped.

      Returns:
      DateTime Segment end time.
    • getErrorString

      String getErrorString()
      Called to get an error string describing the error, when the recorder state is is RECORDER_STATE_ERROR.

      Returns:
      String Error description string
    • getFileVersionDelegate

      IStreamRecorderFileVersionDelegate getFileVersionDelegate()
      Called to get the IStreamRecorderFileVersionDelegate being used by the recorder.

      Returns:
      IStreamRecorderFileVersionDelegate

      See Also:
    • addListener

      Called to add a listener for IStreamRecorderActionNotify events generated by the recorder.
      Multiple listeners can be added. All listeners will be called for each event, in the order in which they were added.

      Parameters:
      listener - An object which implements the IStreamRecorderActionNotify interface
      Returns:
      IStreamRecorderActionNotify The listener object passed in.

      See Also:
    • removeListener

      boolean removeListener(IStreamRecorderActionNotify listener)
      Called to remove a listener from the the recorder.

      Parameters:
      listener - The listener which is to be removed
      Returns:
      boolean true, if listener was found in list, else false