Top Inners Fields Constructors Methods
com.sun.media.jfxmedia.locator

pack-priv final Class HLSConnectionHolder

extends ConnectionHolder
Class Inheritance
Imports
com.sun.media.jfxmedia.MediaError, com.sun.media.jfxmediaimpl.MediaUtils, java.io.BufferedReader, .IOException, .InputStreamReader, java.net.HttpURLConnection, .MalformedURLException, .URI, .URISyntaxException, .URLConnection, java.nio.channels.Channels, .ReadableByteChannel, java.nio.charset.Charset, java.util.ArrayList, .List, java.util.concurrent.BlockingQueue, .CountDownLatch, .LinkedBlockingQueue, .Semaphore

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class
private class
private static class

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private HLSConnectionHolder.Playlist
private ReadableByteChannel
private URLConnection
private static final int
private static final int
private static final int
private static final int
private static final int
private static final long
private static final int
private static final int
private static final int
private static final int
private static final int
private boolean
private boolean
private Semaphore
private int
private HLSConnectionHolder.PlaylistThread
private CountDownLatch
private boolean
private long
private URLConnection
private HLSConnectionHolder.VariantPlaylist
Inherited from com.sun.media.jfxmedia.locator.ConnectionHolder:
bufferchannel

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
adjustBitrate(long readTime)

public void
private void
init()

pack-priv boolean
isRandomAccess()

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.isRandomAccess.

Detects whether the source is a random access source.

pack-priv boolean
isSeekable()

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.isSeekable.

Detects whether the source is seekable.

private int
pack-priv boolean
needBuffer()

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.needBuffer.

Detects whether this source needs buffering at the pipeline level.

private ReadableByteChannel
private ReadableByteChannel
pack-priv int
property(int
- Property ID.
prop
,
int
- Depends on property ID.
value
)

Overrides com.sun.media.jfxmedia.locator.ConnectionHolder.property.

Get or set properties.

pack-priv int
readBlock(long position, int size)

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.readBlock.

Reads a block of data from the arbitrary position of the opened stream.

public int
readNextBlock()

Overrides com.sun.media.jfxmedia.locator.ConnectionHolder.readNextBlock.

Reads a block of data from the current position of the opened stream.

private void
private void
public long
seek(long position)

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.seek.

Performs a seek request to the desired position.

private static String
Inherited from com.sun.media.jfxmedia.locator.ConnectionHolder:
createFileConnectionHoldercreateHLSConnectionHoldercreateMemoryConnectionHoldercreateURIConnectionHoldergetBuffer

Field Detail

CHARSET_US_ASCIIback to summary
private static final String CHARSET_US_ASCII
CHARSET_UTF_8back to summary
private static final String CHARSET_UTF_8
currentPlaylistback to summary
private HLSConnectionHolder.Playlist currentPlaylist
headerChannelback to summary
private ReadableByteChannel headerChannel
headerConnectionback to summary
private URLConnection headerConnection
HLS_PROP_GET_DURATIONback to summary
private static final int HLS_PROP_GET_DURATION
HLS_PROP_GET_HLS_MODEback to summary
private static final int HLS_PROP_GET_HLS_MODE
HLS_PROP_GET_MIMETYPEback to summary
private static final int HLS_PROP_GET_MIMETYPE
HLS_PROP_LOAD_SEGMENTback to summary
private static final int HLS_PROP_LOAD_SEGMENT
HLS_PROP_SEGMENT_START_TIMEback to summary
private static final int HLS_PROP_SEGMENT_START_TIME
HLS_VALUE_FLOAT_MULTIPLIERback to summary
private static final long HLS_VALUE_FLOAT_MULTIPLIER
HLS_VALUE_MIMETYPE_AACback to summary
private static final int HLS_VALUE_MIMETYPE_AAC
HLS_VALUE_MIMETYPE_FMP4back to summary
private static final int HLS_VALUE_MIMETYPE_FMP4
HLS_VALUE_MIMETYPE_MP2Tback to summary
private static final int HLS_VALUE_MIMETYPE_MP2T
HLS_VALUE_MIMETYPE_MP3back to summary
private static final int HLS_VALUE_MIMETYPE_MP3
HLS_VALUE_MIMETYPE_UNKNOWNback to summary
private static final int HLS_VALUE_MIMETYPE_UNKNOWN
isBitrateAdjustableback to summary
private boolean isBitrateAdjustable
isPlaylistClosedback to summary
private boolean isPlaylistClosed
liveSemaphoreback to summary
private Semaphore liveSemaphore
mediaFileIndexback to summary
private int mediaFileIndex
playlistThreadback to summary
private HLSConnectionHolder.PlaylistThread playlistThread
readySignalback to summary
private CountDownLatch readySignal
sendHeaderback to summary
private boolean sendHeader
startTimeback to summary
private long startTime
urlConnectionback to summary
private URLConnection urlConnection
variantPlaylistback to summary
private HLSConnectionHolder.VariantPlaylist variantPlaylist

