Class PushPublishHTTPCupertinoGenericHandler

All Implemented Interfaces:
IPushPublish, IPushPublishHTTPGroupMember, IPushPublishHTTPOutputBuilder, IPushPublishHTTPCupertino

public class PushPublishHTTPCupertinoGenericHandler extends PushPublishHTTPCupertino
Pushes HLS to any HTTP server that accepts PUT (and optionally DELETE) requests, with no CDN specific naming, authentication or path conventions.
 ingest paths look like    http(s)://{host}:{port}/[{basePath}/][{groupName}/]{dstStreamName}/(playlist|chunklist).m3u8
                           http(s)://{host}:{port}/[{basePath}/][{groupName}/]{dstStreamName}/{segmentName}
 group ingest paths        http(s)://{host}:{port}/[{basePath}/]{groupName}/playlist.m3u8
 playback paths are the same by default, but the host, scheme and base can be overridden with "playbackHost"
 and "http.playbackBaseUrl" for servers that ingest and serve on different endpoints.
 
  • Constructor Details

    • PushPublishHTTPCupertinoGenericHandler

      public PushPublishHTTPCupertinoGenericHandler() 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 PushPublishHTTPCupertino
      Parameters:
      appInstance - the app instance
      streamName - the source stream name
      profileData - the profile params
      maps - the map entry params
      streamDebug - stream debug flag
    • load

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

      public void connect()
      Specified by:
      connect in interface IPushPublish
      Overrides:
      connect in class PushPublishHTTPCupertino
    • resetConnection

      public void resetConnection()
      Specified by:
      resetConnection in interface IPushPublish
      Overrides:
      resetConnection in class PushPublishHTTPCupertino
    • getDestinationStreamName

      protected String getDestinationStreamName()
      The destination stream name. The backup side of a redundant pair takes a "-b" suffix so it does not overwrite its primary's output at the destination -- the same separation the cloud-storage handlers use. The adaptive group folder is deliberately not suffixed, so both sides of a pair publish one group master playlist that references each side's own stream folder.
      Returns:
      the destination stream name
    • getStreamPath

      protected String getStreamPath()
      The path of this target's stream folder, relative to the base path. Streams that belong to an adaptive group live in a folder named after the group so the group master playlist can reference them relatively.
      Returns:
      the stream path
    • getDestinationPort

      protected int getDestinationPort()
    • getDestinationDomain

      protected String getDestinationDomain()
    • getDestinationURL

      public String getDestinationURL()
      Returns:
      the URL of this target's stream folder on the destination server
    • getGroupDestinationURL

      public String getGroupDestinationURL(String groupName)
      Parameters:
      groupName - the adaptive group name
      Returns:
      the URL of the group folder on the destination server
    • getPlaybackBaseURL

      public String getPlaybackBaseURL()
      Returns:
      the base URL a player uses to fetch the pushed content. This is the ingest URL unless the destination serves content from somewhere else.
    • getPlaybackURL

      public String getPlaybackURL()
      Returns:
      the URL a player would use to start playback of this target, either the group master playlist if the target is in an adaptive group, or this target's own master playlist if not
    • updateMasterPlaylistPlaybackURI

      public boolean updateMasterPlaylistPlaybackURI(PlaylistModel playlist)
      Description copied from interface: IPushPublishHTTPCupertino
      update the master playlist URI for the provided playlist model that a player would use to consume the content from the CDN Example: "http://myHost.com/myPath/myStream/playlist.m3u8" where "playlist.m3u8" is the value given for masterPlaylistFilename
      Parameters:
      playlist - the master playlist model to update the URI in
      Returns:
      true if the URI was updated
    • updateMediaPlaylistPlaybackURI

      public boolean updateMediaPlaylistPlaybackURI(PlaylistModel playlist)
      Description copied from interface: IPushPublishHTTPCupertino
      update/set the media playlist (chunklist) URI for the provided media playlist file that a player would use to consume the content from the CDN Example: "http://myHost.com/myPath/myStream/chunklist.m3u8" where "chunklist.m3u8" is the value given for mediaPlaylistFilename
      Parameters:
      playlist - to update the uri in
      Returns:
      true if the playlist uri was updated
    • updateMediaSegmentPlaybackURI

      public boolean updateMediaSegmentPlaybackURI(MediaSegmentModel mediaSegment)
      Description copied from interface: IPushPublishHTTPCupertino
      set the media URI for the given media (chunk) file that a player would use to consume the content from the CDN Example: "http://myHost.com/myPath/myStream/media_1.ts" where "media_1.ts" is the value given for mediaFilename
      Parameters:
      mediaSegment - to update the uri of
      Returns:
      true if the uri was updated
    • updateGroupMasterPlaylistPlaybackURI

      public boolean updateGroupMasterPlaylistPlaybackURI(String groupName, PlaylistModel masterPlaylist)
      Description copied from interface: IPushPublishHTTPCupertino
      Get the group master playlist URI for the given group master playlist file that a player would use to consume the content from the CDN Example: "http://myHost.com/myPath/myGroup/playlist.m3u8"
      Parameters:
      groupName - group name
      masterPlaylist - master group playlist
      Returns:
      true if the uri was updated
    • sendMasterPlaylist

      public int sendMasterPlaylist(PlaylistModel playlist)
      Description copied from interface: IPushPublishHTTPCupertino
      Sends the master playlist to the destination.
      Parameters:
      playlist - the master playlist model
      Returns:
      number of bytes sent to output (less than zero implies the implementation does not support, 0 is a failure, > 0 is success)
    • sendMediaPlaylist

      public int sendMediaPlaylist(PlaylistModel playlist)
      Description copied from interface: IPushPublishHTTPCupertino
      Sends the media playlist to the destination.
      Parameters:
      playlist - the media playlist model
      Returns:
      number of bytes sent to output (less than zero implies the implementation does not support, 0 is a failure, > 0 is success)
    • sendGroupMasterPlaylist

      public int sendGroupMasterPlaylist(String groupName, PlaylistModel playlist)
      Description copied from interface: IPushPublishHTTPCupertino
      Sends a group master playlist to the destination.
      Parameters:
      groupName - the group name
      playlist - the group master playlist model
      Returns:
      number of bytes sent to output
    • sendMediaSegment

      public int sendMediaSegment(MediaSegmentModel mediaSegment)
      Description copied from interface: IPushPublishHTTPCupertino
      Sends the media (chunk) to the destination; media provided as a fragment list.
      Parameters:
      mediaSegment - the media file in fragment list form
      Returns:
      number of bytes sent to output (less than zero implies the implementation does not support, 0 is a failure, > 0 is success)
    • deleteMediaSegment

      public int deleteMediaSegment(MediaSegmentModel mediaSegment)
      Description copied from interface: IPushPublishHTTPCupertino
      Deletes the media (chunk) at the destination URI. Default implementation assumes the URI uses the HTTP schema and deletes the media using the WSE HTTPByteWriter. Implementations not using the HTTP schema or not wanting to use the default HTTPByteWriter should override the default method.
      Parameters:
      mediaSegment - the media destination URI
      Returns:
      number of bytes sent if successful (less than zero implies the implementation does not support, 0 is a failure, > 0 is success)
    • outputOpen

      public boolean outputOpen()
      Description copied from interface: IPushPublishHTTPCupertino
      Open the destination (if needed) in preparation of having one or more items (playlists/media segments) pushed to it
      Returns:
      true if the destination was opened
    • outputClose

      public boolean outputClose()
      Description copied from interface: IPushPublishHTTPCupertino
      Close the destination (if needed). All items (playlist/media segments) have been pushed to bring the destination up to date with the current state
      Returns:
      true if the destination was closed
    • createByteWriter

      public HTTPByteWriter createByteWriter(URI uri)
    • destroyByteWriter

      public boolean destroyByteWriter()
    • getPlaylistProperties

      public WMSProperties getPlaylistProperties()
      Specified by:
      getPlaylistProperties in interface IPushPublishHTTPGroupMember
      Overrides:
      getPlaylistProperties in class PushPublishHTTPCupertino
    • getDestionationLogData

      public String getDestionationLogData()
      Description copied from class: PushPublishHTTPCupertino
      Get a JSON formatted string of data that represents the destination to include with the connect/disconnect logging
      Specified by:
      getDestionationLogData in interface IPushPublishHTTPCupertino
      Specified by:
      getDestionationLogData in class PushPublishHTTPCupertino
      Returns:
      JSON formatted string representation