source: trunk/third/gstreamer/testsuite/caps/app_fixate.c @ 21005

Revision 21005, 1.0 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21004, which included commits to RCS files with non-trunk default branches.
Line 
1
2#include <gst/gst.h>
3
4
5static GstCaps *
6handler (GObject * object, GstCaps * caps, gpointer user_data)
7{
8  g_print ("in handler %p, %p, %p\n", object, caps, user_data);
9
10  g_assert (GST_IS_PAD (object));
11
12  g_print ("caps: %s\n", gst_caps_to_string (caps));
13
14  if (gst_caps_is_any (caps)) {
15    return gst_caps_new_simple ("application/x-foo",
16        "field", GST_TYPE_INT_RANGE, 1, 10, NULL);
17  }
18
19  return NULL;
20}
21
22
23int
24main (int argc, char *argv[])
25{
26  GstElement *a;
27  GstElement *b;
28  GstElement *pipeline;
29  GstPad *pad;
30
31  gst_init (&argc, &argv);
32
33  pipeline = gst_pipeline_new (NULL);
34
35  a = gst_element_factory_make ("fakesrc", NULL);
36  g_assert (a);
37  b = gst_element_factory_make ("fakesink", NULL);
38  g_assert (b);
39
40  gst_bin_add_many (GST_BIN (pipeline), a, b, NULL);
41  gst_element_link (a, b);
42
43  pad = gst_element_get_pad (a, "src");
44  g_signal_connect (G_OBJECT (pad), "fixate", G_CALLBACK (handler),
45      (void *) 0xdeadbeef);
46
47  gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
48
49
50  return 0;
51}
Note: See TracBrowser for help on using the repository browser.