Class AbstractStream

java.lang.Object
org.red5.server.stream.AbstractStream
All Implemented Interfaces:
IStream
Direct Known Subclasses:
AbstractClientStream, ServerStream

public abstract class AbstractStream extends Object implements IStream
Abstract base implementation of IStream. Contains codec information, stream name, scope, event handling, and provides stream start and stop operations.
See Also:
  • Field Details

    • log

      private static final org.slf4j.Logger log
    • state

      protected StreamState state
      Current state
    • name

      private String name
      Stream name
    • codecInfo

      private IStreamCodecInfo codecInfo
      Stream audio and video codec information
    • metaData

      private AtomicReference<Notify> metaData
      Stores the streams metadata
    • scope

      private IScope scope
      Stream scope
    • creationTime

      protected long creationTime
      Timestamp the stream was created.
    • lock

      protected final transient Semaphore lock
      Lock for protecting critical sections
    • absoluteStartTimeMs

      private long absoluteStartTimeMs
  • Constructor Details

    • AbstractStream

      public AbstractStream()
  • Method Details

    • getName

      public String getName()
      Return stream name.
      Specified by:
      getName in interface IStream
      Returns:
      Stream name
    • getCodecInfo

      public IStreamCodecInfo getCodecInfo()
      Return codec information.
      Specified by:
      getCodecInfo in interface IStream
      Returns:
      Stream codec information
    • getMetaData

      public Notify getMetaData()
      Returns a copy of the metadata for the associated stream, if it exists.
      Returns:
      stream meta data
    • setMetaData

      public void setMetaData(Notify metaData)
      Set the metadata.
      Parameters:
      metaData - stream meta data
    • getAbsoluteStartTimeMs

      public long getAbsoluteStartTimeMs()
    • getScope

      public IScope getScope()
      Return scope.
      Specified by:
      getScope in interface IStream
      Returns:
      Scope
    • getCreationTime

      public long getCreationTime()
      Returns timestamp at which the stream was created.
      Specified by:
      getCreationTime in interface IStream
      Returns:
      creation timestamp
    • setName

      public void setName(String name)
      Setter for name.
      Parameters:
      name - Stream name
    • setCodecInfo

      public void setCodecInfo(IStreamCodecInfo codecInfo)
      Setter for codec info.
      Parameters:
      codecInfo - Codec info
    • setScope

      public void setScope(IScope scope)
      Setter for scope.
      Parameters:
      scope - Scope
    • getState

      public StreamState getState()
      Return stream state.
      Returns:
      StreamState
    • setState

      public void setState(StreamState state)
      Sets the stream state.
      Parameters:
      state - stream state
    • getStreamAwareHandler

      protected IStreamAwareScopeHandler getStreamAwareHandler()
      Return stream aware scope handler or null if scope is null.
      Returns:
      IStreamAwareScopeHandler implementation