public abstract class AbstractStream extends Object implements IStream
IStream| Modifier and Type | Field and Description |
|---|---|
protected long |
creationTime
Timestamp the stream was created.
|
protected Semaphore |
lock
Lock for protecting critical sections
|
protected long |
startTime
Timestamp the stream was started.
|
protected StreamState |
state
Current state
|
| Constructor and Description |
|---|
AbstractStream() |
| Modifier and Type | Method and Description |
|---|---|
void |
addStateChangeListener(PropertyChangeListener listener)
Adds to the list of listeners tracking changes of the
StreamState of this stream. |
protected void |
fireStateChange(StreamState oldState,
StreamState newState)
Creates a new
PropertyChangeEvent and delivers it to all currently registered state listeners. |
org.red5.codec.IStreamCodecInfo |
getCodecInfo()
Return codec information.
|
long |
getCreationTime()
Returns timestamp at which the stream was created.
|
Notify |
getMetaData()
Returns a copy of the metadata for the associated stream, if it exists.
|
String |
getName()
Return stream name.
|
IScope |
getScope()
Return scope.
|
long |
getStartTime()
Returns timestamp at which the stream was started.
|
StreamState |
getState()
Return stream state.
|
protected IStreamAwareScopeHandler |
getStreamAwareHandler()
Return stream aware scope handler or null if scope is null.
|
void |
removeStateChangeListener(PropertyChangeListener listener)
Removes from the list of listeners tracking changes of the
StreamState of this stream. |
void |
setCodecInfo(org.red5.codec.IStreamCodecInfo codecInfo)
Setter for codec info.
|
void |
setMetaData(Notify metaData)
Set the metadata.
|
void |
setName(String name)
Setter for name.
|
void |
setScope(IScope scope)
Setter for scope.
|
void |
setState(StreamState state)
Sets the stream state.
|
protected StreamState state
protected long creationTime
protected long startTime
protected final transient Semaphore lock
protected void fireStateChange(StreamState oldState, StreamState newState)
PropertyChangeEvent and delivers it to all currently registered state listeners.oldState - the StreamState we had before the changenewState - the StreamState we had after the changepublic void addStateChangeListener(PropertyChangeListener listener)
StreamState of this stream.listener - the listener to registerpublic void removeStateChangeListener(PropertyChangeListener listener)
StreamState of this stream.listener - the listener to removepublic String getName()
public org.red5.codec.IStreamCodecInfo getCodecInfo()
getCodecInfo in interface IStreampublic Notify getMetaData()
public void setMetaData(Notify metaData)
metaData - stream meta datapublic IScope getScope()
public long getCreationTime()
getCreationTime in interface IStreampublic long getStartTime()
getStartTime in interface IStreampublic void setName(String name)
name - Stream namepublic void setCodecInfo(org.red5.codec.IStreamCodecInfo codecInfo)
codecInfo - Codec infopublic void setScope(IScope scope)
scope - Scopepublic StreamState getState()
public void setState(StreamState state)
state - stream stateprotected IStreamAwareScopeHandler getStreamAwareHandler()
Copyright © 2005–2017 Red5. All rights reserved.