Ovc1VisualSampleEntryImpl.java revision dd9eb897ee7c7b507cbdcf80263bb4b5de6966bf
1package com.coremedia.iso.boxes.sampleentry;
2
3import com.coremedia.iso.IsoTypeWriter;
4import com.coremedia.iso.boxes.Box;
5
6import java.nio.ByteBuffer;
7
8
9public class Ovc1VisualSampleEntryImpl extends SampleEntry {
10    private byte[] vc1Content;
11    public static final String TYPE = "ovc1";
12
13
14    @Override
15    protected long getContentSize() {
16        long size = 8;
17
18        for (Box box : boxes) {
19            size += box.getSize();
20        }
21        size += vc1Content.length;
22        return size;
23    }
24
25    @Override
26    public void _parseDetails(ByteBuffer content) {
27        _parseReservedAndDataReferenceIndex(content);
28        vc1Content = new byte[content.remaining()];
29        content.get(vc1Content);
30
31    }
32
33    @Override
34    protected void getContent(ByteBuffer byteBuffer) {
35        byteBuffer.put(new byte[6]);
36        IsoTypeWriter.writeUInt16(byteBuffer, getDataReferenceIndex());
37        byteBuffer.put(vc1Content);
38    }
39
40
41    protected Ovc1VisualSampleEntryImpl() {
42        super(TYPE);
43    }
44
45}
46