@ManagedResource(objectName="org.red5.server:type=ClientBroadcastStream", description="ClientBroadcastStream") public class ClientBroadcastStream extends AbstractClientStream implements IClientBroadcastStream, IFilter, IPushableConsumer, IPipeConnectionListener, IEventDispatcher, IClientBroadcastStreamStatistics, ClientBroadcastStreamMXBean
| Modifier and Type | Field and Description |
|---|---|
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?
|
creationTime, lock, startTime, stateMODE_APPEND, MODE_LIVE, MODE_PUBLISH, MODE_READ, MODE_RECORDKEY| Constructor and Description |
|---|
ClientBroadcastStream() |
| Modifier and Type | Method and Description |
|---|---|
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 |
pushMessage(StatusMessage msg)
Pushes a message out to a consumer.
|
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 |
setRegisterJMX(boolean registerJMX) |
void |
start()
Starts stream, creates pipes, connects
|
void |
startPublishing()
Notify client that stream is ready for publishing.
|
void |
stop()
Stop this stream.
|
void |
stopRecording()
Stops any currently active recording.
|
protected void |
unregisterJMX() |
getBroadcastStreamPublishName, getClientBufferDuration, getConnection, getStreamId, setBroadcastStreamPublishName, setClientBufferDuration, setConnection, setStreamIdaddStateChangeListener, fireStateChange, getCodecInfo, getCreationTime, getMetaData, getName, getScope, getStartTime, getState, getStreamAwareHandler, removeStateChangeListener, setCodecInfo, setMetaData, setName, setScope, setStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBroadcastStreamPublishName, getClientBufferDuration, getConnection, getStreamId, setBroadcastStreamPublishName, setClientBufferDurationgetMetaDatagetCodecInfo, getCreationTime, getName, getScope, getStartTimegetCreationTimeprotected boolean automaticRecording
protected long bytesReceived
protected boolean checkVideoCodec
protected boolean checkAudioCodec
protected int chunkSize
protected volatile boolean closed
protected transient IMessageOutput connMsgOut
protected long firstPacketTime
protected transient IPipe livePipe
protected String publishedName
protected boolean sendStartNotification
protected transient Set<IStreamListener> listeners
protected long latestTimeStamp
public void close()
close in interface IStreamclose in interface ClientBroadcastStreamMXBeanpublic void dispatchEvent(IEvent event)
dispatchEvent in interface IEventDispatcherevent - Event to dispatchpublic int getActiveSubscribers()
getActiveSubscribers in interface IClientBroadcastStreamStatisticspublic long getBytesReceived()
getBytesReceived in interface IClientBroadcastStreamStatisticspublic int getCurrentTimestamp()
getCurrentTimestamp in interface IStreamStatisticspublic int getMaxSubscribers()
getMaxSubscribers in interface IClientBroadcastStreamStatisticspublic IProvider getProvider()
getProvider in interface IBroadcastStreampublic void setPublishedName(String name)
setPublishedName in interface IBroadcastStreamsetPublishedName in interface ClientBroadcastStreamMXBeanname - Name that used for publishing. Set at client side when begin to broadcast with NetStream#publish.public String getPublishedName()
getPublishedName in interface IClientBroadcastStreamStatisticsgetPublishedName in interface IBroadcastStreamgetPublishedName in interface ClientBroadcastStreamMXBeanpublic void setParameters(Map<String,String> params)
setParameters in interface IClientBroadcastStreamparams - parameter mappublic Map<String,String> getParameters()
getParameters in interface IClientBroadcastStreampublic String getSaveFilename()
getSaveFilename in interface IClientBroadcastStreamStatisticsgetSaveFilename in interface IBroadcastStreamgetSaveFilename in interface ClientBroadcastStreamMXBeannullif the stream is not being saved.
public IClientBroadcastStreamStatistics getStatistics()
getStatistics in interface IClientBroadcastStreampublic int getTotalSubscribers()
getTotalSubscribers in interface IClientBroadcastStreamStatisticspublic boolean isAutomaticRecording()
public void setAutomaticRecording(boolean automaticRecording)
automaticRecording - the automaticRecording to setpublic void setRegisterJMX(boolean registerJMX)
registerJMX - the registerJMX to setpublic void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg)
onOOBControlMessage in interface IMessageComponentsource - OOB message sourcepipe - Pipe that used to send OOB messageoobCtrlMsg - Out-of-band control messagepublic void onPipeConnectionEvent(PipeConnectionEvent event)
onPipeConnectionEvent in interface IPipeConnectionListenerevent - Pipe connection eventpublic void pushMessage(IPipe pipe, IMessage message)
pushMessage in interface IPushableConsumerpipe - Pipemessage - Messagepublic void saveAs(String name, boolean isAppend) throws IOException
saveAs in interface IBroadcastStreamsaveAs in interface ClientBroadcastStreamMXBeanname - Stream nameisAppend - Append modeIOException - File could not be created/written toprotected void pushMessage(StatusMessage msg)
msg - StatusMessagepublic void start()
start in interface IStreamstart in interface ClientBroadcastStreamMXBeanpublic void startPublishing()
startPublishing in interface IClientBroadcastStreamstartPublishing in interface ClientBroadcastStreamMXBeanpublic void stop()
stop in interface IStreamstop in interface ClientBroadcastStreamMXBeanpublic void stopRecording()
public boolean isRecording()
public void addStreamListener(IStreamListener listener)
addStreamListener in interface IBroadcastStreamlistener - the listener to addpublic Collection<IStreamListener> getStreamListeners()
getStreamListeners in interface IBroadcastStreampublic void removeStreamListener(IStreamListener listener)
removeStreamListener in interface IBroadcastStreamlistener - the listener to removeprotected File getRecordFile(IScope scope, String name)
scope - scopename - record nameprotected void registerJMX()
protected void unregisterJMX()
Copyright © 2005–2017 Red5. All rights reserved.