Class LiveStreamPacketizerMPEGDash

Object
com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
com.wowza.wms.httpstreamer.mpegdashstreaming.livestreampacketizer.LiveStreamPacketizerMPEGDash
All Implemented Interfaces:
ILiveStreamPacketizer, com.wowza.wms.util.IIdleNotify, Runnable

public class LiveStreamPacketizerMPEGDash extends com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
  • Field Details

    • PACKETIZER_NAME

      public static final String PACKETIZER_NAME
      See Also:
    • MAXSEGMENTLOGCOUNT

      public static final int MAXSEGMENTLOGCOUNT
      See Also:
    • SEGMENTDURATIONTOLERANCE

      public static final int SEGMENTDURATIONTOLERANCE
      See Also:
    • PLAYSTARTTOLERANCE

      public static final int PLAYSTARTTOLERANCE
      See Also:
    • AUDIOGROUPCOUNT

      public static final int AUDIOGROUPCOUNT
      See Also:
    • WAITFORCODECTIME

      public static final int WAITFORCODECTIME
      See Also:
    • clazz

      protected Class clazz
    • clazzName

      protected String clazzName
    • appProps

      protected WMSProperties appProps
    • segmentWriterHandler

      protected com.wowza.wms.httpstreamer.mpegdashstreaming.livestreampacketizer.MPEGDashWriterHandler segmentWriterHandler
    • segmentWriterHandlerToBeKilled

      protected com.wowza.wms.httpstreamer.mpegdashstreaming.livestreampacketizer.MPEGDashWriterHandler segmentWriterHandlerToBeKilled
    • lock

      protected Object lock
    • stream

      protected IMediaStream stream
    • audioCodecId

      protected int audioCodecId
    • videoCodecId

      protected int videoCodecId
    • randomSessionStr

      protected String randomSessionStr
    • randomizeMediaName

      protected boolean randomizeMediaName
    • liveRepeaterEncryptionSharedSecret

      protected String liveRepeaterEncryptionSharedSecret
    • originRepeaterContext

      protected String originRepeaterContext
    • encInfo

      protected CencInfo encInfo
    • minimumUpdatePeriod

      protected long minimumUpdatePeriod
    • enableHbbtvLiveProfile

      protected boolean enableHbbtvLiveProfile
    • additionalLiveProfiles

      protected String additionalLiveProfiles
    • forceDisplaySizeToBeEven

      protected boolean forceDisplaySizeToBeEven
    • segmentIdHandler

    • segmentDurationTarget

      protected int segmentDurationTarget
    • maxSegmentCount

      protected int maxSegmentCount
    • playlistSegmentCount

      protected int playlistSegmentCount
    • repeaterSegmentCount

      protected int repeaterSegmentCount
    • minPlaylistSegmentCount

      protected int minPlaylistSegmentCount
    • repeaterSeq

      protected long repeaterSeq
    • repeaterItems

      protected List<com.wowza.wms.httpstreamer.mpegdashstreaming.livestreampacketizer.MPEGDashRepeaterHolder> repeaterItems
    • packagingWarningCtr

      protected int packagingWarningCtr
    • maxPackagingWarning

      protected int maxPackagingWarning
    • packagingWarning

      protected boolean packagingWarning
    • lastBogusSequence

      protected int lastBogusSequence
    • logRepeaterItems

      protected boolean logRepeaterItems
    • dataHandler

  • Constructor Details

    • LiveStreamPacketizerMPEGDash

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

    • init

      public void init(String streamName, String packetizerName, IApplicationInstance appInstance, com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerItem liveStreamPacketizerItem)
      Description copied from interface: ILiveStreamPacketizer
      Initialize live stream packetizer
      Specified by:
      init in interface ILiveStreamPacketizer
      Overrides:
      init in class com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
      Parameters:
      streamName - stream name
      packetizerName - packetizer name
      appInstance - application instance
      liveStreamPacketizerItem - live stream packetizer
    • parseProps

      protected void parseProps(IApplicationInstance appInstance)
    • setEncryptionRepeaterBytes

      protected void setEncryptionRepeaterBytes(CencInfo encInfo)
    • updateCencInfo

      public CencInfo updateCencInfo(long segmentId, com.wowza.wms.httpstreamer.model.ContentPackaging contentPackaging)
    • getLock

      public Object getLock()
      Returns:
      Packetizer's Lock or null if none
    • internalHandlePacket

      public void internalHandlePacket(IMediaStream stream, AMFPacket packet)
      Specified by:
      internalHandlePacket in class com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
    • internalStartStream

      public void internalStartStream(IMediaStream stream)
      Specified by:
      internalStartStream in class com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
    • internalResetStream

      public void internalResetStream(IMediaStream stream)
      Specified by:
      internalResetStream in class com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
    • createWriterHandler

      protected void createWriterHandler()
    • doResetStream

      protected void doResetStream(IMediaStream stream)
    • sendLastData

      public void sendLastData()
      Description copied from interface: ILiveStreamPacketizer
      Sends the last chunk or segment
    • getCalculatedAudioBitratePeak

      public long getCalculatedAudioBitratePeak()
      Returns:
      calculated audio bitrate peak
    • getCalculatedAudioBitrateAverage

      public long getCalculatedAudioBitrateAverage()
      Returns:
      calculated audio bitrate average
    • getCalculatedVideoBitratePeak

      public long getCalculatedVideoBitratePeak()
      Returns:
      calculated video bitrate peak
    • getCalculatedVideoBitrateAverage

      public long getCalculatedVideoBitrateAverage()
      Returns:
      calculated video bitrate average
    • getDefaultSegmentSetIndex

      public int getDefaultSegmentSetIndex()
    • getDefaultSegmentFormat

      public com.wowza.wms.httpstreamer.model.SegmentFormat getDefaultSegmentFormat()
    • indexStream

      public void indexStream(com.wowza.wms.httpstreamer.mpegdashstreaming.file.HTTPStreamerMPEGDashLiveIndexItem indexItem)
    • getSegmentCount

      public int getSegmentCount()
    • getSegmentCountVideo

      public int getSegmentCountVideo()
    • getSegmentCountAudio

      public int getSegmentCountAudio()
    • getFrameRate

      public double getFrameRate()
    • setAudioCodec

      public void setAudioCodec(int codecId)
    • setVideoCodec

      public void setVideoCodec(int codecId)
    • getVideoSegmentFormatString

      public String getVideoSegmentFormatString(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat)
    • getAudioSegmentFormatString

      public String getAudioSegmentFormatString(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat)
    • getVideoSegmentFileExtString

      public String getVideoSegmentFileExtString(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat)
    • getAudioSegmentFileExtString

      public String getAudioSegmentFileExtString(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat)
    • getAudioSegmentByTime

      public com.wowza.wms.httpstreamer.cmafstreaming.livestreampacketizer.CmafSegment getAudioSegmentByTime(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat, long time)
    • getVideoSegmentByTime

      public com.wowza.wms.httpstreamer.cmafstreaming.livestreampacketizer.CmafSegment getVideoSegmentByTime(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat, long time)
    • getAudioSegment

      public com.wowza.wms.httpstreamer.cmafstreaming.livestreampacketizer.CmafSegment getAudioSegment(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat, long index)
    • getVideoSegment

      public com.wowza.wms.httpstreamer.cmafstreaming.livestreampacketizer.CmafSegment getVideoSegment(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat, long index)
    • getAudioInit

      public com.wowza.wms.httpstreamer.cmafstreaming.livestreampacketizer.CmafSegment getAudioInit(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat)
    • getVideoInit

      public com.wowza.wms.httpstreamer.cmafstreaming.livestreampacketizer.CmafSegment getVideoInit(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat)
    • getVideoMimeType

      public String getVideoMimeType(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat)
    • getAudioMimeType

      public String getAudioMimeType(com.wowza.wms.httpstreamer.model.SegmentFormat segmentFormat)
    • getBitrateAudio

      public long getBitrateAudio()
    • getBitrateVideo

      public long getBitrateVideo()
    • getBitrate

      public long getBitrate()
    • getCodecInfoVideo

      public com.wowza.wms.media.model.MediaCodecInfoVideo getCodecInfoVideo()
    • setCodecInfoVideo

      public void setCodecInfoVideo(com.wowza.wms.media.model.MediaCodecInfoVideo codecInfoVideo)
    • getCodecInfoAudio

      public com.wowza.wms.media.model.MediaCodecInfoAudio getCodecInfoAudio()
    • setCodecInfoAudio

      public void setCodecInfoAudio(com.wowza.wms.media.model.MediaCodecInfoAudio codecInfoAudio)
    • startSegment

      public void startSegment(com.wowza.wms.httpstreamer.model.ContentPackaging contentPackaging, long segmentId, long segmentIdUser, int videoCodecId, int audioCodecId, long timecode, long timecodeUser, String originRepeaterContext, CencInfo encInfo)
    • endSegment

      public void endSegment(com.wowza.wms.httpstreamer.model.ContentPackaging contentPackaging, long endTimecodeVideo, long timecodeAudio)
    • addPacket

      public void addPacket(com.wowza.wms.httpstreamer.model.ContentPackaging contentPackaging, com.wowza.wms.httpstreamer.model.LiveStreamPacketizerPacketHolder holder)
    • startChunk

      public void startChunk(com.wowza.wms.httpstreamer.model.ContentPackaging contentPackaging, long timecode, long timecodeUser, long segmentChunkNum)
    • endChunk

      public void endChunk(com.wowza.wms.httpstreamer.model.ContentPackaging contentPackaging, long endTimecode, long segmentChunkCount)
    • logEdgeConfigWarning

      protected void logEdgeConfigWarning(String method, com.wowza.wms.httpstreamer.model.ContentPackaging contentPackaging)
    • resetStream

      public void resetStream()
    • repeaterItemsMPEGDashflushed

      public void repeaterItemsMPEGDashflushed()
    • isRandomizeMediaName

      public boolean isRandomizeMediaName()
    • setRandomizeMediaName

      public void setRandomizeMediaName(boolean randomizeMediaName)
    • getDataHandler

    • setDataHandler

      public void setDataHandler(IHTTPStreamerMPEGDashLivePacketizerDataHandler dataHandler)
    • isPlaylistReady

      public boolean isPlaylistReady()
    • getVideoSegmentIdFirst

      public long getVideoSegmentIdFirst()
    • getAudioSegmentIdFirst

      public long getAudioSegmentIdFirst()
    • getVideoSegmentIdLast

      public long getVideoSegmentIdLast()
    • getAudioSegmentIdLast

      public long getAudioSegmentIdLast()
    • getRandomSessionStr

      public String getRandomSessionStr()
    • getSegmentDurationTarget

      public int getSegmentDurationTarget()
      Description copied from interface: ILiveStreamPacketizer
      Returns the duration in milliseconds of the segment else throws an UnsupportedOperationException
      Specified by:
      getSegmentDurationTarget in interface ILiveStreamPacketizer
      Overrides:
      getSegmentDurationTarget in class com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
      Returns:
    • getChunkDurationTarget

      public int getChunkDurationTarget()
      Specified by:
      getChunkDurationTarget in interface ILiveStreamPacketizer
      Overrides:
      getChunkDurationTarget in class com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
    • getStreamStartDate

      public Date getStreamStartDate()
    • getSegmentDurationTarget

      public static int getSegmentDurationTarget(IApplicationInstance appInstance, String packetizer)
    • getMinimumUpdatePeriod

      public long getMinimumUpdatePeriod()
    • isHbbtvLiveProfileEnabled

      public boolean isHbbtvLiveProfileEnabled()
    • getAdditionalLiveProfiles

      public String getAdditionalLiveProfiles()
    • getEncInfo

      public CencInfo getEncInfo()
    • getSegmentIdHandler

    • setSegmentIdHandler

      public void setSegmentIdHandler(IHTTPStreamerMPEGDashLiveStreamPacketizerChunkIdHandler segmentIdHandler)
    • getMaxSegmentCount

      public int getMaxSegmentCount()
    • setMaxSegmentCount

      public void setMaxSegmentCount(int maxSegmentCount)
    • getPlaylistSegmentCount

      public int getPlaylistSegmentCount()
    • setPlaylistSegmentCount

      public void setPlaylistSegmentCount(int playlistSegmentCount)
    • getRepeaterSegmentCount

      public int getRepeaterSegmentCount()
    • setRepeaterSegmentCount

      public void setRepeaterSegmentCount(int repeaterSegmentCount)
    • addRepeaterItem

      public void addRepeaterItem(com.wowza.wms.httpstreamer.mpegdashstreaming.livestreampacketizer.MPEGDashRepeaterHolder item)
    • trimRepeaterItems

      protected void trimRepeaterItems(long segmentIndex)
    • getRepeaterLastSeqence

      public long getRepeaterLastSeqence()
      Description copied from interface: ILiveStreamPacketizer
      Get the sequence number of the last added repeater item
      Specified by:
      getRepeaterLastSeqence in interface ILiveStreamPacketizer
      Overrides:
      getRepeaterLastSeqence in class com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
      Returns:
      sequence number
    • getRepeaterItemsMPEGDash

      public void getRepeaterItemsMPEGDash(List<com.wowza.wms.httpstreamer.mpegdashstreaming.livestreampacketizer.MPEGDashRepeaterHolder> items, long seq)
    • getSegmentStartKeyTimecode

      public long getSegmentStartKeyTimecode()
      Description copied from interface: ILiveStreamPacketizer
      Returns the start timecode for the current chunk / segment
      Returns:
      chunkStartKeyTimecodePTS or -1 if not implemented
    • getSegmentStopKeyTimecode

      public long getSegmentStopKeyTimecode()
      Description copied from interface: ILiveStreamPacketizer
      Returns the stop timecode for the current chunk / segment
      Returns:
      chunkStopKeyTimecodePTS or -1 if not implemented
    • setSegmentStopKeyTimecode

      public void setSegmentStopKeyTimecode(long timecode) throws IllegalArgumentException
      Description copied from interface: ILiveStreamPacketizer
      Sets chunkStopKeyTimecodePTS to a specific value
      Parameters:
      timecode - - new value for chunkStopKeyTimecodePTS, must be greater than chunkStartKeyTimecodePTS
      Throws:
      IllegalArgumentException - if timecode <= chunkStartKeyTimecodePTS
    • getMinPlaylistSegmentCount

      public int getMinPlaylistSegmentCount()
      Description copied from interface: ILiveStreamPacketizer
      returns the minimum number of segments that must be available in a live manifest
      Returns:
      minPlaylistSegmentCount or -1 if not implemented