Class Util

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

public final class Util extends Object
Different utility methods used in Nut format muxer and demuxer.
  • Method Details

    • compareUnsigned

      public static int compareUnsigned(long x, long y)
      TODO replace with Long.compareUnsigned(long, long)

      Method is a copy of Long.compareUnsigned(long, long), which is available only since 1.8

      Compares two long values numerically treating the values as unsigned.

      Parameters:
      x - the first long to compare
      y - the second long to compare
      Returns:
      the value 0 if x == y; a value less than 0 if x < y as unsigned values; and a value greater than 0 if x > y as unsigned values
    • convertTimestamp

      public static long convertTimestamp(long pts, Rational timeBaseFrom, Rational timeBaseTo)
      Converts passed in PTS from one timebase to another.

      This method is equivalent to (ln*sn)/(d1*d2)

      Parameters:
      pts - pts in timeBaseFrom
      timeBaseFrom - pts timebase
      timeBaseTo - timebase to switch to
      Returns:
      converted PTS