Class PushPublishHTTPCupertino

Object
com.wowza.wms.pushpublish.model.PushPublishBase
com.wowza.wms.pushpublish.model.PushPublishHTTPBase
com.wowza.wms.pushpublish.protocol.cupertino.PushPublishHTTPCupertino
All Implemented Interfaces:
IPushPublish, IPushPublishHTTPGroupMember, IPushPublishHTTPOutputBuilder, IPushPublishHTTPCupertino
Direct Known Subclasses:
PushPublishHTTPCupertinoAkamaiHandler, PushPublishHTTPCupertinoCloudStorageHandler, PushPublishHTTPCupertinoGoogleHandler

public abstract class PushPublishHTTPCupertino extends PushPublishHTTPBase implements IPushPublishHTTPCupertino, IPushPublishHTTPGroupMember, IPushPublishHTTPOutputBuilder
  • Field Details

    • PLAYLISTNAME

      public static final String PLAYLISTNAME
      See Also:
    • cupertinoTemplateStringReplacer

      protected final com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.CupertinoTemplateStringReplacer cupertinoTemplateStringReplacer
    • liveStreamPacketizerCupertino

      protected ILiveStreamPacketizerCupertino liveStreamPacketizerCupertino
    • CHUNKLISTNAME_AUDIOVIDEO

      public static final String CHUNKLISTNAME_AUDIOVIDEO
      See Also:
    • CHUNKLISTNAME_AUDIOONLY

      public static final String CHUNKLISTNAME_AUDIOONLY
      See Also:
    • CHUNKLISTNAME_VIDEOONLY

      public static final String CHUNKLISTNAME_VIDEOONLY
      See Also:
    • CHUNKLISTNAME_KEYFRAMEONLY

      public static final String CHUNKLISTNAME_KEYFRAMEONLY
      See Also:
    • SUBTITLELISTNAME

      public static final String SUBTITLELISTNAME
      See Also:
    • CHUNKLISTNAMES

      public static final String[] CHUNKLISTNAMES
    • RENDITIONINDEX_AUDIOVIDEO

      public static final int RENDITIONINDEX_AUDIOVIDEO
      See Also:
    • RENDITIONINDEX_AUDIOONLY

      public static final int RENDITIONINDEX_AUDIOONLY
      See Also:
    • RENDITIONINDEX_VIDEOONLY

      public static final int RENDITIONINDEX_VIDEOONLY
      See Also:
    • RENDITIONINDEX_KEYFRAMEONLY

      public static final int RENDITIONINDEX_KEYFRAMEONLY
      See Also:
    • RENDITIONINDEX_SUBTITLES

      public static final int RENDITIONINDEX_SUBTITLES
      See Also:
    • RENDITIONINDEX_COUNT

      public static final int RENDITIONINDEX_COUNT
      See Also:
    • RENDITION_AUDIOVIDEO

      public static final int RENDITION_AUDIOVIDEO
      See Also:
    • RENDITION_AUDIOONLY

      public static final int RENDITION_AUDIOONLY
      See Also:
    • RENDITION_VIDEOONLY

      public static final int RENDITION_VIDEOONLY
      See Also:
    • RENDITION_KEYFRAMEONLY

      public static final int RENDITION_KEYFRAMEONLY
      See Also:
    • RENDITION_SUBTITLES

      public static final int RENDITION_SUBTITLES
      See Also:
    • chunkDurationTarget

      protected int chunkDurationTarget
    • addEndListOnDisconnect

      protected boolean addEndListOnDisconnect
    • keepMediaSegmentDataAfterSending

      protected boolean keepMediaSegmentDataAfterSending
    • pusher

      protected PushPublishHTTPPusher pusher
    • 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 Details

    • PushPublishHTTPCupertino

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

    • init

      public void init(IApplicationInstance appInstance, String streamName, IMediaStream stream, Map<String,String> profileData, 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(HashMap<String,String> dataMap)
      Description copied from class: PushPublishHTTPBase
      Loads map and profile parameters
      Overrides:
      load in class PushPublishHTTPBase
      Parameters:
      dataMap - the data map
    • createOutputItem

      public final PushPublishHTTPOutputItem createOutputItem(ILiveStreamPacketizer liveStreamPacketizer, int lastChunkIndex)
      Specified by:
      createOutputItem in interface IPushPublishHTTPOutputBuilder
    • getMediaPlaylists

      protected Map<Integer,PlaylistModel> getMediaPlaylists(int rIndex, PlaylistModel masterPlaylist, com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerApplicationContextCupertinoStreamer appContext, int lastChunkIndex) throws 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:
      URISyntaxException
    • prepareMediaPlaylist

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

      protected void processPlaylistChunks(int rIndex, int playlistChunksToProcess, int playlistChunkStartIndex, int lastChunkIndex, PlaylistModel livePacketizerMediaPlaylist, boolean isCustomChunkId, PlaylistModel mediaPlaylist) throws URISyntaxException
      Throws:
      URISyntaxException
    • addAudioMediaTag

      protected void addAudioMediaTag(PlaylistModel mediaPlaylist, PlaylistModel masterPlaylist)
    • getHeaderSegment

      protected MediaSegmentModel getHeaderSegment(int rIndex) throws 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:
      URISyntaxException - on invalid segment URIs
    • loadMediaSegment

      protected void loadMediaSegment(MediaSegmentModel mediaSegment, IMediaSegment chunk)
    • 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)
    • outputSend

      public final void outputSend(PushPublishHTTPOutputItem outputItem)
      Specified by:
      outputSend in interface IPushPublishHTTPOutputBuilder
    • getContextStr

      public String getContextStr()
      Specified by:
      getContextStr in interface IPushPublish
      Specified by:
      getContextStr in class PushPublishBase
    • resetNewPacketizer

      public void resetNewPacketizer(ILiveStreamPacketizer liveStreamPacketizer)
      Specified by:
      resetNewPacketizer in interface IPushPublishHTTPOutputBuilder
    • error

      public void error(int errorCode)
      Specified by:
      error in interface IPushPublishHTTPOutputBuilder
    • isInRedundancyPair

      public boolean isInRedundancyPair()
      Specified by:
      isInRedundancyPair in interface IPushPublishHTTPGroupMember
    • createGroupPlaylist

      public ManifestModel createGroupPlaylist(String id, List<List<IPushPublishHTTPGroupMember>> groupingsByRedundantPairs, List<List<IPushPublishHTTPGroupMember>> groupingsByAbrGroups, IApplicationInstance appInstance, String context, WMSProperties properties)
      Description copied from interface: IPushPublishHTTPGroupMember
      Creates a group playlist.
      Specified by:
      createGroupPlaylist in interface IPushPublishHTTPGroupMember
      Parameters:
      id - the id
      groupingsByRedundantPairs - the renditions grouped by redundant pairs
      groupingsByAbrGroups - the renditions grouped by redundant ABR group
      properties - the properties
      Returns:
      the manifest model
    • sendGroupPlaylist

      public void sendGroupPlaylist(String groupName, ManifestModel manifest)
      Description copied from interface: IPushPublishHTTPGroupMember
      Sends a group playlist to the destination.
      Specified by:
      sendGroupPlaylist in interface IPushPublishHTTPGroupMember
      Parameters:
      groupName - the group name
      manifest - the playlist/manifest to send
    • 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.
    • isGroupReady

      public Boolean isGroupReady(List<List<IPushPublishHTTPGroupMember>> groupingsByRedundantPairs, List<List<IPushPublishHTTPGroupMember>> groupingsByAbrGroups)
      Specified by:
      isGroupReady in interface IPushPublishHTTPGroupMember
    • adaptiveGroupPlaylistNeedsUpdating

      public Boolean adaptiveGroupPlaylistNeedsUpdating(long lastUpdateTime, List<List<IPushPublishHTTPGroupMember>> groupingsByRedundantPairs, List<List<IPushPublishHTTPGroupMember>> groupingsByAbrGroups)
      Specified by:
      adaptiveGroupPlaylistNeedsUpdating in interface IPushPublishHTTPGroupMember
    • getPlaylistProperties

      public WMSProperties getPlaylistProperties()
      Specified by:
      getPlaylistProperties in interface IPushPublishHTTPGroupMember
    • getRenditionsStr

      public String getRenditionsStr()
    • setRenditionsStr

      public void setRenditionsStr(String renditionsStr)
    • getGroupIdAudioString

      public String getGroupIdAudioString()
    • setPlaylistGroupidAudio

      public void setPlaylistGroupidAudio(String playlistGroupidAudio)
    • getLiveStreamPacketizerName

      public String getLiveStreamPacketizerName()
      Specified by:
      getLiveStreamPacketizerName in interface IPushPublishHTTPOutputBuilder
    • getPacketizerLock

      public Object getPacketizerLock(ILiveStreamPacketizer liveStreamPacketizer)
      Specified by:
      getPacketizerLock in interface IPushPublishHTTPOutputBuilder
    • getLastChunkId

      public int getLastChunkId(ILiveStreamPacketizer liveStreamPacketizer)
      Specified by:
      getLastChunkId in interface IPushPublishHTTPOutputBuilder
    • getChunkDurationTarget

      public int getChunkDurationTarget(ILiveStreamPacketizer liveStreamPacketizer)
      Specified by:
      getChunkDurationTarget in interface IPushPublishHTTPOutputBuilder
    • connect

      public void connect()
      Specified by:
      connect in interface IPushPublish
    • disconnect

      public void disconnect()
    • disconnect

      public void disconnect(boolean hard)
      Specified by:
      disconnect in interface IPushPublish
    • getMessagesAttemptedCount

      public long getMessagesAttemptedCount()
      Specified by:
      getMessagesAttemptedCount in interface IPushPublish
    • getMessagesRetriedCount

      public long getMessagesRetriedCount()
      Specified by:
      getMessagesRetriedCount in interface IPushPublish
    • getMessagesFailedCount

      public long getMessagesFailedCount()
      Specified by:
      getMessagesFailedCount in interface IPushPublish
    • resetConnection

      public void resetConnection()
      Specified by:
      resetConnection in interface IPushPublish
    • getConnectedState

      public int getConnectedState()
      Specified by:
      getConnectedState in interface IPushPublish
    • 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
    • determinePlaylistSubstitutes

      protected com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.CupertinoTemplateSubstitutes determinePlaylistSubstitutes(int rendition)
    • 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)
    • setLiveStreamPacketizer

      protected void setLiveStreamPacketizer(ILiveStreamPacketizer liveStreamPacketizer)
      Overrides:
      setLiveStreamPacketizer in class PushPublishHTTPBase
    • getLiveStreamPacketizerCupertino

      protected ILiveStreamPacketizerCupertino getLiveStreamPacketizerCupertino(ILiveStreamPacketizer liveStreamPacketizer)
    • getLanguageId

      public String getLanguageId()
    • setLanguageId

      public void setLanguageId(String languageId)
    • getAudioName

      public String getAudioName()
    • setAudioName

      public void setAudioName(String audioName)
    • getAudioCodecId

      public String getAudioCodecId()
    • setAudioCodecId

      public void setAudioCodecId(String audioCodecId)