PlayReadyHeader.javaAPI Docmp4parser 1.0-RC-178099Wed Dec 19 20:10:37 GMT 2012com.googlecode.mp4parser.boxes.piff


public class PlayReadyHeader extends ProtectionSpecificHeader
Specifications > Microsoft PlayReady Format Specification > 2. PlayReady Media Format > 2.7. ASF GUIDs

ASF_Protection_System_Identifier_Object 9A04F079-9840-4286-AB92E65BE0885F95

ASF_Content_Protection_System_Microsoft_PlayReady F4637010-03C3-42CD-B932B48ADF3A6A54

ASF_StreamType_PlayReady_Encrypted_Command_Media 8683973A-6639-463A-ABD764F1CE3EEAE0

Specifications > Microsoft PlayReady Format Specification > 2. PlayReady Media Format > 2.5. Data Objects > 2.5.1. Payload Extension for AES in Counter Mode

The sample Id is used as the IV in CTR mode. Block offset, starting at 0 and incremented by 1 after every 16 bytes, from the beginning of the sample is used as the Counter.

The sample ID for each sample (media object) is stored as an ASF payload extension system with the ID of ASF_Payload_Extension_Encryption_SampleID = {6698B84E-0AFA-4330-AEB2-1C0A98D7A44D}. The payload extension can be stored as a fixed size extension of 8 bytes.

The sample ID is always stored in big-endian byte order.

Fields Summary
private long
private List
Constructors Summary
public PlayReadyHeader()

Methods Summary
public java.nio.ByteBuffergetData()

        int size = 4 + 2;
        for (PlayReadyRecord record : records) {
            size += 2 + 2;
            size += record.getValue().rewind().limit();
        ByteBuffer byteBuffer = ByteBuffer.allocate(size);

        IsoTypeWriter.writeUInt32BE(byteBuffer, size);
        IsoTypeWriter.writeUInt16BE(byteBuffer, records.size());
        for (PlayReadyRecord record : records) {
            IsoTypeWriter.writeUInt16BE(byteBuffer, record.type);
            IsoTypeWriter.writeUInt16BE(byteBuffer, record.getValue().limit());
            ByteBuffer tmp4debug = record.getValue();

        return byteBuffer;
public java.util.ListgetRecords()

        return Collections.unmodifiableList(records);
public voidparse(java.nio.ByteBuffer byteBuffer)

   Length DWORD 32

   PlayReady Record Count WORD 16

   PlayReady Records See Text Varies


        length = IsoTypeReader.readUInt32BE(byteBuffer);
        int recordCount = IsoTypeReader.readUInt16BE(byteBuffer);

        records = PlayReadyRecord.createFor(byteBuffer, recordCount);
public voidsetRecords(java.util.List records)

        this.records = records;
public java.lang.StringtoString()

        final StringBuilder sb = new StringBuilder();
        sb.append(", recordCount=").append(records.size());
        sb.append(", records=").append(records);
        return sb.toString();