Class MediaPlaylist
- Object
-
- com.wowza.wms.manifest.model.ManifestModelLogging
-
- com.wowza.wms.manifest.model.ManifestModel
-
- com.wowza.wms.manifest.model.m3u8.MediaPlaylist
-
- All Implemented Interfaces:
Cloneable
public class MediaPlaylist extends ManifestModel
Provides implementation of HLS media playlists This class is not thread safe.
-
-
Constructor Summary
Constructors Constructor Description MediaPlaylist()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllTags(java.util.Collection<? extends TagModel> tags)
Add a list of tags to the MediaPlaylist and propagate context and debug settingsvoid
addRenditionReportTags(java.util.Collection<TagModelRenditionReport> renditionReports)
Adds EXT-X-RENDITION-REPORT tags.void
addSegment(Segment segment, long segmentId)
Add a new segment to the end of the segment list.TagModel
addTag(TagModel tag)
Add a tag to the playlist model and propagate context and debug settingsObject
clone()
void
doSubs(java.util.Map<String,Object> params, IHTTPStreamerSession httpStreamerSession, IHTTPRequest req, com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.RequestInfo requestInfo)
Does variable replacement within the manifest model based on http request coming inboolean
equals(Object obj)
<T extends TagModel>
TfindTag(Class<T> tagType)
String
getContextStr()
Get the context string associated with the Model to include with the log statementsSegmentPartId
getLastSegmentPart()
Retrieves the last segment's media sequence number and its last partial segment number (if any).String
getManifest()
TagModelMap
getMapTag(long segmentIndex, long partIndex)
Retrieves a partial segment tag.TagModelPartialSegment
getPartTag(long segmentIndex, long partIndex)
Retrieves a partial segment tag.int
getPlaylistCount()
java.util.TreeMap<Long,Segment>
getSegments()
java.util.Collection<TagModel>
getTags()
int
hashCode()
void
logTags()
void
removeMediaPlaylistTags(java.util.Collection<? extends TagModel> tagsToRemove)
Remove a list of "Media Playlist Tags" (as defined by the Apple spec) in the MediaPlaylist.void
setContextStr(String context)
Specific to Playlist reader to set the context in which the playlist is reading.void
setPlaylistCount(int playlistCount)
void
skipSegments(Float duration)
Trims segments off the beginning of the list to the point that the duration of the remaining segments is @duration or slightly overString
toString()
void
updateMediaPlaylistTags(java.util.Collection<? extends TagModel> tagsToUpdate)
Update a list of "Media Playlist Tags" (as defined by the Apple spec) in the MediaPlaylist.void
write(TagWriter tagWriter)
-
Methods inherited from class com.wowza.wms.manifest.model.ManifestModel
setManifest
-
Methods inherited from class com.wowza.wms.manifest.model.ManifestModelLogging
getDebugLog, logDebug, logError, logError, logError, logInfo, logWarn, setDebugLog, setUseSystemOut, usingSystemOut
-
-
-
-
Method Detail
-
getManifest
public String getManifest()
- Overrides:
getManifest
in classManifestModel
- Returns:
- the manifest
-
doSubs
public void doSubs(java.util.Map<String,Object> params, IHTTPStreamerSession httpStreamerSession, IHTTPRequest req, com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.RequestInfo requestInfo)
Description copied from class:ManifestModel
Does variable replacement within the manifest model based on http request coming in- Overrides:
doSubs
in classManifestModel
-
getContextStr
public String getContextStr()
Description copied from class:ManifestModelLogging
Get the context string associated with the Model to include with the log statements- Specified by:
getContextStr
in classManifestModelLogging
- Returns:
- String
-
setContextStr
public void setContextStr(String context)
Specific to Playlist reader to set the context in which the playlist is reading. Intent would be this would be the Source stream name to associate the log entries with- Parameters:
context
- context of the reader
-
getPlaylistCount
public int getPlaylistCount()
- Returns:
- the playlistCount
-
setPlaylistCount
public void setPlaylistCount(int playlistCount)
- Parameters:
playlistCount
- the playlistCount to set
-
addTag
public TagModel addTag(TagModel tag)
Add a tag to the playlist model and propagate context and debug settings- Parameters:
tag
- to be added to the playlist model- Returns:
- tag
-
addAllTags
public void addAllTags(java.util.Collection<? extends TagModel> tags)
Add a list of tags to the MediaPlaylist and propagate context and debug settings- Parameters:
tags
- - list of tags to be added to the playlist model
-
logTags
public void logTags()
-
updateMediaPlaylistTags
public void updateMediaPlaylistTags(java.util.Collection<? extends TagModel> tagsToUpdate)
Update a list of "Media Playlist Tags" (as defined by the Apple spec) in the MediaPlaylist. It is assumed that both the list of tags provided and the list of tags in the current MediaPlaylist contain no repeated tags (i.e. no more than one of any one TagModel type), as should be the case for Media Playlist tags. Media Segment tags should not be included since those are stored in the segment entries themselves.- Parameters:
tagsToUpdate
-
-
removeMediaPlaylistTags
public void removeMediaPlaylistTags(java.util.Collection<? extends TagModel> tagsToRemove)
Remove a list of "Media Playlist Tags" (as defined by the Apple spec) in the MediaPlaylist. It is assumed that both the list of tags provided and the list of tags in the current MediaPlaylist contain no repeated tags (i.e. no more than one of any one TagModel type), as should be the case for Media Playlist tags. Media Segment tags should not be included since those are stored in the segment entries themselves.- Parameters:
tagsToRemove
-
-
addSegment
public void addSegment(Segment segment, long segmentId)
Add a new segment to the end of the segment list. If the list exceeds the maximum number of segments, the first segment in the list is removed.- Parameters:
segment
- - new segment to add. Should be fully setup before calling this method
-
skipSegments
public void skipSegments(Float duration)
Trims segments off the beginning of the list to the point that the duration of the remaining segments is @duration or slightly over- Parameters:
duration
- the minimum length of remaining segments.
-
addRenditionReportTags
public void addRenditionReportTags(java.util.Collection<TagModelRenditionReport> renditionReports)
Adds EXT-X-RENDITION-REPORT tags. This can only be called from a request context where the ABR groupings are known.- Parameters:
renditionReports
- - ordered list of the variant rendition report tag models to add.
-
getLastSegmentPart
public SegmentPartId getLastSegmentPart()
Retrieves the last segment's media sequence number and its last partial segment number (if any).- Returns:
- the segment/part Id
-
getPartTag
public TagModelPartialSegment getPartTag(long segmentIndex, long partIndex)
Retrieves a partial segment tag.- Returns:
- the tag
-
getMapTag
public TagModelMap getMapTag(long segmentIndex, long partIndex)
Retrieves a partial segment tag.- Returns:
- the tag
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classManifestModel
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classManifestModel
-
toString
public String toString()
- Overrides:
toString
in classManifestModel
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classManifestModelLogging
- Throws:
CloneNotSupportedException
-
write
public void write(TagWriter tagWriter) throws java.io.IOException
- Specified by:
write
in classManifestModel
- Throws:
java.io.IOException
-
getTags
public java.util.Collection<TagModel> getTags()
-
findTag
public <T extends TagModel> T findTag(Class<T> tagType)
-
getSegments
public java.util.TreeMap<Long,Segment> getSegments()
-
-