Package com.github.kokorin.jaffree.nut
Class MainHeader
java.lang.Object
com.github.kokorin.jaffree.nut.MainHeader
Nut format main header.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal long[]For frames with a final size <= 4096 this header is prepended to the frame data.final Set<MainHeader.Flag> Main Header flags.final FrameCode[]Nut frame codes.final longNut major version.final longMaximum distance between startcodes.final longNut minor version.final intNumber of streams in a file.final Rational[]Different time bases used in a file. -
Constructor Summary
ConstructorsConstructorDescriptionMainHeader(long majorVersion, long minorVersion, int streamCount, long maxDistance, Rational[] timeBases, FrameCode[] frameCodes, long[] elisionHeaderSize, Set<MainHeader.Flag> flags) CreatesMainHeader. -
Method Summary
-
Field Details
-
majorVersion
public final long majorVersionNut major version. -
minorVersion
public final long minorVersionNut minor version. -
streamCount
public final int streamCountNumber of streams in a file. -
maxDistance
public final long maxDistanceMaximum distance between startcodes. If p1 and p2 are the byte positions of the first byte of two consecutive startcodes, then p2-p1 MUST be less than or equal to max_distance unless the entire span from p1 to p2 comprises a single packet or a syncpoint followed by a single frame. This imposition places efficient upper bounds on seek operations and allows for the detection of damaged frame headers, should a chain of frame headers pass max_distance without encountering any startcode.Syncpoints SHOULD be placed immediately before a keyframe if the previous frame of the same stream was a non-keyframe, unless such non-keyframe - keyframe transitions are very frequent.
SHOULD be set to <=32768. If the stored value is >65536 then max_distance MUST be set to 65536.
This is also half the maximum frame size without a headerChecksum after the frame header.
-
timeBases
Different time bases used in a file. -
frameCodes
Nut frame codes. -
elisionHeaderSize
public final long[] elisionHeaderSizeFor frames with a final size <= 4096 this header is prepended to the frame data. That is if the stored frame is 4000 bytes and the elision_header is 96 bytes then it is prepended, if it is 97 byte then it is not.elision_header[0] is fixed to a length 0 header.
The length of each elision_header except header 0 MUST be < 256 and >0.
The sum of the lengthes of all elision_headers MUST be <=1024.
-
flags
Main Header flags.
-
-
Constructor Details
-
MainHeader
public MainHeader(long majorVersion, long minorVersion, int streamCount, long maxDistance, Rational[] timeBases, FrameCode[] frameCodes, long[] elisionHeaderSize, Set<MainHeader.Flag> flags) CreatesMainHeader.- Parameters:
majorVersion- nut major versionminorVersion- nut minor versionstreamCount- stream countmaxDistance- aximum distance between startcodestimeBases- time basesframeCodes- frame codeselisionHeaderSize- elision header sizeflags- flags
-
-
Method Details