Class FrameCode

java.lang.Object
com.github.kokorin.jaffree.nut.FrameCode

public class FrameCode extends Object
Represents NUT frame code.

It describes common frame characteristics (even across multiple streams).

Note: in NUT specification there is no such class. The name comes from ffmpeg NUT implementation.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    FrameCode Flags.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    The less significant part of the size of the following frame.
    final int
    If FrameCode.Flag.SIZE_MSB is set then data_size_msb which is stored after the frame code is multiplied with it and forms the more significant part of the size of the following frame.
    final long
    The index into the elision_header table.
     
    static final FrameCode
     
    final long
    This is the time difference in stream timebase units from the pts at which the output from the decoder has converged independent from the availability of previous frames (that is the frames are virtually identical no matter if decoding started from the very first frame or from this keyframe).
    final long
    If FrameCode.Flag.CODED_PTS is set in the flags of the current frame then this value MUST be ignored.
    final long
    Number of reserved bytes in NUT frame.
    final int
    If FrameCode.Flag.STREAM_ID is not set then this is the stream number for the frame following this frame_code.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FrameCode(Set<FrameCode.Flag> flags, int streamId, int dataSizeMul, int dataSizeLsb, long ptsDelta, long reservedCount, long matchTimeDelta, long elisionHeaderIdx)
    Creates FrameCode.
  • Method Summary

    Modifier and Type
    Method
    Description

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • flags

      public final Set<FrameCode.Flag> flags
    • streamId

      public final int streamId
      If FrameCode.Flag.STREAM_ID is not set then this is the stream number for the frame following this frame_code.

      If FrameCode.Flag.STREAM_ID is set then this value has no meaning. MUST be < 250.

    • dataSizeMul

      public final int dataSizeMul
      If FrameCode.Flag.SIZE_MSB is set then data_size_msb which is stored after the frame code is multiplied with it and forms the more significant part of the size of the following frame.

      If FrameCode.Flag.SIZE_MSB is not set then this field has no meaning. MUST be < 16384.

    • dataSizeLsb

      public final int dataSizeLsb
      The less significant part of the size of the following frame. This added together with data_size_mul*data_size_msb is the size of the following frame. MUST be <16384.
    • ptsDelta

      public final long ptsDelta
      If FrameCode.Flag.CODED_PTS is set in the flags of the current frame then this value MUST be ignored.

      if FrameCode.Flag.CODED_PTS is not set then pts_delta is the difference between the current pts and last_pts.

      MUST be <16384 and >-16384.

    • reservedCount

      public final long reservedCount
      Number of reserved bytes in NUT frame.

      MUST be <256.

    • matchTimeDelta

      public final long matchTimeDelta
      This is the time difference in stream timebase units from the pts at which the output from the decoder has converged independent from the availability of previous frames (that is the frames are virtually identical no matter if decoding started from the very first frame or from this keyframe).

      If its value is 1-(1<<62) then match_time_delta is unspecified, that is the muxer lacked sufficient information to set it.

      A muxer MUST only set it to 1-(1<<62) if it does not know the correct value. That is, it is not allowed to randomly discard known values.

      If FrameCode.Flag.MATCH_TIME is not set then this value shall be used for match_time_delta, otherwise this value is ignored. MUST be <32768 and >-32768 or =1-(1<<62).

    • elisionHeaderIdx

      public final long elisionHeaderIdx
      The index into the elision_header table. MUST be <128.
    • INVALID

      public static final FrameCode INVALID
  • Constructor Details

    • FrameCode

      public FrameCode(Set<FrameCode.Flag> flags, int streamId, int dataSizeMul, int dataSizeLsb, long ptsDelta, long reservedCount, long matchTimeDelta, long elisionHeaderIdx)
      Creates FrameCode.
      Parameters:
      flags - flags
      streamId - stream id
      dataSizeMul - data size multiplier
      dataSizeLsb - data size least significant byte
      ptsDelta - difference between last & current PTS
      reservedCount - number of reserved bytes
      matchTimeDelta - match time delta
      elisionHeaderIdx - index into the elision_header table
  • Method Details