Class StreamFetcher.WorkerThread

java.lang.Object
java.lang.Thread
io.antmedia.streamsource.StreamFetcher.WorkerThread
All Implemented Interfaces:
Runnable
Enclosing class:
StreamFetcher

public class StreamFetcher.WorkerThread extends Thread
  • Field Details

    • PACKET_WRITER_PERIOD_IN_MS

      private static final int PACKET_WRITER_PERIOD_IN_MS
      See Also:
    • STREAM_FETCH_RE_TRY_PERIOD_MS

      private static final long STREAM_FETCH_RE_TRY_PERIOD_MS
      See Also:
    • streamPublished

      private volatile boolean streamPublished
    • isJobRunning

      protected AtomicBoolean isJobRunning
    • inputFormatContext

      org.bytedeco.ffmpeg.avformat.AVFormatContext inputFormatContext
    • buffering

      private AtomicBoolean buffering
    • bufferQueue

      private ConcurrentSkipListSet<org.bytedeco.ffmpeg.avcodec.AVPacket> bufferQueue
    • bufferingFinishTimeMs

      private volatile long bufferingFinishTimeMs
    • firstPacketReadyToSentTimeMs

      private volatile long firstPacketReadyToSentTimeMs
    • lastPacketTimeMsInQueue

      private long lastPacketTimeMsInQueue
    • firstPacketTime

      long firstPacketTime
    • bufferDuration

      long bufferDuration
    • timeOffsetInMs

      long timeOffsetInMs
    • packetWriterJobName

      long packetWriterJobName
    • firstPacketDtsInMs

      private long firstPacketDtsInMs
    • lastSycnCheckTime

      private long lastSycnCheckTime
  • Constructor Details

    • WorkerThread

      public WorkerThread()
  • Method Details

    • prepare

      public Result prepare(org.bytedeco.ffmpeg.avformat.AVFormatContext inputFormatContext)
    • prepareInput

      public Result prepareInput(org.bytedeco.ffmpeg.avformat.AVFormatContext inputFormatContext)
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • readMore

      public boolean readMore(org.bytedeco.ffmpeg.avcodec.AVPacket pkt)
    • seekFrame

      public int seekFrame()
    • readNextPacket

      public int readNextPacket(org.bytedeco.ffmpeg.avcodec.AVPacket pkt)
    • unReferencePacket

      public void unReferencePacket(org.bytedeco.ffmpeg.avcodec.AVPacket pkt)
    • prepareInputContext

      public boolean prepareInputContext(Broadcast broadcast) throws Exception
      Throws:
      Exception
    • packetRead

      public void packetRead(org.bytedeco.ffmpeg.avcodec.AVPacket pkt)
    • closeInputFormatContext

      public void closeInputFormatContext()
    • close

      public void close(org.bytedeco.ffmpeg.avcodec.AVPacket pkt)
    • writeAllBufferedPackets

      private void writeAllBufferedPackets()
    • writePacket

      public void writePacket(org.bytedeco.ffmpeg.avformat.AVStream stream, org.bytedeco.ffmpeg.avcodec.AVPacket pkt)
    • getLastSentDTS

      public long[] getLastSentDTS()
    • getCodecType

      public int getCodecType(int streamIndex)
    • getStreamTimebase

      public org.bytedeco.ffmpeg.avutil.AVRational getStreamTimebase(int streamIndex)
    • checkAndFixSynch

      public void checkAndFixSynch()
    • writeBufferedPacket

      public void writeBufferedPacket()
    • calculateBufferStatus

      public void calculateBufferStatus()
    • logBufferStatus

      public void logBufferStatus()
    • getBufferedDurationMs

      public long getBufferedDurationMs()
    • getBufferQueue

      public ConcurrentSkipListSet<org.bytedeco.ffmpeg.avcodec.AVPacket> getBufferQueue()
    • setInputFormatContext

      public void setInputFormatContext(org.bytedeco.ffmpeg.avformat.AVFormatContext inputFormatContext)