Class PushPublishHTTPCupertino

    • Field Detail

      • CHUNKLISTNAME_AUDIOVIDEO

        public static final String CHUNKLISTNAME_AUDIOVIDEO
        See Also:
        Constant Field Values
      • CHUNKLISTNAME_AUDIOONLY

        public static final String CHUNKLISTNAME_AUDIOONLY
        See Also:
        Constant Field Values
      • CHUNKLISTNAME_VIDEOONLY

        public static final String CHUNKLISTNAME_VIDEOONLY
        See Also:
        Constant Field Values
      • CHUNKLISTNAME_KEYFRAMEONLY

        public static final String CHUNKLISTNAME_KEYFRAMEONLY
        See Also:
        Constant Field Values
      • CHUNKLISTNAMES

        public static final String[] CHUNKLISTNAMES
      • RENDITIONINDEX_AUDIOVIDEO

        public static final int RENDITIONINDEX_AUDIOVIDEO
        See Also:
        Constant Field Values
      • RENDITIONINDEX_AUDIOONLY

        public static final int RENDITIONINDEX_AUDIOONLY
        See Also:
        Constant Field Values
      • RENDITIONINDEX_VIDEOONLY

        public static final int RENDITIONINDEX_VIDEOONLY
        See Also:
        Constant Field Values
      • RENDITIONINDEX_KEYFRAMEONLY

        public static final int RENDITIONINDEX_KEYFRAMEONLY
        See Also:
        Constant Field Values
      • RENDITIONINDEX_SUBTITLES

        public static final int RENDITIONINDEX_SUBTITLES
        See Also:
        Constant Field Values
      • chunkDurationTarget

        protected int chunkDurationTarget
      • addEndListOnDisconnect

        protected boolean addEndListOnDisconnect
      • keepMediaSegmentDataAfterSending

        protected boolean keepMediaSegmentDataAfterSending
      • minNumToSend

        protected int minNumToSend
        Normal amount of chunks to be sent on one outputSend. If we find a number higher than this, it will be logged as a warning
      • minNumToDelete

        protected int minNumToDelete
        Normal amount of chunks to be deleted on one outputSend. If we find a number higher than this, it will be logged as a warning
    • Constructor Detail

      • PushPublishHTTPCupertino

        public PushPublishHTTPCupertino()
                                 throws com.wowza.wms.server.LicensingException
        Throws:
        com.wowza.wms.server.LicensingException
    • Method Detail

      • init

        public void init​(IApplicationInstance appInstance,
                         String streamName,
                         IMediaStream stream,
                         java.util.Map<String,​String> profileData,
                         java.util.Map<String,​String> maps,
                         com.wowza.wms.pushpublish.manager.IPushPublisher pushPublisher,
                         boolean streamDebug)
        Description copied from class: PushPublishHTTPBase
        Inits the instance.
        Specified by:
        init in interface IPushPublish
        Overrides:
        init in class PushPublishHTTPBase
        Parameters:
        appInstance - the app instance
        streamName - the source stream name
        profileData - the profile params
        maps - the map entry params
        streamDebug - stream debug flag
      • getPlaylistCount

        public int getPlaylistCount()
        Description copied from class: PushPublishHTTPBase
        Get the playlist count. The value from the map file is returned if defined, else the packetizer value is returned return the playlist count
        Overrides:
        getPlaylistCount in class PushPublishHTTPBase
      • load

        public void load​(java.util.HashMap<String,​String> dataMap)
        Description copied from class: PushPublishHTTPBase
        Loads map and profile parameters
        Overrides:
        load in class PushPublishHTTPBase
        Parameters:
        dataMap - the data map
      • getMediaPlaylists

        protected java.util.Map<Integer,​PlaylistModel> getMediaPlaylists​(int rIndex,
                                                                               PlaylistModel masterPlaylist,
                                                                               com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerApplicationContextCupertinoStreamer appContext,
                                                                               int lastChunkIndex)
                                                                        throws java.net.URISyntaxException
        (internal) Used by createOutputItem(ILiveStreamPacketizer, int) This will be overriden by CMAF HLS to handle AUDIO VIDEO cases
        Parameters:
        rIndex - specified playlist rendition to be prepared
        masterPlaylist - current master playlist being created
        appContext - HTTPStreamerApplicationContextCupertinoStreamer initilaized in parent function
        lastChunkIndex - last chunk index passed from parent function
        Returns:
        map with playlists generated for the specified playlistRendition
        Throws:
        java.net.URISyntaxException
      • prepareMediaPlaylist

        protected PlaylistModel prepareMediaPlaylist​(PlaylistModel masterPlaylist,
                                                     com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerApplicationContextCupertinoStreamer appContext,
                                                     int lastChunkIndex,
                                                     int rIndex,
                                                     int chunkRendition)
                                              throws java.net.URISyntaxException
        Throws:
        java.net.URISyntaxException
      • processPlaylistChunks

        protected void processPlaylistChunks​(int rIndex,
                                             int playlistChunksToProcess,
                                             int playlistChunkStartIndex,
                                             int lastChunkIndex,
                                             PlaylistModel livePacketizerMediaPlaylist,
                                             boolean isCustomChunkId,
                                             PlaylistModel mediaPlaylist)
                                      throws java.net.URISyntaxException
        Throws:
        java.net.URISyntaxException
      • getHeaderSegment

        protected MediaSegmentModel getHeaderSegment​(int rIndex)
                                              throws java.net.URISyntaxException
        (Internal-use) Created to be overriden by CMAF core
        Parameters:
        rIndex - PushPublishHTTPCupertino rendition index
        Returns:
        MediaSegmentModel containing the header used for this rendition
        Throws:
        java.net.URISyntaxException - on invalid segment URIs
      • addPlaylistToMasterPlaylist

        protected void addPlaylistToMasterPlaylist​(int rIndex,
                                                   com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerApplicationContextCupertinoStreamer appContext,
                                                   PlaylistModel mediaPlaylist,
                                                   PlaylistModel masterPlaylist)
      • getMediaPlaylistForRendtion

        protected PlaylistModel getMediaPlaylistForRendtion​(int rIndex,
                                                            PlaylistModel masterPlaylist)
        (Meant for internal use)
        Parameters:
        languageId -
        rIndex - rendtion index
        masterPlaylist - PlaylistModel playlist to search
        Returns:
        The already generated PlaylistModel for this rendition or a new empty PlaylistModel in case it doesnt exist
      • getMediaPlaylistStr

        protected String getMediaPlaylistStr​(int rIndex)
      • getGroupPlaylistRenditionDescription

        public String getGroupPlaylistRenditionDescription​(boolean forABRPlaylist)
        Description copied from interface: IPushPublishHTTPGroupMember
        Generates a description or playlist-element String which can be used to differentiate this rendition from other renditions in a group. The group playlist could either for a single stream being pushed redundantly to a primary & backup destination, or for an ABR group of streams being pushed to a single destination or being pushed redundantly to multiple destinations.
        Specified by:
        getGroupPlaylistRenditionDescription in interface IPushPublishHTTPGroupMember
        Parameters:
        forABRPlaylist - flag to indicate whether the description is for an adaptive bitrate group playlist.
      • getRenditionsStr

        public String getRenditionsStr()
      • setRenditionsStr

        public void setRenditionsStr​(String renditionsStr)
      • disconnect

        public void disconnect()
      • getRandomSessionStr

        public String getRandomSessionStr()
        Gets a random session string that lives for the life time of the currently published stream. If the stream times out or drops for one reason or another, this will return a new session string.
        Returns:
        String contianing a unique string to the incoming stream
      • getDestionationLogData

        public abstract String getDestionationLogData()
        Get a JSON formatted string of data that represents the destination to include with the connect/disconnect logging
        Specified by:
        getDestionationLogData in interface IPushPublishHTTPCupertino
        Returns:
        JSON formatted string representation
      • printPlaylist

        public String printPlaylist​(PlaylistModel playlist)
        Will print the provided playlist to a String. Intended as a debug tool
        Parameters:
        playlist - to print to a String
        Returns:
        String containing the text based representation of the playlist (not UTF-8 encoded)
      • createTag

        protected TagModel createTag​(Class<? extends TagModel> clazz)
        Create a TagModel of the provided TagModel
        Parameters:
        clazz - Class of the TagModel to create
        Returns:
        a new instance of the TagModel requested
      • addTagToPlaylist

        protected void addTagToPlaylist​(PlaylistModel playlist,
                                        TagModel tag)
        Adds the provided TagModel to the end of the list of TagModels for the provided Playlist Model
        Parameters:
        playlist - to add the TagModel to
        tag - to add to the playlist
      • addTagToPlaylist

        protected void addTagToPlaylist​(PlaylistModel playlist,
                                        int idx,
                                        TagModel tag)
        Adds the provided TagModel to the list of TagModels at the idx for the provided Playlist Model
        Parameters:
        playlist - to add the TagModel to
        idx - index where to insert the TagModel at
        tag - Model to insert into the list of TagModels
      • createMasterPlaylist

        protected PlaylistModel createMasterPlaylist​(com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerApplicationContextCupertinoStreamer appContext)
        Creates a master playlist and propagates the context string from this implementation to the returned playlist model
        Parameters:
        appContext -
        Returns:
        a new master playlist
      • createMediaPlaylist

        protected PlaylistModel createMediaPlaylist​(int rIndex)
        Creates a empty media playlist and propagates the context from this implemenation to the returned playlist
        Returns:
        a new media playlist
      • createMediaSegmentModel

        protected MediaSegmentModel createMediaSegmentModel()
        Creates an empty media segment model and propagates the context from the implementation to the returnd media segment model
        Returns:
        media segment model
      • writeTagToString

        protected String writeTagToString​(TagModel tag)
        Writes the tag contents out to a string in UTF-8 encoding to a String
        Parameters:
        tag - to be encoded
        Returns:
        String containing the tag contents for use in a playlist
      • createStreamInfTag

        protected TagModel createStreamInfTag​(int rendition,
                                              com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerApplicationContextCupertinoStreamer appContext,
                                              ILiveStreamPacketizerCupertino liveStreamPacketizer)
      • renditionToPacketizerRendition

        protected int renditionToPacketizerRendition​(int rendition)
      • renditionToRenditionIndex

        protected int renditionToRenditionIndex​(int rendition)
      • renditionIndexToRendition

        protected int renditionIndexToRendition​(int renditionIndex)
      • getMediaPlaylistPlaybackURL

        public String getMediaPlaylistPlaybackURL​(int rendition)
      • isRendition

        protected boolean isRendition​(int rendition)