Class LiveStreamPacketizerCupertino

    • Field Detail

      • DEFAULT_ENABLEWEBVTTCAPTIONS

        public static final boolean DEFAULT_ENABLEWEBVTTCAPTIONS
        See Also:
        Constant Field Values
      • DEFAULT_CREATEAUDIOONLYRENDITION

        public static final boolean DEFAULT_CREATEAUDIOONLYRENDITION
        See Also:
        Constant Field Values
      • DEFAULT_ALWAYSSENDZEROPACKETLEN

        public static final boolean DEFAULT_ALWAYSSENDZEROPACKETLEN
        See Also:
        Constant Field Values
      • STREAMMODE_TS_FILEEXTENSION

        public static final String STREAMMODE_TS_FILEEXTENSION
        See Also:
        Constant Field Values
      • STREAMMODE_MP3_FILEEXTENSION

        public static final String STREAMMODE_MP3_FILEEXTENSION
        See Also:
        Constant Field Values
      • STREAMMODE_AAC_FILEEXTENSION

        public static final String STREAMMODE_AAC_FILEEXTENSION
        See Also:
        Constant Field Values
      • STREAMMODE_AC3_FILEEXTENSION

        public static final String STREAMMODE_AC3_FILEEXTENSION
        See Also:
        Constant Field Values
      • STREAMMODE_EC3_FILEEXTENSION

        public static final String STREAMMODE_EC3_FILEEXTENSION
        See Also:
        Constant Field Values
      • KEYFRAMEONLYDURATIONTARGET

        public static final int KEYFRAMEONLYDURATIONTARGET
        See Also:
        Constant Field Values
      • DEFAULT_CHUNKDURATION_MAX

        public static final int DEFAULT_CHUNKDURATION_MAX
        See Also:
        Constant Field Values
      • DEFAULT_CHUNKDURATION_MIN

        public static final int DEFAULT_CHUNKDURATION_MIN
        See Also:
        Constant Field Values
      • DEFAULT_CUPERTINO_FORCE_END_CHUNK_WHEN_NO_KEYFRAMES

        public static final boolean DEFAULT_CUPERTINO_FORCE_END_CHUNK_WHEN_NO_KEYFRAMES
        See Also:
        Constant Field Values
      • DEFAULT_CHUNKDURATION_OVERFLOW_THRESHOLD

        public static final int DEFAULT_CHUNKDURATION_OVERFLOW_THRESHOLD
        See Also:
        Constant Field Values
      • DEFAULT_RELATIVE_PLAYLIST_ITEMS

        public static final boolean DEFAULT_RELATIVE_PLAYLIST_ITEMS
        See Also:
        Constant Field Values
      • DEFAULT_RESET_TARGET_DURATION_ON_NEW_CHUNK

        public static final boolean DEFAULT_RESET_TARGET_DURATION_ON_NEW_CHUNK
        See Also:
        Constant Field Values
      • DEFAULT_ALLOW_CACHING

        public static final boolean DEFAULT_ALLOW_CACHING
        See Also:
        Constant Field Values
      • repeaterChunkCount

        protected int repeaterChunkCount
      • repeaterItems

        protected java.util.List<com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoRepeaterHolder> repeaterItems
      • randomSessionStr

        protected String randomSessionStr
      • originRepeaterContext

        protected String originRepeaterContext
    • Constructor Detail

      • LiveStreamPacketizerCupertino

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

      • getChunkDurationTarget

        public static int getChunkDurationTarget​(IApplicationInstance appInstance,
                                                 String packetizer)
      • 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
      • getEncryptionInfo

        public com.wowza.wms.httpstreamer.cupertinostreaming.util.CupertinoEncInfo getEncryptionInfo()
      • 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
      • internalHandlePacket

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

        public long calculateChunkIndexForPlaylist​(long chunkIndex,
                                                   long timecode)
      • startChunk

        public void startChunk​(int streamMode,
                               int videoCodecId,
                               com.wowza.wms.media.model.MediaCodecInfoVideo codecInfoVideo,
                               int audioCodecId,
                               com.wowza.wms.media.model.MediaCodecInfoAudio codecInfoAudio,
                               long timecode,
                               long timecode90)
        Specified by:
        startChunk in interface ICupertinoChunkWriter
      • sendECMBytesTS

        public void sendECMBytesTS​(java.util.List<com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder> ecmHolders)
      • sendECMBytesAudioTS

        public void sendECMBytesAudioTS​(java.util.List<com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder> ecmHolders)
      • sendECMBytesVideoTS

        public void sendECMBytesVideoTS​(java.util.List<com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder> ecmHolders)
      • sortAudioTS

        public void sortAudioTS​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder tsHolder,
                                boolean doFlush)
      • sortVideoTS

        public void sortVideoTS​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder tsHolder,
                                boolean doFlush)
      • sortTS

        public void sortTS​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder tsHolder,
                           boolean doFlush)
      • encryptTS

        public void encryptTS​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder tsHolder)
      • encryptAudioTS

        public void encryptAudioTS​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder tsHolder)
      • encryptVideoTS

        public void encryptVideoTS​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder tsHolder)
      • addToChunk

        public void addToChunk​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoPacketHolder holder)
        Specified by:
        addToChunk in interface ICupertinoChunkWriter
      • startChunkAudioTS

        public void startChunkAudioTS​(long chunkId,
                                      long chunkIdForPlaylist,
                                      long discontinuitySeq,
                                      boolean isRepeater,
                                      int streamMode,
                                      int videoCodecId,
                                      int audioCodecId,
                                      long timecode,
                                      int encMethod,
                                      String encUrl,
                                      byte[] encRepeaterBytes,
                                      byte[] encIVBytes,
                                      boolean encIVBytesInChunklist,
                                      String encKeyFormat,
                                      String encKeyFormatVersion,
                                      String encPlayReadyHeader,
                                      String originRepeaterContext,
                                      java.util.Map<String,​java.util.Map<String,​String>> userManifestHeaders)
      • startChunkVideoTS

        public void startChunkVideoTS​(long chunkId,
                                      long chunkIdForPlaylist,
                                      long discontinuitySeq,
                                      boolean isRepeater,
                                      int streamMode,
                                      int videoCodecId,
                                      int audioCodecId,
                                      long timecode,
                                      int encMethod,
                                      String encUrl,
                                      byte[] encRepeaterBytes,
                                      byte[] encIVBytes,
                                      boolean encIVBytesInChunklist,
                                      String encKeyFormat,
                                      String encKeyFormatVersion,
                                      String encPlayReadyHeader,
                                      String originRepeaterContext,
                                      java.util.Map<String,​java.util.Map<String,​String>> userManifestHeaders)
      • startChunkTS

        public void startChunkTS​(long chunkId,
                                 long chunkIdForPlaylist,
                                 long discontinuitySeq,
                                 boolean isRepeater,
                                 int streamMode,
                                 int videoCodecId,
                                 int audioCodecId,
                                 long timecode,
                                 int encMethod,
                                 String encUrl,
                                 byte[] encRepeaterBytes,
                                 byte[] encIVBytes,
                                 boolean encIVBytesInChunklist,
                                 String encKeyFormat,
                                 String encKeyFormatVersion,
                                 String encPlayReadyHeader,
                                 String originRepeaterContext,
                                 java.util.Map<String,​java.util.Map<String,​String>> userManifestHeaders)
      • mergeUserManifestHeaders

        public void mergeUserManifestHeaders​(LiveStreamPacketizerCupertinoChunk chunk,
                                             java.util.Map<String,​java.util.Map<String,​String>> userManifestHeaders)
      • endChunkAudioTS

        public void endChunkAudioTS​(long timecode,
                                    java.util.Map<String,​java.util.Map<String,​String>> userManifestHeaders,
                                    String programDateTime)
      • endChunkVideoTS

        public void endChunkVideoTS​(long timecode,
                                    java.util.Map<String,​java.util.Map<String,​String>> userManifestHeaders,
                                    String programDateTime)
      • endChunkTS

        public void endChunkTS​(long timecode,
                               java.util.Map<String,​java.util.Map<String,​String>> userManifestHeaders,
                               String programDateTime)
      • endChunkSubtitles

        public void endChunkSubtitles​(long timecode)
      • endChunkSubtitlesRepeater

        public void endChunkSubtitlesRepeater​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.LiveStreamPacketizerWebVTTChunk captions)
      • addToChunkAudioTS

        public void addToChunkAudioTS​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder tsHolder)
      • addToChunkVideoTS

        public void addToChunkVideoTS​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder tsHolder)
      • addToChunkTS

        public void addToChunkTS​(com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoTSHolder tsHolder)
      • 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
      • getRepeaterItems

        public void getRepeaterItems​(java.util.List<com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoRepeaterHolder> items,
                                     long seq)
        Overrides:
        getRepeaterItems in class com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase
      • trim

        protected void trim​(long chunkIndex)
      • getPlaylistLock

        public Object getPlaylistLock()
      • isEmptyAllPlaylist

        public boolean isEmptyAllPlaylist()
      • getPlayReadySampleEncHeaderFromEarliestChunk

        public String getPlayReadySampleEncHeaderFromEarliestChunk()
      • getUserManifestHeaders

        public com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoUserManifestHeaders getUserManifestHeaders​(com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.CupertinoStreamingRendition rendition)
      • getUserManifestHeaders

        public com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoUserManifestHeaders getUserManifestHeaders()
      • getUserManifestHeadersAudio

        public com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoUserManifestHeaders getUserManifestHeadersAudio()
      • getUserManifestHeadersVideo

        public com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.CupertinoUserManifestHeaders getUserManifestHeadersVideo()
      • addAdditionaManifestHeaders

        public String addAdditionaManifestHeaders​(java.util.Map<String,​java.util.Map<String,​String>> userHeaders)
      • getTitleStr

        public String getTitleStr()
      • setTitleStr

        public void setTitleStr​(String titleStr)
      • isCaptionTargetCEA608

        public boolean isCaptionTargetCEA608()
      • isAudioOnlyRendition

        public boolean isAudioOnlyRendition()
      • isVideoOnlyRendition

        public boolean isVideoOnlyRendition()
      • isAudioVideoRendition

        public boolean isAudioVideoRendition()
      • getCalculatedBitrateAverage

        public long getCalculatedBitrateAverage()
      • getCalculatedAudioBitrateAverage

        public long getCalculatedAudioBitrateAverage()
      • getCalculatedVideoBitrateAverage

        public long getCalculatedVideoBitrateAverage()
      • getCalculatedVideoBitratePeak

        public long getCalculatedVideoBitratePeak()
      • getID3FramesHeader

        public ID3Frames getID3FramesHeader​(com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.CupertinoStreamingRendition rendition)
      • getID3FramesFooter

        public ID3Frames getID3FramesFooter​(com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.CupertinoStreamingRendition rendition)
      • getID3FramesHeader

        public ID3Frames getID3FramesHeader()
      • getID3FramesFooter

        public ID3Frames getID3FramesFooter()
      • getID3FramesHeaderAudio

        public ID3Frames getID3FramesHeaderAudio()
      • getID3FramesFooterAudio

        public ID3Frames getID3FramesFooterAudio()
      • getID3FramesHeaderVideo

        public ID3Frames getID3FramesHeaderVideo()
      • getID3FramesFooterVideo

        public ID3Frames getID3FramesFooterVideo()
      • isEnableDataEvents

        public boolean isEnableDataEvents()
      • setEnableDataEvents

        public void setEnableDataEvents​(boolean enableDataEvents)
      • isOnChunkStartResetCounter

        public boolean isOnChunkStartResetCounter()
      • setOnChunkStartResetCounter

        public void setOnChunkStartResetCounter​(boolean onChunkStartResetCounter)
      • isPacketizeAllStreamsAsTS

        public boolean isPacketizeAllStreamsAsTS()
      • setPacketizeAllStreamsAsTS

        public void setPacketizeAllStreamsAsTS​(boolean packetizeAllStreamsAsTS)
      • getLastChunkId

        public int getLastChunkId()
      • getFirstChunkId

        public int getFirstChunkId()
      • getChunkCount

        public int getChunkCount()
      • getCaptionsChunkById

        public com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.LiveStreamPacketizerWebVTTChunk getCaptionsChunkById​(long index)
      • getChunkDurationTarget

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

        public boolean hasCaptionChunks()
      • getMaxChunkDuration

        public int getMaxChunkDuration()
      • setMaxChunkDuration

        public void setMaxChunkDuration​(int maxChunkDuration)
      • getMinChunkDuration

        public int getMinChunkDuration()
      • setMinChunkDuration

        public void setMinChunkDuration​(int minChunkDuration)
      • isAutoAdjustDurationIfOutOfBounds

        public boolean isAutoAdjustDurationIfOutOfBounds()
      • setAutoAdjustDurationIfOutOfBounds

        public void setAutoAdjustDurationIfOutOfBounds​(boolean autoAdjustDurationIfOutOfBounds)
      • isChunkIdFromRepeater

        public boolean isChunkIdFromRepeater()
      • setChunkIdFromRepeater

        public void setChunkIdFromRepeater​(boolean chunkIdFromRepeater)
      • 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:
      • setSegmentStopKeyTimecode

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

        public com.wowza.wms.httpstreamer.cmafstreaming.livestreampacketizer.CmafSegment getVideoInit​(com.wowza.wms.httpstreamer.model.SegmentFormat cmafAudio)
        Specified by:
        getVideoInit in interface ILiveStreamPacketizerCupertino
      • getAudioInit

        public com.wowza.wms.httpstreamer.cmafstreaming.livestreampacketizer.CmafSegment getAudioInit​(com.wowza.wms.httpstreamer.model.SegmentFormat cmafVideo)
        Specified by:
        getAudioInit in interface ILiveStreamPacketizerCupertino