Interface ICencEncryptor


  • public interface ICencEncryptor
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      byte[] encryptData​(byte[] data, int offset, int len)
      Encrypts len bytes of data starting at offset complying to a scheme in the Common Encryption doc.
      com.wowza.wms.drm.cenc.CencSampleAuxiliaryData encryptNonVideoSample​(byte[] buffer, int dataStart, int dataSize, PacketFragmentList packetsList)
      Performs the alternative mechanism of encryption for non video tracks specified for the implemented scheme (Usually full-sample encryption).
      byte[] encryptSubSample​(byte[] buffer, int offset, int nalUnitLen, int nalSize, com.wowza.wms.drm.cenc.CencSampleAuxiliaryData.CencSubSample subSample)
      Encrypts a Subsample of a NAL Structured Video Sample according to Common Encryption specs
      int getBlockSize()  
      String getCencScheme()  
      void init​(com.wowza.wms.httpstreamer.util.IEncryptionInfo encInfo)
      Initializes the encryptor with the specified encryption information.
      default void setCodecInfoVideo​(com.wowza.wms.media.model.ICodecConfigInfoVideo codecConfigInfoVideo)
      Sets the video codec info of content to be encrypted.
      byte[] startEncryption()
      Resets internal state of the encryptor if necessary.
    • Method Detail

      • init

        void init​(com.wowza.wms.httpstreamer.util.IEncryptionInfo encInfo)
        Initializes the encryptor with the specified encryption information. Encryptor may hold a reference to the provided encInfo. Will log errors if the configuration is not valid, but will not halt.
        Parameters:
        encInfo - Encryption Information.
      • startEncryption

        byte[] startEncryption()
        Resets internal state of the encryptor if necessary.
        Returns:
        If a per sample IV is used, returns the iv bytes to be used, null otherwise.
      • encryptData

        byte[] encryptData​(byte[] data,
                           int offset,
                           int len)
        Encrypts len bytes of data starting at offset complying to a scheme in the Common Encryption doc.
        Parameters:
        data - buffer of bytes
        offset - index in buffer where to start encryption
        len - ammount of bytes to encrypt
        Returns:
        new byte array with the encrypted data
      • getBlockSize

        int getBlockSize()
        Returns:
        block size needed for the specific scheme.
      • getCencScheme

        String getCencScheme()
        Returns:
        4 letter code that specifies the scheme implemented by this class. (Ex. "cenc", "cbcs", etc)
      • encryptSubSample

        byte[] encryptSubSample​(byte[] buffer,
                                int offset,
                                int nalUnitLen,
                                int nalSize,
                                com.wowza.wms.drm.cenc.CencSampleAuxiliaryData.CencSubSample subSample)
        Encrypts a Subsample of a NAL Structured Video Sample according to Common Encryption specs
        Parameters:
        buffer - input buffer
        offset - start of data
        nalUnitLen - length of size attribute of NAL.
        nalSize - size of NAL unit.
        subSample - will be updated to represent the number of bytes of clear data (will be added if existing) and number of bytes of encrypted data (will be overwritten)
        Returns:
        new byte array holding all clear and encrypted bytes of data on the subsample.
      • encryptNonVideoSample

        com.wowza.wms.drm.cenc.CencSampleAuxiliaryData encryptNonVideoSample​(byte[] buffer,
                                                                             int dataStart,
                                                                             int dataSize,
                                                                             PacketFragmentList packetsList)
        Performs the alternative mechanism of encryption for non video tracks specified for the implemented scheme (Usually full-sample encryption). Adds a packet fragment to the packets list with a new byte array of encrypted data. Does not modify input buffer.
        Parameters:
        buffer - input buffer
        dataStart - start of data in buffer
        dataSize - size of data in buffer
        packetsList - where to store new packets if encryption is successful
        Returns:
        Sample Auxiliary Data compliant to the specified scheme.
      • setCodecInfoVideo

        default void setCodecInfoVideo​(com.wowza.wms.media.model.ICodecConfigInfoVideo codecConfigInfoVideo)
        Sets the video codec info of content to be encrypted. This is needed in cases of NAL subsample encryption where encryption needs to start on the first full byte after Slice Headers as is the case for cbcs.
        Parameters:
        codecConfigInfoVideo -