Package io.antmedia.streamsource
Class StreamFetcher
java.lang.Object
io.antmedia.streamsource.StreamFetcher
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
class
-
Field Summary
Modifier and TypeFieldDescriptionprivate AntMediaApplicationAdapter
private AppSettings
private int
private int
Buffer time in millisecondsprivate Result
private static final int
private DataStore
private boolean
private long
Last packet received timeprivate long[]
private long[]
protected static org.slf4j.Logger
private MuxAdaptor
private static final int
private long
private long
private boolean
If it is true, it restarts fetching everytime it disconnects if it is false, it does not restartprivate IScope
private AtomicLong
private AtomicBoolean
private boolean
This flag closes the stream in the worker thread.(package private) StreamFetcher.IStreamFetcherListener
private String
private String
private String
private StreamFetcher.WorkerThread
private AtomicBoolean
private int
Connection setup timeout valueprivate io.vertx.core.Vertx
-
Constructor Summary
ConstructorDescriptionStreamFetcher
(String streamUrl, String streamId, String streamType, IScope scope, io.vertx.core.Vertx vertx, long seekTimeInMs) -
Method Summary
Modifier and TypeMethodDescriptionvoid
debugSetStopRequestReceived
(boolean stopRequest) This is for test purposesprivate AppSettings
org.bytedeco.ffmpeg.avcodec.AVPacket
int
long[]
getScope()
void
initDTSArrays
(int nbStreams) boolean
boolean
boolean
boolean
boolean
If thread is alive and receiving packet with in thePACKET_RECEIVED_INTERVAL_TIMEOUT
time mean it is runningboolean
boolean
void
restart()
void
seekTime
(long seekTimeInMilliseconds) void
setBufferTime
(int bufferTime) void
setCameraError
(Result cameraError) void
setConnectionTimeout
(int timeoutMs) Set timeout when establishing connectionvoid
setDataStore
(DataStore dataStore) void
setMuxAdaptor
(MuxAdaptor muxAdaptor) void
setRestartStream
(boolean restartStream) void
void
setSeekTimeRequestReceived
(AtomicBoolean seekTimeRequestReceived) void
setStreamFetcherListener
(StreamFetcher.IStreamFetcherListener streamFetcherListener) void
setStreamId
(String streamId) void
setStreamUrl
(String streamUrl) void
setThread
(StreamFetcher.WorkerThread thread) void
setThreadActive
(boolean threadActive) void
void
-
Field Details
-
logger
protected static org.slf4j.Logger logger -
thread
-
timeoutMicroSeconds
private int timeoutMicroSecondsConnection setup timeout value -
exceptionInThread
private boolean exceptionInThread -
lastPacketReceivedTime
private long lastPacketReceivedTimeLast packet received time -
threadActive
-
cameraError
-
PACKET_RECEIVED_INTERVAL_TIMEOUT
private static final int PACKET_RECEIVED_INTERVAL_TIMEOUT- See Also:
-
scope
-
appInstance
-
lastSentDTS
private long[] lastSentDTS -
lastReceivedDTS
private long[] lastReceivedDTS -
muxAdaptor
-
restartStream
private boolean restartStreamIf it is true, it restarts fetching everytime it disconnects if it is false, it does not restart -
stopRequestReceived
private volatile boolean stopRequestReceivedThis 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 bufferTimeBuffer time in milliseconds -
COUNT_TO_LOG_BUFFER
private static final int COUNT_TO_LOG_BUFFER- See Also:
-
bufferLogCounter
private int bufferLogCounter -
appSettings
-
vertx
private io.vertx.core.Vertx vertx -
dataStore
-
readNextPacketStartTime
private long readNextPacketStartTime -
readNextPacketCompleteTime
private long readNextPacketCompleteTime -
streamFetcherListener
StreamFetcher.IStreamFetcherListener streamFetcherListener -
streamUrl
-
streamId
-
streamType
-
seekTimeRequestReceived
-
seekTimeInMs
-
-
Constructor Details
-
StreamFetcher
-
-
Method Details
-
getStreamFetcherListener
-
setStreamFetcherListener
-
initDTSArrays
public void initDTSArrays(int nbStreams) -
startStream
public void startStream() -
getDataStore
-
setDataStore
-
getAVPacket
public org.bytedeco.ffmpeg.avcodec.AVPacket getAVPacket() -
isStreamAlive
public boolean isStreamAlive()If thread is alive and receiving packet with in thePACKET_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
-
setThread
-
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
-
setCameraError
-
getScope
-
setScope
-
getInstance
-
getMuxAdaptor
-
setMuxAdaptor
-
isRestartStream
public boolean isRestartStream() -
setRestartStream
public void setRestartStream(boolean restartStream) -
getBufferTime
public int getBufferTime() -
setBufferTime
public void setBufferTime(int bufferTime) -
getAppSettings
-
debugSetStopRequestReceived
public void debugSetStopRequestReceived(boolean stopRequest) This is for test purposes- Parameters:
stopRequest
-
-
getStreamId
-
getStreamUrl
-
setStreamId
-
setStreamUrl
-
getSeekTimeRequestReceived
-
setSeekTimeRequestReceived
-
getLastSentDTS
public long[] getLastSentDTS()
-