Interface IDvrManifest
-
public interface IDvrManifest
Interface for a DVR Store manifest. A DVR manifest collects type-specific manifest info, including:- Audio manifest
- Video manifest
- data manifest
- time map manifest, to map DVR, packet and real time
- codec manifest to track codec information
- onMetadata manifest
The difference between retrieving 'recorded entries' and 'live entries' is an important one. Recorded Entries means every current manifest entry. Live Entries refers to a subset of these because a playlist will not include the very last entries, as some chunks must be available for buffering.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CODEC_TYPE
Constant for codec manifest type.static String
MANIFEST_TAGNAME_CAN_PLAY
static String
MANIFEST_TAGNAME_CAN_RECORD
static String
MANIFEST_TAGNAME_CHUNK_GROUPING
static String
MANIFEST_TAGNAME_CURRENT_TIME
static String
MANIFEST_TAGNAME_HAS_ENCRYPTION
static String
MANIFEST_TAGNAME_PURGE_TIME
static int
ON_METADATA_TYPE
Constant for 'onMetadata' manifest type.static int
TIME_MAP_TYPE
Constant for time map manifest type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addToManifest(java.util.List<DvrManifestEntry> entries)
Add manifest entries to the manifestvoid
deserialize(byte[] bytes)
Deserialize the manifest.long
expandEndTime(int type, long dvrEndTime)
long
expandStartTime(int type, long dvrStartTime)
IDvrChunkIDHandler3
getChunkIDHandler()
long
getClosestStartTime(int type, long dvrTime)
Given a dvrTime and a manifest type, find the closest chunk starting time.DvrManifestCodecEntry
getCodecEntryForTime(long dvrTime)
Return most recent codec entry for a given DVR time.long
getDvrTime(int type)
DvrManifestEntryRangeGroup
getEntriesToPurge(long purgeTime)
Given a purge time, return a group of manifest ranges to purge.DvrManifestEntry
getFirstEntry(int type)
Given manifest type, get the first playlist manifest entry.DvrManifestEntry
getLastLiveEntry(int type)
Given manifest type, get the last playlist manifest entry.DvrManifestEntry
getLastRecordedEntry(int type)
Given manifest type and DVR time, get last entry.long
getLastRecordedIndex(int type)
Return last index of DVR entry for given type.long
getLiveDuration(int type)
Given manifest type, return DVR live duration in secondsjava.util.List<DvrManifestEntry>
getLiveEntries(int type, long dvrStart)
Given manifest type and DVR time, get a list of the live entries.java.util.List<DvrManifestEntry>
getLiveEntriesWithLimit(int type, long dvrTime, int limit)
Given manifest type and DVR time, get a list of the live entries limiting number of returned items.com.wowza.wms.dvr.DvrChannelManifest
getManifestChannel(int type)
For a given manifest type, return the channel manifest.DvrManifestOnMetadataEntry
getMetadataEntryForTime(long dvrTime)
Return most recent metadataEntry for a given DVR time.long
getNextChunkIndex(String streamName, com.wowza.wms.dvr.DvrPacketHolder vPackets, com.wowza.wms.dvr.DvrPacketHolder aPackets)
long
getNextCodecIndex()
long
getNextMetadataIndex()
long
getNextTimeMapIndex()
int
getNumberLiveEntries(int type, long dvrStart)
Given manifest type and DVR time, get the number of live entries at the given time.int
getNumberLiveEntries(int type, long dvrStart, long dvrEnd)
Given manifest type and DVR time, get the number of live entries at the given time.int
getNumberRecordedEntries(int type, long dvrStart)
Given manifest type and DVR time, get the number of entries at the given time.int
getNumberRecordedEntries(int type, long dvrStart, long dvrEnd)
Given manifest type and DVR time, get the number of live entries at the given time.long
getRecordedDuration(int type)
Given manifest type, return DVR recorded duration in secondsjava.util.List<DvrManifestEntry>
getRecordedEntries(int type)
Get a copy of all manifest entries of a given type.java.util.List<DvrManifestEntry>
getRecordedEntries(int type, long dvrStartTime)
Given manifest type and DVR time, get a list of recorded entries.java.util.List<DvrManifestEntry>
getRecordedEntries(int type, long dvrStartTime, long dvrEndTime)
Given manifest type and DVR time, get a list of recorded entries.java.util.List<DvrManifestEntry>
getRecordedEntriesInRange(DvrManifestEntryRange range)
Given a DvrManifestEntryRange, get a list of recorded entries in this range.java.util.Map<Long,DvrManifestEntry>
getRecordedEntriesMap(int type)
Get a copy of all manifest entries of a given type as a Map of indices.java.util.List<DvrManifestEntry>
getRecordedEntriesWithLimit(int type, long dvrTime, int limit)
Given manifest type and DVR time, get a list of recorded entries limiting number of returned items.DvrManifestEntry
getRecordedEntryByIndex(int type, long index)
Get the manifest entry given a manifest type and an index.DvrManifestEntry
getRecordedEntryByTimeKey(int type, long dvrTime)
Get the manifest entry given a manifest type and a time (in DVR units)IDvrTimeMap
getTimeMap()
boolean
hasAudio()
Does manifest contain audio.boolean
hasCodecData()
Does manifest contain codec data.boolean
hasData()
Does manifest contain data.boolean
hasOnMetadata()
Does manifest contain onMetadata.boolean
hasTimeMapData()
Does manifest contain time map info.boolean
hasVideo()
Does manifest contain video.void
importManifest(IDvrManifest manifest, boolean persist)
Import the specified manifest into this manifestvoid
initialize()
Initialize the manifest.java.util.List<DvrManifestEntry>
purgeEntries(DvrManifestEntryRangeGroup ranges)
Given a group of ranges, purge the manifest entries.void
refreshManifest()
Refresh the mainfest.byte[]
serialize(boolean ignoreEntries)
Serialize the manifest.
-
-
-
Field Detail
-
ON_METADATA_TYPE
static final int ON_METADATA_TYPE
Constant for 'onMetadata' manifest type.- See Also:
- Constant Field Values
-
CODEC_TYPE
static final int CODEC_TYPE
Constant for codec manifest type.- See Also:
- Constant Field Values
-
TIME_MAP_TYPE
static final int TIME_MAP_TYPE
Constant for time map manifest type.- See Also:
- Constant Field Values
-
MANIFEST_TAGNAME_CAN_RECORD
static final String MANIFEST_TAGNAME_CAN_RECORD
- See Also:
- Constant Field Values
-
MANIFEST_TAGNAME_CAN_PLAY
static final String MANIFEST_TAGNAME_CAN_PLAY
- See Also:
- Constant Field Values
-
MANIFEST_TAGNAME_HAS_ENCRYPTION
static final String MANIFEST_TAGNAME_HAS_ENCRYPTION
- See Also:
- Constant Field Values
-
MANIFEST_TAGNAME_CHUNK_GROUPING
static final String MANIFEST_TAGNAME_CHUNK_GROUPING
- See Also:
- Constant Field Values
-
MANIFEST_TAGNAME_PURGE_TIME
static final String MANIFEST_TAGNAME_PURGE_TIME
- See Also:
- Constant Field Values
-
MANIFEST_TAGNAME_CURRENT_TIME
static final String MANIFEST_TAGNAME_CURRENT_TIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
void initialize()
Initialize the manifest. Called after the previous storage has been loaded but before any chunks are added.
-
refreshManifest
void refreshManifest()
Refresh the mainfest.
-
addToManifest
void addToManifest(java.util.List<DvrManifestEntry> entries)
Add manifest entries to the manifest- Parameters:
entries
- list of entries.
-
getRecordedEntries
java.util.List<DvrManifestEntry> getRecordedEntries(int type)
Get a copy of all manifest entries of a given type. Valid types include:IVHost.CONTENTTYPE_AUDIO
,IVHost.CONTENTTYPE_VIDEO
,IVHost.CONTENTTYPE_DATA
,ON_METADATA_TYPE
,CODEC_TYPE
, orTIME_MAP_TYPE
- Parameters:
type
- The manifest type.- Returns:
- list of entries
-
getRecordedEntriesMap
java.util.Map<Long,DvrManifestEntry> getRecordedEntriesMap(int type)
Get a copy of all manifest entries of a given type as a Map of indices. Valid types include:IVHost.CONTENTTYPE_AUDIO
,IVHost.CONTENTTYPE_VIDEO
,IVHost.CONTENTTYPE_DATA
,ON_METADATA_TYPE
,CODEC_TYPE
, orTIME_MAP_TYPE
- Parameters:
type
- the manifest type.- Returns:
- map of entries
-
getRecordedEntriesInRange
java.util.List<DvrManifestEntry> getRecordedEntriesInRange(DvrManifestEntryRange range)
Given a DvrManifestEntryRange, get a list of recorded entries in this range.- Parameters:
range
- a range (which consists of a manifest type and a start and end index)- Returns:
- list of entries
-
getLastRecordedEntry
DvrManifestEntry getLastRecordedEntry(int type)
Given manifest type and DVR time, get last entry."Recorded Entries" includes those entries after the end of the playlist.
- Parameters:
type
- the manifest type.- Returns:
- manifest entry
-
getRecordedEntryByTimeKey
DvrManifestEntry getRecordedEntryByTimeKey(int type, long dvrTime)
Get the manifest entry given a manifest type and a time (in DVR units)- Parameters:
type
- the manifest type.dvrTime
- DVR time- Returns:
- manifest entry
-
getRecordedEntryByIndex
DvrManifestEntry getRecordedEntryByIndex(int type, long index)
Get the manifest entry given a manifest type and an index.- Parameters:
type
- the manifest type.index
- the index into the manifest- Returns:
- manifest entry
-
getEntriesToPurge
DvrManifestEntryRangeGroup getEntriesToPurge(long purgeTime)
Given a purge time, return a group of manifest ranges to purge. This method ensures that the purge entries are aligned by index so that audio and video always remain index aligned.- Parameters:
purgeTime
- The DVR time to purge- Returns:
- a group of ranges.
-
purgeEntries
java.util.List<DvrManifestEntry> purgeEntries(DvrManifestEntryRangeGroup ranges)
Given a group of ranges, purge the manifest entries.- Parameters:
ranges
- Group of ranges- Returns:
- A list of the purged items.
-
getMetadataEntryForTime
DvrManifestOnMetadataEntry getMetadataEntryForTime(long dvrTime)
Return most recent metadataEntry for a given DVR time. The manifest for metadata entries is sparse-- it only stores items periodically. So for a given time t, the returned entry will exist at or before time t.- Parameters:
dvrTime
- DVR time- Returns:
- onMetadata Entry
-
getCodecEntryForTime
DvrManifestCodecEntry getCodecEntryForTime(long dvrTime)
Return most recent codec entry for a given DVR time. The manifest for codec entries is sparse-- it only stores items periodically. So for a given time t, the returned entry will exist at or before time t.- Parameters:
dvrTime
- DVR time- Returns:
- Codec Entry
-
getNumberLiveEntries
int getNumberLiveEntries(int type, long dvrStart)
Given manifest type and DVR time, get the number of live entries at the given time."Live Entries" means that a couple of the last entries will not be included as they are too close to the live point to be part of the playlist.
- Parameters:
type
- the manifest type.dvrStart
- DVR time- Returns:
- number of entries.
-
getNumberLiveEntries
int getNumberLiveEntries(int type, long dvrStart, long dvrEnd)
Given manifest type and DVR time, get the number of live entries at the given time."Live Entries" means that a couple of the last entries will not be included as they are too close to the live point to be part of the playlist.
- Parameters:
type
- the manifest type.dvrStart
- DVR timedvrEnd
- end DVR time- Returns:
- number of entries.
-
getNumberRecordedEntries
int getNumberRecordedEntries(int type, long dvrStart)
Given manifest type and DVR time, get the number of entries at the given time."Recorded Entries" includes those entries after the end of the playlist.
- Parameters:
type
- the manifest type.dvrStart
- DVR time- Returns:
- number of entries.
-
getNumberRecordedEntries
int getNumberRecordedEntries(int type, long dvrStart, long dvrEnd)
Given manifest type and DVR time, get the number of live entries at the given time."Recorded Entries" includes those entries after the end of the playlist.
- Parameters:
type
- the manifest type.dvrStart
- DVR timedvrEnd
- end DVR time- Returns:
- number of entries.
-
getFirstEntry
DvrManifestEntry getFirstEntry(int type)
Given manifest type, get the first playlist manifest entry.- Parameters:
type
- the manifest type.- Returns:
- manifest entry
-
getLastLiveEntry
DvrManifestEntry getLastLiveEntry(int type)
Given manifest type, get the last playlist manifest entry."Live Entries" means that a couple of the last entries will not be included as they are too close to the live point to be part of the playlist.
- Parameters:
type
- the manifest type.- Returns:
- manifest entry
-
getLiveEntries
java.util.List<DvrManifestEntry> getLiveEntries(int type, long dvrStart)
Given manifest type and DVR time, get a list of the live entries."Live Entries" means that a couple of the last entries will not be included as they are too close to the live point to be part of the playlist.
- Parameters:
type
- the manifest type.dvrStart
- DVR time- Returns:
- list of entries.
-
getLiveEntriesWithLimit
java.util.List<DvrManifestEntry> getLiveEntriesWithLimit(int type, long dvrTime, int limit)
Given manifest type and DVR time, get a list of the live entries limiting number of returned items."Live Entries" means that a couple of the last entries will not be included as they are too close to the live point to be part of the playlist.
- Parameters:
type
- the manifest type.dvrTime
- DVR timelimit
- maximum number of returned items- Returns:
- list of entries.
-
getRecordedEntriesWithLimit
java.util.List<DvrManifestEntry> getRecordedEntriesWithLimit(int type, long dvrTime, int limit)
Given manifest type and DVR time, get a list of recorded entries limiting number of returned items."Recorded Entries" includes those entries after the end of the playlist.
- Parameters:
type
- the manifest type.dvrTime
- DVR timelimit
- maximum number of returned items- Returns:
- list of entries.
-
getRecordedEntries
java.util.List<DvrManifestEntry> getRecordedEntries(int type, long dvrStartTime)
Given manifest type and DVR time, get a list of recorded entries."Recorded Entries" includes those entries after the end of the playlist.
- Parameters:
type
- the manifest type.dvrStartTime
- DVR time- Returns:
- list of entries.
-
getRecordedEntries
java.util.List<DvrManifestEntry> getRecordedEntries(int type, long dvrStartTime, long dvrEndTime)
Given manifest type and DVR time, get a list of recorded entries."Recorded Entries" includes those entries after the end of the playlist.
- Parameters:
type
- the manifest type.dvrStartTime
- DVR timedvrEndTime
- DVR end time- Returns:
- list of entries.
-
getRecordedDuration
long getRecordedDuration(int type)
Given manifest type, return DVR recorded duration in seconds"Recorded Entries" includes those entries after the end of the "live" playlist.
- Parameters:
type
- the manifest type.- Returns:
- duration in seconds
-
getLiveDuration
long getLiveDuration(int type)
Given manifest type, return DVR live duration in seconds"Recorded Entries" includes those entries after the end of the "live" playlist.
- Parameters:
type
- the manifest type.- Returns:
- duration in seconds
-
getDvrTime
long getDvrTime(int type)
-
getLastRecordedIndex
long getLastRecordedIndex(int type)
Return last index of DVR entry for given type.- Parameters:
type
-- Returns:
- index, or -1 if type does not exist
-
getNextChunkIndex
long getNextChunkIndex(String streamName, com.wowza.wms.dvr.DvrPacketHolder vPackets, com.wowza.wms.dvr.DvrPacketHolder aPackets)
-
getNextMetadataIndex
long getNextMetadataIndex()
-
getNextCodecIndex
long getNextCodecIndex()
-
getNextTimeMapIndex
long getNextTimeMapIndex()
-
getManifestChannel
com.wowza.wms.dvr.DvrChannelManifest getManifestChannel(int type)
For a given manifest type, return the channel manifest.- Parameters:
type
-- Returns:
- channel manifest
-
importManifest
void importManifest(IDvrManifest manifest, boolean persist)
Import the specified manifest into this manifest- Parameters:
manifest
-persist
-
-
getClosestStartTime
long getClosestStartTime(int type, long dvrTime)
Given a dvrTime and a manifest type, find the closest chunk starting time.- Parameters:
type
- manifest typedvrTime
- DVR time- Returns:
- time that corresponds to the closest start time of the given manifest type
-
expandEndTime
long expandEndTime(int type, long dvrEndTime)
-
expandStartTime
long expandStartTime(int type, long dvrStartTime)
-
hasVideo
boolean hasVideo()
Does manifest contain video.- Returns:
- true if it contains video.
-
hasAudio
boolean hasAudio()
Does manifest contain audio.- Returns:
- true if it contains audio.
-
hasData
boolean hasData()
Does manifest contain data.- Returns:
- true if it contains data.
-
hasOnMetadata
boolean hasOnMetadata()
Does manifest contain onMetadata.- Returns:
- true if it contains onMetadata.
-
hasCodecData
boolean hasCodecData()
Does manifest contain codec data.- Returns:
- true if it contains codec data
-
hasTimeMapData
boolean hasTimeMapData()
Does manifest contain time map info.- Returns:
- true if it contains time map info.
-
serialize
byte[] serialize(boolean ignoreEntries)
Serialize the manifest.- Parameters:
ignoreEntries
- If true, the individual manifest entries are not serialized.- Returns:
- byte array of serialized data
-
deserialize
void deserialize(byte[] bytes)
Deserialize the manifest. Should be called after default constructor for manifest has been called.- Parameters:
bytes
- buffer of bytes to deserialize
-
getTimeMap
IDvrTimeMap getTimeMap()
-
getChunkIDHandler
IDvrChunkIDHandler3 getChunkIDHandler()
-
-