|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.server.stream.AbstractStream
org.red5.server.stream.AbstractClientStream
org.red5.server.stream.ClientBroadcastStream
@ManagedResource(objectName="org.red5.server:type=ClientBroadcastStream", description="ClientBroadcastStream") public class ClientBroadcastStream
Represents live stream broadcasted from client. As Flash Media Server, Red5 supports recording mode for live streams, that is, broadcasted stream has broadcast mode. It can be either "live" or "record" and latter causes server-side application to record broadcasted stream. Note that recorded streams are recorded as FLV files. The same is correct for audio, because NellyMoser codec that Flash Player uses prohibits on-the-fly transcoding to audio formats like MP3 without paying of licensing fee or buying SDK. This type of stream uses two different pipes for live streaming and recording.
Field Summary | |
---|---|
protected boolean |
automaticRecording
Whether or not to automatically record the associated stream. |
protected long |
bytesReceived
Total number of bytes received. |
protected boolean |
checkAudioCodec
Is there need to check audio codec? |
protected boolean |
checkVideoCodec
Is there need to check video codec? |
protected int |
chunkSize
Data is sent by chunks, each of them has size |
protected boolean |
closed
Is this stream still active? |
protected IMessageOutput |
connMsgOut
Output endpoint that providers use |
protected long |
firstPacketTime
Stores timestamp of first packet |
protected long |
latestTimeStamp
|
protected Set<IStreamListener> |
listeners
Listeners to get notified about received packets. |
protected IPipe |
livePipe
Pipe for live streaming |
protected Map<String,String> |
parameters
Streaming parameters |
protected String |
publishedName
Stream published name |
protected boolean |
sendStartNotification
Is there need to send start notification? |
Fields inherited from class org.red5.server.stream.AbstractStream |
---|
creationTime, lock, metaData, state |
Fields inherited from interface org.red5.server.api.stream.IClientStream |
---|
MODE_APPEND, MODE_LIVE, MODE_PUBLISH, MODE_READ, MODE_RECORD |
Fields inherited from interface org.red5.server.messaging.IPushableConsumer |
---|
KEY |
Constructor Summary | |
---|---|
ClientBroadcastStream()
|
Method Summary | |
---|---|
void |
addStreamListener(IStreamListener listener)
Add a listener to be notified about received packets. |
void |
close()
Closes stream, unsubscribes provides, sends stoppage notifications and broadcast close notification. |
void |
dispatchEvent(IEvent event)
Dispatches event |
int |
getActiveSubscribers()
Return current number of subscribers. |
long |
getBytesReceived()
Return total number of bytes received from client for this stream. |
int |
getCurrentTimestamp()
Return the currently active timestamp inside the stream. |
int |
getMaxSubscribers()
Return maximum number of concurrent subscribers. |
Map<String,String> |
getParameters()
Returns streaming parameters. |
IProvider |
getProvider()
Getter for provider |
String |
getPublishedName()
Getter for published name |
protected File |
getRecordFile(IScope scope,
String name)
Get the file we'd be recording to based on scope and given name. |
String |
getSaveFilename()
Get the filename the stream is being saved as. |
IClientBroadcastStreamStatistics |
getStatistics()
Return statistics about the stream. |
Collection<IStreamListener> |
getStreamListeners()
Return registered stream listeners. |
int |
getTotalSubscribers()
Return total number of subscribers. |
boolean |
isAutomaticRecording()
|
boolean |
isRecording()
|
void |
onOOBControlMessage(IMessageComponent source,
IPipe pipe,
OOBControlMessage oobCtrlMsg)
Out-of-band control message handler |
void |
onPipeConnectionEvent(PipeConnectionEvent event)
Pipe connection event handler |
void |
pushMessage(IPipe pipe,
IMessage message)
Currently not implemented |
protected void |
registerJMX()
|
void |
removeStreamListener(IStreamListener listener)
Remove a listener from being notified about received packets. |
void |
saveAs(String name,
boolean isAppend)
Save broadcasted stream. |
void |
setAutomaticRecording(boolean automaticRecording)
|
void |
setParameters(Map<String,String> params)
Sets streaming parameters as supplied by the publishing application. |
void |
setPublishedName(String name)
Setter for stream published name |
void |
start()
Starts stream. |
void |
startPublishing()
Notify client that stream is ready for publishing. |
void |
stop()
Stop this stream. |
void |
stopRecording()
Stops any currently active recordings. |
protected void |
unregisterJMX()
|
Methods inherited from class org.red5.server.stream.AbstractClientStream |
---|
getBroadcastStreamPublishName, getClientBufferDuration, getConnection, getStreamId, setBroadcastStreamPublishName, setClientBufferDuration, setConnection, setStreamId |
Methods inherited from class org.red5.server.stream.AbstractStream |
---|
getCodecInfo, getCreationTime, getMetaData, getName, getScope, getState, getStreamAwareHandler, setCodecInfo, setName, setScope, setState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.red5.server.api.stream.IClientStream |
---|
getBroadcastStreamPublishName, getClientBufferDuration, getConnection, getStreamId, setClientBufferDuration |
Methods inherited from interface org.red5.server.api.stream.IBroadcastStream |
---|
getMetaData |
Methods inherited from interface org.red5.server.api.stream.IStream |
---|
getCodecInfo, getCreationTime, getName, getScope |
Methods inherited from interface org.red5.server.api.statistics.IStatisticsBase |
---|
getCreationTime |
Field Detail |
---|
protected boolean automaticRecording
protected long bytesReceived
protected boolean checkVideoCodec
protected boolean checkAudioCodec
protected int chunkSize
protected volatile boolean closed
protected IMessageOutput connMsgOut
protected long firstPacketTime
protected IPipe livePipe
protected String publishedName
protected Map<String,String> parameters
protected boolean sendStartNotification
protected Set<IStreamListener> listeners
protected long latestTimeStamp
Constructor Detail |
---|
public ClientBroadcastStream()
Method Detail |
---|
public void close()
close
in interface IStream
close
in interface ClientBroadcastStreamMXBean
public void dispatchEvent(IEvent event)
dispatchEvent
in interface IEventDispatcher
event
- Event to dispatchpublic int getActiveSubscribers()
getActiveSubscribers
in interface IClientBroadcastStreamStatistics
public long getBytesReceived()
getBytesReceived
in interface IClientBroadcastStreamStatistics
public int getCurrentTimestamp()
getCurrentTimestamp
in interface IStreamStatistics
public int getMaxSubscribers()
getMaxSubscribers
in interface IClientBroadcastStreamStatistics
public IProvider getProvider()
getProvider
in interface IBroadcastStream
public void setPublishedName(String name)
setPublishedName
in interface IBroadcastStream
setPublishedName
in interface ClientBroadcastStreamMXBean
name
- Name that used for publishing. Set at client side when begin to broadcast with NetStream#publish.public String getPublishedName()
getPublishedName
in interface IClientBroadcastStreamStatistics
getPublishedName
in interface IBroadcastStream
getPublishedName
in interface ClientBroadcastStreamMXBean
public void setParameters(Map<String,String> params)
setParameters
in interface IClientBroadcastStream
public Map<String,String> getParameters()
getParameters
in interface IClientBroadcastStream
public String getSaveFilename()
getSaveFilename
in interface IClientBroadcastStreamStatistics
getSaveFilename
in interface IBroadcastStream
getSaveFilename
in interface ClientBroadcastStreamMXBean
null
if the stream is not being saved.public IClientBroadcastStreamStatistics getStatistics()
getStatistics
in interface IClientBroadcastStream
public int getTotalSubscribers()
getTotalSubscribers
in interface IClientBroadcastStreamStatistics
public boolean isAutomaticRecording()
public void setAutomaticRecording(boolean automaticRecording)
automaticRecording
- the automaticRecording to setpublic void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg)
onOOBControlMessage
in interface IMessageComponent
source
- OOB message sourcepipe
- Pipe that used to send OOB messageoobCtrlMsg
- Out-of-band control messagepublic void onPipeConnectionEvent(PipeConnectionEvent event)
onPipeConnectionEvent
in interface IPipeConnectionListener
event
- Pipe connection eventpublic void pushMessage(IPipe pipe, IMessage message)
pushMessage
in interface IPushableConsumer
pipe
- Pipemessage
- Messagepublic void saveAs(String name, boolean isAppend) throws IOException
saveAs
in interface IBroadcastStream
saveAs
in interface ClientBroadcastStreamMXBean
name
- Stream nameisAppend
- Append mode
IOException
- File could not be created/written topublic void start()
start
in interface IStream
start
in interface ClientBroadcastStreamMXBean
public void startPublishing()
startPublishing
in interface IClientBroadcastStream
startPublishing
in interface ClientBroadcastStreamMXBean
public void stop()
stop
in interface IStream
stop
in interface ClientBroadcastStreamMXBean
public void stopRecording()
public boolean isRecording()
public void addStreamListener(IStreamListener listener)
addStreamListener
in interface IBroadcastStream
listener
- the listener to addpublic Collection<IStreamListener> getStreamListeners()
getStreamListeners
in interface IBroadcastStream
public void removeStreamListener(IStreamListener listener)
removeStreamListener
in interface IBroadcastStream
listener
- the listener to removeprotected File getRecordFile(IScope scope, String name)
scope
- name
-
protected void registerJMX()
protected void unregisterJMX()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |