1 | /* |
---|
2 | * Copyright (C) 2004 Benjamin Otte <in7y118@public.uni-hamburg.de> |
---|
3 | * |
---|
4 | * This library is free software; you can redistribute it and/or |
---|
5 | * modify it under the terms of the GNU General Public |
---|
6 | * License as published by the Free Software Foundation; either |
---|
7 | * version 2 of the License, or (at your option) any later version. |
---|
8 | * |
---|
9 | * This library is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
12 | * General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU General Public |
---|
15 | * License along with this library; if not, write to the Free |
---|
16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
17 | */ |
---|
18 | |
---|
19 | #include <gst/gst.h> |
---|
20 | |
---|
21 | gint |
---|
22 | main (gint argc, gchar ** argv) |
---|
23 | { |
---|
24 | GstCaps *caps; |
---|
25 | GstElement *sink, *identity; |
---|
26 | GstElement *pipeline; |
---|
27 | |
---|
28 | gst_init (&argc, &argv); |
---|
29 | |
---|
30 | pipeline = gst_pipeline_new ("pipeline"); |
---|
31 | g_assert (pipeline); |
---|
32 | identity = gst_element_factory_make ("identity", NULL); |
---|
33 | g_assert (identity); |
---|
34 | sink = gst_element_factory_make ("fakesink", NULL); |
---|
35 | g_assert (sink); |
---|
36 | gst_bin_add_many (GST_BIN (pipeline), identity, sink, NULL); |
---|
37 | gst_element_link_filtered (identity, sink, |
---|
38 | gst_caps_new_simple ("audio/x-raw-int", NULL)); |
---|
39 | caps = gst_pad_get_caps (gst_element_get_pad (identity, "sink")); |
---|
40 | g_print ("caps: %s\n", gst_caps_to_string (caps)); |
---|
41 | g_assert (!gst_caps_is_any (caps)); |
---|
42 | caps = gst_pad_get_allowed_caps (gst_element_get_pad (identity, "sink")); |
---|
43 | g_print ("allowed caps: %s\n", gst_caps_to_string (caps)); |
---|
44 | g_assert (gst_caps_is_any (caps)); |
---|
45 | |
---|
46 | return 0; |
---|
47 | } |
---|