コード例 #1
0
  /**
   * 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;
  }
コード例 #2
0
  private static List<ElementFactory> lister(
      GList glist, Caps caps, PadDirection direction, boolean subsetonly) {
    List<ElementFactory> filterList = new ArrayList<ElementFactory>();
    GList gFilterList = gst.gst_element_factory_list_filter(glist, caps, direction, subsetonly);

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

    gst.gst_plugin_list_free(glist);
    gst.gst_plugin_list_free(gFilterList);

    return filterList;
  }
コード例 #3
0
 /**
  * Gets the list of {@link StaticPadTemplate} for this factory.
  *
  * @return The list of {@link StaticPadTemplate}
  */
 public List<StaticPadTemplate> getStaticPadTemplates() {
   logger.entering("ElementFactory", "getStaticPadTemplates");
   GList glist = gst.gst_element_factory_get_static_pad_templates(this);
   logger.log(DEBUG, "gst.gst_element_factory_get_static_pad_templates returned: " + glist);
   List<StaticPadTemplate> templates = new ArrayList<StaticPadTemplate>();
   GList next = glist;
   while (next != null) {
     if (next.data != null) {
       GstStaticPadTemplate temp = new GstStaticPadTemplate(next.data);
       templates.add(
           new StaticPadTemplate(
               temp.name_template,
               temp.direction,
               temp.presence,
               gst.gst_static_caps_get(temp.static_caps)));
     }
     next = next.next();
   }
   return templates;
 }