Package com.wowza.wms.mediacaster
Class MediaCasterStreamMap
- Object
-
- com.wowza.wms.mediacaster.MediaCasterStreamMap
-
public class MediaCasterStreamMap extends Object
-
-
Constructor Summary
Constructors Constructor Description MediaCasterStreamMap(IApplicationInstance appInstance)
Create a new mediacaster map
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaCasterStreamItem
acquire(String streamName)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away).MediaCasterStreamItem
acquire(String inStreamName, MediaCasterItem mediaCasterDef)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away).MediaCasterStreamItem
acquire(String inStreamName, String streamType)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away).MediaCasterStreamItem
acquire(String streamName, String liveStreamPacketizer, String liveStreamRepeater)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away).MediaCasterStreamItem
acquire(String inStreamName, String liveStreamPacketizer, String liveStreamRepeater, MediaCasterItem mediaCasterDef)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away).MediaCasterStreamItem
acquire(String inStreamName, String liveStreamPacketizer, String liveStreamRepeater, String streamType)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away).MediaCasterStreamItem
acquireAndRelease(String inStreamName, String liveStreamPacketizer, String liveStreamRepeater, MediaCasterItem mediaCasterDef)
Increment and then decrement the lock count for a media caster item (so that it is loaded and will stay loaded for at least the KeepAliveTime).void
addStreamSrcToMediaCaster(long streamSrc, String mediaCasterId)
void
clearStreamSrcToMediaCaster(long streamSrc)
void
doWatchdog()
Do periodic idle time processingIApplicationInstance
getApplicationInstance()
Get the parent application instance for this mapedu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock
getLock()
Get the read/write lock for this interfaceMediaCasterStreamItem
getMediaCaster(String streamName)
Get media caster item based on given stream nameMediaCasterStreamItem
getMediaCaster(String streamName, String liveStreamPacketizer, String liveStreamRepeater)
Get media caster item based on given stream nameint
getMediaCasterCount()
Get the number of mediacasters current runningjava.util.List<String>
getMediaCasterNames()
Get a list of all the currently running media caster namesjava.util.List<MediaCasterStreamItem>
getMediaCasterStreamItems()
MediaCasterStreamManager
getStreamManager()
Get the stream manager interface for managing the starting and stopping of streamsvoid
registerPlayer(IMediaStreamPlay player, MediaCasterItem mediaCasterDef)
Register a player to a media caster item (internal use)void
release(MediaCasterStreamItem mediaCasterStreamItem)
Decrement lock count on media caster itemvoid
release(MediaCasterStreamItem mediaCasterStreamItem, boolean removeIfZero)
void
remove(MediaCasterStreamItem mediaCasterStreamItem)
void
shutdown(boolean isAppInstanceShutdown)
Shutdown this media caster and close all running media castersString
streamSrcToMediaCaster(long streamSrc)
void
unregisterPlayer(IMediaStreamPlay player, MediaCasterItem mediaCasterDef)
Unregister a player to a media caster item (internal use)
-
-
-
Constructor Detail
-
MediaCasterStreamMap
public MediaCasterStreamMap(IApplicationInstance appInstance)
Create a new mediacaster map- Parameters:
appInstance
- application instance
-
-
Method Detail
-
getLock
public edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock getLock()
Get the read/write lock for this interface- Returns:
- read/write lock
-
getStreamManager
public MediaCasterStreamManager getStreamManager()
Get the stream manager interface for managing the starting and stopping of streams- Returns:
- stream manager interface
-
getApplicationInstance
public IApplicationInstance getApplicationInstance()
Get the parent application instance for this map- Returns:
- parent application instance for this map
-
getMediaCasterCount
public int getMediaCasterCount()
Get the number of mediacasters current running- Returns:
- number of mediacasters current running
-
getMediaCasterStreamItems
public java.util.List<MediaCasterStreamItem> getMediaCasterStreamItems()
-
doWatchdog
public void doWatchdog()
Do periodic idle time processing
-
shutdown
public void shutdown(boolean isAppInstanceShutdown)
Shutdown this media caster and close all running media casters- Parameters:
isAppInstanceShutdown
- is this due to application shutdown
-
getMediaCasterNames
public java.util.List<String> getMediaCasterNames()
Get a list of all the currently running media caster names- Returns:
- list of all the currently running media caster names
-
getMediaCaster
public MediaCasterStreamItem getMediaCaster(String streamName)
Get media caster item based on given stream name- Parameters:
streamName
- stream name- Returns:
- media caster item
-
getMediaCaster
public MediaCasterStreamItem getMediaCaster(String streamName, String liveStreamPacketizer, String liveStreamRepeater)
Get media caster item based on given stream name- Parameters:
streamName
- stream nameliveStreamPacketizer
- live stream packetizer nameliveStreamRepeater
- live stream repeater name- Returns:
- media caster item
-
acquire
public MediaCasterStreamItem acquire(String streamName, String liveStreamPacketizer, String liveStreamRepeater)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away). Will load the media caster if not already loaded. Uses default application instance stream type.- Parameters:
streamName
- stream nameliveStreamPacketizer
- live stream packetizer nameliveStreamRepeater
- live stream repeater name- Returns:
- media caster item
-
acquire
public MediaCasterStreamItem acquire(String streamName)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away). Will load the media caster if not already loaded. Uses default application instance stream type.- Parameters:
streamName
- stream name- Returns:
- media caster item
-
acquire
public MediaCasterStreamItem acquire(String inStreamName, MediaCasterItem mediaCasterDef)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away). Will load the media caster if not already loaded. This API allow loading of a MediaCaster into a non-MediaCaster stream type such as the "live" or "liverepeater-origin" stream type.- Parameters:
inStreamName
- stream namemediaCasterDef
- MediaCaster definition- Returns:
- media caster item
-
acquire
public MediaCasterStreamItem acquire(String inStreamName, String liveStreamPacketizer, String liveStreamRepeater, MediaCasterItem mediaCasterDef)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away). Will load the media caster if not already loaded. This API allow loading of a MediaCaster into a non-MediaCaster stream type such as the "live" or "liverepeater-origin" stream type.- Parameters:
inStreamName
- stream nameliveStreamPacketizer
- live stream packetizer nameliveStreamRepeater
- live stream repeater namemediaCasterDef
- MediaCaster definition- Returns:
- media caster item
-
acquireAndRelease
public MediaCasterStreamItem acquireAndRelease(String inStreamName, String liveStreamPacketizer, String liveStreamRepeater, MediaCasterItem mediaCasterDef)
Increment and then decrement the lock count for a media caster item (so that it is loaded and will stay loaded for at least the KeepAliveTime). Will load the media caster if not already loaded. This API allow loading of a MediaCaster into a non-MediaCaster stream type such as the "live" or "liverepeater-origin" stream type.- Parameters:
inStreamName
- stream nameliveStreamPacketizer
- live stream packetizer nameliveStreamRepeater
- live stream repeater namemediaCasterDef
- MediaCaster definition- Returns:
- media caster item
-
acquire
public MediaCasterStreamItem acquire(String inStreamName, String streamType)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away). Will load the media caster if not already loaded.- Parameters:
inStreamName
- stream namestreamType
- stream type to use (null will use default application streamType)- Returns:
- media caster item
-
acquire
public MediaCasterStreamItem acquire(String inStreamName, String liveStreamPacketizer, String liveStreamRepeater, String streamType)
Increment the lock count for a media caster item (so that it remains loaded even if all listeners go away). Will load the media caster if not already loaded.- Parameters:
inStreamName
- stream nameliveStreamPacketizer
- live stream packetizer nameliveStreamRepeater
- live stream repeater namestreamType
- stream type to use (null will use default application streamType)- Returns:
- media caster item
-
release
public void release(MediaCasterStreamItem mediaCasterStreamItem)
Decrement lock count on media caster item- Parameters:
mediaCasterStreamItem
- media caster item to decrement
-
release
public void release(MediaCasterStreamItem mediaCasterStreamItem, boolean removeIfZero)
-
remove
public void remove(MediaCasterStreamItem mediaCasterStreamItem)
-
streamSrcToMediaCaster
public String streamSrcToMediaCaster(long streamSrc)
-
addStreamSrcToMediaCaster
public void addStreamSrcToMediaCaster(long streamSrc, String mediaCasterId)
-
clearStreamSrcToMediaCaster
public void clearStreamSrcToMediaCaster(long streamSrc)
-
registerPlayer
public void registerPlayer(IMediaStreamPlay player, MediaCasterItem mediaCasterDef)
Register a player to a media caster item (internal use)- Parameters:
player
- player to registermediaCasterDef
- media caster definition
-
unregisterPlayer
public void unregisterPlayer(IMediaStreamPlay player, MediaCasterItem mediaCasterDef)
Unregister a player to a media caster item (internal use)- Parameters:
player
- player to unregistermediaCasterDef
- media caster definition
-
-