Constructor Detail

HLSConnectionHolderback to summary
pack-priv HLSConnectionHolder(URI uri)

Method Detail

adjustBitrateback to summary
private void adjustBitrate(long readTime)
closeConnectionback to summary
public void closeConnection()

Overrides com.sun.media.jfxmedia.locator.ConnectionHolder.closeConnection.

Doc from com.sun.media.jfxmedia.locator.ConnectionHolder.closeConnection.

Closes connection when done. Overriding methods should call this method in the beginning of their implementation.

Annotations
@Override
initback to summary
private void init()
isRandomAccessback to summary
pack-priv boolean isRandomAccess()

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.isRandomAccess.

Doc from com.sun.media.jfxmedia.locator.ConnectionHolder.isRandomAccess.

Detects whether the source is a random access source. If the method returns true then the source is capable of working in pull mode. To be able to work in pull mode holder must provide implementation.

Returns:boolean

true is the source is random access, false otherwise.

Annotations
@Override
isSeekableback to summary
pack-priv boolean isSeekable()

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.isSeekable.

Doc from com.sun.media.jfxmedia.locator.ConnectionHolder.isSeekable.

Detects whether the source is seekable.

Returns:boolean

true if the source is seekable, false otherwise.

Annotations
@Override
loadNextSegmentback to summary
private int loadNextSegment()
needBufferback to summary
pack-priv boolean needBuffer()

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.needBuffer.

Doc from com.sun.media.jfxmedia.locator.ConnectionHolder.needBuffer.

Detects whether this source needs buffering at the pipeline level. When true the pipeline contains progressbuffer after the source.

Returns:boolean

true if the source needs a buffer, false otherwise.

Annotations
@Override
openChannelback to summary
private ReadableByteChannel openChannel() throws IOException
openHeaderChannelback to summary
private ReadableByteChannel openHeaderChannel() throws IOException
propertyback to summary
pack-priv int property(int prop, int value)

Overrides com.sun.media.jfxmedia.locator.ConnectionHolder.property.

Doc from com.sun.media.jfxmedia.locator.ConnectionHolder.property.

Get or set properties.

Parameters
prop:int

- Property ID.

value:int

- Depends on property ID.

Returns:int

- Depends on property ID.

Annotations
@Override
readBlockback to summary
pack-priv int readBlock(long position, int size) throws IOException

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.readBlock.

Doc from com.sun.media.jfxmedia.locator.ConnectionHolder.readBlock.

Reads a block of data from the arbitrary position of the opened stream.

Returns:int

The number of bytes read, possibly zero, or -1 if the given position is greater than or equal to the file's current size.

Annotations
@Override
readNextBlockback to summary
public int readNextBlock() throws IOException

Overrides com.sun.media.jfxmedia.locator.ConnectionHolder.readNextBlock.

Doc from com.sun.media.jfxmedia.locator.ConnectionHolder.readNextBlock.

Reads a block of data from the current position of the opened stream.

Returns:int

The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream.

Annotations
@Override
resetConnectionback to summary
private void resetConnection()
resetHeaderConnectionback to summary
private void resetHeaderConnection()
seekback to summary
public long seek(long position)

Implements abstract com.sun.media.jfxmedia.locator.ConnectionHolder.seek.

Doc from com.sun.media.jfxmedia.locator.ConnectionHolder.seek.

Performs a seek request to the desired position.

Returns:long

-1 if the seek request failed or new stream position

Annotations
@Override
stripParametersback to summary
private static String stripParameters(String mediaFile)
com.sun.media.jfxmedia.locator back to summary

