Class StreamFetcher

java.lang.Object
io.antmedia.streamsource.StreamFetcher

public class StreamFetcher extends Object
  • Field Details

    • logger

      protected static org.slf4j.Logger logger
    • thread

    • timeoutMicroSeconds

      private int timeoutMicroSeconds
      Connection setup timeout value
    • exceptionInThread

      private boolean exceptionInThread
    • lastPacketReceivedTime

      private long lastPacketReceivedTime
      Last packet received time
    • threadActive

      private AtomicBoolean threadActive
    • cameraError

      private Result cameraError
    • PACKET_RECEIVED_INTERVAL_TIMEOUT

      private static final int PACKET_RECEIVED_INTERVAL_TIMEOUT
      See Also:
    • scope

      private IScope scope
    • appInstance

      private AntMediaApplicationAdapter appInstance
    • lastSentDTS

      private long[] lastSentDTS
    • lastReceivedDTS

      private long[] lastReceivedDTS
    • muxAdaptor

      private MuxAdaptor muxAdaptor
    • restartStream

      private boolean restartStream
      If it is true, it restarts fetching everytime it disconnects if it is false, it does not restart
    • stopRequestReceived

      private volatile boolean stopRequestReceived
      This flag closes the stream in the worker thread. It should be a field of StreamFetcher. Because WorkerThread instance can be re-created and we can lost the flag value. This case causes stream NOT TO BE STOPPED
    • bufferTime

      private int bufferTime
      Buffer time in milliseconds
    • COUNT_TO_LOG_BUFFER

      private static final int COUNT_TO_LOG_BUFFER
      See Also:
    • bufferLogCounter

      private int bufferLogCounter
    • appSettings

      private AppSettings appSettings
    • vertx

      private io.vertx.core.Vertx vertx
    • dataStore

      private DataStore dataStore
    • readNextPacketStartTime

      private long readNextPacketStartTime
    • readNextPacketCompleteTime

      private long readNextPacketCompleteTime
    • streamFetcherListener

    • streamUrl

      private String streamUrl
    • streamId

      private String streamId
    • streamType

      private String streamType
    • seekTimeRequestReceived

      private AtomicBoolean seekTimeRequestReceived
    • seekTimeInMs

      private AtomicLong seekTimeInMs
  • Constructor Details

    • StreamFetcher

      public StreamFetcher(String streamUrl, String streamId, String streamType, IScope scope, io.vertx.core.Vertx vertx, long seekTimeInMs)
  • Method Details

    • getStreamFetcherListener

      public StreamFetcher.IStreamFetcherListener getStreamFetcherListener()
    • setStreamFetcherListener

      public void setStreamFetcherListener(StreamFetcher.IStreamFetcherListener streamFetcherListener)
    • initDTSArrays

      public void initDTSArrays(int nbStreams)
    • startStream

      public void startStream()
    • getDataStore

      public DataStore getDataStore()
    • setDataStore

      public void setDataStore(DataStore dataStore)
    • getAVPacket

      public org.bytedeco.ffmpeg.avcodec.AVPacket getAVPacket()
    • isStreamAlive

      public boolean isStreamAlive()
      If thread is alive and receiving packet with in the PACKET_RECEIVED_INTERVAL_TIMEOUT time mean it is running
      Returns:
      true if it is running and false it is not
    • isStreamBlocked

      public boolean isStreamBlocked()
    • isStopped

      public boolean isStopped()
    • stopStream

      public void stopStream()
    • seekTime

      public void seekTime(long seekTimeInMilliseconds)
    • isStopRequestReceived

      public boolean isStopRequestReceived()
    • getThread

      public StreamFetcher.WorkerThread getThread()
    • setThread

      public void setThread(StreamFetcher.WorkerThread thread)
    • restart

      public void restart()
    • setConnectionTimeout

      public void setConnectionTimeout(int timeoutMs)
      Set timeout when establishing connection
      Parameters:
      timeoutMs - in ms
    • isExceptionInThread

      public boolean isExceptionInThread()
    • setThreadActive

      public void setThreadActive(boolean threadActive)
    • isThreadActive

      public boolean isThreadActive()
    • getCameraError

      public Result getCameraError()
    • setCameraError

      public void setCameraError(Result cameraError)
    • getScope

      public IScope getScope()
    • setScope

      public void setScope(IScope scope)
    • getInstance

      public AntMediaApplicationAdapter getInstance()
    • getMuxAdaptor

      public MuxAdaptor getMuxAdaptor()
    • setMuxAdaptor

      public void setMuxAdaptor(MuxAdaptor muxAdaptor)
    • isRestartStream

      public boolean isRestartStream()
    • setRestartStream

      public void setRestartStream(boolean restartStream)
    • getBufferTime

      public int getBufferTime()
    • setBufferTime

      public void setBufferTime(int bufferTime)
    • getAppSettings

      private AppSettings getAppSettings()
    • debugSetStopRequestReceived

      public void debugSetStopRequestReceived(boolean stopRequest)
      This is for test purposes
      Parameters:
      stopRequest -
    • getStreamId

      public String getStreamId()
    • getStreamUrl

      public String getStreamUrl()
    • setStreamId

      public void setStreamId(String streamId)
    • setStreamUrl

      public void setStreamUrl(String streamUrl)
    • getSeekTimeRequestReceived

      public AtomicBoolean getSeekTimeRequestReceived()
    • setSeekTimeRequestReceived

      public void setSeekTimeRequestReceived(AtomicBoolean seekTimeRequestReceived)
    • getLastSentDTS

      public long[] getLastSentDTS()