/**
  * Get a list of factories that match the given parameter.
  *
  * <p>It is a combination of listGetElement and listFilter passing all the results of the first
  * call to the second.
  *
  * <p>This method improves performance because there is no need to map to java list the elements
  * returned by the first call.
  *
  * @param type a {@link ElementFactoryListType}
  * @param minrank Minimum rank
  * @param caps a {@link Caps}
  * @param direction a {@link PadDirection} to filter on
  * @param subsetonly whether to filter on caps subsets or not.
  * @return a {@link List} of {@link ElementFactory} elements that match the given requisits.
  */
 public static List<ElementFactory> listGetElementFilter(
     ElementFactoryListType type,
     Rank minrank,
     Caps caps,
     PadDirection direction,
     boolean subsetonly) {
   GList glist = gst.gst_element_factory_list_get_elements(type.getValue(), minrank.getValue());
   return lister(glist, caps, direction, subsetonly);
 }
  /**
   * Get a list of factories that match the given type. Only elements with a rank greater or equal
   * to minrank will be returned. The list of factories is returned by decreasing rank.
   *
   * @param type a {@link ElementFactoryListType}
   * @param minrank Minimum rank
   * @return a List of ElementFactory elements.
   */
  public static List<ElementFactory> listGetElement(ElementFactoryListType type, Rank minrank) {
    GList glist = gst.gst_element_factory_list_get_elements(type.getValue(), minrank.getValue());
    List<ElementFactory> list = new ArrayList<ElementFactory>();

    GList next = glist;
    while (next != null) {
      if (next.data != null) {
        ElementFactory fact = new ElementFactory(initializer(next.data, true, true));
        list.add(fact);
      }
      next = next.next();
    }

    gst.gst_plugin_list_free(glist);

    return list;
  }