private Class HLSConnectionHolder.Playlist

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private String
private double
private boolean
private boolean
private volatile boolean
private volatile boolean
private final Object
private final List<String>
private final List<Boolean>
private final List<Double>
private int
private boolean
private URI
private int
private int
private boolean
private double
private long

Constructor Summary

AccessConstructor and Description
private
Playlist(boolean isLive, int targetDuration)

private

Method Summary

Modifier and TypeMethod and Description
private void
addMediaFile(String URI, double duration, boolean isDiscontinuity)

private void
private double
private String
private String
private double
private int
private String
private long
private boolean
private boolean
private boolean
private double
seek(long time)

private void
setBaseURI(String playlistURI, String URI)

private void
setForceDiscontinuity(boolean value)

private void
private boolean
setSequenceNumber(int value)

private void
update(String nextMediaFile)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseURIback to summary
private String baseURI
durationback to summary
private double duration
forceDiscontinuityback to summary
private boolean forceDiscontinuity
isLiveback to summary
private boolean isLive
isLiveStopback to summary
private volatile boolean isLiveStop
isLiveWaitingback to summary
private volatile boolean isLiveWaiting
lockback to summary
private final Object lock
mediaFilesback to summary
private final List<String> mediaFiles
mediaFilesDiscontinuitiesback to summary
private final List<Boolean> mediaFilesDiscontinuities
mediaFilesStartTimesback to summary
private final List<Double> mediaFilesStartTimes
mimeTypeback to summary
private int mimeType
needBaseURIback to summary
private boolean needBaseURI
playlistURIback to summary
private URI playlistURI
sequenceNumberback to summary
private int sequenceNumber
sequenceNumberStartback to summary
private int sequenceNumberStart
sequenceNumberUpdatedback to summary
private boolean sequenceNumberUpdated
startTimeback to summary
private double startTime
targetDurationback to summary
private long targetDuration

Constructor Detail

Playlistback to summary
private Playlist(boolean isLive, int targetDuration)
Playlistback to summary
private Playlist(URI uri)

Method Detail

addMediaFileback to summary
private void addMediaFile(String URI, double duration, boolean isDiscontinuity)
closeback to summary
private void close()
getDurationback to summary
private double getDuration()
getHeaderFileback to summary
private String getHeaderFile()
getMediaFileExtensionback to summary
private String getMediaFileExtension()
getMediaFileStartTimeback to summary
private double getMediaFileStartTime()
getMimeTypeback to summary
private int getMimeType()
getNextMediaFileback to summary
private String getNextMediaFile()
getTargetDurationback to summary
private long getTargetDuration()
isCurrentMediaFileDiscontinuityback to summary
private boolean isCurrentMediaFileDiscontinuity()
isFragmentedMP4back to summary
private boolean isFragmentedMP4()
isLiveback to summary
private boolean isLive()
seekback to summary
private double seek(long time)
setBaseURIback to summary
private void setBaseURI(String playlistURI, String URI)
setForceDiscontinuityback to summary
private void setForceDiscontinuity(boolean value)
setPlaylistURIback to summary
private void setPlaylistURI(URI uri)
setSequenceNumberback to summary
private boolean setSequenceNumber(int value)
updateback to summary
private void update(String nextMediaFile)
com.sun.media.jfxmedia.locator back to summary

private Class HLSConnectionHolder.PlaylistParser

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.media.jfxmedia.locator.HLSConnectionHolder.PlaylistParser

Field Summary

Modifier and TypeField and Description
private List<Boolean>
private List<Double>
private int
private List<Integer>
private List<String>
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private int
private int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private Boolean
private Charset
getCharset(String url, String mimeType)

private Double
private Integer
private int
private String
private int
private boolean
private boolean
private boolean
private void
load(URI uri)

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dataListBooleanback to summary
private List<Boolean> dataListBoolean
dataListDoubleback to summary
private List<Double> dataListDouble
dataListIndexback to summary
private int dataListIndex
dataListIntegerback to summary
private List<Integer> dataListInteger
dataListStringback to summary
private List<String> dataListString
isDiscontinuityback to summary
private boolean isDiscontinuity
isEndListback to summary
private boolean isEndList
isFirstLineback to summary
private boolean isFirstLine
isLineMediaFileURIback to summary
private boolean isLineMediaFileURI
isLinePlaylistURIback to summary
private boolean isLinePlaylistURI
isVariantPlaylistback to summary
private boolean isVariantPlaylist
sequenceNumberback to summary
private int sequenceNumber
targetDurationback to summary
private int targetDuration

