[gstreamer-bugs] [Bug 402141] gst_element_factory_can_{sink, src}_caps seems to be broken

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Jun 21 13:19:51 PDT 2010


https://bugzilla.gnome.org/show_bug.cgi?id=402141
  GStreamer | gstreamer (core) | git

Stefan Kost (gstreamer, gtkdoc dev) <ensonic> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #10 from Stefan Kost (gstreamer, gtkdoc dev) <ensonic at sonicpulse.de> 2010-06-21 20:19:49 UTC ---
For reference, I have this code in buzztard:

**
 * bt_gst_element_factory_can_sink_media_type:
 * @factory: element factory to check
 * @name: caps type name
 *
 * Check if the sink pads of the given @factory are compatible with the given 
 * @name. The @name can e.g. be "audio/x-raw-int".
 *
 * Returns: %TRUE if the pads are compatible.
 */
gboolean bt_gst_element_factory_can_sink_media_type(GstElementFactory
*factory,const gchar *name) {
  GList *node;
  GstStaticPadTemplate *tmpl;
  GstCaps *caps;
  guint i,size;
  const GstStructure *s;

  g_assert(GST_IS_ELEMENT_FACTORY(factory));

  node=(GList *)gst_element_factory_get_static_pad_templates(factory);
  for(;node;node=g_list_next(node)) {
    tmpl=node->data;
    if(tmpl->direction==GST_PAD_SINK) {
      caps=gst_static_caps_get(&tmpl->static_caps);
      size=gst_caps_get_size(caps);
      GST_DEBUG("  testing caps: %" GST_PTR_FORMAT, caps);
      for(i=0;i<size;i++) {
        s=gst_caps_get_structure(caps,i);
        if(gst_structure_has_name(s,name)) {
          gst_caps_unref(caps);
          return(TRUE);
        }
      }
      gst_caps_unref(caps);
    }
    else {
      GST_DEBUG("  skipping template, wrong dir: %d", tmpl->direction);
    }
  }
  return(FALSE);
}

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list