Package com.wowza.wms.dvr
Class DefaultDvrStreamVersionHandler
- Object
-
- com.wowza.wms.dvr.DefaultDvrStreamVersionHandler
-
- All Implemented Interfaces:
IDvrStreamVersionHandler
public class DefaultDvrStreamVersionHandler extends Object implements IDvrStreamVersionHandler
Default stream Version Handler. May be sub-classed
-
-
Constructor Summary
Constructors Constructor Description DefaultDvrStreamVersionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDvrStreamStore
determineExistingStoreForPlaying(IDvrStreamManager dvrMgr, String baseStreamName)
When a session requests a stream store w/o specifying the version, we need gto determine the version of the stream to store.IDvrStreamStore
determineExistingStoreForRecording(IDvrStreamManager dvrMgr, String baseStreamName)
After a set of versioned streams are loaded from disk, one of them may be designated the stream that will be recorded to (i.e.String
getArchiveStrategy(IDvrStreamManager dvrMgr, String baseStreamName)
Determine the archive strategy for a given set of streams.boolean
handleArchivedStream(IDvrStreamManager dvrMgr, String baseStreamName, String vStreamName, java.util.SortedSet<Integer> versions, com.wowza.wms.dvr.io.manifest.DvrManifestHolder manifestHolder)
When a stream group inits, the file system is checked for older versions of the streams.boolean
shouldDeleteArchivedStream(IDvrStreamManager dvrMgr, IDvrStreamStore store)
Determine if a given stream store version should be deleted.boolean
shouldLoadArchivedStream(IDvrStreamManager dvrMgr, String baseStreamName, String vStreamName, java.util.SortedSet<Integer> versions, com.wowza.wms.dvr.io.manifest.DvrManifestHolder manifest)
Determine if a given stream store version should be loaded into WMS.
-
-
-
Method Detail
-
getArchiveStrategy
public String getArchiveStrategy(IDvrStreamManager dvrMgr, String baseStreamName)
Description copied from interface:IDvrStreamVersionHandler
Determine the archive strategy for a given set of streams.Typically, this returns the archive strategy as specified in Application.xml, but this API provides a hook for more detailed logic in determining the strategy.
- Specified by:
getArchiveStrategy
in interfaceIDvrStreamVersionHandler
- Parameters:
dvrMgr
- The DVR App Instance ManagerbaseStreamName
- The base stream name (no version info). e.g. myStream- Returns:
- the archive strategy
- See Also:
DefaultDvrStreamVersionHandler
,IDvrConstants.ARCHIVE_STRATEGY_APPEND
,IDvrConstants.ARCHIVE_STRATEGY_DELETE
,IDvrConstants.ARCHIVE_STRATEGY_VERSION
-
determineExistingStoreForRecording
public IDvrStreamStore determineExistingStoreForRecording(IDvrStreamManager dvrMgr, String baseStreamName)
Description copied from interface:IDvrStreamVersionHandler
After a set of versioned streams are loaded from disk, one of them may be designated the stream that will be recorded to (i.e. append mode).The default implementation says that if append mode, then the highest versioned stream that has canRecord set to true is used. But this API, allows for a more detailed logic.
- Specified by:
determineExistingStoreForRecording
in interfaceIDvrStreamVersionHandler
- Parameters:
dvrMgr
- The DVR Stream ManagerbaseStreamName
- The base stream name (no version info). e.g. myStream- Returns:
- stream store to append to, null if no stream in the stream group is to be appended to.
- See Also:
DefaultDvrStreamVersionHandler
-
determineExistingStoreForPlaying
public IDvrStreamStore determineExistingStoreForPlaying(IDvrStreamManager dvrMgr, String baseStreamName)
Description copied from interface:IDvrStreamVersionHandler
When a session requests a stream store w/o specifying the version, we need gto determine the version of the stream to store.The default implementation first checks the recording stream. If it 'canPlay(), it is returned. Otherwise, the highest versioned stream that canRecord set to true is used.
- Specified by:
determineExistingStoreForPlaying
in interfaceIDvrStreamVersionHandler
- Parameters:
dvrMgr
- The DVR Stream ManagerbaseStreamName
- The base stream name (no version info). e.g. myStream- Returns:
- stream store to stream, null if no stream in the stream group can be played.
- See Also:
DefaultDvrStreamVersionHandler
-
handleArchivedStream
public boolean handleArchivedStream(IDvrStreamManager dvrMgr, String baseStreamName, String vStreamName, java.util.SortedSet<Integer> versions, com.wowza.wms.dvr.io.manifest.DvrManifestHolder manifestHolder)
Description copied from interface:IDvrStreamVersionHandler
When a stream group inits, the file system is checked for older versions of the streams. This method is called to handle the streams.Typically, 3 things can happen: The stream is ignored, loaded, or deleted.
- Specified by:
handleArchivedStream
in interfaceIDvrStreamVersionHandler
- Parameters:
dvrMgr
- The DVR Stream ManagerbaseStreamName
- The base stream name (no version info). e.g. myStreamvStreamName
- The version of the stream to be loaded.versions
- A sorted set of all the versions that are attempting to be loadedmanifestHolder
- The main manifest info of the stream- Returns:
- true if handled in some manner, false if ignored (unhandled)
- See Also:
DefaultDvrStreamVersionHandler
-
shouldLoadArchivedStream
public boolean shouldLoadArchivedStream(IDvrStreamManager dvrMgr, String baseStreamName, String vStreamName, java.util.SortedSet<Integer> versions, com.wowza.wms.dvr.io.manifest.DvrManifestHolder manifest)
Description copied from interface:IDvrStreamVersionHandler
Determine if a given stream store version should be loaded into WMS.- Specified by:
shouldLoadArchivedStream
in interfaceIDvrStreamVersionHandler
- Parameters:
dvrMgr
- The DVR Stream ManagerbaseStreamName
- The base stream name (no version info). e.g. myStreamvStreamName
- The version of the stream to be loaded.versions
- A sorted set of all the versions that are attempting to be loadedmanifest
- The main manifest info of the stream- Returns:
- true if should be loaded. false if not.
- See Also:
DefaultDvrStreamVersionHandler
-
shouldDeleteArchivedStream
public boolean shouldDeleteArchivedStream(IDvrStreamManager dvrMgr, IDvrStreamStore store)
Description copied from interface:IDvrStreamVersionHandler
Determine if a given stream store version should be deleted.- Specified by:
shouldDeleteArchivedStream
in interfaceIDvrStreamVersionHandler
- Parameters:
dvrMgr
- The DVR Stream Managerstore
- The DVR store- Returns:
- true if should be deleted. false if not.
- See Also:
DefaultDvrStreamVersionHandler
-
-