Class LiveStreamPacketizerMPEGDash

  • All Implemented Interfaces:
    ILiveStreamPacketizer, com.wowza.wms.util.IIdleNotify, Runnable

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

      • SEGMENTDURATIONTOLERANCE

        public static final int SEGMENTDURATIONTOLERANCE
        See Also:
        Constant Field Values
      • clazz

        protected Class clazz
      • clazzName

        protected String clazzName
      • segmentWriterHandler

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

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

        protected Object lock
      • audioCodecId

        protected int audioCodecId
      • videoCodecId

        protected int videoCodecId
      • randomSessionStr

        protected String randomSessionStr
      • randomizeMediaName

        protected boolean randomizeMediaName
      • liveRepeaterEncryptionSharedSecret

        protected String liveRepeaterEncryptionSharedSecret
      • originRepeaterContext

        protected String originRepeaterContext
      • minimumUpdatePeriod

        protected long minimumUpdatePeriod
      • enableHbbtvLiveProfile

        protected boolean enableHbbtvLiveProfile
      • additionalLiveProfiles

        protected String additionalLiveProfiles
      • forceDisplaySizeToBeEven

        protected boolean forceDisplaySizeToBeEven
      • segmentDurationTarget

        protected int segmentDurationTarget
      • maxSegmentCount

        protected int maxSegmentCount
      • playlistSegmentCount

        protected int playlistSegmentCount
      • repeaterSegmentCount

        protected int repeaterSegmentCount
      • repeaterSeq

        protected long repeaterSeq
      • repeaterItems

        protected java.util.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
    • Constructor Detail

      • LiveStreamPacketizerMPEGDash

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

      • 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
      • 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)
      • 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 java.util.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()
      • 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​(java.util.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