Class MediaCasterStreamMap


  • public class MediaCasterStreamMap
    extends Object
    • 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
      • 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 name
        liveStreamPacketizer - live stream packetizer name
        liveStreamRepeater - 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 name
        liveStreamPacketizer - live stream packetizer name
        liveStreamRepeater - 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 name
        mediaCasterDef - 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 name
        liveStreamPacketizer - live stream packetizer name
        liveStreamRepeater - live stream repeater name
        mediaCasterDef - 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 name
        liveStreamPacketizer - live stream packetizer name
        liveStreamRepeater - live stream repeater name
        mediaCasterDef - 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 name
        streamType - 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 name
        liveStreamPacketizer - live stream packetizer name
        liveStreamRepeater - live stream repeater name
        streamType - 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
      • 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 register
        mediaCasterDef - 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 unregister
        mediaCasterDef - media caster definition