Package com.wowza.wms.drm.cenc
Interface ICencEncryptor
public interface ICencEncryptor
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
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 specsint
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[]
Resets internal state of the encryptor if necessary.
-
Method Details
-
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 bytesoffset
- index in buffer where to start encryptionlen
- 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 bufferoffset
- start of datanalUnitLen
- 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 bufferdataStart
- start of data in bufferdataSize
- size of data in bufferpacketsList
- 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
-
-