package net.katsuster.strview.media.m4v;

import net.katsuster.strview.util.*;
import net.katsuster.strview.media.*;


/**
 * <p>
 * MPEG4 Part 2 Visual ヘッダ。
 * </p>
 *
 * <p>
 * 参考規格
 * </p>
 * <ul>
 * <li>ISO/IEC 14496-2:
 * Information technology - Coding of audio-visual objects
 * Part 2: Video</li>
 * </ul>
 */
public class M4VHeader<T extends LargeList<?>>
        extends BlockAdapter<T>
        implements Cloneable {
    public UInt start_code;

    public M4VHeader() {
        start_code = new UInt();
    }

    @Override
    public M4VHeader clone()
            throws CloneNotSupportedException {
        M4VHeader obj = (M4VHeader)super.clone();

        obj.start_code = (UInt)start_code.clone();

        return obj;
    }

    @Override
    public void read(StreamReader<?> c) {
        read(c, this);
    }

    public static void read(StreamReader<?> c,
                            M4VHeader d) {
        c.enterBlock("M4V header");

        d.start_code = c.readUInt(32, d.start_code);

        c.leaveBlock();
    }

    @Override
    public void write(StreamWriter<?> c) {
        write(c, this);
    }

    public static void write(StreamWriter<?> c,
                             M4VHeader d) {
        c.enterBlock("M4V header");

        c.writeUInt(32, d.start_code, "start_code", d.getStartCodeName());

        c.leaveBlock();
    }

    public String getStartCodeName() {
        return M4VConsts.getStartCodeName(start_code.intValue());
    }
}

@@ -505,16 +505,28 @@
 ew UInt(
+%22start_code%22
 );%0A    %7D
@@ -561,16 +561,19 @@
 4VHeader
+%3CT%3E
  clone()
@@ -638,16 +638,19 @@
 4VHeader
+%3CT%3E
  obj = (
@@ -658,16 +658,19 @@
 4VHeader
+%3CT%3E
 )super.c
@@ -749,32 +749,116 @@
 urn obj;%0A    %7D%0A%0A
+    @Override%0A    public String getTypeName() %7B%0A        return %22M4V header%22;%0A    %7D%0A%0A
     @Override%0A  
@@ -1034,36 +1034,25 @@
 .enterBlock(
-%22M4V header%22
+d
 );%0A%0A        
@@ -1329,28 +1329,17 @@
 erBlock(
-%22M4V header%22
+d
 );%0A%0A    
@@ -1375,22 +1375,8 @@
 ode,
- %22start_code%22,
  d.g

Support generics and block name for MPEG4 visual parsing.