Package org.red5.server.stream
Class AbstractStream
java.lang.Object
org.red5.server.stream.AbstractStream
- All Implemented Interfaces:
IStream
- Direct Known Subclasses:
AbstractClientStream
,ServerStream
Abstract base implementation of IStream. Contains codec information, stream name, scope, event handling, and provides stream start and stop operations.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate long
private IStreamCodecInfo
Stream audio and video codec informationprotected long
Timestamp the stream was created.protected final Semaphore
Lock for protecting critical sectionsprivate static final org.slf4j.Logger
private AtomicReference<Notify>
Stores the streams metadataprivate String
Stream nameprivate IScope
Stream scopeprotected StreamState
Current state -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Return codec information.long
Returns timestamp at which the stream was created.Returns a copy of the metadata for the associated stream, if it exists.getName()
Return stream name.getScope()
Return scope.getState()
Return stream state.protected IStreamAwareScopeHandler
Return stream aware scope handler or null if scope is null.void
setCodecInfo
(IStreamCodecInfo codecInfo) Setter for codec info.void
setMetaData
(Notify metaData) Set the metadata.void
Setter for name.void
Setter for scope.void
setState
(StreamState state) Sets the stream state.
-
Field Details
-
log
private static final org.slf4j.Logger log -
state
Current state -
name
Stream name -
codecInfo
Stream audio and video codec information -
metaData
Stores the streams metadata -
scope
Stream scope -
creationTime
protected long creationTimeTimestamp the stream was created. -
lock
Lock for protecting critical sections -
absoluteStartTimeMs
private long absoluteStartTimeMs
-
-
Constructor Details
-
AbstractStream
public AbstractStream()
-
-
Method Details
-
getName
Return stream name. -
getCodecInfo
Return codec information.- Specified by:
getCodecInfo
in interfaceIStream
- Returns:
- Stream codec information
-
getMetaData
Returns a copy of the metadata for the associated stream, if it exists.- Returns:
- stream meta data
-
setMetaData
Set the metadata.- Parameters:
metaData
- stream meta data
-
getAbsoluteStartTimeMs
public long getAbsoluteStartTimeMs() -
getScope
Return scope. -
getCreationTime
public long getCreationTime()Returns timestamp at which the stream was created.- Specified by:
getCreationTime
in interfaceIStream
- Returns:
- creation timestamp
-
setName
Setter for name.- Parameters:
name
- Stream name
-
setCodecInfo
Setter for codec info.- Parameters:
codecInfo
- Codec info
-
setScope
Setter for scope.- Parameters:
scope
- Scope
-
getState
Return stream state.- Returns:
- StreamState
-
setState
Sets the stream state.- Parameters:
state
- stream state
-
getStreamAwareHandler
Return stream aware scope handler or null if scope is null.- Returns:
- IStreamAwareScopeHandler implementation
-