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
FieldsModifier and TypeFieldDescriptionprivate longprivate IStreamCodecInfoStream audio and video codec informationprotected longTimestamp the stream was created.protected final SemaphoreLock for protecting critical sectionsprivate static final org.slf4j.Loggerprivate AtomicReference<Notify>Stores the streams metadataprivate StringStream nameprivate IScopeStream scopeprotected StreamStateCurrent state -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturn codec information.longReturns 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 IStreamAwareScopeHandlerReturn stream aware scope handler or null if scope is null.voidsetCodecInfo(IStreamCodecInfo codecInfo) Setter for codec info.voidsetMetaData(Notify metaData) Set the metadata.voidSetter for name.voidSetter for scope.voidsetState(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:
getCodecInfoin 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:
getCreationTimein 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
-