Constructor Detail

PlaylistParserback to summary
private PlaylistParser()

Method Detail

getBooleanback to summary
private Boolean getBoolean()
getCharsetback to summary
private Charset getCharset(String url, String mimeType)
getDoubleback to summary
private Double getDouble()
getIntegerback to summary
private Integer getInteger()
getSequenceNumberback to summary
private int getSequenceNumber()
getStringback to summary
private String getString()
getTargetDurationback to summary
private int getTargetDuration()
hasNextback to summary
private boolean hasNext()
isLivePlaylistback to summary
private boolean isLivePlaylist()
isVariantPlaylistback to summary
private boolean isVariantPlaylist()
loadback to summary
private void load(URI uri)
parseLineback to summary
private boolean parseLine(String line)
com.sun.media.jfxmedia.locator back to summary

private Class HLSConnectionHolder.PlaylistThread

extends Thread
Class Inheritance

Field Summary

Modifier and TypeField and Description
private URI
private final Object
private HLSConnectionHolder.Playlist
public static final int
public static final int
public static final int
private final BlockingQueue<Integer>
private volatile boolean
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
putState(int state)

public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

private void
setPlaylistURI(URI playlistURI)

private void
private void
private void
Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopthreadIdtoStringyield

Field Detail

playlistURIback to summary
private URI playlistURI
reloadLockback to summary
private final Object reloadLock
reloadPlaylistback to summary
private HLSConnectionHolder.Playlist reloadPlaylist
STATE_EXITback to summary
public static final int STATE_EXIT
STATE_INITback to summary
public static final int STATE_INIT
STATE_RELOAD_PLAYLISTback to summary
public static final int STATE_RELOAD_PLAYLIST
stateQueueback to summary
private final BlockingQueue<Integer> stateQueue
stoppedback to summary
private volatile boolean stopped

Constructor Detail

PlaylistThreadback to summary
private PlaylistThread()

Method Detail

putStateback to summary
private void putState(int state)
runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.

Annotations
@Override
setPlaylistURIback to summary
private void setPlaylistURI(URI playlistURI)
setReloadPlaylistback to summary
private void setReloadPlaylist(HLSConnectionHolder.Playlist playlist)
stateInitback to summary
private void stateInit()
stateReloadPlaylistback to summary
private void stateReloadPlaylist()
com.sun.media.jfxmedia.locator back to summary

private Class HLSConnectionHolder.VariantPlaylist

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.media.jfxmedia.locator.HLSConnectionHolder.VariantPlaylist

Field Summary

Modifier and TypeField and Description
private int
private String
private List<HLSConnectionHolder.Playlist>
private List<Integer>
private List<String>
private URI

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
private void
addPlaylistInfo(String location, int bitrate)

private HLSConnectionHolder.Playlist
getPlaylist(int index)

private HLSConnectionHolder.Playlist
private URI
private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

infoIndexback to summary
private int infoIndex
mediaFileExtensionback to summary
private String mediaFileExtension
playlistsback to summary
private List<HLSConnectionHolder.Playlist> playlists
playlistsBitratesback to summary
private List<Integer> playlistsBitrates
playlistsLocationsback to summary
private List<String> playlistsLocations
playlistURIback to summary
private URI playlistURI

Constructor Detail

VariantPlaylistback to summary
private VariantPlaylist(URI uri)

Method Detail

addPlaylistback to summary
private void addPlaylist(HLSConnectionHolder.Playlist playlist)
addPlaylistInfoback to summary
private void addPlaylistInfo(String location, int bitrate)
getPlaylistback to summary
private HLSConnectionHolder.Playlist getPlaylist(int index)
getPlaylistBasedOnBitrateback to summary
private HLSConnectionHolder.Playlist getPlaylistBasedOnBitrate(int bitrate)
getPlaylistURIback to summary
private URI getPlaylistURI() throws URISyntaxException, MalformedURLException
hasNextback to summary
private boolean hasNext()