Class RecordingListener

java.lang.Object
org.red5.server.stream.RecordingListener
All Implemented Interfaces:
IStreamListener, IRecordingListener

public class RecordingListener extends Object implements IRecordingListener
Stream listener for recording stream events to a file.
Author:
Paul Gregoire (mondain@gmail.com)
  • Constructor Details

    • RecordingListener

      public RecordingListener()
  • Method Details

    • getRecordFile

      public static File getRecordFile(IScope scope, String name)
      Get the file we'd be recording to based on scope and given name.
      Parameters:
      scope - scope
      name - name
      Returns:
      file
    • init

      public boolean init(IConnection conn, String name, boolean isAppend)
      Initialize the listener.
      Specified by:
      init in interface IRecordingListener
      Parameters:
      conn - Stream source connection
      name - Stream name
      isAppend - Append mode
      Returns:
      true if initialization completes and false otherwise
    • init

      public boolean init(IScope scope, String name, boolean isAppend)
      Initialize the listener.
      Specified by:
      init in interface IRecordingListener
      Parameters:
      scope - Stream source scope
      name - Stream name
      isAppend - Append mode
      Returns:
      true if initialization completes and false otherwise
    • start

      public void start()
      Start the recording.
      Specified by:
      start in interface IRecordingListener
    • stop

      public void stop()
      Stop the recording.
      Specified by:
      stop in interface IRecordingListener
    • packetReceived

      public void packetReceived(IBroadcastStream stream, IStreamPacket packet)
      A packet has been received from a stream.
      Specified by:
      packetReceived in interface IRecordingListener
      Specified by:
      packetReceived in interface IStreamListener
      Parameters:
      stream - the stream the packet has been received for
      packet - the packet received
    • isRecording

      public boolean isRecording()
      Specified by:
      isRecording in interface IRecordingListener
      Returns:
      recording state, true if recording and false otherwise
    • isAppending

      public boolean isAppending()
      Specified by:
      isAppending in interface IRecordingListener
      Returns:
      appending state, true if appending and false otherwise
    • getFileConsumer

      public FileConsumer getFileConsumer()
      Specified by:
      getFileConsumer in interface IRecordingListener
      Returns:
      the recordingConsumer
    • setFileConsumer

      public void setFileConsumer(FileConsumer recordingConsumer)
      Specified by:
      setFileConsumer in interface IRecordingListener
      Parameters:
      recordingConsumer - the recordingConsumer to set
    • getFileName

      public String getFileName()
      Specified by:
      getFileName in interface IRecordingListener
      Returns:
      the fileName
    • setFileName

      public void setFileName(String fileName)
      Specified by:
      setFileName in interface IRecordingListener
      Parameters:
      fileName - the fileName to set