code: public static boolean matches(@NotNull MediaFormat first, @NotNull MediaFormat second) {
      if (!(first.hasRatio() && second.hasRatio())) {
        return false;
      }
      return matches(first.getRatio(), second.getRatio());
    }
docs: Checks if the ratios of both given media formats are the same within the bounds of the
  {@link MediaFormatHandler#RATIO_TOLERANCE}.
  If one or both of the media formats do not have a ratio set, the method returns false.
  @param first First ratio
  @param second Second ratio
  @return If ratio matches.