[gst-devel] Re: [gst-cvs] wtay gst-plugins: gst-plugins/ gst-plugins/gst-libs/gst/video/

Benjamin Otte in7y118 at public.uni-hamburg.de
Sat Jul 17 05:21:10 CEST 2004


On Fri, 16 Jul 2004, Ronald Bultje wrote:

> That can never happen. The sink element has the alpha_mask property in its
> pad template, and thus the source element's source pad is *required* to
> explicitely contain an alpha_mask property in its negotiation caps. If it
> doesn't, caps negotiation fails and that's exactly what *should* happen.
>
That's how it once worked, where gst_caps_intersect implicitly relied on
the order of the properties.
Are you sure this is still the case?

In fact I just wrote a simple test program (attached) that doesn't look
like it would still work that way.

Benjamin
-------------- next part --------------
#include <gst/gst.h>

int
main (int argc, gchar **argv)
{
  gst_init (&argc, &argv);

  GstCaps *caps1 = gst_caps_from_string ("mime/type, some_property=(int)17");
  GstCaps *caps2 = gst_caps_from_string ("mime/type");
  GstElement *src = gst_element_factory_make ("fakesrc", NULL);
  GstElement *sink = gst_element_factory_make ("fakesink", NULL);
  GstPad *srcpad = gst_element_get_pad (src, "src");
  GstPad *sinkpad = gst_element_get_pad (sink, "sink");
  gst_pad_use_explicit_caps (srcpad);
  gst_pad_use_explicit_caps (sinkpad);
  g_assert (gst_pad_link (srcpad, sinkpad));
  g_assert (gst_pad_set_explicit_caps (srcpad, caps1));
  g_assert (gst_pad_set_explicit_caps (sinkpad, caps2));
  g_assert (gst_element_set_state (src, GST_STATE_PLAYING) == GST_STATE_SUCCESS);
  g_assert (gst_element_set_state (sink, GST_STATE_PLAYING) == GST_STATE_SUCCESS);
  g_assert (gst_element_set_state (src, GST_STATE_NULL) == GST_STATE_SUCCESS);
  g_assert (gst_element_set_state (sink, GST_STATE_NULL) == GST_STATE_SUCCESS);
  g_assert (gst_pad_set_explicit_caps (srcpad, caps2));
  g_assert (gst_pad_set_explicit_caps (sinkpad, caps1));
  g_assert (gst_element_set_state (src, GST_STATE_PLAYING) == GST_STATE_SUCCESS);
  g_assert (gst_element_set_state (sink, GST_STATE_PLAYING) == GST_STATE_SUCCESS);
  
  return 0;
}


More information about the gstreamer-devel mailing list