gstreamer/tests/old/testsuite/caps/app_fixate.c
David Schleef 2f85a255ba gst/elements/gsttee.c: Remove usage of gst_pad_proxy_fixate.
Original commit message from CVS:
* gst/elements/gsttee.c: (gst_tee_init), (gst_tee_request_new_pad):
Remove usage of gst_pad_proxy_fixate.
* gst/gstcaps.c: (gst_caps_append), (gst_caps_append_structure),
(gst_caps_split_one), (gst_caps_replace):
Add poisoning code.
* gst/gstmarshal.list:
Add pointer__pointer for fixate signal
* gst/gstpad.c: (gst_real_pad_class_init),
(_gst_real_pad_fixate_accumulator), (gst_pad_link_fixate),
(_gst_pad_default_fixate_func), (gst_pad_proxy_fixate),
(gst_pad_set_explicit_caps), (gst_pad_template_new):
Add poisoning code. Add fixate signal on RealPad. Change
set_explicit_caps() to take const GstCaps, like try_set_caps().
* gst/gstpad.h:
* testsuite/caps/Makefile.am:
* testsuite/caps/app_fixate.c: Add a test for the fixate signal
2004-01-04 23:43:11 +00:00

53 lines
1,018 B
C

#include <gst/gst.h>
static GstCaps *
handler (GObject *object, GstCaps *caps, gpointer user_data)
{
g_print("in handler %p, %p, %p\n", object, caps, user_data);
g_assert (GST_IS_PAD(object));
g_print("caps: %s\n", gst_caps_to_string(caps));
if (gst_caps_is_any (caps)) {
return gst_caps_new_simple ("application/x-foo",
"field", GST_TYPE_INT_RANGE, 1, 10, NULL);
}
return NULL;
}
int
main (int argc, char *argv[])
{
GstElement *a;
GstElement *b;
GstElement *pipeline;
GstPad *pad;
gst_init(&argc, &argv);
pipeline = gst_pipeline_new (NULL);
a = gst_element_factory_make ("fakesrc", NULL);
g_assert (a);
b = gst_element_factory_make ("fakesink", NULL);
g_assert (b);
gst_bin_add_many (GST_BIN (pipeline), a,b, NULL);
gst_element_link (a,b);
pad = gst_element_get_pad (a, "src");
g_signal_connect (G_OBJECT (pad), "fixate", G_CALLBACK (handler),
(void *)0xdeadbeef);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
return 0;
}