FileDocCategorySizeDatePackage
CencSampleEncryptionInformationGroupEntry.javaAPI Docmp4parser 1.0-RC-173641Wed Dec 19 20:10:37 GMT 2012com.googlecode.mp4parser.boxes.mp4.samplegrouping

CencSampleEncryptionInformationGroupEntry

public class CencSampleEncryptionInformationGroupEntry extends GroupEntry
Each sample in a protected track shall be associated with an IsEncrypted flag, IV_Size, and KID. This can be accomplished by (a) relying on the default values in the TrackEncryptionBox (see 8.2), or (b) specifying the parameters by sample group, or (c) using a combination of these two techniques.

When specifying the parameters by sample group, the SampleToGroupBox in the sample table or track fragment specifies which samples use which sample group description from the SampleGroupDescriptionBox.

Fields Summary
public static final String
TYPE
private int
isEncrypted
private byte
ivSize
private byte[]
kid
Constructors Summary
Methods Summary
public booleanequals(java.lang.Object o)

        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CencSampleEncryptionInformationGroupEntry that = (CencSampleEncryptionInformationGroupEntry) o;

        if (isEncrypted != that.isEncrypted) {
            return false;
        }
        if (ivSize != that.ivSize) {
            return false;
        }
        if (!Arrays.equals(kid, that.kid)) {
            return false;
        }

        return true;
    
public java.nio.ByteBufferget()

        ByteBuffer byteBuffer = ByteBuffer.allocate(20);
        IsoTypeWriter.writeUInt24(byteBuffer, isEncrypted);
        IsoTypeWriter.writeUInt8(byteBuffer, ivSize);
        byteBuffer.put(kid);
        byteBuffer.rewind();
        return byteBuffer;
    
public intgetEncrypted()

        return isEncrypted;
    
public bytegetIvSize()

        return ivSize;
    
public byte[]getKid()

        return kid;
    
public inthashCode()

        int result = isEncrypted;
        result = 31 * result + (int) ivSize;
        result = 31 * result + (kid != null ? Arrays.hashCode(kid) : 0);
        return result;
    
public voidparse(java.nio.ByteBuffer byteBuffer)


    
        
        isEncrypted = IsoTypeReader.readUInt24(byteBuffer);
        ivSize = (byte) IsoTypeReader.readUInt8(byteBuffer);
        kid = new byte[16];
        byteBuffer.get(kid);

    
public voidsetEncrypted(int encrypted)

        isEncrypted = encrypted;
    
public voidsetIvSize(byte ivSize)

        this.ivSize = ivSize;
    
public voidsetKid(byte[] kid)

        assert kid.length == 16;
        this.kid = kid;
    
public java.lang.StringtoString()

        return "CencSampleEncryptionInformationGroupEntry{" +
                "isEncrypted=" + isEncrypted +
                ", ivSize=" + ivSize +
                ", kid=" + Hex.encodeHex(kid) +
                '}";