org.red5.server.stream
Class RecordingListener

java.lang.Object
  extended by org.red5.server.stream.RecordingListener
All Implemented Interfaces:
IStreamListener

public class RecordingListener
extends Object
implements IStreamListener

Stream listener for recording stream events to a file.

Author:
Paul Gregoire ([email protected])

Constructor Summary
RecordingListener()
           
 
Method Summary
 void closeStream()
           
 FileConsumer getFileConsumer()
           
 String getFileName()
           
static File getRecordFile(IScope scope, String name)
          Get the file we'd be recording to based on scope and given name.
 boolean init(IConnection conn, String name, boolean isAppend)
          Initialize the listener.
 boolean isAppending()
           
 boolean isRecording()
           
 void packetReceived(IBroadcastStream stream, IStreamPacket packet)
          A packet has been received from a stream.
 void setFileConsumer(FileConsumer recordingConsumer)
           
 void setFileName(String fileName)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordingListener

public RecordingListener()
Method Detail

init

public boolean init(IConnection conn,
                    String name,
                    boolean isAppend)
Initialize the listener.

Parameters:
conn - Stream source connection
name - Stream name
isAppend - Append mode
Returns:
true if initialization completes and false otherwise

start

public void start()

packetReceived

public void packetReceived(IBroadcastStream stream,
                           IStreamPacket packet)
Description copied from interface: IStreamListener
A packet has been received from a stream.

Specified by:
packetReceived in interface IStreamListener
Parameters:
stream - the stream the packet has been received for
packet - the packet received

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 -
name -
Returns:
file

closeStream

public void closeStream()

isRecording

public boolean isRecording()
Returns:
the recording

isAppending

public boolean isAppending()
Returns:
the appending

getFileConsumer

public FileConsumer getFileConsumer()
Returns:
the recordingConsumer

setFileConsumer

public void setFileConsumer(FileConsumer recordingConsumer)
Parameters:
recordingConsumer - the recordingConsumer to set

getFileName

public String getFileName()
Returns:
the fileName

setFileName

public void setFileName(String fileName)
Parameters:
fileName - the fileName to set


Copyright © 2006-2012 The Red5 Project